I use Img.save_as_fits() and Img.load_fits() for saving averaged dark images.
However I run into the problem, that the Img.meta dictionary is not saved (and consequently reloaded). Thus exposure times etc cannot be used for dark correction.
This could be fixed by adding hdu.header.update(self.meta) to the Img.save_as_fits() method. This however results in the following error when calling the method
File "C:\Users\asd\AppData\Local\Continuum\Anaconda3\envs\pyplis\lib\site-packages\astropy\io\fits\card.py", line 311, in value
raise ValueError('Illegal value: {!r}.'.format(value))
ValueError: Illegal value: datetime.datetime(2017, 7, 20, 13, 29, 59, 257474).
as (probably) only standard types can be saved in a Fits header.
For now, single meta data can be saved by adding e.g.
I use
Img.save_as_fits()
andImg.load_fits()
for saving averaged dark images. However I run into the problem, that theImg.meta
dictionary is not saved (and consequently reloaded). Thus exposure times etc cannot be used for dark correction.This could be fixed by adding
hdu.header.update(self.meta)
to theImg.save_as_fits()
method. This however results in the following error when calling the methodas (probably) only standard types can be saved in a Fits header.
For now, single meta data can be saved by adding e.g.
instead of the whole meta dictionary.
Nevertheless, on the long run, it should be possible to save the full meta dictionary reliably.