Cube Processing
iris.cube_processing
Utilities for loading and processing spectral cubes.
Some utilities in this module use the spectral_cube and reproject packages.
load_fits_with_bounds(path, lon_steps, lon_min, lon_max, lat_steps, lat_min, lat_max, v_min, v_max)
Reads a spectral cube saved as a FITS file and converts it to a NumPy array.
Opens the FITS file, then reprojects and reinterpolates the spectral cube within a
new set of specified bounds using the reproject and spectral_cube libraries.
Ensures that the cube is expressed within Cartesian galactic longitude/latitude
coordinates consistent with the IRIS spherical coordinate system. Automatically
corrects, for instance, spectral cubes expressed in terms of a sine projection.
Does not reinterpolate the velocity dimension of the cube.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the FITS file on the disk. |
required |
lon_steps
|
int
|
Number of galactic longitude steps. Longitude values are linearly spaced. |
required |
lon_min
|
float
|
Minimal longitude bound. |
required |
lon_max
|
float
|
Maximal longitude bound. |
required |
lat_steps
|
int
|
Number of galactic latitude steps. Latitude values are linearly spaced. |
required |
lat_min
|
float
|
Minimal latitude bound. |
required |
lat_max
|
float
|
Maximal latitude bound. |
required |
v_min
|
float
|
Minimal velocity bound. |
required |
v_max
|
float
|
Maximal velocity bound. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The spectral cube as a NumPy array. |
Source code in iris/cube_processing.py
make_cube(lon_steps, lat_steps, v_steps, hyper, units='iris', verbose=False)
Makes a spectral cube of specified shape from the cube path or paths and configuration parameters specified in a hyperparameters object.
Sources a spectral cube or spectral cubes from either a list
hyper.cube_hyper.data_path of NumPy .np files or a
user-specified mapping function hyper.cube_hyper.fits_map
that returns a list of FITS file objects. Designed to process a list of
cubes in case IRIS is configured to observe and revert multiple spectral lines
in combination. Interpolates cubes onto the shared grid, applies any denoising
steps, specified as a list hyper.cube_hyper.clean_noise of
user-defined functions with input and output of a spectral cube, and converts
into the desired units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lon_steps
|
int
|
Number of galactic longitude steps. Longitude values are linearly spaced. |
required |
lat_steps
|
int
|
Number of galactic latitude steps. Latitude values are linearly spaced. |
required |
v_steps
|
int
|
Number of velocity steps. Velocity values are linearly spaced. |
required |
hyper
|
Hyper
|
A hyperparameters object. |
required |
units
|
str
|
One of |
'iris'
|
verbose
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Tensor
|
The cube or stacked cubes, with dimensions |
Tensor
|
|
Tensor
|
lat_steps |
Tensor
|
If there are multiple cubes, they are stacked along the channel dimension, for |
Tensor
|
ease of use with observation and reversion. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in iris/cube_processing.py
make_default_cube(hyper, units='iris', numpy=False, verbose=False)
Makes a spectral cube of default shape from the cube path or paths and configuration parameters specified in a hyperparameters object.
A wrapper for make_cube.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
A hyperparameters object. |
required |
units
|
str
|
One of |
'iris'
|
numpy
|
bool
|
If |
False
|
verbose
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Tensor | ndarray
|
The cube or stacked cubes, with dimensions |
Tensor | ndarray
|
|
Tensor | ndarray
|
lat_steps |
Tensor | ndarray
|
If there are multiple cubes, they are stacked along the channel dimension, for |
Tensor | ndarray
|
ease of use with observation and reversion. |
Source code in iris/cube_processing.py
corrected_antenna_temperature_to_raleigh_jeans_temperature(cube, hyper)
A convenience function for converting corrected antenna temperature to Raleigh-Jeans temperature.
Designed to be used as an entry in hyper.cube_hyper.conversion_raw_to_T_K.
Not used for IRIS SEDIGISM, as the SEDIGISM \(^{13}\text{CO}\) cubes are published in units of
Raleigh-Jeans temperature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cube
|
Tensor
|
A cube to convert. |
required |
hyper
|
Hyper
|
A hyperparameters object. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
The corrected cube. |
Source code in iris/cube_processing.py
intensity_to_raleigh_jeans_temperature(I, hyper, nu_ul)
A convenience function for converting intensity in Jy/sr to Raleigh-Jeans temperature in K.
Designed to be used as an entry in hyper.cube_hyper.conversion_raw_to_T_K,
but must in this case be used via a lambda pattern to specify nu_ul.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
I
|
Tensor
|
The input cube of intensity in Jy/sr. |
required |
hyper
|
Hyper
|
A hyperparameters object. |
required |
nu_ul
|
float
|
The transition frequency in Hz. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
The output cube of Raleigh-Jeans brightness temperature in K. |