package for reading radiosonde data
Project description
bsod2
BSoD2(BalloonScope on Deck 2) is a package in Python for reading and visualizing radiosonde data.
Requirements
- numpy == 2.4.3
- pandas == 3.0.2
- metpy == 1.7.1
Installation
This package can be installed from PyPI.
pip install bsod2
Usage
The only functionality provided by this package is the bsod2.Sonde class, which retrieves radiosonde data and performs quality control.
Basic Sonde construction and methods
Initialize the class with the file path to the raw data.
from pathlib import Path
from bsod2 import Sonde
data = Sonde(Path("Seisuimaru2407/raw_data/F2024061806S1101771.CSV"))
data
>>> Sonde(sonde_no=1101771, launch_time=2024-06-18 06:01:42, product_name=iMS-100 , num_records=1101)
Accessors for observed variables
The following accessors can be used to retrieve meteorological variables.
Most accessors return values with metpy.units.units attached.
| Accessor | units | Description | Example |
|---|---|---|---|
df |
quality-controlled pandas.DataFrame |
sonde.df |
|
time |
Time | sonde.time |
|
lat |
units("deg") |
Latitude | sonde.lat |
lon |
units("deg") |
Longitude | sonde.lon |
x |
units("m") |
X-displacement from the launch point | sonde.x |
y |
units("m") |
Y-displacement from the launch point | sonde.y |
z |
units("m") |
Altitude | sonde.z |
p |
units("hPa") |
Pressure | sonde.p |
t |
units("degC") |
Temperature | sonde.temp |
rh |
units("percents") |
Relative humidity | sonde.rh |
wd |
units("deg") |
Wind direction | sonde.wd |
ws |
units("m/s") |
Wind speed | sonde.ws |
Save as CSV
Save the quality-controlled DataFrame as a CSV file to the specified file path using the save_df method.
data.save_df(Path("output.csv"))
Altitude or pressure interpolation
Interpolate linearly onto an evenly spaced grid in pressure or altitude using the interp argument.
data = Sonde(FILE_PATH,interp="p")
By default, the interpolated pressure axis ranges from 100 to 1100 hPa at 1 hPa intervals, and the height axis ranges from 0 m to 2000 m at 10 m intervals.
Values outside the original data range are filled with NaN. The range and resolution of the interpolation axes can be specified using the following arguments.
| Argument | Description | Default |
|---|---|---|
interp |
Name of the interpolation axis. If None, interpolation is not performed. | None |
interp_pmin |
Minimum value of the interpolated pressure axis (hPa) | 100 |
interp_pmax |
Maximum value of the interpolated pressure axis (hPa) | 1100 |
interp_dp |
Step size of the interpolated pressure axis (hPa) | 1 |
interp_zmin |
Minimum value of the interpolated height axis (m) | 0 |
interp_zmax |
Maximum value of the interpolated height axis (m) | 20000 |
interp_dz |
Step size of the interpolated height axis (m) | 10 |
Sample plots
data
Sample data was observed in Seisui-maru 2407 cruise (2024年度 三重大学 陸海空・環境科学実習).
z vs. sonde variables plot
additional dependencies
- matplotlib
See z_vs_var.ipynb for more details.
time-z cross section plot
additional dependencies
- matplotlib
- xarray
See vertcal_csec.ipynb for more details.
2D/3D trajectories plot
additional dependencies
- matplotlib
- cartopy
- pygmt
- imageio
- tqdm
See trajectory.ipynb for more details.
emagram
additional dependencies
- matplotlib
See emagram.ipynb for more details.
License
This project is distributed under the terms of the GNU General Public License, Version 3 (GPLv3).
See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bsod2-0.1.3.tar.gz.
File metadata
- Download URL: bsod2-0.1.3.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69d7190876557946a697e395c8bae89c6e62d7186dc2e1a0decc0d50dcffc7fc
|
|
| MD5 |
aae4d282fc894c9c9d5863d29fc47f40
|
|
| BLAKE2b-256 |
908965c12c46bddd747ba6f641b305359a543780fd59f5cb1858cc9105fa7a4e
|
Provenance
The following attestation bundles were made for bsod2-0.1.3.tar.gz:
Publisher:
publish.yml on sotomita/bsod2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsod2-0.1.3.tar.gz -
Subject digest:
69d7190876557946a697e395c8bae89c6e62d7186dc2e1a0decc0d50dcffc7fc - Sigstore transparency entry: 1367135234
- Sigstore integration time:
-
Permalink:
sotomita/bsod2@126283c61fa488b9fac3193a1017402dc7f61ef6 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/sotomita
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@126283c61fa488b9fac3193a1017402dc7f61ef6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bsod2-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bsod2-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93b70ffe54df6c76d9a56a9f2d5f05da761227f76d66db2a162e1765dac37b9a
|
|
| MD5 |
ef8567c9350b0a092efc3705968b26e5
|
|
| BLAKE2b-256 |
49eae6bf4a8f596b9e5991fdf6d7a9e59477fab27cc558de25c2decfba1e43d8
|
Provenance
The following attestation bundles were made for bsod2-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on sotomita/bsod2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsod2-0.1.3-py3-none-any.whl -
Subject digest:
93b70ffe54df6c76d9a56a9f2d5f05da761227f76d66db2a162e1765dac37b9a - Sigstore transparency entry: 1367135272
- Sigstore integration time:
-
Permalink:
sotomita/bsod2@126283c61fa488b9fac3193a1017402dc7f61ef6 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/sotomita
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@126283c61fa488b9fac3193a1017402dc7f61ef6 -
Trigger Event:
release
-
Statement type: