diff --git a/LOFAR LBA imaging tutorial v4.ipynb b/LOFAR LBA imaging tutorial v4.ipynb index 73ff050..dbc45f0 100644 --- a/LOFAR LBA imaging tutorial v4.ipynb +++ b/LOFAR LBA imaging tutorial v4.ipynb @@ -141,6 +141,27 @@ " station_type = \"intl\"" ] }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'os' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmakedirs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'results'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexist_ok\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'os' is not defined" + ] + } + ], + "source": [ + "os.makedirs('results', exist_ok=True)" + ] + }, { "cell_type": "code", "execution_count": 11, diff --git a/lofarimaging/singlestationutil.py b/lofarimaging/singlestationutil.py index 50584c1..7952538 100644 --- a/lofarimaging/singlestationutil.py +++ b/lofarimaging/singlestationutil.py @@ -267,10 +267,7 @@ def make_ground_image(xst_filename, else: station_type = "intl" - try: - os.mkdir('results') - except FileExistsError: - pass + os.makedirs('results', exist_ok=True) # Distill metadata from filename obsdatestr, obstimestr, _, rcu_mode, _, subbandname = cubename.rstrip(".dat").split("_")