emc2.core.Model

class emc2.core.Model[source]

This class stores the model specific parameters for the radar simulator.

Attributes:
Rho_hyd: dict

A dictionary whose keys are the names of the model’s hydrometeor classes and whose values are the density of said hydrometeors in \(kg\ m^{-3}\)

fluffy: dict

A dictionary whose keys are the names of the model’s ice hydrometeor classes and whose values are the ice fluffiness factor for the fwd calculations using r_e, where values of 0 - equal volume sphere, 1 - fluffy sphere i.e., diameter = maximum dimension.

lidar_ratio: dict

A dictionary whose keys are the names of the model’s hydrometeor classes and whose values are the lidar_ratio of said hydrometeors.

vel_param_a: dict

A dictionary whose keys are the names of the model’s hydrometeor classes and whose values are the \(a\) parameters to the equation \(V = aD^b\) used to calculate terminal velocity corresponding to each hydrometeor.

vel_param_b: dict

A dictionary whose keys are the names of the model’s hydrometeor classes and whose values are the \(b\) parameters to the equation \(V = aD^b\) used to calculate terminal velocity corresponding to each hydrometeor.

N_field: dict

A dictionary whose keys are the names of the model’s hydrometeor classes and whose values are the number concentrations in \(cm^{-3}\) corresponding to each hydrometeor class.

T_field: str

A string containing the name of the temperature field in the model.

q_field: str

A string containing the name of the water vapor mixing ratio field (in kg/kg) in the model.

p_field: str

A string containing the name of the pressure field (in mbar) in the model.

z_field: str

A string containing the name of the height field (in m) in the model.

conv_frac_names: dict

A dictionary containing the names of the convective fraction corresponding to each hydrometeor class in the model.

strat_frac_names: dict

A dictionary containing the names of the stratiform fraction corresponding to each hydrometeor class in the model.

conv_frac_names_for_rad: dict

A dictionary containing the names of the convective fraction corresponding to each hydrometeor class in the model for the radiation scheme.

strat_frac_names_for_rad: dict

A dictionary containing the names of the stratiform fraction corresponding to each hydrometeor class in the model for the radiation scheme.

conv_re_fields: dict

A dictionary containing the names of the effective radii of each convective hydrometeor class

strat_re_fields: dict

A dictionary containing the names of the effective radii of each stratiform hydrometeor class

asp_ratio_func: dict

A dictionary that returns hydrometeor aspect ratios as a function of maximum dimension in mm.

hyd_types: list

list of hydrometeor classes to include in calcuations. By default set to be consistent with the model represented by the Model subclass.

time_dim: str

The name of the time dimension in the model.

height_dim: str

The name of the height dimension in the model.

lat_dim: str

Name of the latitude dimension in the model (relevant for regional output)

lon_dim: str

Name of the longitude dimension in the model (relevant for regional output)

mcphys_scheme: str

Name of the microphysics scheme to use for models with multiple microphysics schemes.

stacked_time_dim: str or None

This attribute becomes a string of the original time dimension name only if stacking was required to enable EMC2 to processes a domain output (time x lat x lon).

process_conv: bool

If True, then processing convective model output (can typically be set to False for some models).

model_name: str

The name of the model.

variable_density: dict

If the model allows for particle density for vary (e.g. 2-moment NSSL), then this is a dict pointing to the variable with the density for each hydrometeor class

__init__()[source]

Methods

__init__()

check_and_stack_time_lat_lon([...])

Stack the time dim together with the lat and lon dims (if the lat and/or lon dims are longer than 1) to enable EMC^2 processing of regional model output.

finalize_subcol_fields([more_fieldnames])

Remove all zero values from subcolumn output fields enabling better visualization.

load_subcolumns_from_netcdf(file_name)

Load all of the subcolumn data from a previously saved netCDF file.

permute_dims_for_processing([base_order, ...])

Reorder dims for consistent processing such that the order is: subcolumn x time x height.

remove_appended_str([all_appended_in_lat])

Remove appended strings from xr.Dataset coords and fieldnames based on lat/lon coord names (typically required when using post-processed output data files).

remove_subcol_fields([cloud_class])

Remove all subcolumn output fields for the given cloud class to save memory (mainly releveant for CESM and E3SM).

set_hyd_types(hyd_types)

subcolumns_to_netcdf(file_name)

Saves all of the simulated subcolumn parameters to a netCDF file.

unstack_time_lat_lon([order_dim, ...])

Unstack the time, lat, and lon dims if they were previously stacked together (self.stacked_time_dim is not None).

Attributes

hydrometeor_classes

The list of hydrometeor classes.

num_hydrometeor_classes

The number of hydrometeor classes used

num_subcolumns

Gets the number of subcolumns in the model.