public class FITSWriter extends Writer implements stream.StatefulProcessor
Write data to a FITS file sequentially.
This processor is able to serialize scalars and 1d-arrays of fixed length containing primitive types. Other data structures will be ignored (complex objects) or lead to errors (variable length arrays).
The fits file is initialised and the header is filled using the given keys from first data item. All following items must have the same structure.
Modifier and Type | Field and Description |
---|---|
boolean |
allowNullKeys |
boolean |
caseSensitive |
String |
extname |
stream.Keys |
headerKeys |
stream.Keys |
keys |
URL |
url |
Constructor and Description |
---|
FITSWriter() |
Modifier and Type | Method and Description |
---|---|
void |
addFACTToolsMetaData(nom.tam.fits.Header header) |
void |
finish() |
static String |
formatDateTime(ZonedDateTime zonedDateTime)
Java DateTimeFormatter.ISO_INSTANT creates variable length strings, because
only the significant digits are returned.
|
void |
init(stream.ProcessContext processContext) |
stream.Data |
process(stream.Data item) |
void |
resetState() |
getDefaultKeys, isSimulated, testKeys
@Parameter(description="Keys to save to the outputfile, if not given, the default keys for observations and simulations are stored, taken from the default/settings.properties file") public stream.Keys keys
@Parameter(description="Keys to write to the FITS Header. Only the first data item will be used. Using streams.Keys") public stream.Keys headerKeys
@Parameter(required=true, description="Url for the output file") public URL url
@Parameter(defaultValue="Events", description="EXTNAME for the binary table extension") public String extname
@Parameter(required=false, description="Set if you want to allow non existing keys.") public boolean allowNullKeys
@Parameter(required=false, description="If the matching of the keys should be done case sensitive") public boolean caseSensitive
public stream.Data process(stream.Data item)
process
in interface stream.Processor
public void addFACTToolsMetaData(nom.tam.fits.Header header) throws nom.tam.fits.FitsException
nom.tam.fits.FitsException
public void init(stream.ProcessContext processContext) throws Exception
init
in interface stream.StatefulProcessor
Exception
public void resetState() throws Exception
resetState
in interface stream.StatefulProcessor
Exception
public void finish() throws Exception
finish
in interface stream.StatefulProcessor
Exception
public static String formatDateTime(ZonedDateTime zonedDateTime)
zonedDateTime
- Copyright © 2019. All rights reserved.