Menu ▾ ▴

Invalid CALSTAT fields in stacked output

2026-10-25
2026-10-27
  • Marcin Owsiany

    Marcin Owsiany - 2026-10-25

    It seems that when stacking, the CALSTAT field in the header of the output FITS file gets one F letter for every subframe that was flat-calibrated.

    For example:

    $ for f in *stacked*.fit*;do echo "$f"; fitstool "$f"|grep CALSTAT;done
    C_2025_A6_Lemmon_Light_R_10_secs_2025-10-03T05-34-16_030@  0xFD  60xF  0xD  28xR_stacked.fit
    CALSTAT "" FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    no_object, 2025-10-03, 28x10R, EQMod Mount, (R), ToupTek ATR585M(USB20)_stacked.fits
    CALSTAT "" FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFS
    

    (fitstool above is my toy program that dumps the FITS header of a file)

    Is this intended? I wasn't able to find a specification of this field, but I admit not looking deep...

    With a lot of subframes, this leads to apprarently invalid header. At least the astrogo/fitsio library complains about it: https://codeberg.org/astrogo/fitsio/issues/61

    First noticed in an old version of ASTAP, but just reproduced with version 2026-10-14.

    regards,
    Marcin

     
  • Marcin Owsiany

    Marcin Owsiany - 2026-10-26

    Turns out the fitsio developer also noticed another corrupted field:

    *** Error:   Keyword #75, DATE-AVG: (from CFITSIO error stack:)
                 input date string has illegal format:
                 -4712-01-01T12:00:00
    

    I wonder if this is a result of the overflow, or a separate issue.

     
  • han.k

    han.k - 2026-10-26

    Hi Marcin,

    That should not happen. I tested it here and I can not reproduce the effect.

    I vaguely remember this happened briefly a few weeks ago and was almost immediately fixed. Version 2026-10-14 should not have it. I tested the Linux version. Can you download a fresh copy of ASTAP and try again?

    If the effect is persistent, can you create a small test set of frames to reproduce the effect? Then share it and I can test it here.

    The -4712-01-01T12:00:00 is a separate issue. This is the year 0 of the Julian day calculation. Weird, looks like the date was not readable. Do you use DSLR images? Send a sample to reproduce the problems.

    cs, Han

     
  • Marcin Owsiany

    Marcin Owsiany - 2026-10-26

    Interesting. Here is a zip with the inputs and outputs, and here is the procedure I used:

    • I run ASTAP, check its version is 2026.10.24 [1.png]
    • Click stack, select lights, drop the files [2.png]
    • Click analyze and organize,
    20:16:13  Analysing lights
    20:16:14  Move file /home/porridge/tmp/2025-10-03 - DELETEME after 2026-12-01/repro/small/master_flat_corrected_with_flat_darks_R_60xF_0xFD_0.2sec_2025-10-03.fit to tab FLATS
    20:16:14  Analysing group _R_10 for outliers.        Average image quality (nrstars/sqr(hfd*binning))=0, σ=0.5
    20:16:14  Analysing lights done.
    
    • The master flat lands in flats tab [3.png] [4.png]
    • Check settings [5.png]
    • Go back to lights tab, check "Write stack log file", and click stack LRGB.
    • Produced files contain many Fs in CALSTAT:
    $ ~/Desktop/coding/fitstool/fitstool *stacked*.fit* | egrep '^(dumping|CALSTAT)'
    dumping C_2025_A6_Lemmon_Light_R_10_secs_2025-10-03T04-56-11_010@  0xFD  60xF  0xD  10xR_stacked.fit
    CALSTAT "" FFFFFFFFFFFFFFFFFFFF
    dumping no_object, 2025-10-03, 10x10R, EQMod Mount, (R), ToupTek ATR585M(USB20)_stacked.fits
    CALSTAT "" FFFFFFFFFFFFFFFFFFFFS
    
     
  • han.k

    han.k - 2026-10-27

    Thanks. I can reproduce the problem here. Now I have to find out why this happens.....

     
  • han.k

    han.k - 2026-10-27

    I have found the cause. The reason there is no dark is available, only the flat.. This is rare. Normally you would at least apply the dark. Some people skip the flat. You did the opposite.

    The fix is one line extra code. It will be fixed in the next version.

    cs, Han

     
    ❤️
    1

Log in to post a comment.