colors of trajectories

Topics about the HYSPLIT trajectory model.
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

colors of trajectories

Post by Martina »

Hi all,

I am currently comparing trajectories from different meteorological datasets and some specific locations and I'm struggling a bit with the colouring.
I would like to have at each of my points the same colour per model.

First I simply run hysplit once per model - each time with my 3 points. However what ever options I used with the -k options in trajplot, I only got different colours per point, but not per model.
Then I did it the other way around: looping over my 3 points and running for each of it hysplit with the different meterological datasets.
This worked well as long as I had 3 models with the command

Code: Select all

 ${MDL}/exec/trajplot -i+filelist -otrajplot_${number}.ps -g0:1200 -h71:-45
where filelist contains my different trajectories in the order
point1model1
point1model2
point1model3
point2model1
point2model2
point2model3
point3model1
point3model2
point3model3

But now I have four models, and I can't convince trajplot to use more than 3 colours and thus I do not have anymore one colour per model at each point, but at the first point one trajectory of color 1, one of color 2 and two of color 3 - and similar at the other points.
I tried -k12:123412341234 and -k4:1234 and k12:111222333444, but nothing is giving me the effect that I'm looking for. Basicly whatever I put leads to haveing one and the same colour everywhere!

Is there anyway to prescribe the colors? Did I misunderstood the use of the -k option?

Also, I was wondering, is there a simple way to set up a legend, i.e. saying that color red corresponds to model 1, color blue to model 2 etc?

Thanks a lot for your help,
Martina
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

Re: colors of trajectories

Post by Martina »

Hi,

ok, true, so far I wasn't exploring the options of doing the plots outside of hysplit!
I'll be away now for around a week, but I'll look into that option then once I'm back.
What I liked so far with trajplot was that I could run it directly from my script (it would be difficult otherwise since I'm looping over days, points and meteodata) and do get one single pdf-file with multiple pages with all my runs by pressing one button. So I would be hoping to get something similar also with MeteoInfo (at least the plotting part, even if the simulation part would be done separately).

Thanks for your advice,
Martina
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

Re: colors of trajectories

Post by Martina »

That sounds great, I would be looking foward to that!

Martina
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

Re: colors of trajectories

Post by Martina »

Hi all,

after the traveling and spending time on other projects, I'm no back to my trajectory-hysplit projects.
I tried now the plotting with MeteoInfo and I agree, it works very nicely - a pity however that there wasn't any feedback from any hysplit (non MetoInfo) users or developpers :-(.
I started now looking into the usage of scripts in MeteoInfo, since all the clicking otherwise is too timeconsuming and not possible when working with my larger simulation sets. For the start I have one main question: The documentation about scripts that I found deals with the "normal" MeteoInfo version, while I'm using the Java Version.
Is it also possible to do that also with the Java Version and could someone outline if so the basic steps (instead of the usage of MIScript.exe)? Or maybe you could point me to some other documentation? (I'm had some troubles to install the normal MeteoInfo version, so I'd like to know if I should now go back to that or if I can continue with the Java version.)

Thanks,
Martina
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

Re: colors of trajectories

Post by Martina »

Thanks a lot for these examples, that gives me a good starting point for my own work.
I have solved in the meanwhile also my actual question of my last post, when I was wondering what to do instead of using MIScript.exe + script. I realized that I could simply put these scripts in the Script window from the Java version and everything works fine now.

Thanks!
Martina
Martina
Posts: 21
Joined: September 27th, 2013, 10:26 am
Registered HYSPLIT User: No

Re: colors of trajectories

Post by Martina »

Hi Yaqiang,

I am makeing progress with my jython scripts, however there is a few points that I'm struggling with.

First, is there any kind of documentation? I found a chinese forum which I google translated partly but didn't really found what I'm looking for. For the moment I'm just using javap -v on the *.class files in the MeteoInfo.jar, but it's not a very handy way of getting infos about existing attributes and subroutines....

In your example scripts:
What kind of object is "miapp"? Why is it nowhere defined in your script? I tried things like miapp = mdi.app(), but that's not going to work, so somehow it's automatically created. Can I create it also by myself to use the script outside of the GUI?

Then I was trying to add my background image (currently it's a shapefile or an imagefile), so I was searching for the equivalent of createTrajLineLayer() or createRasterLayer() but couldn't find anything that would digest my input files.

Then I need to make several separate figures, however all my figures are the same and contain what should be distributed over severals:

Code: Select all

for day in days:
       # Add the layers into the MeteoInfo application (miapp)
       mf = miapp.getMapDocument().getActiveMapFrame()
       #...
       #.... do some stuff
       mf.addLayer(trajLayer)
       # Output figure
       figfile='Traj_figure_day'+day+'.png' #this fig should only contain what was drawn on the iteration "day"
       if os.path.isfile(figfile):
	         os.remove(figfile)
       figurefn = os.path.join(outDir,figfile)
       miapp.getMapDocument().getMapLayout().exportToPicture(figurefn)
I tried to use difference instances of mf, but that didn't help, my feeling is that I somehow would need different MapDocument or even several miapps?

And last but not least the legends are working fine in the sens that the colors are chosen as I like it, however the legend is not depicted on the figure. How can I switch it on and place it in a suitable place? Could give me a hint in which of the class file to find the corresponding commands?

Thanks a lot for your support.

Martina
Post Reply

Return to “Trajectory Model”