easyclimate.wrf

Submodules

Attributes

xarray_enabled

disable_xarray

enable_xarray

cartopy_enabled

disable_cartopy

enable_cartopy

basemap_enabled

disable_basemap

enable_basemap

pyngl_enabled

enable_pyngl

disable_pyngl

set_cache_size

get_cache_size

omp_enabled

ALL_TIMES

Constants

ConversionFactors

ProjectionTypes

default_fill

OMP_SCHED_STATIC

OMP_SCHED_DYNAMIC

OMP_SCHED_GUIDED

OMP_SCHED_AUTO

destagger

getvar

xy

interp1d

interp2dxy

interpz3d

slp

tk

td

rh

uvmet

smooth2d

cape_2d

cape_3d

cloudfrac

ctt

dbz

srhel

udhel

avo

pvo

eth

wetbulb

tvirtual

omega

pw

DiagnosticError

omp_set_num_threads

omp_get_num_threads

omp_get_max_threads

omp_get_thread_num

omp_get_num_procs

omp_in_parallel

omp_set_dynamic

omp_get_dynamic

omp_set_nested

omp_get_nested

omp_set_schedule

omp_get_schedule

omp_get_thread_limit

omp_set_max_active_levels

omp_get_max_active_levels

omp_get_level

omp_get_ancestor_thread_num

omp_get_team_size

omp_get_active_level

omp_in_final

omp_init_lock

omp_init_nest_lock

omp_destroy_lock

omp_destroy_nest_lock

omp_set_lock

omp_set_nest_lock

omp_unset_lock

omp_unset_nest_lock

omp_test_lock

omp_test_nest_lock

omp_get_wtime

omp_get_wtick

interplevel

vertcross

interpline

vinterp

xy_to_ll

ll_to_xy

xy_to_ll_proj

ll_to_xy_proj

viewitems

viewkeys

viewvalues

isstr

py2round

py3range

ucode

to_np

extract_global_attrs

is_standard_wrf_var

extract_dim

extract_vars

extract_times

combine_files

npbytes_to_str

is_moving_domain

is_staggered

get_left_indexes

iter_left_indexes

get_right_slices

get_proj_params

from_args

args_to_list

arg_location

psafilepath

get_id

from_var

combine_dims

either

get_iterable

IterWrapper

is_coordvar

latlon_coordvars

is_mapping

has_time_coord

is_multi_file

is_multi_time_req

get_coord_pairs

is_time_coord_var

geo_bounds

get_cartopy

get_basemap

get_pyngl

cartopy_xlim

cartopy_ylim

latlon_coords

ll_points

pairs_to_latlon

GeoBounds

NullGeoBounds

WrfProj

NullProjection

LambertConformal

Mercator

PolarStereographic

LatLon

RotatedLatLon

getproj

CoordPair

to_xy_coords

cache_item

get_cached_item

Functions

open_wrf_data(→ netCDF4.Dataset)

Open WRF (Weather Research and Forecasting) Model Output data.

transfer_xarray2nctype(→ netCDF4.Dataset)

Transfer WRF data from xarray.Dataset to netCDF4.Dataset.

Package Contents

