Hi all,

I'm trying to write my own Python pipelines to calibrate, platesolve and stack FITS files. My acquisition setup is:

  • QHY163-M / QHYCFW-2 / QHY-5-II (guider) / EQMod (EQ6)
  • indiserver ran via indi-web on a Raspberry Pi
  • Kstars/Ekos with local patesolving

In my script, I load all files in a ccdproc collection and try to iterate on it like this:
for img, fname in collection.ccds(return_fname=True):
But then I get the following error:
ValueError: a unit for CCDData must be specified.

From what I've read here , this seems to be due to a missing BUNIT header in the FITS file. So I've wrote the following workaround:
    for hdu in collection.hdus(overwrite=True):
        hdu.header['bunit'] = 'adu'
        hdu.header.pop('radecsys', None)
        hdu.header['radesys'] = 'FK5'
The problem is that it somehow resets the "created at" value of the FITS file and generally feels like bad practice.

So my question(s) is (are): Are we really missing a BUNIT header or is my code wrong? If we're missing it, is there a way to tell Ekos to write it in?
Bonus question: Say I wanted to run each newly acquired FITS file through a simple pipeline (write the BUNIT value and update the WCS with a freshly solved one), what would be the best way to do it?

Thanks!

Read More...