diff --git a/CHANGELOG.md b/CHANGELOG.md index 3606919ce475875e63918a45d79e213b28c72b87..3908c1dff89c8a38c73c6437b9a889a5a376acba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,68 +1,100 @@ # CHANGELOG + All changes to the Metis L1 pipeline are documented in this file. -## 3.1 - 2022-01-27 +## Version 3.2.1 (2024-02-14) + +• Fixed a bug that caused wrong values of the keywords CHECKSUM and DATASUM. +• Introduce new values of the keywords OBJECT (= ‘Sun’) and TARGET (= ‘Corona’) whose use was still TBD. +• Include some code optimisations. + +## Version 3.2.0 (2023-05-23) + +- Update the management of the keywords SOOPTYPE, SOOPNAME, OBS_ID, OBS_MODE, and OBS_TYPE, according to RD-2. + +## Version 3.1.2 (2022-09-05) + +- Include a patch to add the keyword SEQ_NUM where missing (polarimetric images processed with the python version of the L0 pipeline). + +## Version 3.1.1 (2022-06-09) + +- Fix a typo in the interpol_param.pro routine that caused the pipeline exit with a wrong error code in some cases. +- Update the management of the FITS versioning (version increment is now performed by the infrastructure). +- Include some code optimisations. + +## Version 3.1.0 (2022-01-27) + - Manage the new format of the VL bad-pixel map which now includes the detector reference rows. - Fix a bug that caused wrong values in the WCS keywords CTYPE1 and CTYPE2 of UV images. - Add management of errors originating from the lack of a mandatory parameter in the input HK table: the pipeline now exits with a non-zero error code. - Add management of the predictive Solar Orbiter’s SPICE meta-kernel. - Duplicate some Metis specific WCS keywords in the FITS header using more user-friendly names: - - SUNPIX1 = SUN_XCEN and SUNPIX2 = SUN_YCEN - - SCPIX1 = SC_XCEN and SCPIX2 = SC_YCEN - - IOPIX1 = IO_XCEN and IOPIX2 = IO_YCEN - - FSPIX1 = FS_XCEN and FSPIX2 = FS_YCEN +- SUNPIX1 = SUN_XCEN and SUNPIX2 = SUN_YCEN +- SCPIX1 = SC_XCEN and SCPIX2 = SC_YCEN +- IOPIX1 = IO_XCEN and IOPIX2 = IO_YCEN +- FSPIX1 = FS_XCEN and FSPIX2 = FS_YCEN - Optimize the solo_get_pointing.pro routine in order to also provide coordinates of the spacecraft in the celestial J2000 coordinate frame. - Fix a potential bug in the make_bin_table.pro routine. -- Make changes to better handle the L0 FITS files generated from the new version of Metis OBSW 2.2.0. +- Make changes to handle the L0 FITS files generated from the new version of Metis OBSW 2.2.0. -## 3.0 - 2021-07-19 -- Modify the pipeline to manage the new input I/F which includes the full set of Solar Orbiter SPICE kernels and the Metis Calibration Package. In the input file contents.json, the two fields TLS_FILE_NAME and TSC_FILE_NAME are now replaced by the field SPICE_KERNELS providing the path of the Solar Orbiter SPICE kernels folder. The field CAL_PACK_PATH is added to provide the path of the Metis Calibration Package folder. +## Version 3.0.0 (2021-07-19) + +- Modify the pipeline to manage the new input I/F which includes the full set of Solar Orbiter’s SPICE kernels and the Metis calibration package. In the input file contents.json, the two fields TLS_FILE_NAME and TSC_FILE_NAME are now replaced by the field SPICE_KERNELS providing the path of the Solar Orbiter’s SPICE kernels folder. The field CAL_PACK_PATH is added to provide the path of the Metis calibration package folder. - Add the WCS (World Coordinate System) keywords to the FITS header and a set of routines to perform calculation of the instrument boresight parameters and S/C coordinates. - Add the derivation of the quality matrix which is now included in an extension to the L1 FITS file. -- Include several code optimisations. +- Include several code optimizations. + +## Version 2.3.1 (21-04-19) -## 2.3.1 - 2021-04-19 - Fix a bug that caused an incorrect FITS file format: images with unsigned or long integer data type were saved as signed integers with the wrong BSCALE and BZERO scale keywords. -## 2.3 - 2021-03-10 +## Version 2.3.0 (2021-03-10) + - Fix a bug that caused incorrect pixel counts in re-binned images. Pixel counts are now correctly multiplied by the square of the binning factor after re-binning. - Introduce the correction for the total effective exposure time: pixel counts are now multiplied by the number of frames that were averaged during the acquisition, so as not to change the real signal-to-noise statistics in each pixel, related to counts integrated over the total effective exposure time. The XPOSURE and NSUMEXP keywords of the FITS, which are affected, are properly updated using parameters DIT, NDIT, NDIT1, and NDIT2. - Add the HV_TEMP keyword in the FITS header of UV images. - Fix a bug that caused some keywords in the FITS header of light curves to be incorrectly ordered. -## 2.2.1 – 2021-02-23 -- Minor changes and optimisations. +## Version 2.2.1 (2021-02-23) + +- Minor changes and optimizations. + +## Version 2.2.0 (2020-11-25) -## 2.2 – 2020-11-25 - Change the way how the house-keeping parameters are saved into the FITS binary table, in order to prevent very long computation times when the house-keeping parameter table is large in data volume. - Modify the decode_obt.pro routine to fix a bug that caused the OBT_BEG and OBT_END keyword values to be converted from double to long. -- Optimise some keyword description texts in the FITS header. +- Optimize some keyword description texts in the FITS header. - Add the make_bin_table.pro routine. - Remove the strreplace.pro routine. -## 2.1 – 2020-11-13 +## Version 2.1.0 (2020-11-13) + - Fix a bug that triggered the re-binning of VL images even when not necessary. - Fix a bug that caused an error in writing the log file for data products that are not images (e.g., light curves). -## 2.0 – 2020-10-06 +## Version 2.0.0 (2020-10-06) + - Include the re-binning of images that had been acquired with binning enabled, so that the size of the data in the FITS is consistent with the commanded binning. - Modify the interpolation method of house-keeping parameters to manage cases in which interpolation fails, avoiding output values such as “NaN” or “Inf”. - Add conversion to string for all the keywords of the scientific header that are boolean type. - Include the generation of a log file with information on the processing and errors, useful for debugging. -## 1.1 – 2020-04-21 +## Version 1.1.0 (2020-04-21) + - Modify the interpolation method of house-keeping parameters to take into account: - - the possible lack of a parameter; - - the possible presence of an uncalibrated parameter (whose engineering value is flagged with “N/A”); - - the fact that the GEN_TIME keyword is provided in UTC rather than OBT. +- the possible lack of a parameter; +- the possible presence of an uncalibrated parameter (whose engineering value is flagged with “N/A”); +- the fact that the GEN_TIME keyword is provided in UTC rather than OBT. - Fix a bug that prevented the correct update of some keywords of the FITS header, in particular those related to sensor temperatures, whose values are interpolated using the input house-keeping parameter table. - Add correct computation of the TELAPSE and XPOSURE keywords. - Include the EMPTY_PARAMS field in the output auxiliary JSON file, containing the list of house-keeping parameters in the input table that are not calibrated but which have been interpolated to correct the value of some of the FITS header keywords. - Revise the structure of the binary table containing the house-keeping parameters to make it more user-friendly. -## 1.0 – 2020-03-06 +## Version 1.0.0 (2020-03-06) + - Add the decode_obt.pro routine. -- Include several code optimisations. +- Include several code optimizations. + +## Version 0.0.0 (2020-01-16) -## 0.0 – 2020-01-16 Prototype version of the L1 pipeline. diff --git a/README.md b/README.md index 774b168ca355cbf5112563ec5cb17beea8142a8b..b4fae8238cc37609ead2bf1f7a054947588c03e7 100644 --- a/README.md +++ b/README.md @@ -1,330 +1,178 @@ -# README +# Metis L1 pipeline This file describes the structure of the Metis L1 pipeline. The pipeline source code is written using the Interactive Data Language (IDL). The present version has been developed and tested using IDL 8.7 and higher versions. -## metis_l1_prep.pro -Main pipeline program. - -### Call -The main program can be launched from outside IDL with the following command: - - idl -e metis_l1_prep - -The main program must be launched from a working directory containing two folders, *input* and *output*, where the data files used and generated by the pipeline are respectively located. - -### Framework setup -IDL must include the NASA IDL Astronomy Users's Library, which can be downloaded at the following link: https://idlastro.gsfc.nasa.gov. -In addition, the SPICE toolkit for IDL provided by the NASA's Navigation and Ancillary Information Facility (NAIF; https://naif.jpl.nasa.gov/naif) must be installed. - -### Operations -The pipeline performs the following specific operations: -+ **saturation and quality classification** (applied only to image data products): a quality matrix with same size of the input image is created, containing classification of the quality of each pixel -+ **image rebinning** (applied only to image data products): image is rebinned according to the commanded binning, and pixel values are multiplied by the relevant binning factor (4.0 for 2×2 binning and 16.0 for 4×4 binning) -+ **exposure time correction** (applied only to visible-light and UV image data products): pixel values are multiplied by the total number of frames averaged by the Metis on-board software -+ **bad-pixel flagging** (applied only to image data products): the quality matrix is updated to take into account and to provide indication of known corrupted/unreliable detector pixels; the values of the pixels (or bins) in the quality matrix corresponding to (or associated with) a bad pixel are set to zero, according to the convention used for the saturation and quality classification -+ **time conversions**:all times (begin and end of acquisition) are converted from on-board time units to UTC using the last released version of the Solar Orbiter's SPICE kernel dataset -+ **determination of the World Coordinate System (WCS) parameters and spacecraft coordinates**: WCS keywords and spacecraft coordinates are computed using the boresight parameters given in the Metis calibration package and the last released version of the Solar Orbiter's SPICE ephemeris and attitude kernels, and are added to the FITS header - -### Input -The pipeline input data are listed in a JSON file located in the *input* folder. The file must be named *contents.json* and formatted according to the following structure: - - { - "file_name": "", - "spice_kernels": "", - "sk_arc_version": "", - "cal_pack_path": "", - "planning_file_name": "", - "hk_file_name": "", - "sw_version": "", - "obsw_version": "", - "idb_version": "", - "hdr_version": "", - "l1_version": 0 - } - -where all fields are defined as follows: - -+ **file_name**: a string scalar containing the full pathname of the L0 FITS file to be processed -+ **spice_kernels**: a string scalar containing the full path of the last released version of the Solar Orbiter's SPICE ephemeris and attitude kernels -+ **sk_arc_version**: a string scalar containing the three-digit version identifier of the SPICE kernels -+ **cal_pack_path**: a string scalar containing the full path of the applicable version of the Metis calibration package -+ **planning_file_name**: a string scalar containing the full pathname of a JSON file containing the planning metadata associated with the input L0 FITS file -+ **hk_file_name**: a string scalar containing the full pathname of a JSON file containing the set of Metis house-keeping parameters associated with the input L0 data -+ **sw_version**: a string scalar containing the version identifier of the processor used for generating the final pipeline product, i.e. the L1 FITS file -+ **obsw_version**: a string scalar containing the version identifier of the Metis on-board software used for the acquisition of the input data -+ **idb_version**: a string scalar containing the version identifier of the current instrument database used for the processing of the input data -+ **hdr_version**: a string scalar containing the version identifier of the scientific header structure associated with the input data -+ **l1_version**: an integer scalar corresponding to the incremental number version of the last L1 FITS file generated from the same input L0 FITS file - -> ***Note***: all input files listed in the *contents.json* file must be located in the *input* folder and their pathname must be relative to the main working directory - -### Additional input -#### Planning metadata -The planning metadata JSON file has the following structure: - - { - "mission_ltp": 0, - "obs_id": "", - "soop_name": "", - "obs_mode": "" - } - -where all fields are defined as follows: -+ **mission_ltp**: an integer scalar corresponding to the LTP period number which the observation belongs to -+ **obs_id**: a string scalar containing the value of the *socIds* key associated with the observation which the data belongs to, contained in the Observation Timeline Export JSON file provided by the Solar Orbiter SOC -> ***Note***: this field must be formatted as `smet_xxxx_xxx_xxx_xxxx_xxx`, where `x` can be either a character or a digit -+ **obs_mode**: a string scalar containing the value of the *name* key that is associated with the observation which the data belongs to, contained in the Observation Timeline Export JSON file -+ **soop_name**: a string scalar containing the value of the *soopType* key that is associated with the SOOP which the observation belongs to, contained in the Observation Timeline Export JSON file - -#### House-keeping parameters -The JSON file containing the house-keeping parameters associated with the L0 data has the following structure: - - { - "par_name": [""], - "packet": [""], - "rec_time": [""], - "gen_time": [""], - "raw_val": [""], - "eng_val": [""], - "unit": [""], - "desc": [""] - } -where all fields are defined as follows: -+ **par_name**: a one-dimensional string array containing the names of the house-keeping parameters -+ **packet**: a one-dimensional string array containing the names of the telemetry packets which the parameters belong to -+ **rec_time**: a one-dimensional string array containing the UTC packet creation times in ISO8601 format -> ***Note***: this is the time at which the SCOS-2000 packet was created, which is also approximately the time at which the packet was received by the MCS and stored -+ **gen_time**: a one-dimensional string array containing the UTC spacecraft times in ISO8601 format -> ***Note***: this is the time at which the CCSDS packet was created on baord, contained in the packet data field header and converted from on-board time units to UTC on ground -+ **raw_val**: a one-dimensional string array containing the raw values of the parameters -+ **eng_val**: a one-dimensional string array containing the calibrated values of the parameters -> ***Note***: if calibration is not available for a parameter, the corresponding *eng_val* field has the value "N/A" -+ **unit**: a one-dimensional string array containing the physical units of the calibrated values -+ **desc**: a one-dimensional string array containing descriptions of the parameter content as per instrument database definition -> ***Note***: for each house-keeping parameter, the JSON file must contain at least two values: the last value measured before the start of the observation which the data belongs to, and the first value measured after the end of the observation - -### Output -The output data files generated by the pipeline are saved into the *output* folder. They are listed in a JSON file named *contents.json* having the following structure: - - { - "file_name": "", - "l0_file_name": "", - "log_file_name": "", - "empty_params": [""] - } - -where all fields are defined as follows: - -+ **file_name**: a string scalar containing the pathname of the generated L1 FITS file - -> ***Note***: the FITS file is named according to the convention: `solo_L1_metis-[datatype]_[date-time]_V[version].fits`, where `[datatype]` identifies the Metis data product type, `[date-time]` is the 15-character date of observation, formatted as `yyyymmddThhmmss`, and `[version]` is the 2-digit, zero-padded incremental version number of the FITS file - -+ **l0_file_name**: a string scalar containing the full pathname of the input L0 FITS file that has been processed -+ **log_file_name**: a string scalar containing the full pathname of an ASCII text file containing a log of the pipeline processing -+ **empty_params**: a string array containing the list of the house-keeping parameters for which raw values were used instead of calibrated values in generating the house-keeping extension of the output L1 file - -## check_quality.pro -Makes a classification of the quality of the input image creating a matrix providing, pixel by pixel, a quality index. - -### Call - result = check_quality(image, cal_pack[, filter]) - -### Input -+ **image**: a two-dimensional 16-bit unsigned-integer array containing a raw Metis image -+ **cal_pack**: an IDL structure variable containing the applicable Metis calibration package +## Schema and description + + + +### Inputs -### Output -+ **result**: a two-dimensional floating-point array with same size as the input image containing the quality index values +| Name | Description | +| ------------------- | -------------------------------------------------------------------------------------------------------- | +| L0 FITS file | Metis L0 FITS file to be processed | +| Calibration package | Folder containing the applicable Metis calibration package | +| SPICE kernels | Folder containing the latest version of the Solar Orbiter's SPICE ephemeris and attitude kernels | +| HK parameters | JSON file listing values of specific Solar Orbiter and Metis HK parameters relevant to the input L0 file | +| Planning info | JSON file listing planning information relevant to the input L0 file | +| Auxiliary info | JSON file listing the relative pathnames of the input files and folders | + +The input files shall be collected in the working directory. The working directory must also contain two folders with names `input` and `output`. The input folder must contain the auxiliary info JSON file named contents.json. The structure of this file is described below. -> ***Note***: possible values of the quality index are: *NaN*, for all saturated pixel or pixels having a value well below the average detector bias level; 1 for all pixels whose values are within the detector linearity range; 0 for all remaining pixels. +#### Calibration package -### Optional input -+ **filter**: a string scalar indicating which Metis channel has acquired the input image. If not provided, the VL channel is assumed +The applicable Metis calibration package is the L1 calibration package called `LTP00`. -## decode_obt.pro -See the documentation of the Metis L0 pipeline. +#### SPICE kernels -## fits_hdr2struct.pro -Converts a FITS header string array into an IDL data structure. +The latest version of Solar Orbiter’s SPICE kernels can be retrieved from the repository at the following URL: +https://s2e2.cosmos.esa.int/bitbucket/scm/spice_kernels/solar-orbiter.git -### Call - result = fits_hdr2struct(string_header) +#### HK parameters -### Input -+ **string_header**: a one-dimensional string array containing a valid FITS header as obtained, e.g., from *fitsread*.*pro* or *mrdfits*.*pro* +The HK parameter JSON file shall contain the following fields. -### Output -+ **result**: an IDL structure variable containing the converted header +| Name | Description | Type | +| ------------ | ---------------------------------------------- | ------------ | +| **PAR_NAME** | Parameter name | String array | +| **PACKET** | Name of the TM packet the parameter belongs to | String array | +| **GEN_TIME** | Packet generation time in UTC | String array | +| **REC_TIME** | Packet reception time in UTC (not used) | String array | +| **RAW_VAL** | Parameter raw (uncalibrated) value | String array | +| **ENG_VAL** | Parameter engineering (calibrated) value | String array | +| **UNIT** | Calibration unit (if applicable) | String array | +| **DESC** | Description | String array | -## get_light_time.pro -Computes the light time of a target body relative to an observer for the given date, and optionally returns its velocity vector. +##### Mandatory HK parameters -### Call - result = get_light_time(utc, target, observer[, rad_velocity = rad_velocity]) -> ***Note***: a valid set of SPICE ephemeris and attitude kernels for the specified target body and observer must be loaded before calling this routine +The HK parameter JSON file shall contain values for the following mandatory parameters. -### Input -+ **utc**: a string scalar containing the UTC date in ISO8601 format at which the light time is to be computed -+ **target**: a string scalar containing the name or SPICE ID code of the target body -+ **observer**: a string scalar containing the name or SPICE ID code of the observing body +| Name | Description | Applicable data types | +| ------------ | ----------------------------- | --------------------- | +| **NIT0E050** | UVDA temperature | 1, 4, 6 | +| **NIT0E070** | HVU Screen commanded voltage | 1, 4, 6 | +| **NIT0E071** | HVU MCP commanded voltage | 1, 4, 6 | +| **NIT0E0B5** | HVU temperature | 1, 4, 6 | +| **NIT0E0B6** | HVU MCP read voltage | 1, 4, 6 | +| **NIT0E0B7** | HVU Screen + MCP read voltage | 1, 4, 6 | +| **NIT0E0BF** | HVU MCP read current | 1, 4, 6 | +| **NIT0E0E0** | VLDA temperature | 0, 3, 5 | +| **NIT0L00D** | PMP temperature | 0, 3, 5 | -### Output -+ **result**: a double-precision floating-point scalar with the one-way light time between the target body and the observer in seconds +#### Planning info + +The planning info JSON file shall contain the following fields. + +| Name | Description | Type | Default | +| ------------------ | ------------------------------------------------------------------------------------------- | ------- | ------------------- | +| **MISSION_LTP** | Number of the mission LTP the data belongs to | Integer | N/A | +| **MISSION_STP** | Number of the mission STP the data belongs to | Integer | N/A | +| **IOR_NUMBER** | ID of the IOR file the observation belongs to (not used) | Integer | N/A | +| **IOR_VERSION** | Version ID of the IOR file the observation belongs to (not used) | Integer | N/A | +| **SOOP_NAME** | Name of the SOOP the data belongs to, if applicable | String | “none” | +| **SESSION_NUMBER** | Acquisition session number | String | N/A | +| **SEQUENCE_NAME** | Name of the start-acquisition sequence that generated the data (not used) | String | N/A | +| **OBS_ID** | Observation ID | String | “none” | +| **OBS_MODE** | Observation mode | String | “METIS_GENERIC_OBS” | +| **UNIQUE_ID** | Unique ID associated with the start-acquisition sequence that generated the data (not used) | String | N/A | +| **ACTION_TIME** | Action time of the start-acquisition sequence that generated the data (not used) | String | N/A | +| **PARAM_COUNT** | Number of parameters of the start-acquisition sequence that generated the data (not used) | Integer | N/A | -### Optional output -+ **rad_velocity**: a named variable that will receive the double-precision floating-point scalar with the radial component of the target body velocity relative to the observer in km/s +#### Auxiliary info -## interpol_param.pro -Interpolates the table of Metis house-keeping parameters to get the value of a specified parameter at the given date. Calibrated values of the specified parameter are used by default for the interpolation; if they are not available in the input table, raw values are used instead. +The auxiliary info JSON file shall contain the following fields. -### Call +| Name | Description | Type | +| ---------------------- | ---------------------------------------------------------------------------------------------- | ------- | +| **FILE_NAME** | Pathname of the L0 FITS file to be processed | String | +| **CAL_PACK_PATH** | Pathname of the calibration package folder | String | +| **SPICE_KERNELS** | Pathname of the Solar Orbiter’s SPICE kernel folder | String | +| **HK_FILE_NAME** | Pathname of the HK parameter JSON file | String | +| **PLANNING_FILE_NAME** | Pathname of the planning info JSON file | String | +| **L1_VERSION** | Highest number version of existing L1 FITS files generated from the same L0 FITS file in input | Integer | +| **HDR_VERSION** | Version of the scientific header | String | +| **SW_VERSION** | Version of environment and pipeline software | String | +| **IDB_VERSION** | Version of Metis IDB | String | +| **OBSW_VERSION** | Version of Metis on-board software | String | +| **SK_ARC_VERSION** | Version of Solar Orbiter’s SPICE kernels (not used) | String | - result = interpol_param(hk_table, par_name, date[, empty_params = empty_params]) +All pathnames listed in the auxiliary info JSON file shall be relative to the working directory. -### Input -+ **hk_table**: an IDL structure variable containing the Metis house-keeping parameter table provided as input to the L1 pipeline -+ **par_name**: a string scalar containing the name of the parameter for which interpolation is to be done -+ **date**: a string scalar containing the UTC date in ISO8601 format at which interpolation of the specified parameter is to be done +### Outputs -### Output -+ **result**: a floating-point scalar with the value resulting from the linear interpolation of the table values -> ***Note***: if the specified date is outside the range of dates for which values are given in the input table, or if no values are given for the specified parameter, a null value is returned +| Name | Description | +| -------------- | ------------------------------------------------------------- | +| L1 FITS file | Generated L1 FITS file | +| Log | Plain-text file with information about the pipeline execution | +| Auxiliary info | JSON file listing the relative pathnames of the output files | + +The output files will be saved into the output folder contained in the working directory. The auxiliary info JSON file will have name `contents.json`. + +#### Auxiliary info + +The auxiliary info JSON file shall contain the following fields. + +| Name | Description | Type | +| ----------------- | ----------------------------------------------------------------------------------------------- | ------------ | +| **FILE_NAME** | Pathname of the generated L1 FITS file | String | +| **L0_FILE_NAME** | Pathname of the input L0 FITS file | String | +| **LOG_FILE_NAME** | Pathname off the log file | String | +| **EMPTY_PARAMS** | List of parameters in the HK parameter JSON file for which calibrated values were not available | String array | + +### Exit codes + +The following codes are returned. + +| Code | Description | Type | +| ---- | -------------------------------------------------------------- | ------- | +| 0 | Successful execution | Success | +| 1 | Parameter not found in house-keeping table | Error | +| 2 | Insufficient number of parameter values in house-keeping table | Error | +| 3 | Interpolation of HK parameter failed | Error | + +## Deploy and execution + +### Build and Deploy Environment + +Below is a list of the specific tools that shall be used for the build and deploy of the release. + +| Tool/Software | Version | +| ------------- | -------------- | +| IDL | 8.7.2 or later | + +### Dependencies + +| Tool/Software | Version | Comments | +| -------------------------- | ------- | ----------------------------------------------- | +| NASA Astronomy Libraries | Latest | See https://idlastro.gsfc.nasa.gov | +| NAIF SPICE Toolkit for IDL | Latest | See https://naif.jpl.nasa.gov/naif/toolkit.html | + +### Procedures + +- check_quality.pro +- decode_obt.pro +- fits_hdr2struct.pro +- fix_fits_header.pro +- get_light_time.pro +- interpol_param.pro +- json_write.pro +- load_spice_kernels.pro +- make_bin_table.pro +- metis_l1_prep.pro (main program) +- metis_rectify.pro +- metis_wcs.pro +- solo_get_carringrot.pro +- solo_get_coords.pro +- solo_get_ephemeris.pro +- solo_get_pointing.pro +- solo_get_solar_angles.pro +- solo_obt2utc.pro +- solo_utc2obt.pro + +### Execution + +The main program shall be executed with the following command: + + idl -e metis_l1_prep -### Optional output -+ **empty_params**: a named string scalar or string array variable to which the string scalar with the name of the specified parameter is appended if calibrated values are not available for that parameter in the input table - -## json_write.pro -See the documentation of the Metis L0 pipeline. - -## load_spice_kernels.pro -Load or unload the Solar Orbiter's SPICE ephemeris and attitude kernels. - -### Call - - load_spice_kernels, path[, unload = unload][, kernel_list = kernel_list][, kernel_version = kernel_version] - -### Input -+ **path**: a string scalar containing the full path of the Solar Orbiter's SPICE kernels folder - -### Output -None. - -### Optional input -+ **unload**: set this keyword to unload the kernels -> ***Note***: if this keyword is set, the list of loaded kernels must be passed through the *kernel_list* argument - -### Optional output -+ **kernel_list**: a named variable that will receive the string array with the full pathnames of the kernel files that have been loaded -+ **kernel_version**: a named variable that will receive the string scalar with the version identifier of the kernel dataset that has been loaded - -## make_bin_table.pro -Returns an IDL structure variable containing a copy of the Metis house-keeping parameter table with the proper format to be saved as a binary table in an L1 FITS file extension. - -### Call - - result = make_bin_table(hk_table) - -### Input -+ **hk_table**: an IDL structure variable containing the Metis house-keeping parameter table provided as input to the L1 pipeline - -### Output -+ **result**: an IDL structure variable containing the reformatted table - -## metis_rectify.pro -Applies the proper transformation to bring the input image from Metis detector reference frame to the Sun-oriented detector reference frame - -> ***Note***: the Sun-oriented detector reference frame is defined as the reference frame with both axes parallel to the detector sides, axis 1 (X) pointing towards the solar West, and axis 2 (Y) pointing to the solar North in the case the spacecraft roll is zero - -### Call - - result = metis_rectify(image[, filter]) - -### Input -+ **image**: a two-dimensional array containing the detector-oriented Metis image - -### Output: -+ **result**: a two-dimensional array with same size as the input image containing the Sun-oriented image - -### Optional input -+ **filter**: a string scalar indicating which Metis channel has acquired the input image. If not provided, the VL channel is assumed - -## metis_wcs.pro -Returns an IDL list variable containing the full set of FITS header keywords compliant with the World Coordinate System (WCS) standard. Information for the calculation of the WCS keywords are taken from the image FITS header, Solar Orbiter's SPICE attitude kernels, and applicable Metis calibration package. - -### Call - - result = metis_wcs(header, cal_pack[, ref_detector = ref_detector]) -> ***Note***: a valid set of Solar Orbiter's SPICE ephemeris and attitude kernels must be loaded before calling this routine - -### Input -+ **header**: an IDL structure variable containing a valid Metis FITS header -> ***Note***: this routine will not work with a Metis L0 FITS header, since some relevant keyword values are computed only at level L1 -+ **cal_pack**: an IDL structure variable containing the applicable Metis calibration package - -### Output -+ **result**: an IDL list variable containing the full set of WCS keywords: - - WCSNAME Name of coordinate system - PCi_j Transformation matrix (i, j = 1, 2) - CRPIX1, CRPIX2 Reference pixel coordinates - CDELT1, CDELT2 Pixel scales - CRVAL1, CRVAL2 Values for reference pixel - CTYPE1, CTYPE1 System projection types - CUNIT1, CUNIT2 Units - CROTA Rotation angle (deprecated) - plus other Metis-specific keywords - -### Optional input -+ **ref_detector**: set this keyword to force the calculation of the WCS keywords for the detector-oriented image. The default is to compute them for the Sun-oriented image - -## solo_get_carringrot.pro -Returns the decimal Carrington rotation number of Sun's disk center as seen by Solar Orbiter for the given date. - -### Call - - result = solo_get_carringrot(utc) -> ***Note***: a valid set of Solar Orbiter's SPICE ephemeris and attitude kernels must be loaded before calling this routine - -### Input -+ **utc**: a string scalar containing the UTC date in ISO8601 format at which the Carrington rotation number is to be computed - -### Output -+ **result**: a floating-point scalar with the decimal Carrington rotation number - -## solo_get_coords.pro -Returns the orbital state vector of Solar Orbiter in the specified reference frame relative to an observer for the given date. - -### Call - - result = solo_get_coords(utc, frame, observer[, spherical = spherical][, degrees = degrees][, velocity = velocity]) -> ***Note***: a valid set of Solar Orbiter's SPICE ephemeris and attitude kernels must be loaded before calling this routine - -### Input -+ **utc**: a string scalar containing the UTC date in ISO8601 format at which the Solar Orbiter state is to be calculated -+ **frame**: a string scalar containing the name of one of the following standard coordinate systems: - - RTN Radial-Tangential-Normal - HEE Heliocentric Earth Ecliptic - HCI Heliocentric Inertial - HAE Heliocentric Aries Ecliptic - HEQ Heliocentric Earth Equatorial - GSE Geocentric Solar Ecliptic - GEI Geocentric Equatorial Inertial - CARRINGTON Carrington system (can be abbreviated) -+ **observer**: a string scalar containing the name or SPICE ID code of the observing body - -### Output -+ **result**: a double-precision floating-point array with the three Cartesian (default, in km) or spherical (either in radians or degrees) coordinates of Solar Orbiter in the specified reference frame - -### Optional input -+ **spherical**: set this keyword to return spherical coordinates (distance in km, longitude and latitude in radians) instead of Cartesian coordinates -+ **degrees**: set this keyword to return longitude and latitude in degrees instead of radians - -### Optional output -+ **velocity**: a named variable that will receive the double-precision floating-point array with the three Cartesian components of Solar Orbiter's velocity relative to the observer in km/s - -## solo_get_ephemeris.pro - -### Call -### Input -### Output \ No newline at end of file +This command shall be run from a working directory containing the input and output folders and the input data files as described in the previous sections. diff --git a/schema.png b/schema.png new file mode 100644 index 0000000000000000000000000000000000000000..f44f3462682e02d4ea4abd9d019bbd155adb9bec Binary files /dev/null and b/schema.png differ