Full Name: | herschel.ia.io.fits.FitsArchive |
Alias: | FitsArchive |
Type: | Java Class -
![]() |
Import: | from herschel.ia.io.fits import FitsArchive |
Category |
A class for reading and writing FITS files.
The FitsArchive provides a transparent way to store and retrieve Products as defined within the Herschel Data Processing software. FitsArchive is thread tolerant. It is not thread safe: do not share a FitsArchive object between several threads.
Example 1: default usage: | ||
---|---|---|
|
Example 2: reading a HCSS FITS file which contains a removed class: | ||
---|---|---|
|
Example 3: reading a externally generated FITS file into a Product: | ||
---|---|---|
|
Example 4: reading a gzipped product: | ||
---|---|---|
|
Example 5: reading a zipped product: | ||
---|---|---|
|
Example 6: saving an empty ArrayDataset is allowed: | ||
---|---|---|
|
Example 7: saving an empty column in a TableDataset is NOT allowed: | ||
---|---|---|
|
Example 8: saving the product minimising product metadata keyword translations and making keywords duplicity: | ||
---|---|---|
|
Example 9: saving a gzipped product | ||
---|---|---|
|
Fields | |
---|---|
FitsReader
HCSS_READER
|
|
HCSS FITS Reader |
|
FitsReader
STANDARD_READER
|
|
Generic FITS Reader |
|
FitsReader
RAW_READER
|
FitsReader
HCSS_READER
|
|||
---|---|---|---|
HCSS FITS Reader A FITS reader that expects a FITS format that was produced by this archive implementation. This is a shared object among any FitsArchive instance. In a multithreaded environment, you should use a new instance of a reader. It can handle nested structures, derived datasets and quantities of the data within FITS. This is the default reader when you create a FitsArchive. |
|||
Examples | |||
creating a new FitsArchive | |||
|
|||
creating a new FitsArchive | |||
|
FitsReader
STANDARD_READER
|
|||
---|---|---|---|
Generic FITS Reader A generic FITS reader for FITS files that are not created by the HCSS FitsArchive. This is a shared object among any FitsArchive instance. In a multithreaded environment, you should use a new instance of a reader. This reader can read FITS files that were generated by other software as long as it complies to the FITS standard and translates the contents into a Product. |
|||
Examples | |||
Import data from an externally generated FITS file | |||
|
|||
Reusing this FitsArchive but changing the reader | |||
|
FitsReader
RAW_READER
|
|||
---|---|---|---|
Example | |||
creating a new FitsArchive with a RawFitsReader | |||
|
Product
load
(String name)
|
||
---|---|---|
Loads a Product from a FITS file. Loads a Product from a FITS file using the current reader. |
||
Argument | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
Product
load
(String name, boolean handleMissingClasses)
|
||
---|---|---|
Loads a Product from a FITS file. Loads a Product from a FITS file using the current reader. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
Product
load
(String file)
|
||
---|---|---|
Loads a Product from a FITS file. Loads a Product from a FITS file using the current reader. |
||
Argument | ||
String file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
Product
load
(String file, boolean handleMissingClasses)
|
||
---|---|---|
Loads a Product from a FITS file. Loads a Product from a FITS file using the current reader. |
||
Arguments | ||
String file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
Product
load
(InputStream is)
|
||
---|---|---|
Loads a Product from a FITS InputStream. Loads a Product from a FITS InputStream using the current reader. |
||
Argument | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
Product
load
(InputStream is, boolean handleMissingClasses)
|
||
---|---|---|
Loads a Product from a FITS InputStream. Loads a Product from a FITS InputStream using the current reader. The user must close the InputStream. |
||
Arguments | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
Product
An object of the herschel.ia.dataset.Product family. |
save
(String name, [Optionally derived] Product. product)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
save
(boolean compress, String name, [Optionally derived] Product. product)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
boolean compress
[INPUT, MANDATORY, default=no default value]
|
||
'true' for writing a gzip FITS file. |
||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
save
(String name, [Optionally derived] Product. product, Boolean. minimizeTranslations, [Optionally derived] Product. keysDuplicity)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
||
Boolean. minimizeTranslations
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if some keywords that are not in any dictionary will be transalted without using 'META' following some rules. |
||
[Optionally derived] Product. keysDuplicity
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if a keyword will be translated to several FITS keywords. |
save
(boolean compress, String name, [Optionally derived] Product. product, Boolean. minimizeTranslations, [Optionally derived] Product. keysDuplicity)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
boolean compress
[INPUT, MANDATORY, default=no default value]
|
||
'true' for writting a gzip FITS file. |
||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
||
Boolean. minimizeTranslations
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if some keywords that are not in any dictionary will be transalted without using 'META' following some rules. |
||
[Optionally derived] Product. keysDuplicity
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if a keyword will be translated to several FITS keywords. |
save
(File file, [Optionally derived] Product. product)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
save
(boolean compress, File file, [Optionally derived] Product. product)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
boolean compress
[INPUT, MANDATORY, default=no default value]
|
||
'true' for writting a gzip FITS file. |
||
File file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
save
(File file, [Optionally derived] Product. product, Boolean. minimizeTranslations, [Optionally derived] Product. keysDuplicity)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file. |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
||
Boolean. minimizeTranslations
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if some keywords that are not in any dictionary will be transalted without using 'META' following some rules. |
||
[Optionally derived] Product. keysDuplicity
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if a keyword will be translated to several FITS keywords. |
save
(boolean compress, File file, [Optionally derived] Product. product, Boolean. minimizeTranslations, [Optionally derived] Product. keysDuplicity)
|
||
---|---|---|
Saves a Product to a FITS file. Saves a Product to a FITS file with sufficient information to preserve the quantities of the data as well as the original dataset type and contents. |
||
Arguments | ||
boolean compress
[INPUT, MANDATORY, default=no default value]
|
||
'true' for writting a gzip FITS file. |
||
File file
[INPUT, MANDATORY, default=no default value]
|
||
FITS file. |
||
[Optionally derived] Product. product
[INPUT, MANDATORY, default=no default value]
|
||
An object of the herschel.ia.dataset.Product family. |
||
Boolean. minimizeTranslations
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if some keywords that are not in any dictionary will be transalted without using 'META' following some rules. |
||
[Optionally derived] Product. keysDuplicity
[INPUT, MANDATORY, default=no default value]
|
||
Specifies if a keyword will be translated to several FITS keywords. |
MetaData
loadMeta
(String name)
|
||
---|---|---|
Loads a MetaData product object from a FITS file. Loads a MetaData product object using the current reader. |
||
Argument | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
Return | ||
MetaData
A MetaData product object. |
MetaData
loadMeta
(File file)
|
||
---|---|---|
Loads a MetaData product object from a FITS file. Loads a MetaData product object using the current reader. |
||
Argument | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
Return | ||
MetaData
A MetaData product object. |
MetaData
loadMeta
(InputStream is)
|
||
---|---|---|
Loads a MetaData product object from a FITS file. Loads a MetaData product object using the current reader. The user must close the InputStream. |
||
Argument | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file. |
||
Return | ||
MetaData
A MetaData product object. |
MetaData
loadMeta
(String name, integer hduIndex)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(String name, integer hduIndex, integer commentExtraSpacesToRemove)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(File file, integer hduIndex)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(File file, integer hduIndex, integer commentExtraSpacesToRemove)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(InputStream is, integer hduIndex)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. The user must close the InputStream. |
||
Arguments | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file. |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(InputStream is, integer hduIndex, integer commentExtraSpacesToRemove)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. The user must close the InputStream. |
||
Arguments | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file. |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(String name, integer hduIndex, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(String name, integer hduIndex, integer commentExtraSpacesToRemove, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
String name
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(File file, integer hduIndex, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(File file, integer hduIndex, integer commentExtraSpacesToRemove, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. |
||
Arguments | ||
File file
[INPUT, MANDATORY, default=no default value]
|
||
Name of the FITS file |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(InputStream is, integer hduIndex, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. The user must close the InputStream. |
||
Arguments | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file. |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |
MetaData
loadMeta
(InputStream is, integer hduIndex, integer commentExtraSpacesToRemove, boolean handleMissingClasses)
|
||
---|---|---|
Loads a MetaData object from a FITS file at the specified HDU index. Loads a MetaData object using the current reader for HDU index 0. Loads a MetaData object using STANDARD_READER for HDU index greater than 0. The user must close the InputStream. |
||
Arguments | ||
InputStream is
[INPUT, MANDATORY, default=no default value]
|
||
InputStream to the FITS file. |
||
integer hduIndex
[INPUT, MANDATORY, default=no default value]
|
||
HDU index. |
||
integer commentExtraSpacesToRemove
[INPUT, MANDATORY, default=no default value]
|
||
Comment extra spaces to be removed. |
||
boolean handleMissingClasses
[INPUT, MANDATORY, default=no default value]
|
||
For creating dummy classes when an HCSS class is not found. |
||
Return | ||
MetaData
A MetaData object at the specified HDU index. |