class foxes.input.states.FieldDataNC(foxes.core.States)[source]

Heterogeneous ambient states on a regular horizontal grid in NetCDF format.

Attributes

data_source: str or xarray.Dataset

The data or the file search pattern, should end with suffix ‘.nc’. One or many files.

ovars: list of str

The output variables

var2ncvar: dict

Mapping from variable names to variable names in the nc file

fixed_vars: dict

Uniform values for output variables, instead of reading from data

states_coord: str

The states coordinate name in the data

x_coord: str

The x coordinate name in the data

y_coord: str

The y coordinate name in the data

h_coord: str

The height coordinate name in the data

pre_load: bool

Flag for loading all data into memory during initialization

weight_ncvar: str

Name of the weight data variable in the nc file(s)

bounds_error: bool

Flag for raising errors if bounds are exceeded

fill_value: number

Fill value in case of exceeding bounds, if no bounds error

time_format: str

The datetime parsing format string

interp_nans: bool

Linearly interpolate nan values

interpn_pars: dict, optional

Additional parameters for scipy.interpolate.interpn

Public members

FieldDataNC(data_source, output_vars, var2ncvar={}, ...)[source]

Constructor.

output_point_vars(algo)[source]

The variables which are being modified by the model.

load_data(algo, verbosity=0)[source]

Load and/or create all model data that is subject to chunking.

size()[source]

The total number of states.

index()[source]

The index list

weights(algo)[source]

The statistical weights of all states.

calculate(algo, mdata, fdata, tdata)[source]

” The main model calculation.

ensure_variables(algo, mdata, fdata, tdata)[source]

Add variables to tdata, initialized with NaN

run_calculation(algo, *data, out_vars, **calc_pars)[source]

Starts the model calculation in parallel, via xarray’s apply_ufunc.

__repr__()[source]

Return repr(self).

property model_id

Unique id based on the model type.

var(v)[source]

Creates a model specific variable name.

property initialized

Initialization flag.

sub_models()[source]

List of all sub-models

initialize(algo, verbosity=0, force=False)[source]

Initializes the model.

finalize(algo, verbosity=0)[source]

Finalizes the model.

get_data(variable, target, lookup='smfp', mdata=None, ...)[source]

Getter for a data entry in the model object or provided data sources

data_to_store(name, algo, data)[source]

Adds data from mdata to the local store, intended for iterative runs.

from_data_or_store(name, algo, data, ret_dims=False, safe=False)[source]

Get data from mdata or local store