Skip to content

noaa-gml/pytorf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Tools for Obspack, Receptors and Footprints (pytorf) - in development

GitHub commit activity python-check GitHub Repo stars

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.

Installation

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 .

R version

Check the R version rtorf

Usage

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)

Contributing

Contributions are welcome! If you would like to contribute to the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your branch to your forked repository.
  5. Create a pull request to the main repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Special thanks to all the contributors

Contributors