Other cookbook
Table of contents
- Convert x axis
- Convert y axis
- Shift to barycentric frame
- Shift to rest frame
- Shift from rest frame
- Import a data structure from a session into the current one
- Modify a data structure using a binary operator
Convert x axis
Method | CookbookEdit.x_convert |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "x_convert", "params": { "zem": "0", "xunit": "km / s" } } |
Convert the x axis to wavelength or velocity units. The x axis can be converted to any unit of wavelength or velocity (default: nm and km/s). The conversion applies to both the spectrum and the line list. When converting to and from velocity units, the zero point is set at (1+zem)λ_Lya (where λ_Lya = 121.567 nm is the rest-frame wavelength of the Lyman-alpha transition).
Convert y axis
Method | CookbookEdit.y_convert |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "y_convert", "params": { "yunit": "electron / nm" } } |
Convert the y axis to different units. The y axis can be expressed in different units depending on how it was calibrated (default: erg/(cm^2 s nm)). It can be converted to any unit of the same physical quantity. The conversion applies to both the spectrum and the line list.
Shift to barycentric frame
Method | CookbookEdit.shift_bary |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "shift_bary", "params": { "v": "null" } } |
Shift x axis to the barycentric frame of the solar system.
Shift to rest frame
Method | CookbookEdit.shift_to_rf |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "shift_to_rf", "params": { "z": "0" } } |
Shift x axis to the rest frame.
Shift from rest frame
Method | CookbookEdit.shift_from_rf |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "shift_from_rf", "params": { "z": "0" } } |
Shift x axis from rest frame to the original frame.
Import a data structure from a session into the current one
Method | CookbookEdit.struct_import |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "struct_import", "params": { "struct": "'0,systs'", "mode": "'replace'" } } |
The structure to be imported is described by a string with the session number and the structure tag (spec, lines, systs), separated by a comma (e.g. 0,spec, meaning “spectrum from session 0”). The imported structure is either replaced or appended to the corresponding one in the current session.
Modify a data structure using a binary operator
Method | CookbookEdit.struct_modify |
Parameters |
|
JSON template | { "cookbook": "cb", "recipe": "struct_modify", "params": { "col": "''", "expr": "''" } } |
Modify a data structure using a binary operator. An output column is computed from an expression with input columns as arguments. The expression must be parsable by AST, with columns described by a string with the session number, the structure tag (spec, lines, systs), and the column name separated by a comma (e.g. 0,spec,x, meaning “column x of spectrum from session 0”). Columns can be from different data structures only if they have the same length. If the output column already exists, it is overwritten.