padre_craft.io.fits_tools#
Provides utilities to read and write fits files
Functions
|
Add processing info metadata to a fits header. |
|
Get the bunit and comment for a given data level and data type. |
|
Given a keyword, return the standard comment for a header card. |
|
Create a standard FITS header for the observation. |
|
Get the processing hash and standard comment for FITS header. |
|
Create a standard FITS primary header following SOLARNET conventions. |
|
Get the processing library description and standard comment for FITS header. |
|
Get the processing procedure description and standard comment for FITS header. |
|
Get the processing version and standard comment for FITS header. |
|
Get the processing step description and standard comment for FITS header. |
|
Get the processing version and standard comment for FITS header. |
- padre_craft.io.fits_tools.add_process_info_to_header(header: Header, n: int = 1) Header[source]#
Add processing info metadata to a fits header.
It adds the following SOLARNET compatible FITS cards; PRSTEPn, PRPROCn, PRPVERn, PRLIBnA, PRVERnA, PRLIBnA, PRHSHnA, PRVERnB
- Parameters:
header (fits.Header) – The fits header to add the new cards to
n (int, default 1) – The processing step number. Must be >= 1 and <= 9.
- Returns:
header (fits.Header)
- padre_craft.io.fits_tools.get_bunit(data_level: str, data_type: str) Tuple[str, str][source]#
Get the bunit and comment for a given data level and data type.
- padre_craft.io.fits_tools.get_comment(keyword: str) str[source]#
Given a keyword, return the standard comment for a header card.
- padre_craft.io.fits_tools.get_obs_header(data_level: str, data_type: str)[source]#
Create a standard FITS header for the observation.
This function creates a new FITS header with standard metadata including the current date, default PADRE attributes, processing information, data level, data type, original APID, and original filename.
- padre_craft.io.fits_tools.get_prhsh(n: int = 1, a: str = 'A') Tuple[str, str][source]#
Get the processing hash and standard comment for FITS header. This function returns a tuple containing the processing hash and the corresponding standard comment based on the Processing step.
- padre_craft.io.fits_tools.get_primary_header(file_path: Path, data_level: str, data_type: str, procesing_step: int = 1) Header[source]#
Create a standard FITS primary header following SOLARNET conventions.
This function creates a new FITS header with standard metadata including the current date, default PADRE attributes, processing information, data level, data type, original APID, and original filename.
- Parameters:
- Returns:
fits.Header – A FITS header populated with standard metadata
- padre_craft.io.fits_tools.get_prlib(n: int = 1, a: str = 'A') Tuple[str, str][source]#
Get the processing library description and standard comment for FITS header. This function returns a tuple containing the processing library description and the corresponding standard comment based on the Processing step.
- padre_craft.io.fits_tools.get_prproc(n: int = 1) Tuple[str, str][source]#
Get the processing procedure description and standard comment for FITS header. This function returns a tuple containing the processing procedure description and the corresponding standard comment based on the Processing step.
- Parameters:
n (int, optional) – Processing step number, default is 1.
- Returns:
tuple – A tuple of (processing_procedure_description, standard_comment)
- padre_craft.io.fits_tools.get_prpver(n: int = 1) Tuple[str, str][source]#
Get the processing version and standard comment for FITS header. This function returns a tuple containing the processing version and the corresponding standard comment based on the Processing step.
- Parameters:
n (int, optional) – Processing step number, default is 1.
- Returns:
tuple – A tuple of (processing_version, standard_comment)
- padre_craft.io.fits_tools.get_prstep(n: int = 1) Tuple[str, str][source]#
Get the processing step description and standard comment for FITS header. This function returns a tuple containing the processing step description and the corresponding standard comment based on the Processing step.
- Parameters:
n (int, optional) – Processing step number, default is 1. 1: Raw to L1 2: L1 to L2 3: L2 to L3 4: L3 to L4
- Returns:
tuple – A tuple of (processing_step_description, standard_comment)
- Raises:
ValueError – If the Processing step number is not in the range 1-4.