IsoHysplit is a Python package for calculating and analyzing HYSPLIT back trajectories with a focus on water isotope data integration. It provides tools for trajectory generation, analysis, and visualization including moisture source diagnostics and isotopic composition along air parcel trajectories.
This code benefits significantly from the following projects:
- greater than Python 3.11
- Required Python packages:
numpy pandas xarray matplotlib cartopy geopandas shapely joblib
-
Clone the repository:
git clone https://github.com/yourusername/IsoHysplit.git cd IsoHysplit
-
Install required Python packages:
pip install -r requirements.txt
-
Ensure HYSPLIT is installed and the executable path is correctly specified in your namelist file.
IsoHysplit/
├── exec/ # HYSPLIT executables
├── working/ # Working directory for HYSPLIT
├── output/ # Output directory
├── Forcing/ # Meteorological data
├── isotope/ # Isotope data files
├── namelist/ # Namelist configuration files
└── src/ # Source code
Configure your analysis by editing the namelist file (main.nml). Example configuration:
&general
basename=Singapore
years=2005
months=4
hours = 0, 3, 6, 9, 12, 15, 18, 21
altitudes = 1000
location = 1.352, 103.820
runtime = -240
working_dir = ../working
storage_dir = ../output/SG2
meteo_dir = ../Forcing/gdas1-new
isotope_dir = ../isotope
hysplit = ../exec
/
Key parameters include:
basename
: Base name for output filesyears
,months
,hours
: Temporal parametersaltitudes
: Starting heights for trajectories (in meters)location
: Starting coordinates (latitude, longitude)runtime
: Length of back trajectories in hours (negative for back trajectories)- Directory paths:
working_dir
: HYSPLIT working directorystorage_dir
: Output storage locationmeteo_dir
: Meteorological data locationisotope_dir
: Isotope data location
-
Prepare your namelist file:
cp namelist/main.nml.template namelist/main.nml # Edit main.nml with your parameters
-
Run the main script:
python IsoHysplit.py namelist/main.nml
- Back trajectory calculation using HYSPLIT
- Multiple starting heights and times
- Configurable runtime and meteorological inputs
- Humidity along trajectories
- Pressure levels
- Moisture flux calculations
- Moisture uptake diagnostics
- Precipitable water δ18O and δD analysis
- Precipitation water δ18O and δD analysis
- Vapor water δ18O and δD analysis
- Integration with isotope data along trajectories
Set these options in the namelist file:
plot_bulktraj_with_humidity = True
plot_bulktraj_with_pressure = True
plot_bulktraj_with_moisture_flux = True
plot_bulktraj_with_moisturetake = True
plot_bulktraj_with_Precipitable_Water_Delta18O = True
plot_bulktraj_with_Precipitable_Water_DeltaD = True
- HYSPLIT format trajectory files
- Clipped versions for clustering analysis
- Reverse trajectories (if enabled)
- Trajectory data with meteorological parameters
- Moisture diagnostics
- Isotope compositions
- Trajectory maps with various parameters
- Moisture source regions
- Isotopic composition distributions
Common issues and solutions:
-
HYSPLIT executable not found:
# Check your namelist file hysplit path hysplit = ../exec
-
Missing meteorological data:
- Ensure GDAS1 data is present in meteo_dir
- Check file naming convention matches expected format
-
Isotope data issues:
- Verify isotope file format matches expected structure
- Check coordinate systems match between trajectory and isotope data
- Fork the repository
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- Open an issue on the GitHub repository
- Check existing documentation and issues
- Review the example namelist files in the namelist directory