Package nom.tam.fits

Class FitsFactory.FitsSettings

java.lang.Object
nom.tam.fits.FitsFactory.FitsSettings
All Implemented Interfaces:
Cloneable
Enclosing class:
FitsFactory

protected static final class FitsFactory.FitsSettings extends Object implements Cloneable
An class for aggregating all the settings internal to FitsFactory.
Author:
Attila Kovacs
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Returns the formatter instance for HIERARCH style keywords.
    protected boolean
    Checks if we are tolerant to FITS standard violations when reading 3rd party FITS files.
    protected boolean
    Checks if we treat junk after the last properly formed HDU silently withotu generating an exception.
    protected boolean
    Whether we check if ASCII strings in FITS files conform to the restricted set of characters (0x20 trough 0x7E) allowed by the FITS standard.
    protected boolean
    Checks if we allow storing long string values (using the OGIP 1.0 convention) in FITS headers.
    protected boolean
    Deprecated.
    The FITS standard is very explicit that assignment must be "= " (equals followed by a space).
    protected boolean
    Whether to write tables as ASCII tables automatically if possible.
    protected boolean
    Checks if we should use the letter 'D' to mark exponents of double-precision values (in FITS headers and ASCII tables).
    protected boolean
    Whether we allow using HIERARCH-style keywords, which may be longer than the standard 8-character FITS keywords, and may specify a hierarchy, and may also allow upper and lower-case characters depending on what formatting rules we use.
    protected boolean
    Checks if we allow storing Java char[] arrays in binary tables as 16-bit short[].

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • clone

      protected FitsFactory.FitsSettings clone()
      Overrides:
      clone in class Object
    • getHierarchKeyFormatter

      protected IHierarchKeyFormatter getHierarchKeyFormatter()
      Returns the formatter instance for HIERARCH style keywords. Our own standard is to define such keywords internally as starting with the string HIERARCH. followed by a dot-separated hierarchy, or just an unusually long FITS keywords that cannot be represented by a standard 8-byte keyword. The HIERARCH formatted will take such string keywords and will format them according to its rules when writing them to FITS headers.
      Returns:
      The formatter instance used for HIERARCH-style keywords.
    • isUseExponentD

      protected boolean isUseExponentD()
      Checks if we should use the letter 'D' to mark exponents of double-precision values (in FITS headers and ASCII tables). For ecample, in the typical Java number formatting the String 1.37E-13 may represent either a float or double value -- which are not exactly the same. For that reason FITS offers the possibility to replace 'E' in the string formatted number with 'D' when the value specifies a double-precision number, thus disambiguating the two.
      Returns:
      true if we will use 'D' to denote the exponent of double-precision values in FITS headers and ASCII tables.
    • isAllowTerminalJunk

      protected boolean isAllowTerminalJunk()
      Checks if we treat junk after the last properly formed HDU silently withotu generating an exception. When this setting is true we can read corrupted FITS files (at least partially) without raising an alarm.
      Returns:
      true if we allow additional bytes after the last readable HDU to be present in FITS files without throwing an exception. Otherwise false.
    • isCheckAsciiStrings

      protected boolean isCheckAsciiStrings()
      Whether we check if ASCII strings in FITS files conform to the restricted set of characters (0x20 trough 0x7E) allowed by the FITS standard. If the checking is enabled, we will log any such violations so they can be inspected and perhaps fixed.
      Returns:
      true if we should check and report if string appearing in FITS files do not conform to specification. Otherwise false
    • isLongStringsEnabled

      protected boolean isLongStringsEnabled()
      Checks if we allow storing long string values (using the OGIP 1.0 convention) in FITS headers. Such long string may span multiple 80-character header records. They are now standard as of FITS 4.0, but they were not in earlier specifications. When long strings are not enabled, we will throw a LongValueException whenever one tries to add a string value that cannot be contained in a single 80-character header record.
      Returns:
      true (default) if we allow adding long string values to out FITS headers. Otherwise false.
    • isSkipBlankAfterAssign

      @Deprecated protected boolean isSkipBlankAfterAssign()
      Deprecated.
      The FITS standard is very explicit that assignment must be "= " (equals followed by a space). If we allow skipping the space, it will result in a non-standard FITS, and may render it unreadable for other tools.
      Returns:
      whether to use only "=", instead of the standard "= " between the keyword and the value.
    • isUseAsciiTables

      protected boolean isUseAsciiTables()
      Whether to write tables as ASCII tables automatically if possible. Binary tables are generally always a better option, as they are both more compact and flexible but sometimes we might want to make our table data to be human readable in a terminal without needing any FITS-specific tool -- even though the 1970s is long past...
      Returns:
      true if we have a preference for writing table data in ASCII format (rather than binary), whenever that is possible. Otherwise false
    • isUseHierarch

      protected boolean isUseHierarch()
      Whether we allow using HIERARCH-style keywords, which may be longer than the standard 8-character FITS keywords, and may specify a hierarchy, and may also allow upper and lower-case characters depending on what formatting rules we use. Our own standard is to define such keywords internally as starting with the string HIERARCH. followed by a dot-separated hierarchy, or just an unusually long FITS keywords that cannot be represented by a standard 8-byte keyword.
      Returns:
      true if we allow HIERARCH keywords. Otherwise false
    • isUseUnicodeChars

      protected boolean isUseUnicodeChars()
      Checks if we allow storing Java char[] arrays in binary tables as 16-bit short[]. Otherwise we will store them as simple 8-bit ASCII.
      Returns:
      true if char[] is stored as short[] in binary tables, or false if we store than as 8-bit ASCII.
    • isAllowHeaderRepairs

      protected boolean isAllowHeaderRepairs()
      Checks if we are tolerant to FITS standard violations when reading 3rd party FITS files.
      Returns:
      true if we tolerate minor violations of the FITS standard when interpreting headers, which are unlikely to affect the integrity of the FITS otherwise. The violations will still be logged, but no exception will be generated. Or, false if we want to generate exceptions for such error.s