easyclimate.wrf.xarray_enabled = False
easyclimate.wrf.disable_xarray = None
easyclimate.wrf.enable_xarray = None
easyclimate.wrf.cartopy_enabled = False
easyclimate.wrf.disable_cartopy = None
easyclimate.wrf.enable_cartopy = None
easyclimate.wrf.basemap_enabled = False
easyclimate.wrf.disable_basemap = None
easyclimate.wrf.enable_basemap = None
easyclimate.wrf.pyngl_enabled = False
easyclimate.wrf.enable_pyngl = None
easyclimate.wrf.disable_pyngl = None
easyclimate.wrf.set_cache_size = None
easyclimate.wrf.get_cache_size = None
easyclimate.wrf.omp_enabled = False
easyclimate.wrf.ALL_TIMES = None
easyclimate.wrf.Constants = None
easyclimate.wrf.ConversionFactors = None
easyclimate.wrf.ProjectionTypes = None
easyclimate.wrf.default_fill = None
easyclimate.wrf.OMP_SCHED_STATIC = None
easyclimate.wrf.OMP_SCHED_DYNAMIC = None
easyclimate.wrf.OMP_SCHED_GUIDED = None
easyclimate.wrf.OMP_SCHED_AUTO = None
easyclimate.wrf.destagger = None
easyclimate.wrf.getvar
easyclimate.wrf.xy = None
easyclimate.wrf.interp1d = None
easyclimate.wrf.interp2dxy = None
easyclimate.wrf.interpz3d = None
easyclimate.wrf.slp = None
easyclimate.wrf.tk = None
easyclimate.wrf.td = None
easyclimate.wrf.rh = None
easyclimate.wrf.uvmet = None
easyclimate.wrf.smooth2d = None
easyclimate.wrf.cape_2d = None
easyclimate.wrf.cape_3d = None
easyclimate.wrf.cloudfrac = None
easyclimate.wrf.ctt = None
easyclimate.wrf.dbz = None
easyclimate.wrf.srhel = None
easyclimate.wrf.udhel = None
easyclimate.wrf.avo = None
easyclimate.wrf.pvo = None
easyclimate.wrf.eth = None
easyclimate.wrf.wetbulb = None
easyclimate.wrf.tvirtual = None
easyclimate.wrf.omega = None
easyclimate.wrf.pw = None
easyclimate.wrf.DiagnosticError = None
easyclimate.wrf.omp_set_num_threads = None
easyclimate.wrf.omp_get_num_threads = None
easyclimate.wrf.omp_get_max_threads = None
easyclimate.wrf.omp_get_thread_num = None
easyclimate.wrf.omp_get_num_procs = None
easyclimate.wrf.omp_in_parallel = None
easyclimate.wrf.omp_set_dynamic = None
easyclimate.wrf.omp_get_dynamic = None
easyclimate.wrf.omp_set_nested = None
easyclimate.wrf.omp_get_nested = None
easyclimate.wrf.omp_set_schedule = None
easyclimate.wrf.omp_get_schedule = None
easyclimate.wrf.omp_get_thread_limit = None
easyclimate.wrf.omp_set_max_active_levels = None
easyclimate.wrf.omp_get_max_active_levels = None
easyclimate.wrf.omp_get_level = None
easyclimate.wrf.omp_get_ancestor_thread_num = None
easyclimate.wrf.omp_get_team_size = None
easyclimate.wrf.omp_get_active_level = None
easyclimate.wrf.omp_in_final = None
easyclimate.wrf.omp_init_lock = None
easyclimate.wrf.omp_init_nest_lock = None
easyclimate.wrf.omp_destroy_lock = None
easyclimate.wrf.omp_destroy_nest_lock = None
easyclimate.wrf.omp_set_lock = None
easyclimate.wrf.omp_set_nest_lock = None
easyclimate.wrf.omp_unset_lock = None
easyclimate.wrf.omp_unset_nest_lock = None
easyclimate.wrf.omp_test_lock = None
easyclimate.wrf.omp_test_nest_lock = None
easyclimate.wrf.omp_get_wtime = None
easyclimate.wrf.omp_get_wtick = None
easyclimate.wrf.interplevel
easyclimate.wrf.vertcross = None
easyclimate.wrf.interpline = None
easyclimate.wrf.vinterp = None
easyclimate.wrf.xy_to_ll = None
easyclimate.wrf.ll_to_xy = None
easyclimate.wrf.xy_to_ll_proj = None
easyclimate.wrf.ll_to_xy_proj = None
easyclimate.wrf.viewitems = None
easyclimate.wrf.viewkeys = None
easyclimate.wrf.viewvalues = None
easyclimate.wrf.isstr = None
easyclimate.wrf.py2round = None
easyclimate.wrf.py3range = None
easyclimate.wrf.ucode = None
easyclimate.wrf.to_np = None
easyclimate.wrf.extract_global_attrs = None
easyclimate.wrf.is_standard_wrf_var = None
easyclimate.wrf.extract_dim = None
easyclimate.wrf.extract_vars = None
easyclimate.wrf.extract_times = None
easyclimate.wrf.combine_files = None
easyclimate.wrf.npbytes_to_str = None
easyclimate.wrf.is_moving_domain = None
easyclimate.wrf.is_staggered = None
easyclimate.wrf.get_left_indexes = None
easyclimate.wrf.iter_left_indexes = None
easyclimate.wrf.get_right_slices = None
easyclimate.wrf.get_proj_params = None
easyclimate.wrf.from_args = None
easyclimate.wrf.args_to_list = None
easyclimate.wrf.arg_location = None
easyclimate.wrf.psafilepath = None
easyclimate.wrf.get_id = None
easyclimate.wrf.from_var = None
easyclimate.wrf.combine_dims = None
easyclimate.wrf.either = None
easyclimate.wrf.get_iterable = None
easyclimate.wrf.IterWrapper = None
easyclimate.wrf.is_coordvar = None
easyclimate.wrf.latlon_coordvars = None
easyclimate.wrf.is_mapping = None
easyclimate.wrf.has_time_coord = None
easyclimate.wrf.is_multi_file = None
easyclimate.wrf.is_multi_time_req = None
easyclimate.wrf.get_coord_pairs = None
easyclimate.wrf.is_time_coord_var = None
easyclimate.wrf.geo_bounds = None
easyclimate.wrf.get_cartopy = None
easyclimate.wrf.get_basemap = None
easyclimate.wrf.get_pyngl = None
easyclimate.wrf.cartopy_xlim = None
easyclimate.wrf.cartopy_ylim = None
easyclimate.wrf.latlon_coords = None
easyclimate.wrf.ll_points = None
easyclimate.wrf.pairs_to_latlon = None
easyclimate.wrf.GeoBounds = None
easyclimate.wrf.NullGeoBounds = None
easyclimate.wrf.WrfProj = None
easyclimate.wrf.NullProjection = None
easyclimate.wrf.LambertConformal = None
easyclimate.wrf.Mercator = None
easyclimate.wrf.PolarStereographic = None
easyclimate.wrf.LatLon = None
easyclimate.wrf.RotatedLatLon = None
easyclimate.wrf.getproj = None
easyclimate.wrf.CoordPair = None
easyclimate.wrf.to_xy_coords = None
easyclimate.wrf.cache_item = None
easyclimate.wrf.get_cached_item = None
easyclimate.wrf.open_wrf_data(filename: str | os.PathLike, mode: Literal['r', 'w', 'r+', 'a', 'x', 'rs', 'ws', 'r+s', 'as'] = 'r', clobber: bool = True, format: Literal['NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_CLASSIC', 'NETCDF3_64BIT_OFFSET', 'NETCDF3_64BIT_DATA'] = 'NETCDF4', diskless: bool = False, persist: bool = False, keepweakref: bool = False, memory: typing_extensions.Buffer | int | None = None, encoding: str | None = None, parallel: bool = False, comm: Any = None, info: Any = None, auto_complex: bool = False, **kwargs) netCDF4.Dataset

