Missing fields from FITS header on save

I’m trying to follow the procedure described on this astrobin thread to evaluate the backspace for my coma corrector. I’m using Ekos to capture the focus sequence image but when I try to load it on ASTAP it complains, because the focus images are compressed. As I know that SiriL is hable to work with compressed FITS, my plan was to convert the images into another set (I was forcing SiriL to “debayer” the mono images) and it almost worked. The new images where generated uncompressed (I’ve compression disabled on SiriL). But I said almost because the focus position field was striped from the header.

This was the original FITS header:

XTENSION= 'BINTABLE'           / binary table extension
BITPIX  =                    8 / 8-bit bytes
NAXIS   =                    2 / 2-dimensional binary table
NAXIS1  =                    8 / width of table in bytes
NAXIS2  =                  961 / number of rows in table
PCOUNT  =             12591434 / size of special data area
GCOUNT  =                    1 / one data group (required keyword)
TFIELDS =                    1 / number of fields in each row
TTYPE1  = 'COMPRESSED_DATA'    / label for field   1
TFORM1  = '1PB(15033)'         / data format of field: variable length array
ZIMAGE  =                    T / extension contains compressed image
ZSIMPLE =                    T / file does conform to FITS standard
ZBITPIX =                   16 / data type of original image
ZNAXIS  =                    2 / dimension of original image
ZNAXIS1 =                 3008 / length of original image axis
ZNAXIS2 =                 3008 / length of original image axis
ZTILE1  =                  100 / size of tiles to be compressed
ZTILE2  =                  100 / size of tiles to be compressed
ZCMPTYPE= 'RICE_1  '           / compression algorithm
ZNAME1  = 'BLOCKSIZE'          / compression block size
ZVAL1   =                   32 / pixels per block
ZNAME2  = 'BYTEPIX '           / bytes per pixel (1, 2, 4, or 8)
ZVAL2   =                    2 / bytes per pixel (1, 2, 4, or 8)
BZERO   =                32768 / offset data range to that of unsigned short
BSCALE  =                    1 / default scaling factor
DATAMIN =                   0. / Minimum value
DATAMAX =               65532. / Maximum value
MIN1    =                   0. / Min Channel 1
MAX1    =               65532. / Max Channel 1
MEAN1   =     6042.48293781669 / Mean Channel 1
MEDIAN1 =                5996. / Median Channel 1
STDDEV1 =      945.28053571818 / Standard Deviation Channel 1
ROWORDER= 'TOP-DOWN'           / ROWORDER
INSTRUME= 'ZWO CCD ASI533MC Pro' / INSTRUME
TELESCOP= 'EQMod Mount'        / TELESCOP
OBSERVER= 'Unknown '           / OBSERVER
OBJECT  = 'Vega    '           / OBJECT
EXPTIME =                   4. / Total Exposure Time (s)
CCD-TEMP=                 -10. / CCD Temperature (Celsius)
PIXSIZE1=                 3.76 / Pixel Size 1 (microns)
PIXSIZE2=                 3.76 / Pixel Size 2 (microns)
XBINNING=                    1 / Binning factor in width
YBINNING=                    1 / Binning factor in height
XPIXSZ  =                 3.76 / X binned pixel size in microns
YPIXSZ  =                 3.76 / Y binned pixel size in microns
FRAME   = 'Light   '           / FRAME
IMAGETYP= 'Light Frame'        / IMAGETYP
FILTER  = 'L       '           / FILTER
XBAYROFF=                    0 / X offset of Bayer array
YBAYROFF=                    0 / Y offset of Bayer array
BAYERPAT= 'RGGB    '           / Bayer color pattern
FOCALLEN=                 600. / Focal Length (mm)
APTDIA  =                 150. / Telescope diameter (mm)
FOCUSPOS=                16686 / Focus position in steps
FOCUSTEM=                30.32 / Focuser temperature in degrees C
SCALE   =             1.292813 / arcsecs per pixel
SITELAT =             39.47528 / Latitude of the imaging site in degrees
SITELONG=           -0.3761111 / Longitude of the imaging site in degrees
AIRMASS =             1.078274 / AIRMASS
OBJCTAZ =             277.3479 / Azimuth of center of image in Degrees
OBJCTALT=             68.01898 / Altitude of center of image in Degrees
OBJCTRA = '18 37 07.43'        / Object J2000 RA in Hours
OBJCTDEC= '38 46 01.76'        / Object J2000 DEC in Degrees
RA      =              279.281 / Object J2000 RA in Degrees
DEC     =             38.76716 / Object J2000 DEC in Degrees
PIERSIDE= 'EAST    '           / East, looking West
EQUINOX =                 2000 / EQUINOX
CRVAL1  =         279.28097043 / CRVAL1
CRVAL2  =         38.767156302 / CRVAL2
RADECSYS= 'FK5     '           / RADECSYS
CTYPE1  = 'RA---TAN'           / CTYPE1
CTYPE2  = 'DEC--TAN'           / CTYPE2
CRPIX1  =                1504. / CRPIX1
CRPIX2  =                1504. / CRPIX2
SECPIX1 =         1.2928133301 / SECPIX1
SECPIX2 =         1.2928133301 / SECPIX2
CDELT1  =      0.0003591148139 / CDELT1
CDELT2  =      0.0003591148139 / CDELT2
CROTA1  =         356.54639159 / CROTA1
CROTA2  =         356.54639159 / CROTA2
DATE-OBS= '2022-10-24T18:20:31.386' / 2022-10-24T18:20:31.386
COMMENT = '        '           / Generated by INDI
GAIN    =                 340. / GAIN
OFFSET  =                  30. / OFFSET
END

