aws2cosipy

Reads the input data (model forcing) and writes the output to a netCDF file. It supports point models with create_1D_input and distributed simulations with create_2D_input.

The 1D input function works without a static file, in which the static variables are created.

Edit the configuration by supplying a valid .toml file - this includes lapse rates for both cases. See the sample utilities_config.toml for more information.

Usage:

From source: python -m cosipy.utilities.aws2cosipy.aws2cosipy -i <input> -o <output> -s <static> [-u <path>] [-b <date>] [-e <date>]

Entry point: cosipy-aws2cosipy -i <input> -o <output> -s <static> [-u <path>] [-b <date>] [-e <date>]

Options and arguments:

Required arguments:
-i, --input <path>

Path to .csv file with meteorological data.

-o, --output <path>

Path to the resulting COSIPY netCDF file.

-s, --static_file <path>

Path to static file with DEM, slope etc.

Optional arguments:
-u, --u <path>

Relative path to utilities’ configuration file.

-b, --start_date <int>

Start date.

-e, --end_date <int>

End date.

--xl <float>

Left longitude value of the subset.

--xr <float>

Right longitude value of the subset.

--yl <float>

Lower latitude value of the subset.

--yu <float>

Upper latitude value of the subset.

Functions

add_variable_along_latlon(ds, var, name, ...)

Add spatial data to a dataset.

add_variable_along_point(ds, var, name, ...)

Add point data to a dataset.

add_variable_along_timelatlon(ds, var, name, ...)

Add spatiotemporal data to a dataset.

add_variable_along_timelatlon_point(ds, var, ...)

Add spatiotemporal point data to a dataset.

check(field, max_bound, min_bound)

Check the validity of the input data.

check_data(dataset, dataframe)

Check data is within physically reasonable bounds.

check_for_nan(ds)

check_for_nan_point(ds)

check_temperature_bounds(temperature)

compute_scale_and_offset(min, max, n)

convert_to_numeric(series)

Convert series to numeric type.

create_1D_input(cs_file, cosipy_file, ...)

Create an input dataset from a csv file with input point data.

create_2D_input(cs_file, cosipy_file, ...[, ...])

Create a 2D input dataset from a .csv file.

get_pressure_bias(data, height)

get_time_slice(dataframe, start_date, end_date)

get_user_arguments(parser)

Get user arguments for converting AWS data.

get_variable_metadata(name)

Get metadata associated with a variable name.

load_config(module_name)

Load configuration for module.

main()

nansumwrapper(a, **kw_args)

Sum dataframe columns which contain NaNs.

raise_nan_error()

Raise error if NaNs are in the dataset.

read_input_file(input_path)

Read input data, parse dates, and convert to a dataframe.

set_bias(data, lapse_type[, altitude, limit])

Apply lapse rate to data.

set_dataset_coordinates(dataset, latitude, ...)

set_order_and_type(dataframe[, replace_pressure])

Set dataframe order and convert to numeric type.

set_relative_humidity_bounds(humidity)

Limit bounds for relative humidity.

set_variable_metadata()

Initialise variable names and units.

set_zero_field(time_index, lat_index, lon_index)

Initialise array and fill with zeros.

write_netcdf(dataset, output_path)