Open WRF (Weather Research and Forecasting) Model Output data.

Parameters

filename: str.

Name of netCDF file to hold dataset. Can also be a python 3 pathlib instance or the URL of an OpenDAP dataset. When memory is set this is just used to set the filepath().

mode: [“r”, “w”, “r+”, “a”, “x”, “rs”, “ws”, “r+s”, “as”], default: “r”.

access mode. r means read-only; no data can be modified. w means write; a new file is created, an existing file with the same name is deleted. x means write, but fail if an existing file with the same name already exists. a and r+ mean append; an existing file is opened for reading and writing, if file does not exist already, one is created. Appending s to modes r, w, r+ or a will enable unbuffered shared access to NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA formatted files. Unbuffered access may be useful even if you don’t need shared access, since it may be faster for programs that don’t access data sequentially. This option is ignored for NETCDF4 and NETCDF4_CLASSIC formatted files.

clobber: bool, default: True.

If True (default), opening a file with mode='w' will clobber an existing file with the same name. If False, an exception will be raised if a file with the same name already exists. mode=x is identical to mode=w with clobber=False.

format: [“NETCDF4”, “NETCDF4_CLASSIC”, “NETCDF3_CLASSIC”, “NETCDF3_64BIT_OFFSET”, “NETCDF3_64BIT_DATA”], default: “NETCDF4”.