and this one is the result after conversion

SIMPLE  =                    T / file does conform to FITS standard
BITPIX  =                   16 / number of bits per data pixel
NAXIS   =                    3 / number of data axes
NAXIS1  =                 3008 / length of data axis 1
NAXIS2  =                 3008 / length of data axis 2
NAXIS3  =                    3 / length of data axis 3
EXTEND  =                    T / FITS dataset may contain extensions
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H
BZERO   =               32768. / offset data range to that of unsigned short
BSCALE  =                   1. / default scaling factor
MIPS-HI =                65532 / Upper visualization cutoff
MIPS-LO =                    0 / Lower visualization cutoff
ROWORDER= 'TOP-DOWN'           / Order of the rows in image array
INSTRUME= 'ZWO CCD ASI533MC Pro' / instrument name
TELESCOP= 'EQMod Mount'        / telescope used to acquire this image
OBSERVER= 'Unknown '           / observer name
DATE    = '2022-10-25T06:39:02' / UTC date that FITS file was created
DATE-OBS= '2022-10-24T18:17:26.877000' / YYYY-MM-DDThh:mm:ss observation start,
EXPTIME =                   4. / Exposure time [s]
XPIXSZ  =                 3.76 / X pixel size microns
YPIXSZ  =                 3.76 / Y pixel size microns
XBINNING=                    1 / Camera binning mode
YBINNING=                    1 / Camera binning mode
FOCALLEN=                 600. / Camera focal length
CCD-TEMP=                 -9.8 / CCD temp in C
FILTER  = 'L       '           / Active filter name
IMAGETYP= 'Light Frame'        / Type of image
OBJECT  = 'Vega    '           / Name of the object of interest
GAIN    =                  340 / Camera gain
OFFSET  =                   30 / Camera offset
AIRMASS =             1.073871 / Airmass
SITELAT =             39.47528 / [deg] Observation site latitude
SITELONG=           -0.3761111 / [deg] Observation site longitude
PROGRAM = 'Siril v1.1.0'       / Software that created this HDU
CTYPE1  = 'RA---TAN'           / Coordinate type for the first axis
CTYPE2  = 'DEC--TAN'           / Coordinate type for the second axis
CUNIT1  = 'deg     '           / Unit of coordinates
CUNIT2  = 'deg     '           / Unit of coordinates
EQUINOX =                2000. / Equatorial equinox
OBJCTRA = '18 37 07.43'        / Image center Right Ascension (hms)
OBJCTDEC= '38 46 01.76'        / Image center Declination (dms)
RA      =              279.281 / Image center Right Ascension (deg)
DEC     =             38.76716 / Image center Declination (deg)
CRPIX1  =                1504. / Axis1 reference pixel
CRPIX2  =                1504. / Axis2 reference pixel
CRVAL1  =         279.28097023 / Axis1 reference value (deg)
CRVAL2  =          38.76715623 / Axis2 reference value (deg)
CDELT1  =      0.0003591148139 / X pixel size (deg)
CDELT2  =      0.0003591148139 / Y pixel size (deg)
PC1_1   =    0.998183901379403 / Linear transformation matrix (1, 1)
PC1_2   =  -0.0602403438485667 / Linear transformation matrix (1, 2)
PC2_1   =   0.0602403438485667 / Linear transformation matrix (2, 1)
PC2_2   =    0.998183901379403 / Linear transformation matrix (2, 2)
END

The fields that are needed to perform the focus analysis are gone. It seems odd to me that from all this info

FOCALLEN=                 600. / Focal Length (mm)
APTDIA  =                 150. / Telescope diameter (mm)
FOCUSPOS=                16686 / Focus position in steps
FOCUSTEM=                30.32 / Focuser temperature in degrees C
SCALE   =             1.292813 / arcsecs per pixel

the only field that survives a load/save cycle is the FOCALLEN. I suppose that it’s kept because it is useful for the plate solving algorithms.

FITS keywords is a wide issue.
In Siril we are doing this simple. We only keep tthe keyword we interpret and we use.
So this is why you don’t have the missing keywords.
There are too many keywords, and no standard. So this is not an easy task to handle everything.

Understood. Thanks!