FITS2ANA - ITA-Solar/solo-spice-ql GitHub Wiki
Source code: fits2ana.pro
Description
FITS2ANA reads a FITS file and returns one or more ANA structure(s). The input FITS file should be a product of ANA2FITS. It must contain at least one RESULTS extension per window.
The DATA extension may be an external extension, else it should be present in the input file. The DATA is automatically transformed, if necessary so that the absorbed dimension is the first dimension.
XDIM1, WEIGHTS, INCLUDE and CONSTANTS extensions are optional.
If not present:
- a dummy DATA cube will be created, but only if create_dummy_data keyword is set.
- XDIM1 will be created using the WCS parameters given in the data header.
- WEIGHTS, INCLUDE and CONSTANTS will be created with default values.
- RESIDUALS is created using the fits components and the DATA cube.
An ANA structure is used by e.g. XCFIT_BLOCK, it is created by e.g. MK_ANALYSIS.
Syntax
anas = fits2ana( fitsfile [, windows=windows] [ ,headers_results=headers_results] [, headers_data=headers_data] [, headers_lambda=headers_lambda] [, headers_residuals=headers_residuals] [, headers_weights=headers_weights] [, headers_include=headers_include] [, headers_contants=headers_contants] [, /headers_only] [, /create_dummy_data] [, /loud] [, /quiet] )
Return Value
An array of ANA structures, the number of elements is the same as the number of windows in the FITS file. Output is scalar if there is only one window.
Output is zero if an error occurred, or if keyword 'headers_only' is set.
Arguments
fitsfile
Name and path to a FITS file (e.g. SPICE level 3 file)
Optional Inputs
windows
A scalar or array of indices of windows to be returned. If not provided all windows will be returned.
Keywords
headers_only
If set, then the data is not loaded, only the headers, the function returns a zero.
create_dummy_data
If set, then a dummy data cube will be created in case the original data is not found.
loud
If set, then the function will output messages about non-existing extensions.
quiet
If set, warnings will be suppressed.
Optional Output
headers_results
A pointer array, containing the headers of the results extensions as string arrays.
headers_data
A pointer array, containing the headers of the data extensions as string arrays.
headers_lambda
A pointer array, containing the headers of the lambda extensions as string arrays.
headers_residuals
A pointer array, containing the headers of the residuals extensions as string arrays.
headers_weights
A pointer array, containing the headers of the weights extensions as string arrays.
headers_include
A pointer array, containing the headers of the include extensions as string arrays.
headers_contants
A pointer array, containing the headers of the constants extensions as string arrays.