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 two ways to get started
- Create a fresh virtual environment using your favorite method and install the package
- Use an already established virtual environment and install the package
Dependencies
I have provided a list of the dependencies and their versions below.
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_plotting
Usage
Plot data at GERG using Python.
Example: Create a set of maps showing data point temperature, salinity, depth, and time
from gerg_plotting import Data,MapPlot,Bounds
from gerg_plotting.utils import generate_random_point
import numpy as np
import pandas as pd
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
# Generate Test Data
bounds = Bounds(lat_min = 24,lat_max = 31,lon_min = -99,lon_max = -88,depth_top=-1,depth_bottom=1000)
data_bounds = Bounds(lat_min = 27,lat_max = 28.5,lon_min = -96,lon_max = -89,depth_top=-1,depth_bottom=1000)
n_points = 1000
lats,lons = np.transpose([generate_random_point(lat_min=data_bounds.lat_min,
lat_max=data_bounds.lat_max,
lon_min=data_bounds.lon_min,
lon_max=data_bounds.lon_max) for _ in range(n_points)])
salinity = np.random.uniform(low=28,high=32,size=n_points)
temperature = np.random.uniform(low=5,high=28,size=n_points)
depth = np.random.uniform(low=-200,high=0,size=n_points)
time = pd.Series(pd.date_range(start='10-01-2024',end='10-10-2024',periods=n_points)).apply(mdates.date2num)
# Init Data object
data = Data(lat=lats,lon=lons,salinity=salinity,temperature=temperature,depth=depth,time=time)
# Init subplots
fig,ax = plt.subplots(figsize=(10,20),nrows=4,subplot_kw={'projection': ccrs.PlateCarree()})
# Init MapPlot object
plotter = MapPlot(instrument=data,bounds=bounds,grid_spacing=3)
# Generate Scatter plots on one figure
plotter.scatter(fig=fig,ax=ax[0],var='temperature',show_bathy=True,pointsize=30)
plotter.scatter(fig=fig,ax=ax[1],var='salinity',show_bathy=True,pointsize=30)
plotter.scatter(fig=fig,ax=ax[2],var='depth',show_bathy=True,pointsize=30)
plotter.scatter(fig=fig,ax=ax[3],var='time',show_bathy=True,pointsize=30)
fig.savefig('map_example.png',dpi=500)
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.21.tar.gz
.
File metadata
- Download URL: gerg_plotting-0.0.21.tar.gz
- Upload date:
- Size: 60.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc2e1d3b46dfea09490e767591c3bf5cfc5dfb5855464c59b1664de8e682c7fe |
|
MD5 | e8d63b0f66a1f46f2097a5819a389985 |
|
BLAKE2b-256 | 5d51d947ebb42dabd3cf03850fa5b348c595d0c0b357b4c29db7e4dd18371a41 |
File details
Details for the file gerg_plotting-0.0.21-py3-none-any.whl
.
File metadata
- Download URL: gerg_plotting-0.0.21-py3-none-any.whl
- Upload date:
- Size: 60.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.5 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03e338d54b41d8a4636355beb8ea20e9cd3805998dc277ab2544f3bde33515f7 |
|
MD5 | 6cf13c363baff50c8c8516ff1d0b1f7f |
|
BLAKE2b-256 | 85d87f65db443aa91f278531ed5edb3e8d20a70f586a038d3552478efea585df |