Closed EastEriq closed 6 months ago
Further processing of the images adds to the mangling: At a later stage we have
ORIGNAME= '/data/PTF_default_24854.fits' / Filename as written by the camera
FILENAME= 'PTF201110114398_11_o_24854.fits' / Filename of delivered camera imag
PROCORIG= 'IPAC-PTF pipelines' / Processing origin
PROCDATE= 'Sun Dec 18 21:44:36 2011' / Processing date/time (Pacific time)
PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program
PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/'' / Pathname of pixel mask' / pm
PMASKFIL= '70sOn35s_pixmask_chip2.trimmed.v4.fits' / Filename of pixel mask
SFLATPTH= '/ptf/pos/sbx2/2011/10/11/f11/c2/cal/p4/cId62146/'' / Pathname of su&'
CONTINUE 'per ' / 11/f11/c2/cal/p4/cId62146/' / Pathname of super
LONGSTRN= 'OGIP 1.0' / The HEASARC Long String Convention may be used.
COMMENT This FITS file may contain long string keyword values that are
COMMENT continued over multiple keywords. The HEASARC convention uses the &
COMMENT character at the end of each substring which is then continued
COMMENT on the next keyword which has the name CONTINUE.
SFLATFIL= 'PTF_201110110000_i_s_flat_t120000_u000062146_f11_p000000_c02.fits'''
SBIASPTH= '/ptf/pos/sbx2/2011/10/10/f2/c2/p13/v1/'' / Pathname of super bias'
SBIASFIL= 'PTF_201110100000_i_s_bias_t120000_u000050818_f00_p000000_c02.fits'''
I think that the pattern is: "long mangled fields are split as CONTINUE (within reason), long comments are truncated"
Since the risk of breaking the reading of FITS file with modifications of the code is very high, I have created a branch FITSheaderWithLongStrings
which needs to be vetted before merging. My first commit, https://github.com/EranOfek/AstroPack/commit/c219a71c74e4eb7c00f0cf0cc0d3f7168ccb98c1, modifies FITS.readHeader1
so that it deals correctly with single line header key-value-comment, in which value is a string which may be longer than 20 char, may contain slashes, and comments may be absent all together. Moreover, it fixes a small bug of a trailing space in comments.
Apparently, AstroImage(filename)
makes use of this method, so the header should be retrieved correctly.
E.g., this file
contains this section of the header:
If I read this file with
AI=AstroImage(imagefile)
I get inside the header, shown here for clarity in format shortNote that the content of
PMASKPTH
,SFLATPTH
,SBIASPTH
,SBIASFIL
is messed up. Not that I really need these particular fields, but the problem is carried on. In more detail:Note the pieces carried from the content field to the comment field, the doubled apices, etc.