Jupyter notebook PHY241/assignments/Observing Project.ipynb
Kernel: Anaconda (Python 3)
In [5]:
In [6]:
Out[6]:
array([[1219, 1208, 1247, ..., 1421, 1663, 2005],
[1186, 1209, 1231, ..., 1227, 1350, 1405],
[1218, 1189, 1187, ..., 1201, 1261, 1303],
...,
[1196, 1209, 1249, ..., 1190, 1179, 1185],
[1208, 1240, 1222, ..., 1174, 1148, 1154],
[1211, 1220, 1209, ..., 1189, 1149, 1201]], dtype=uint16)
In [7]:
Out[7]:
In [8]:
Out[8]:
30.0
In [9]:
In [10]:
In [11]:
In [12]:
Out[12]:
file imagetyp exposure filter
------------------- -------- -------- ------
bias_1.fit BIAS 0.0 --
bias_2.fit BIAS 0.0 --
bias_3.fit BIAS 0.0 --
dark_300_1.fit DARK 300.0 --
dark_300_2.fit DARK 300.0 --
dark_300_3.fit DARK 300.0 --
dark_30_1.fit DARK 30.0 --
dark_30_2.fit DARK 30.0 --
dark_30_3.fit DARK 30.0 --
flat_b_1.fit FLAT 7.0 B
... ... ... ...
ngc7789_b_300_2.fit LIGHT 300.0 B
ngc7789_b_300_3.fit LIGHT 300.0 B
ngc7789_b_30_1.fit LIGHT 30.0 B
ngc7789_b_30_2.fit LIGHT 30.0 B
ngc7789_b_30_3.fit LIGHT 30.0 B
ngc7789_v_300_1.fit LIGHT 300.0 V
ngc7789_v_300_2.fit LIGHT 300.0 V
ngc7789_v_300_3.fit LIGHT 300.0 V
ngc7789_v_30_1.fit LIGHT 30.0 V
ngc7789_v_30_2.fit LIGHT 30.0 V
ngc7789_v_30_3.fit LIGHT 30.0 V
Length = 27 rows
In [13]:
Out[13]:
LIGHT
In [14]:
In [15]:
Out[15]:
ERROR:ccdproc.image_collection:error writing file ../data/Observing Project/calib_data/bias_1.fit
One or more of the reduced images already exists. Delete those files and try again. This class will NOT overwrite existing files.
In [16]:
Out[16]:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-16-7b1de03c5440> in <module>()
6 apply_to={'imagetyp':'BIAS'},
7 destination=destination_dir)
----> 8 make_master_bias.action()
/projects/cc2eb3bf-2c88-48fa-96e2-80b295a5a4c1/PHY241/assignments/reduction_tools.py in action(self)
218 fname = '_'.join(fname) + '.fit'
219 dest_path = os.path.join(self.destination, fname)
--> 220 combined.write(dest_path)
221 self._combined = combined
222
/projects/anaconda3/lib/python3.5/site-packages/astropy/nddata/mixins/ndio.py in write(self, *args, **kwargs)
37 formats.
38 """
---> 39 io_registry.write(self, *args, **kwargs)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/registry.py in write(data, *args, **kwargs)
401
402 writer = get_writer(format, data.__class__)
--> 403 writer(data, *args, **kwargs)
404
405
/projects/anaconda3/lib/python3.5/site-packages/ccdproc/ccddata.py in fits_ccddata_writer(ccd_data, filename, hdu_mask, hdu_uncertainty, hdu_flags, **kwd)
762 hdu = ccd_data.to_hdu(hdu_mask=hdu_mask, hdu_uncertainty=hdu_uncertainty,
763 hdu_flags=hdu_flags)
--> 764 hdu.writeto(filename, **kwd)
765
766
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in writeto(self, fileobj, output_verify, clobber, checksum)
684 # file object that's open to write only, or in append/update modes
685 # but only if the file doesn't exist.
--> 686 fileobj = _File(fileobj, mode='ostream', clobber=clobber)
687 hdulist = self.fromfile(fileobj)
688
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in __init__(self, fileobj, mode, memmap, clobber, cache)
148 self._open_fileobj(fileobj, mode, clobber)
149 elif isinstance(fileobj, string_types):
--> 150 self._open_filename(fileobj, mode, clobber)
151 else:
152 self._open_filelike(fileobj, mode, clobber)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _open_filename(self, filename, mode, clobber)
474
475 if mode == 'ostream':
--> 476 self._overwrite_existing(clobber, None, True)
477
478 if os.path.exists(self.name):
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _overwrite_existing(self, clobber, fileobj, closed)
393 os.remove(self.name)
394 else:
--> 395 raise IOError("File %r already exists." % self.name)
396
397 def _open_fileobj(self, fileobj, mode, clobber):
OSError: File '../data/Observing Project/calib_data/master_bias.fit' already exists.
In [ ]:
In [ ]:
In [17]:
In [18]:
Out[18]:
ERROR:ccdproc.image_collection:error writing file ../data/Observing Project/calib_data/dark_300_1.fit
One or more of the reduced images already exists. Delete those files and try again. This class will NOT overwrite existing files.
In [19]:
In [20]:
Out[20]:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-20-3296f56c88b7> in <module>()
5 group_by='exposure',
6 destination=destination_dir)
----> 7 make_master_dark.action()
/projects/cc2eb3bf-2c88-48fa-96e2-80b295a5a4c1/PHY241/assignments/reduction_tools.py in action(self)
218 fname = '_'.join(fname) + '.fit'
219 dest_path = os.path.join(self.destination, fname)
--> 220 combined.write(dest_path)
221 self._combined = combined
222
/projects/anaconda3/lib/python3.5/site-packages/astropy/nddata/mixins/ndio.py in write(self, *args, **kwargs)
37 formats.
38 """
---> 39 io_registry.write(self, *args, **kwargs)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/registry.py in write(data, *args, **kwargs)
401
402 writer = get_writer(format, data.__class__)
--> 403 writer(data, *args, **kwargs)
404
405
/projects/anaconda3/lib/python3.5/site-packages/ccdproc/ccddata.py in fits_ccddata_writer(ccd_data, filename, hdu_mask, hdu_uncertainty, hdu_flags, **kwd)
762 hdu = ccd_data.to_hdu(hdu_mask=hdu_mask, hdu_uncertainty=hdu_uncertainty,
763 hdu_flags=hdu_flags)
--> 764 hdu.writeto(filename, **kwd)
765
766
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in writeto(self, fileobj, output_verify, clobber, checksum)
684 # file object that's open to write only, or in append/update modes
685 # but only if the file doesn't exist.
--> 686 fileobj = _File(fileobj, mode='ostream', clobber=clobber)
687 hdulist = self.fromfile(fileobj)
688
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in __init__(self, fileobj, mode, memmap, clobber, cache)
148 self._open_fileobj(fileobj, mode, clobber)
149 elif isinstance(fileobj, string_types):
--> 150 self._open_filename(fileobj, mode, clobber)
151 else:
152 self._open_filelike(fileobj, mode, clobber)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _open_filename(self, filename, mode, clobber)
474
475 if mode == 'ostream':
--> 476 self._overwrite_existing(clobber, None, True)
477
478 if os.path.exists(self.name):
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _overwrite_existing(self, clobber, fileobj, closed)
393 os.remove(self.name)
394 else:
--> 395 raise IOError("File %r already exists." % self.name)
396
397 def _open_fileobj(self, fileobj, mode, clobber):
OSError: File '../data/Observing Project/calib_data/master_dark_exposure_30.0.fit' already exists.
In [ ]:
In [ ]:
In [21]:
Out[21]:
300.0
In [22]:
Out[22]:
ERROR:ccdproc.image_collection:error writing file ../data/Observing Project/calib_data/flat_b_1.fit
One or more of the reduced images already exists. Delete those files and try again. This class will NOT overwrite existing files.
In [23]:
Out[23]:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-23-17f0c0d00ed0> in <module>()
5 destination=destination_dir,
6 apply_to={'imagetyp':'FLAT'})
----> 7 make_master_flat.action()
/projects/cc2eb3bf-2c88-48fa-96e2-80b295a5a4c1/PHY241/assignments/reduction_tools.py in action(self)
218 fname = '_'.join(fname) + '.fit'
219 dest_path = os.path.join(self.destination, fname)
--> 220 combined.write(dest_path)
221 self._combined = combined
222
/projects/anaconda3/lib/python3.5/site-packages/astropy/nddata/mixins/ndio.py in write(self, *args, **kwargs)
37 formats.
38 """
---> 39 io_registry.write(self, *args, **kwargs)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/registry.py in write(data, *args, **kwargs)
401
402 writer = get_writer(format, data.__class__)
--> 403 writer(data, *args, **kwargs)
404
405
/projects/anaconda3/lib/python3.5/site-packages/ccdproc/ccddata.py in fits_ccddata_writer(ccd_data, filename, hdu_mask, hdu_uncertainty, hdu_flags, **kwd)
762 hdu = ccd_data.to_hdu(hdu_mask=hdu_mask, hdu_uncertainty=hdu_uncertainty,
763 hdu_flags=hdu_flags)
--> 764 hdu.writeto(filename, **kwd)
765
766
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in writeto(self, fileobj, output_verify, clobber, checksum)
684 # file object that's open to write only, or in append/update modes
685 # but only if the file doesn't exist.
--> 686 fileobj = _File(fileobj, mode='ostream', clobber=clobber)
687 hdulist = self.fromfile(fileobj)
688
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in __init__(self, fileobj, mode, memmap, clobber, cache)
148 self._open_fileobj(fileobj, mode, clobber)
149 elif isinstance(fileobj, string_types):
--> 150 self._open_filename(fileobj, mode, clobber)
151 else:
152 self._open_filelike(fileobj, mode, clobber)
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _open_filename(self, filename, mode, clobber)
474
475 if mode == 'ostream':
--> 476 self._overwrite_existing(clobber, None, True)
477
478 if os.path.exists(self.name):
/projects/anaconda3/lib/python3.5/site-packages/astropy/io/fits/file.py in _overwrite_existing(self, clobber, fileobj, closed)
393 os.remove(self.name)
394 else:
--> 395 raise IOError("File %r already exists." % self.name)
396
397 def _open_fileobj(self, fileobj, mode, clobber):
OSError: File '../data/Observing Project/calib_data/master_flat_filter_B.fit' already exists.
In [ ]:
In [24]:
Out[24]:
ERROR:ccdproc.image_collection:error writing file ../data/Observing Project/calib_data/ngc7789_b_300_1.fit
One or more of the reduced images already exists. Delete those files and try again. This class will NOT overwrite existing files.
In [29]:
Out[29]:
In [ ]:
In [ ]: