NOAA Obspack is a collection of greenhouse gases observations
pytorf is a Python package designed for reading NetCDF files into Pandas DataFrames. It provides a convenient function, obs_read_nc
, which allows users to extract and manipulate observational data from NetCDF files efficiently.
pytorf
only depends on pandas
and netCDF4
, which is basically parallel C,
so it can be installed in any machine.
To install the package, you can clone the repository and install the required dependencies using pip:
git clone https://github.com/noaa-gml/pytorf.git
cd pytorf
pip install -r requirements.txt
Alternatively, you can install the package directly from the source:
pip install .
Check the R version rtorf
To use the obs_read_nc
function, you can import it from the package and call it with the appropriate parameters. Here is a basic example:
import pytorf
# Assuming you have an index DataFrame ready
`obs_summary` takes the input of the obspack directory and return a DataFrame
categories=["aircraft-pfp",
"aircraft-insitu",
"surface-insitu",
"tower-insitu",
"aircore",
"surface-pfp",
"shipboard-insitu",
"flask"]
obs = "Z:/torf/obspack_ch4_1_GLOBALVIEWplus_v5.1_2023-03-08/data/nc/"
index = obs_summary(obs = obs)
data = obs_read_nc(index, categories="flask", solar_time=False, as_list=False, verbose=True)
Contributions are welcome! If you would like to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch to your forked repository.
- Create a pull request to the main repository.
This project is licensed under the MIT License. See the LICENSE file for more details.