-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1ad873
commit 51ec5fc
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Python Tools for Obspack, Receptors and Footprints (pytorf) | ||
|
||
 | ||
[](https://github.com/noaa-gml/pytorf/actions/workflows/python-app.yml) | ||
 | ||
|
||
[NOAA Obspack](https://gml.noaa.gov/ccgg/obspack/) is a collection of green house 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: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
pip install . | ||
``` | ||
|
||
## 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: | ||
|
||
```python | ||
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 | ||
|
||
[](https://github.com/noaa-gml/pytorf/graphs/contributors) |