Incorrect FITS headers after stacking

classic Classic list List threaded Threaded
8 messages Options
pdb
Reply | Threaded
Open this post in threaded view
|

Incorrect FITS headers after stacking

pdb
Hi,

Using ASTROIMAGEJ 5.2.0.06 on Win10.

When stacking images using the "combine stack slices into single image"  in the resulting image, the Fits Header looks ok for DATE-OBS, JD-AVG en DATE-AVG in avg stacking (median gives invalid fits header and Fits header is wrong)

When saving the file in fits format, only JD-AVG is filled in.

Reading the file in another program (in this case Siril, but it is the same in DS9) gives this
----------------------------------
EQUINOX =               2000.0 / Equinox of celestial coordinate system
HISTORY  Stack of 10 images using method: Average Intensity
EXPTIME =               1200.0 / Total luminance exposure time in seconds
DATE-OBS DATE_OBS of last exposure in stack
JD-AVG  =    2459973.292005932 / Julian Day of the observation mid-point.
DATE-AVG
END
------------------------------------

Opening in AstroImageJ again shows the fields empty.


Paul De Backer
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

karenacollins
Administrator
Hi Paul,

Thanks for the report. The fits header processing part of stack combiner code was contributed by an AIJ user, so it will possibly take us some time to dig into it, unless the original author of the code is available to look into it.

In the meantime, can you confirm that what you are reporting happens even when averaging the stack is selected?

I think that you are also saying that when median is selected, the headers are incorrect even before saving the FITS file, but let us know if that is wrong.

Karen
pdb
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

pdb
Hi Karen,

thanks for looking into it. For median stacking, AstroImageJ shows "Invalid Fits Header" when trying to look at the header. After saving the file only these lines are in the header:

SIMPLE  =                    T / Java FITS: Wed Feb 01 08:07:55 CET 2023
BITPIX  =                  -32 / bits per data value
NAXIS   =                    2 / number of axes
NAXIS1  =                 3126 / size of the n'th axis
NAXIS2  =                 2088 / size of the n'th axis
EXTEND  =                    T / Extensions are permitted
END

Is the source code available somewhere? Could try to fix it myself.

Regards,

Paul
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

Bill Tschumy
In reply to this post by pdb
I believe I was the person that worked on the FITS header that results from stacking.  I can reproduce your problem and will look into it today.
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

Bill Tschumy
In reply to this post by pdb
OK, looking at the code, it looks like a fix for this was checked in on Feb 1st, 2023 by Eastridge.  From what I can see, it doesn't look like this change has made it into a public release yet, although you might get it with the Nightly build.  Karen, will this be released soon?
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

karenacollins
Administrator
Hi Bill,

Indeed. Kevin took a quick look and identified the two fairly straightforward fixes, so went ahead and implemented them. A new daily build will be posted with the fixes in the next day or two.

Thanks as always for your AIJ code contribution!

Karen
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

karenacollins
Administrator
Hi Paul,

Fixes for both of these problems are now in the latest daily build (5.2.0.07 or later).

Bill,

Thanks for following up on this. Much continued appreciation for your contribution of the main FITS header update code that just needed a couple of small tweaks to correct these issues.

Karen
pdb
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect FITS headers after stacking

pdb
Bill and Karen,

thank you very much. I updated, and tested on my stack. Looks very good (both avg and median stacking now have the header)

Rgrds,

Paul