Reference
This reference manual details functions, modules, and objects included in
joseki
, describing what they are and what they do.
Accessor¶
Accessor module.
JosekiAccessor
¶
Joseki accessor.
Source code in src/joseki/accessor.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
|
column_mass_density: t.Dict[str, pint.Quantity]
property
¶
Compute column mass density.
Returns:
Type | Description |
---|---|
t.Dict[str, pint.Quantity]
|
A mapping of molecule and column mass density. |
Notes
The column mass density is given by:
where
- \(N_{\mathrm{M}}\) is the column number density of molecule M,
- \(m_{\mathrm{M}}\) is the molecular mass of molecule M.
column_number_density: t.Dict[str, pint.Quantity]
property
¶
Compute column number density.
Returns:
Type | Description |
---|---|
t.Dict[str, pint.Quantity]
|
A mapping of molecule and column number density. |
Notes
The column number density is given by:
with
where
- \(z\) is the altitude,
- \(x_{\mathrm{M}}(z)\) is the volume mixing ratio of molecule M at altitude \(z\),
- \(n(z)\) is the air number density at altitude \(z\),
- \(n_{\mathrm{M}}(z)\) is the number density of molecule M at altitude \(z\).
If the dataset has a z_bounds
coordinate, the integral is computed
using the centered rectangle method, where the z
coordinate
corresponds to the rectangle centers.
If the dataset does not have a z_bounds
coordinate, the
integration is performed using the trapezoidal rule.
mass_density_at_sea_level: t.Dict[str, pint.Quantity]
property
¶
Compute mass density at sea level.
Returns:
Type | Description |
---|---|
t.Dict[str, pint.Quantity]
|
A mapping of molecule and mass density at sea level. |
molecules: t.List[str]
property
¶
Return list of molecules.
number_density_at_sea_level: t.Dict[str, pint.Quantity]
property
¶
Compute number density at sea level.
Returns:
Type | Description |
---|---|
t.Dict[str, pint.Quantity]
|
A mapping of molecule and number density at sea level. |
volume_fraction: xr.DataArray
property
¶
Extract volume fraction and tabulate as a function of (m, z).
Returns:
Type | Description |
---|---|
xr.DataArray
|
Volume fraction. |
volume_fraction_at_sea_level: t.Dict[str, pint.Quantity]
property
¶
Compute volume fraction at sea level.
Returns:
Type | Description |
---|---|
t.Dict[str, pint.Quantity]
|
A mapping of molecule and volume mixing fraction at sea level. |
rescale(factors, check_volume_fraction_sum=False)
¶
Rescale molecules concentration in atmospheric profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
factors |
t.MutableMapping[str, float]
|
A mapping of molecule and scaling factor. |
required |
check_volume_fraction_sum |
bool
|
if True, check that volume fraction sums are never larger than one. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
if check_volume_fraction_sum is |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Rescaled dataset (new object). |
Source code in src/joseki/accessor.py
scaling_factors(target)
¶
Compute scaling factor(s) to reach specific target amount(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target |
t.MutableMapping[str, pint.Quantity]
|
Mapping of molecule and target amount. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If a target amount has dimensions that are not supported. |
Returns:
Type | Description |
---|---|
t.MutableMapping[str, float]
|
Mapping of molecule and scaling factors. |
Notes
For each molecule in the target
mapping, the target amount is
interpreted, depending on its dimensions (indicated in square
brackets), as:
- a column number density [
length^-2
], - a column mass density [
mass * length^-2
], - a number densitx at sea level [
length^-3
], - a mass density at sea level [
mass * length^-3
], - a volume mixing fraction at sea level [
dimensionless
]
The scaling factor is then evaluated as the ratio of the target amount with the original amount, for each molecule.
See Also
rescale
Source code in src/joseki/accessor.py
validate(check_volume_fraction_sum=False, ret_true_if_valid=False)
¶
Validate atmosphere thermophysical profile dataset schema.
Returns:
Type | Description |
---|---|
bool
|
|
Source code in src/joseki/accessor.py
molecular_mass(m)
¶
Return the average molecular mass of a molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
m |
str
|
Molecule formula. |
required |
Returns:
Type | Description |
---|---|
pint.Quantity
|
Average molecular mass. |
Data¶
Profiles¶
Factory¶
Profile factory module.
ProfileFactory
¶
Profile factory class.
Source code in src/joseki/profiles/factory.py
registered_identifiers: t.List[str]
property
¶
Registered profile identifiers.
Returns:
Type | Description |
---|---|
t.List[str]
|
List of registered profile identifiers. |
create(identifier, **kwargs)
¶
Create a profile instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
Profile identifier. |
required |
Returns:
Type | Description |
---|---|
Profile
|
Profile instance. |
Source code in src/joseki/profiles/factory.py
register(identifier)
¶
Register a profile class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
Profile identifier. |
required |
Returns:
Type | Description |
---|---|
t.Callable
|
Decorator function. |
Source code in src/joseki/profiles/factory.py
Core¶
Core module for atmosphere thermophysical profiles.
The Profile
abstract class defines the interface for atmosphere thermophysical
profiles.
The interp
function is used to interpolate an atmosphere thermophysical
profile on new altitude values.
The represent_profile_in_cells
function is used to compute the cells
representation of the atmosphere thermophysical profile.
Profile
¶
Bases: ABC
Abstract class for atmosphere thermophysical profiles.
Source code in src/joseki/profiles/core.py
to_dataset(z=None, interp_method=None, conserve_column=False, **kwargs)
abstractmethod
¶
Return the profile as a dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z |
t.Optional[pint.Quantity]
|
Altitude grid. If the profile can be evaluated at arbitrary altitudes, this parameter is passed to the evaluating method for that profile. If the profile is defined on a fixed altitude grid, this parameter is used to interpolate the profile on the specified altitude grid. |
None
|
interp_method |
t.Optional[t.Mapping[str, str]]
|
Interpolation method for each variable.
If |
None
|
conserve_column |
bool
|
If |
False
|
kwargs |
t.Any
|
Parameters passed to lower-level methods. |
{}
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Atmospheric profile. |
Source code in src/joseki/profiles/core.py
interp(ds, z_new, method=DEFAULT_METHOD, conserve_column=False)
¶
Interpolate atmospheric profile on new altitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds |
xr.Dataset
|
Atmospheric profile to interpolate. |
required |
z_new |
pint.Quantity
|
Altitudes values at which to interpolate the atmospheric profile. |
required |
method |
t.Dict[str, str]
|
Mapping of variable and interpolation method. If a variable is not in the mapping, the linear interpolation is used. By default, linear interpolation is used for all variables. |
DEFAULT_METHOD
|
conserve_column |
bool
|
If True, ensure that column densities are conserved. |
False
|
Mapping of variable and interpolation method.
If a variable is not in the mapping, the linear interpolation is used. By default, linear interpolation is used for all variables.
Returns:
Type | Description |
---|---|
xr.Dataset
|
Interpolated atmospheric profile. |
Source code in src/joseki/profiles/core.py
represent_profile_in_cells(ds, method=DEFAULT_METHOD, conserve_column=False)
¶
Compute the cells representation of the atmosphere thermophysical profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds |
xr.Dataset
|
Initial atmospheric profile. |
required |
method |
t.Dict[str, str]
|
Mapping of variable and interpolation method. If a variable is not in the mapping, the linear interpolation is used. By default, linear interpolation is used for all variables. |
DEFAULT_METHOD
|
conserve_column |
bool
|
If True, ensure that column densities are conserved. |
False
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Cells representation of the atmosphere thermophysical profile. |
Notes
Atmosphere cells (or layers) are defined by two consecutive altitude
values. The layer's center altitude is defined as the arithmetic
average of these two values. The pressure, temperature, number density
and volume fraction fields are interpolated at these layer' center
altitude values. In the new atmospheric profile, the z
coordinate
is updated with layer' center altitude values and a data variable
z_bounds
indicating the altitude bounds of each layer, is added.
A copy of the dataset is returned, the original dataset is not
modified.
Source code in src/joseki/profiles/core.py
rescale_to_column(reference, ds)
¶
Rescale volume fraction to ensure that column densities are conserved.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference |
xr.Dataset
|
Reference profile. |
required |
ds |
xr.Dataset
|
Profile to rescale. |
required |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Rescaled profile. |
Source code in src/joseki/profiles/core.py
Dataset schema¶
Dataset schema for atmosphere thermophysical profiles.
The dataset schema defines the variables, coordinates and attributes that are expected in a dataset representing an atmosphere thermophysical profile.
Schema
¶
Dataset schema for atmosphere thermophysical profiles.
Source code in src/joseki/profiles/schema.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
convert(data_vars, coords, attrs)
¶
Convert input to schema-compliant dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_vars |
t.Mapping[str, pint.Quantity]
|
Mapping of data variable names to quantities. |
required |
coords |
t.Mapping[str, pint.Quantity]
|
Mapping of coordinate names to quantities. |
required |
attrs |
t.Mapping[str, str]
|
Mapping of attribute names to values. |
required |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Dataset with schema-compliant data variables, coordinates, and |
xr.Dataset
|
attributes. |
Source code in src/joseki/profiles/schema.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
validate(ds, check_volume_fraction_sum=False, ret_true_if_valid=False)
¶
Validate dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds |
xr.Dataset
|
Dataset to validate. |
required |
check_volume_fraction_sum |
bool
|
if True, check that volume fraction sums are never larger than one. |
False
|
ret_true_if_valid |
bool
|
make this method return True if the dataset is valid. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
If the dataset does not match the schema. |
Returns:
Type | Description |
---|---|
t.Optional[bool]
|
None or bool: If |
Source code in src/joseki/profiles/schema.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
volume_fraction_sum(ds)
¶
Compute the sum of volume mixing fractions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds |
xr.Dataset
|
Dataset. |
required |
Returns:
Type | Description |
---|---|
pint.Quantity
|
The sum of volume fractions. |
Source code in src/joseki/profiles/schema.py
AFGL (1986)¶
AFGL 1986 atmosphere's thermophysical profiles.
The profiles are generated from data files stored in joseki/data/afgl_1986
.
These data files correspond to tables 1a-f and 2a-d of the technical report
Anderson+1986.
AFGL1986MidlatitudeSummer
¶
Bases: Profile
AFGL 1986 midlatitude summer atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
AFGL1986MidlatitudeWinter
¶
Bases: Profile
AFGL 1986 midlatitude winter atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
AFGL1986SubarcticSummer
¶
Bases: Profile
AFGL 1986 subarctic summer atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
AFGL1986SubarcticWinter
¶
Bases: Profile
AFGL 1986 subarctic winter atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
AFGL1986Tropical
¶
Bases: Profile
AFGL 1986 tropical atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
AFGL1986USStandard
¶
Bases: Profile
AFGL 1986 US Standard atmosphere thermophysical profile.
Source code in src/joseki/profiles/afgl_1986.py
Identifier
¶
Bases: enum.Enum
AFGL 1986 atmospheric profile identifier enumeration.
Source code in src/joseki/profiles/afgl_1986.py
dataframe_to_dataset(df, identifier, additional_molecules=True)
¶
Convert the output of the parse
method to a xarray.Dataset
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
pd.DataFrame
|
Atmospheric profile data. |
required |
identifier |
Identifier
|
Atmospheric profile identifier. |
required |
additional_molecules |
bool
|
If |
True
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Atmospheric profile dataset. |
Notes
Use the z
column of the output pandas.DataFrame of read_raw_data
as data coordinate and all other columns as data variables.
All data variables and coordinates of the returned xarray.Dataset are
associated metadata (standard name, long name and units).
Raw data units are documented in the technical report AFGL Atmospheric
Constituent Profiles (0-120 km), Anderson et al., 1986
Anderson+1986.
dataset attributes are added.
Source code in src/joseki/profiles/afgl_1986.py
get_dataset(identifier, additional_molecules=True)
¶
Read data files for a given atmospheric profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
Identifier
|
Atmospheric profile identifier.
See
|
required |
additional_molecules |
bool
|
If |
True
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Atmospheric profile dataset. |
Notes
Chain calls to
parse
and
dataframe_to_dataset
.
Source code in src/joseki/profiles/afgl_1986.py
parse(identifier)
¶
Parse table data files for a given atmospheric profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
Identifier
|
Atmospheric profile identifier. |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame
|
Atmospheric profile dataset. |
Notes
Read the relevant raw data files corresponding to the atmospheric profile.
These raw data files correspond to tables 1 and 2 from the
technical report AFGL Atmospheric Constituent Profiles (0-120 km),
Anderson et al., 1986.
Each atmospheric profile has 5 tables, i.e. 5 raw data files, associated
to it.
Only the first of these tables is specific to each atmospheric profile.
All 5 raw data files are read into pandas.DataFrame
objects and
then concatenated after dropping the duplicate columns.
Source code in src/joseki/profiles/afgl_1986.py
to_dataset(identifier, z=None, interp_method=None, conserve_column=False, **kwargs)
¶
Helper Profile.to_dataset() method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
Identifier
|
AFGL 1986 atmosphere thermophysical profile identifier.
See
|
required |
z |
t.Optional[pint.Quantity]
|
New level altitudes.
If |
None
|
interp_method |
t.Mapping[str, str]
|
Interpolation method for each data variable. Default is
|
None
|
conserve_column |
bool
|
If |
False
|
kwargs |
t.Any
|
Additional arguments passed to
|
{}
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Atmosphere thermophysical profile dataset. |
Source code in src/joseki/profiles/afgl_1986.py
MIPAS (2007)¶
MIPAS atmosphere thermophysical profiles.
Remedios et al. (2007) define a set of 5 "standard atmospheres" representing the atmosphere at different latitudes and seasons or times of day:
- midlatitude day
- midlatitude night
- polar winter
- polar summer
- tropical
MIPAS standard atmospheres were intended to provide an updated set of pro- files for characteristic atmospheric states such as the AFGL Atmospheric constituent profiles.
Identifier
¶
Bases: enum.Enum
MIPAS atmosphere thermophysical profile identifier enumeration.
Source code in src/joseki/profiles/mipas_2007.py
MIPASMidlatitudeDay
¶
Bases: Profile
MIPAS midlatitude day reference atmosphere.
Source code in src/joseki/profiles/mipas_2007.py
MIPASMidlatitudeNight
¶
Bases: Profile
MIPAS Midlatitude night reference atmosphere.
Source code in src/joseki/profiles/mipas_2007.py
MIPASPolarSummer
¶
Bases: Profile
MIPAS Polar summer reference atmosphere.
Source code in src/joseki/profiles/mipas_2007.py
MIPASPolarWinter
¶
Bases: Profile
MIPAS Polar winter reference atmosphere.
Source code in src/joseki/profiles/mipas_2007.py
MIPASTropical
¶
Bases: Profile
MIPAS Tropical reference atmosphere.
Source code in src/joseki/profiles/mipas_2007.py
get_dataset(identifier)
¶
Read MIPAS reference atmosphere data files into an xarray.Dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
Identifier
|
Atmospheric profile identifier.
See
|
required |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Atmospheric profile. |
Source code in src/joseki/profiles/mipas_2007.py
parse_content(lines)
¶
Parse lines.
Source code in src/joseki/profiles/mipas_2007.py
parse_units(s)
¶
Parse units.
Source code in src/joseki/profiles/mipas_2007.py
parse_values_line(s)
¶
Parse a line with numeric values.
Source code in src/joseki/profiles/mipas_2007.py
parse_var_line(s)
¶
Parse a line with the declaration of a variable and its units.
Source code in src/joseki/profiles/mipas_2007.py
parse_var_name(n)
¶
read_file_content(identifier)
¶
Read data file content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
Identifier
|
Atmospheric profile identifier.
See
|
required |
Returns:
Type | Description |
---|---|
str
|
file content, URL, URL date. |
Source code in src/joseki/profiles/mipas_2007.py
to_chemical_formula(name)
¶
Convert to chemical formula.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Molecule name. |
required |
Returns:
Type | Description |
---|---|
str
|
Molecule formula. |
Notes
If molecule name is unknown, returns name unchanged.
Source code in src/joseki/profiles/mipas_2007.py
to_dataset(identifier, z=None, method=None, conserve_column=False, **kwargs)
¶
Helper for Profile.to_dataset
method
Source code in src/joseki/profiles/mipas_2007.py
translate_cfc(name)
¶
Convert chlorofulorocarbon name to corresponding chemical formula.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Chlorofulorocarbon name. |
required |
Returns:
Type | Description |
---|---|
str
|
Chlorofulorocarbon chemical formula. |
Raises:
Type | Description |
---|---|
ValueError
|
If the name does not match a known chlorofulorocarbon. |
Source code in src/joseki/profiles/mipas_2007.py
US Standard Atmosphere (1976)¶
Module to compute the U.S. Standard Atmosphere 1976.
The U.S. Standard Atmosphere 1976 is a Earth atmosphere thermophysical model described in the technical report NOAA+1976.
USSA1976
¶
Bases: Profile
Class to compute the U.S. Standard Atmosphere 1976.
The U.S. Standard Atmosphere 1976 is a Earth atmosphere thermophysical model described in the technical report NOAA+1976.
Source code in src/joseki/profiles/ussa_1976.py
Command line interface¶
Command-line interface.
main(file_name, identifier, altitudes, altitude_units, represent_in_cells, conserve_column, p_interp_method, t_interp_method, n_interp_method, x_interp_method)
¶
Joseki command-line interface.
Source code in src/joseki/__main__.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
Core¶
Core module.
identifiers()
¶
List all registered profile identifiers.
Returns:
Type | Description |
---|---|
t.List[str]
|
List of all registered profile identifiers. |
load_dataset(path, *args, **kwargs)
¶
Thin wrapper around xarray.load_dataset
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
os.PathLike
|
Path to the dataset. |
required |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Profile. |
make(identifier, z=None, interp_method=DEFAULT_METHOD, represent_in_cells=False, conserve_column=False, **kwargs)
¶
Create a profile with the specified identifier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
Profile identifier. |
required |
z |
t.Optional[pint.Quantity]
|
Altitude values. |
None
|
interp_method |
t.Optional[t.Mapping[str, str]]
|
Mapping of variable and interpolation method. |
DEFAULT_METHOD
|
represent_in_cells |
bool
|
If |
False
|
conserve_column |
bool
|
If |
False
|
kwargs |
t.Any
|
Additional keyword arguments passed to the profile constructor. |
{}
|
Returns:
Type | Description |
---|---|
xr.Dataset
|
Profile as xarray.Dataset. |
Source code in src/joseki/core.py
open_dataset(path, *args, **kwargs)
¶
Thin wrapper around xarray.open_dataset
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
os.PathLike
|
Path to the dataset. |
required |
Returns:
Type | Description |
---|---|
xr.Dataset
|
Profile. |
Units¶
Units module.
to_quantity(da)
¶
Convert a xarray.DataArray
to a pint.Quantity
.
Notes
The array's attrs
metadata mapping must contain a units
field.
This function can also be used on coordinate variables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
da |
xr.DataArray
|
xarray.DataArray instance which will be converted. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the |
Returns:
Type | Description |
---|---|
pint.Quantity
|
The corresponding quantity. |
Source code in src/joseki/units.py
Util¶
Utility module.
utcnow()
¶
Get current UTC time.
Returns:
Type | Description |
---|---|
str
|
ISO 8601 formatted UTC timestamp. |