No project description provided
Project description
Table of Contents
About The Project
This project was created to streamline and standardize the process of generating plots at GERG.
Built With
Getting Started
There are three ways to get started
- Create a fresh virtual environment using your favorite method and install the dependencies
- Use an already established virtual environment and install the dependencies
Dependencies
I have provided some commands to install the dependencies using conda but you can use any package manager
List of dependencies:
- python = 3.12
- numpy = 2.0.0
- pandas = 2.2.2
- matplotlib = 3.9.1
- xarray = 2024.6.0
- attrs = 23.2.0
- netcdf4 = 1.7.1.post1
- cmocean = 4.0.3
- scipy = 1.14.0
- mayavi = 4.8.2
Installation
- Activate your virtual environment
- Use pip to install
pip install gerg_glider
Usage
Plot data at GERG using Python.
Create Histgrams for U and V current vectors
import xarray as xr
import matplotlib.pyplot as plt
from gerg_plotting import Histogram, Buoy
# Open in the dataset
ds = xr.open_dataset('../test_data/buoy.nc')
# Convert the dataset to pandas dataframe
df = ds[['u','v']].to_dataframe().reset_index()
# Initialize the buoy instrument data container
buoy = Buoy(depth=df['bin'].to_numpy(),
time=df['date'].to_numpy(),
u_current=df['u'].to_numpy(),
v_current=df['v'].to_numpy())
# Initialize the figure and axes
fig,axes = plt.subplots(nrows=2,figsize = (5,10))
# Initialize the histogram plotter
hist = Histogram(instrument=buoy)
# Plot the 1-d histograms for u and v currents
hist.plot(fig=fig,ax=axes[0],var='u_current',bins=100)
hist.plot(fig=fig,ax=axes[1],var='v_current',bins=100)
# Add Titles to Histograms
axes[0].set_title('Current Vector U')
axes[1].set_title('Current Vector V')
# Show Figure
plt.show()
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Alec Krueger - alecmkrueger@tamu.edu
Project Link: https://github.com/alecmkrueger/gerg_plotting
Acknowledgments
- Alec Krueger, Texas A&M University, Geochemical and Environmental Research Group, alecmkrueger@tamu.edu
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file gerg_plotting-0.0.9.tar.gz
.
File metadata
- Download URL: gerg_plotting-0.0.9.tar.gz
- Upload date:
- Size: 57.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a31472372559397c47e6548115344c2d0c55ec35a7465aa32d72e460f3fb0275 |
|
MD5 | b3bdd6c01ffe3d2ae6b0b24db3c320a6 |
|
BLAKE2b-256 | 38716097b26eaf41af2fb39a4da60892f18a4a8bc89724ee86d1f5dfea9ab984 |
File details
Details for the file gerg_plotting-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: gerg_plotting-0.0.9-py3-none-any.whl
- Upload date:
- Size: 57.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 438f8e273196dc398a80c5057b5f9d561e1696652677c5e45789bdcd6a452502 |
|
MD5 | b77dc9db0fc2ad6a709b50fcb77f92a8 |
|
BLAKE2b-256 | ad72bbff5c21faef85c95e94b453abce7c4b18e170a8969324c80c71f9d6beb8 |