underlying file format (one of 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_CLASSIC', 'NETCDF3_64BIT_OFFSET' or 'NETCDF3_64BIT_DATA'. Only relevant if mode = 'w' (if mode = 'r','a' or 'r+' the file format is automatically detected). Default 'NETCDF4', which means the data is stored in an HDF5 file, using netCDF 4 API features. Setting format='NETCDF4_CLASSIC' will create an HDF5 file, using only netCDF 3 compatible API features. netCDF 3 clients must be recompiled and linked against the netCDF 4 library to read files in NETCDF4_CLASSIC format. 'NETCDF3_CLASSIC' is the classic netCDF 3 file format that does not handle 2+ Gb files. 'NETCDF3_64BIT_OFFSET' is the 64-bit offset version of the netCDF 3 file format, which fully supports 2+ GB files, but is only compatible with clients linked against netCDF version 3.6.0 or later. 'NETCDF3_64BIT_DATA' is the 64-bit data version of the netCDF 3 file format, which supports 64-bit dimension sizes plus unsigned and 64 bit integer data types, but is only compatible with clients linked against netCDF version 4.4.0 or later.

diskless: bool, default: False.

If True, create diskless (in-core) file. This is a feature added to the C library after the netcdf-4.2 release. If you need to access the memory buffer directly, use the in-memory feature instead (see memory kwarg).

persist: bool, default: False.

if diskless=True, persist file to disk when closed (default False).

keepweakref: bool, default: False.

if True, child Dimension and Variable instances will keep weak references to the parent Dataset or Group object. Default is False, which means strong references will be kept. Having Dimension and Variable instances keep a strong reference to the parent Dataset instance, which in turn keeps a reference to child Dimension and Variable instances, creates circular references. Circular references complicate garbage collection, which may mean increased memory usage for programs that create may Dataset instances with lots of Variables. It also will result in the Dataset object never being deleted, which means it may keep open files alive as well. Setting keepweakref=True allows Dataset instances to be garbage collected as soon as they go out of scope, potentially reducing memory usage and open file handles. However, in many cases this is not desirable, since the associated Variable instances may still be needed, but are rendered unusable when the parent Dataset instance is garbage collected.

memory: Buffer or int.

if not None, create or open an in-memory Dataset. If mode = r, the memory kwarg must contain a memory buffer object (an object that supports the python buffer interface). The Dataset will then be created with contents taken from this block of memory. If mode = w, the memory kwarg should contain the anticipated size of the Dataset in bytes (used only for NETCDF3 files). A memory buffer containing a copy of the Dataset is returned by the Dataset.close() method. Requires netcdf-c version 4.4.1 for mode=``r`` netcdf-c 4.6.2 for mode=``w``. To persist the file to disk, the raw bytes from the returned buffer can be written into a binary file. The Dataset can also be re-opened using this memory buffer.

encoding: str.

encoding used to encode filename string into bytes. Default is None (sys.getdefaultfileencoding() is used).

parallel: bool, default: False.

open for parallel access using MPI (requires mpi4py and parallel-enabled netcdf-c and hdf5 libraries). Default is False. If True, comm and info kwargs may also be specified.

comm: Any.

MPI_Comm object for parallel access. Default None, which means MPI_COMM_WORLD will be used. Ignored if parallel=False.

info: Any.

MPI_Info object for parallel access. Default None, which means MPI_INFO_NULL will be used. Ignored if parallel=False.

auto_complex: bool, default: False.

if True, then automatically convert complex number types.

Returns

Data (netCDF4.Dataset).

easyclimate.wrf.transfer_xarray2nctype(ds: xarray.Dataset) netCDF4.Dataset

Transfer WRF data from xarray.Dataset to netCDF4.Dataset.

Parameters

ds: xarray.Dataset.

WRF data read by xarray engine.

Returns

Data (netCDF4.Dataset).