This python library implements HySPLIT based trajectory modeling and analysis.
pip install hytraj
or
pip install git+https://github.com/pankajkarman/HyTraj.git
Latest documentation is available here. Improved documentation will come up shortly.
See this notebook for example usecase.
import hytraj as ht
from hytraj import HyTraj
met_type = "ncep_new"
dates = pd.date_range("2010-02-01", freq="24h", end="2010-02-10")
hy = HyTraj(stations, height, run_time, working, metdir, outdir, met_type)
data = hy.run(dates, njobs=7)
hy.plot(data["Neumayer"], vertical="alt", show=True)
from hytraj import HyCluster
labels = HyCluster(data).fit(kmax=10, method='KMeans')
from hytraj import HyHAC
trj = HyHAC(data)
labels = trj.fit(nclus=4, metric='sspd')
trj.plot_dendrogram()
from hytraj import HyReceptor, HyData
station = 'South Pole'
data = HyData(files, stations).read()[station]
model = HyReceptor(ozone, data, station_name="South Pole")
cwt = model.calculate_cwt(weighted=False)
pscf = model.calculate_pscf(thresh=0.95)
rtwc = model.calculate_rtwc(normalise=True)
model.plot_map(rtwc, boundinglats=[-55, -90])
-
HyTraj: Higher level implementation of Parallel Generation, reading and plotting of Trajectories (Recommended).
-
HyGen: Generation of Trajectories using various meteo datasets (NCEP and GDAS implemented).
-
HyControl: Generation of control files for parallel trajectory generation afterwards.
-
HyParallel: Parallel generation of trajectories using control files produced using HyControl.
-
HyData: Reading and binning trajectories data (NetCDF with xarray support).
-
HyCluster: Clustering of trajectories with KMeans using wavelet features.
-
HyHAC: Clustering of trajectories with Hierarchical Agglomerative Clustering (HAC) using various trajectory distance metric like DTW, EDR, LCSS, SSPD, Frechet Distance, Hausdorf Distance.
-
HyReceptor: Single site Receptor Modeling ( both weighted and unweighted):
- Concentration weighted Trajectory (CWT)
- Potential Source Contribution Function (PSCF)
- Residence Time Weighted Concentration (RTWC)
- Support for more meteorology like ERA5.
- Add documentation.
- GUI: Medium-term goal
PS: Find pre-built HYSPLIT executable at this link and copy executeble to working directory.