Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve validation Code #2

Open
53 tasks
brampf opened this issue Jul 14, 2020 · 0 comments
Open
53 tasks

Improve validation Code #2

brampf opened this issue Jul 14, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@brampf
Copy link
Owner

brampf commented Jul 14, 2020

The validation routines are currently very limited and do not cover many cases. It should be a piece of cake to implement most if not all of the rule for FITSverify(https://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify/):

SEVERE ERROR CONDITIONS

  • Mandatory keyword not present or out of order
  • Mandatory keyword has wrong datatype or illegal value
  • END header keyword is not present
  • Sum of table column widths is inconsistent with NAXIS1 value
  • BLANK keyword present in image with floating-point datatype
  • TNULLn keyword present for floating-point binary table column
  • Bit column has non-zero fill bits or is not left adjusted(*)
  • ASCII TABLE column contains illegal value inconsistent with TFORMn(*)
  • Address to a variable length array not within the data heap(*)
  • Extraneous bytes in the FITS file following the last HDU

ERROR CONDITIONS

  • Mandatory keyword values not expressed in fixed format
  • Mandatory keyword duplicated elsewhere in the header
  • Header contains illegal ASCII character (not ASCII 32 - 126)
  • Keyword name contains illegal character
  • Keyword value field has illegal format
  • Value and comment fields not separated by a slash character
  • END keyword not filled with blanks in columns 9 - 80
  • Reserved keyword with wrong datatype or illegal value
  • XTENSION keyword in the primary array
  • Column related keyword (TFIELDS, TTYPEn,TFORMn, etc.) in an image
  • SIMPLE, EXTEND, or BLOCKED keyword in any extension
  • BSCALE, BZERO, BUNIT, BLANK, DATAMAX, DATAMIN keywords in a table
  • Table WCS keywords (TCTYPn, TCRPXn, TCRVLn, etc.) in an image
  • TDIMn or THEAP keyword in an ASCII table
  • TBCOLn keyword in a Binary table
  • THEAP keyword in a binary table that has PCOUNT = 0
  • XTENSION, TFORMn, TDISPn or TDIMn value contains leading space(s)
  • WCSAXES keyword appears after other WCS keywords
  • Index of any WCS keyword (CRPIXn, CRVALn, etc.) greater than value of WCSAXES
  • Index of any table column descriptor keyword (TTYPEn, TFORMn, etc.) greater than value of TFIELDS
  • TSCALn or TZEROn present for an ASCII, logical, or Bit column
  • TDISPn value is inconsistent with the column datatype
  • Length of a variable length array greater than the maximum length as given by the TFORMn keyword
  • ASCII table floating-point column value does not have decimal point(*)
  • ASCII table numeric column value has embedded space character
  • Logical column contains illegal value not equal to 'T', 'F', or 0(*)
  • Character string column contains non-ASCII text character(*)
  • Header fill bytes not all blanks (**)
  • Data fill bytes not all blanks in ASCII tables or all zeros in any other type of HDU (**)
  • Gaps between defined ASCII table columns contain characters with ASCII value > 127 (**)

WARNING CONDITIONS

  • SIMPLE = F
  • Presence of deprecated keywords BLOCKED or EPOCH
  • 2 HDUs have identical EXTNAME and EXTVER values
  • BSCALE or TSCALn value = 0.
  • BLANK OR TNULLn value exceeds the legal range
  • TFORMn has 'rAw' format and r is not a multiple of w
  • DATE = 'dd/mm/yy' and yy is less than 10 (Y2K problem??)
  • Index of any WCS keyword (CRPIXn, CRVALn, etc.) greater than value of NAXIS, if the WCSAXES keyword is not present
  • Duplicated keyword (except COMMENT, HISTORY, blank, etc.)
  • Column name (TTYPEn) does not exist or contains characters other than letter, digit and underscore
  • Binary table has PCOUNT > 0, but no variable-length array columns
  • Calculated checksum inconsistent with CHECKSUM or DATASUM keyword(***)
  • The HEASARC long string keyword convention is used without the recommended LONGSTRN keyword (****)

(*) only checked when "testdata" is 'Yes'
(**) only checked when "testdata" and "testfill" are 'Yes'
(***) only checked when "testdata" and "tchksum" are 'Yes'
(****) only checked when the "heasarc" is 'Yes'

Every HDU in the FITS file is checked in turn until the end of file is detected.

@brampf brampf added the enhancement New feature or request label Jul 14, 2020
brampf added a commit that referenced this issue Aug 1, 2020
Implemented 3 simple examples for severe cases
@brampf brampf added this to the 0.2 milestone Aug 11, 2020
@brampf brampf modified the milestones: 0.2, 0.4 Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant