API reference¶
bsod2.Sondeset(fpath, rm_descending=False, interp=None, interp_pmin=50.0, interp_pmax=1100.0, interp_dp=1.0, interp_zmin=0.0, interp_zmax=20000.0, interp_dz=10.0)
dataclass
¶
Collection of radiosonde profiles.
Load one or more raw sonde files, apply quality control, and optionally interpolate them onto a common pressure or height axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fpath
|
str | Path | list[str | Path]
|
path, or list of paths, to raw files ( |
required |
rm_descending
|
bool
|
True to remove descending records, by default False |
False
|
interp
|
str | None
|
name of interpolation axis. if None, interpolation is not performed, by default None |
None
|
interp_pmin
|
float
|
minimum value of interpolated pressure axis, by default 50.0 |
50.0
|
interp_pmax
|
float
|
maximum value of interpolated pressure axis, by default 1100.0 |
1100.0
|
interp_dp
|
float
|
step value of interpolated pressure axis, by default 1.0 |
1.0
|
interp_zmin
|
float
|
minimum value of interpolated z axis, by default 0.0 |
0.0
|
interp_zmax
|
float
|
maximum value of interpolated z axis, by default 20000.0 |
20000.0
|
interp_dz
|
float
|
step value of interpolated z axis, by default 10.0 |
10.0
|
ds
property
¶
interpolated and combined dataset
Returns:
| Type | Description |
|---|---|
Dataset
|
dataset with dimensions (n, z) or (n, p) |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
bsod2.sonde.Sonde(fpath, rm_descending=False, interp=None, interp_pmin=50.0, interp_pmax=1100.0, interp_dp=1.0, interp_zmin=0.0, interp_zmax=20000.0, interp_dz=10.0)
dataclass
¶
Single radiosonde profile.
Read one raw sonde file and apply quality control.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fpath
|
str | Path
|
path of raw file |
required |
rm_descending
|
bool
|
True to remove descending records, by default False |
False
|
interp
|
str | None
|
name of interpolation axis. if None, interpolation is not performed, by default None |
None
|
interp_pmin
|
float
|
minimum value of interpolated pressure axis, by default 50.0 |
50.0
|
interp_pmax
|
float
|
maximum value of interpolated pressure axis, by default 1100.0 |
1100.0
|
interp_dp
|
float
|
step value of interpolated pressure axis, by default 1.0 |
1.0
|
interp_zmin
|
float
|
minimum value of interpolated z axis, by default 0.0 |
0.0
|
interp_zmax
|
float
|
maximum value of interpolated z axis, by default 20000.0 |
20000.0
|
interp_dz
|
float
|
step value of interpolated z axis, by default 10.0 |
10.0
|
time
property
¶
time
Returns:
| Type | Description |
|---|---|
Series
|
time series |
lat
property
¶
latitude
Returns:
| Type | Description |
|---|---|
Quantity
|
latitude with units("degrees") |
lon
property
¶
longitude
Returns:
| Type | Description |
|---|---|
Quantity
|
longitude with units ("degrees") |
x
property
¶
x-displacement from the launch point
Returns:
| Type | Description |
|---|---|
Quantity
|
x-displacement with units("m") |
y
property
¶
y-displacement from the launch point
Returns:
| Type | Description |
|---|---|
Quantity
|
y-displacement with units("m") |
p
property
¶
pressure
Returns:
| Type | Description |
|---|---|
Quantity
|
pressure with units("hPa") |
z
property
¶
height
Returns:
| Type | Description |
|---|---|
Quantity
|
height with units("m") |
t
property
¶
temperature
Returns:
| Type | Description |
|---|---|
Quantity
|
temperature with units("degC") |
rh
property
¶
relative humidity
Returns:
| Type | Description |
|---|---|
Quantity
|
relative humidity with units("percent") |
wd
property
¶
wind direction
Returns:
| Type | Description |
|---|---|
Quantity
|
wind direction with units("degrees") |
ws
property
¶
wind speed
Returns:
| Type | Description |
|---|---|
Quantity
|
wind speed with units("m/s") |
u
property
¶
u component of wind
Returns:
| Type | Description |
|---|---|
Quantity
|
u component of wind with units("m/s") |
v
property
¶
v component of wind
Returns:
| Type | Description |
|---|---|
Quantity
|
v component of wind with units("m/s") |
td
property
¶
dew point temperature
Returns:
| Type | Description |
|---|---|
Quantity
|
dew point temperature with units("degC") |
save_df(fpath, dropna=True)
¶
save as csv
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fpath
|
str | Path
|
file path the df saved |
required |
dropna
|
bool
|
True to save DataFrame without NaN records, by default True. Records outside the observed range (interpolated data) and records whose observed values are all NaN are removed. |
True
|
plot_emagram(save_dir)
¶
plot emagram
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_dir
|
str | Path
|
fig dir |
required |