TrajStat icon indicating copy to clipboard operation
TrajStat copied to clipboard

Can this be used as a Java library?

Open kxygk opened this issue 4 years ago • 2 comments

Sorry if this is a naiive question - but can TrajStat and MeteoInfo in general be used as a normal Java library? ( I see MeteoInfo is on Maven, but TrajStat is not)

I'd like to run some HYSPLIT trajectories to do moisture tracebacks from a small open source Java/Clojure application I'm writing, and I'd great if I could run HYSPLIT tracebacks without calling out to an external program - but I'm not sure if that's possible/realistic.

Maybe the whole project isn't really setup to be used as library? From the documentation it looks like it's just a GUI interface with only Python scripting extensability but I thought I'd check first :) Maybe there are Java examples elsewhere

Thank you for this great project!

kxygk avatar Aug 11 '21 09:08 kxygk

Yes, TrajStat can also be used as a Java library. But the external HYSPLIT excutable file was used for the trajectory calculation function in TrajStat.

Yaqiang avatar Aug 11 '21 12:08 Yaqiang

Ah okay. I see it now

_trajExcuteFileName = workDir + File.separator + "hyts_std.exe";   

https://github.com/meteoinfo/TrajStat/blob/78d368d94b18133da0a86b137ed71972bb146972/src/main/java/org/meteothink/trajstat/trajectory/TrajConfig.java#L44

So this wouldn't run on Linux without modifications anyway

I misunderstood. I thought this was a re-implementation of the HYSPLIT algorithm on the JVM

I was hoping to avoid haven't to deal with that FORTRAN monster haha - but in this case I may have an easier time calling it myself instead of dealing with a layer of indirection :)

Thanks for getting back to me so quickly

kxygk avatar Aug 11 '21 12:08 kxygk