pyIntensityFeatures.utils.output

Functions for formatting and preparing output.

Functions

init_boundary_dicts([opt_coords, lat_dim])

Initialize dict for output from multiple auroral image boundaries.

update_boundary_dicts(sweep_data, coord_dict, data_dict)

Update coordinate and data dicts with boundary output.

reshape_lat_coeff_data(coord_dict, data_dict, max_coeff)

Reshape data that depends on latitude or coefficients to be uniform.

convert_boundary_dict(coord_dict, data_dict, max_coeff)

Convert coordinate and data dictionaries to an xarray Dataset.

Module Contents

pyIntensityFeatures.utils.output.init_boundary_dicts(opt_coords=None, lat_dim='lat')[source]

Initialize dict for output from multiple auroral image boundaries.

Parameters:
opt_coordsdict or NoneType

Dict of coordinates to include in the output or None to only have the required coordinates (default=None)

lat_dimstr

Name of the latitude dimension

Returns:
coord_dictdict

Dictionary with required and optional coordinates

data_dictdict

Dictionary with initialized data lists and dimensions

See also

proc.intensity.find_intensity_boundaries
pyIntensityFeatures.utils.output.update_boundary_dicts(sweep_data, coord_dict, data_dict)[source]

Update coordinate and data dicts with boundary output.

Parameters:
sweep_datadict or NoneType

Dict with desired boundary data, if data was found. None otherwise.

coord_dictdict

Dictionary with required and optional coordinates

data_dictdict

Dictionary with data lists and dimensions

Raises:
ValueError

If there is a change in the magnetic local time bins.

pyIntensityFeatures.utils.output.reshape_lat_coeff_data(coord_dict, data_dict, max_coeff, lat_dim='lat', lat_var='mlat', coeff_dim='coeff')[source]

Reshape data that depends on latitude or coefficients to be uniform.

Parameters:
coord_dictdict

Dictionary for xr.Dataset coordinate input

data_dictdict

Dictionary for xr.Dataset input

max_coeffint

Maximum number of coefficients

lat_dimstr

Name of the latitude dimension

lat_varstr

Name of the latitude variable

coeff_dimstr

Name of the coefficient dimension

Returns:
mlat_binsarray-like

Updated magnetic latitude bins.

data_dictarray-like

Updated data dictionary, with consistent dimensions and padded data.

Raises:
ValueError

If the latitude bins have an unexpected shape or inconsistent increments. Also if the coefficients have an unexpected shape.

pyIntensityFeatures.utils.output.convert_boundary_dict(coord_dict, data_dict, max_coeff, lat_dim='lat', lat_var='mlat', coeff_dim='coeff', attr_dict=None)[source]

Convert coordinate and data dictionaries to an xarray Dataset.

Parameters:
coord_dictdict

Dictionary for xr.Dataset coordinate input

data_dictdict

Dictionary for xr.Dataset input

max_coeffint

Maximum number of coefficients

lat_dimstr

Name of the latitude dimension

lat_varstr

Name of the latitude variable

coeff_dimstr

Name of the coefficient dimension

attr_dictdict or NoneType

Dict containing global attributes or None to omit (default=None)

Returns:
out_dataxr.Dataset

Dataset with coordinates, values, and dimensions supplied by the input dictionaries (reshaped to have consistent dimensions).

Raises:
ValueError

If the latitude bins have an unexpected shape or inconsistent increments. Also if the coefficients have an unexpected shape.