NCL
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
NCL
Dear users,
I am thinking to move on NCL to get ROMS figures instead of Matlab
so I am collecting scripts .ncl for vecplots and other fields..
If you are willing to share you'll save me a lot of time
Thanks in advance!
Cheers, Ivica
I am thinking to move on NCL to get ROMS figures instead of Matlab
so I am collecting scripts .ncl for vecplots and other fields..
If you are willing to share you'll save me a lot of time
Thanks in advance!
Cheers, Ivica
- arango
- Site Admin
- Posts: 1356
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Plotting is a matter of taste. I personally stay away from plotting software that does not have vector graphics in their core. However, I do use Matlab as a scientific tool but it takes a lot of skill and experience to produce high quality plots for publications. In publications, we usually need to reduce the size of the plots which affects lines, labels, and text fonts. Post-processing software (CorelDraw, Adobe, etc) is required to edit the plot. Reducing or enlarging raster plots gives unsatisfactory results. This is not a problem in vector graphics.
ROMS output is CF compliant so any NetCDF browser tool can be used to plot. The quality of plots is not that great for publications but good enough to examine your results. Some of these browsers plot the vertical terrain-following coordinates correctly because of the CF compliant attributes:
ROMS also has its own
plotting package which it is in the svn repository. This plotting package has been developed over the last 15 years. It is quite complex but easy to use. It is a collection of F77 routines that use
NCAR's GKS plotting library which is now part of NCL. Kate has mentioned in the past her desire to use the NCL capability of the NCAR package to plot ROMS results. The resulting plots are vector. The text labels are also vector but it can use some improvement.
We added a lot information in WikiROMS about the ROMS
plotting package. It is easy to install, use, and it is free
.
ROMS output is CF compliant so any NetCDF browser tool can be used to plot. The quality of plots is not that great for publications but good enough to examine your results. Some of these browsers plot the vertical terrain-following coordinates correctly because of the CF compliant attributes:
Code: Select all
double s_rho(s_rho) ;
s_rho:long_name = "S-coordinate at RHO-points" ;
s_rho:valid_min = -1. ;
s_rho:valid_max = 0. ;
s_rho:standard_name = "ocean_s_coordinate" ;
s_rho:formula_terms = "s: s_rho eta: zeta depth: h a: theta_s b: theta_b depth_c: hc" ;
double s_w(s_w) ;
s_w:long_name = "S-coordinate at W-points" ;
s_w:valid_min = -1. ;
s_w:valid_max = 0. ;
s_w:standard_name = "ocean_s_coordinate" ;
s_w:formula_terms = "s: s_w eta: zeta depth: h a: theta_s b: theta_b depth_c: hc" ;
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
We added a lot information in WikiROMS about the ROMS
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Thanks for the reply,
I have installed week ago
, plotting stuff from roms svn, I am using it but seems to me it's easier to use scripts like .ncl where one can change more options like res@ and so on on the fly...
At think that on the wiki you should put ncargwww and ncarg2gif commented that It can be used with Image magic convert (have more/less every linux machine) and that there is no need to install imtools (which I could not on linux machine).... putting some example .in file for doing vectors would help and attract more people to use it.. I do need this stuff for batch script run by crontab without DISPLAY, and not fooling matlab with vncserver and all other dirty techniques in order to get .gif or .png for web....
Sure, for publications I use matlab, for fast preview of like frc fields ncview and so on.. .NCL seems more mature in nowdays than it was before...
I was hopping that Kate is having collection of .ncl scripts, know she is doing a lot with ncl ....
Cheers, Ivica
I have installed week ago
![Wink :wink:](./images/smilies/icon_wink.gif)
At think that on the wiki you should put ncargwww and ncarg2gif commented that It can be used with Image magic convert (have more/less every linux machine) and that there is no need to install imtools (which I could not on linux machine).... putting some example .in file for doing vectors would help and attract more people to use it.. I do need this stuff for batch script run by crontab without DISPLAY, and not fooling matlab with vncserver and all other dirty techniques in order to get .gif or .png for web....
Sure, for publications I use matlab, for fast preview of like frc fields ncview and so on.. .NCL seems more mature in nowdays than it was before...
I was hopping that Kate is having collection of .ncl scripts, know she is doing a lot with ncl ....
Cheers, Ivica
- arango
- Site Admin
- Posts: 1356
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
We do this all the time. Notice that any of the plotting input files cnt.in, ccnt.in, sec.in, and csec.in can be put in scripts. Check the following script plot/src/Bin/plt_html.sh to see how this is done. This script was used to generate the following
images.
We have used similar scripts to generate hundreds of plots automatically. Mostly all the plots in the Applications menu of the ROMS website use such scripts. For example, check the forecast experiments in the
Philippine Archipelago and
Intra-Americas Sea. We have a single script that process input data, run the model, assimilate data, and send the plots to the website. Of course, some experience is required to write all these scripts. Pretty neat, ha?
We have also done animations with such scripts.
Yes, we have versions of ncargwww and ncar2gif for Linux computers which uses convert instead of imconv. These scripts are well documented and easy to follow. I will load a newer ncarg2gif to the svn repository. I missed that one.
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
We have used similar scripts to generate hundreds of plots automatically. Mostly all the plots in the Applications menu of the ROMS website use such scripts. For example, check the forecast experiments in the
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
We have also done animations with such scripts.
Yes, we have versions of ncargwww and ncar2gif for Linux computers which uses convert instead of imconv. These scripts are well documented and easy to follow. I will load a newer ncarg2gif to the svn repository. I missed that one.
There are a couple scripts in http://people.arsc.edu/~kate/NCL/
roms_sst.ncl plots SST with the correct map - it was written by one of the NCL folks at NCAR and is very close to the ROMS example on their site. Change gsn_csm_contour_map to gsn_csm_contour for square box coordinates. stations.ncl is for plotting stations. I'm afraid we don't yet have the full functionality of Hernan's plotting package, though I think there is a set_depth code around somewhere too.
roms_sst.ncl plots SST with the correct map - it was written by one of the NCL folks at NCAR and is very close to the ROMS example on their site. Change gsn_csm_contour_map to gsn_csm_contour for square box coordinates. stations.ncl is for plotting stations. I'm afraid we don't yet have the full functionality of Hernan's plotting package, though I think there is a set_depth code around somewhere too.
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Thanks Kate;
I find Hernan's ploting stuff very usefull and have installed it without a problem. More over, I would like to change vector's color and so on, play little bit with contour @res and other options, add something and put it to run via cron (without DISPLAY which matlab req.).. so I think .ncl are usefull as well, hoping that one have made vector plot via .ncl by reinteroplating at rho points or using 1/2 offset...
Cheers, Ivica
I find Hernan's ploting stuff very usefull and have installed it without a problem. More over, I would like to change vector's color and so on, play little bit with contour @res and other options, add something and put it to run via cron (without DISPLAY which matlab req.).. so I think .ncl are usefull as well, hoping that one have made vector plot via .ncl by reinteroplating at rho points or using 1/2 offset...
Cheers, Ivica
For those of you which are struggling with Matlab plotting without a display, there is a way to by-pass this.
If you print the plots in *.ps with -cymk -painters options, it works even without a display.
Then you can convert your *.ps in whatever format you want outside Matlab (I personally use mogrify from ImageMagick in LINUX).
If you print the plots in *.ps with -cymk -painters options, it works even without a display.
Then you can convert your *.ps in whatever format you want outside Matlab (I personally use mogrify from ImageMagick in LINUX).
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
model time
I have problem using plotting package when I use TIMEREF=-2,
so I have offset of datenum(1968,23,5) which is state in @units and not in the add_offset ....
Should I change opencdf.F where are attributes checked to get right offset?
Thanks
Ivica
so I have offset of datenum(1968,23,5) which is state in @units and not in the add_offset ....
Should I change opencdf.F where are attributes checked to get right offset?
Thanks
Ivica
- arango
- Site Admin
- Posts: 1356
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
You don't need to change any code. The plotting program will figure out internally that your time coordinates are modified Julian day numbers. The year and starting year-day in the plotting input scripts will be ignored. You can set it:
and the plotting programs will give you the correct date in the plot label. Notice that you can still plot if you do
but not time dates will be used in the label.
Also, try
to see what dyou get. You can manipulate all these parameters to junk for a specific day to plot.
Code: Select all
2008 0 : year and starting year-day (use yearday<0, for no time label)
Code: Select all
2008 -1 : year and starting year-day (use yearday<0, for no time label)
Also, try
Code: Select all
0 FRSTD : first day to plot
0 LASTD : last day to plot
0 DSKIP : plot every other DSKIP days (0.0 plot at its own time frequency)
Re: NCL
Hi Kate,
Can you kindly give my your NCL scripts to plot the output of the ROMS model.
I can not to connect to the link "http://people.arsc.edu/~kate/NCL/"
Here is my email address "ntmanh18196@gmail.com".
Thank you very much!
Bests,
Manh,
Can you kindly give my your NCL scripts to plot the output of the ROMS model.
I can not to connect to the link "http://people.arsc.edu/~kate/NCL/"
Here is my email address "ntmanh18196@gmail.com".
Thank you very much!
Bests,
Manh,
Re: NCL
This is not the time to start learning NCL. Support for NCL development has been dropped and the focus is now on developing Python tools instead.
While we have some plotting capability in pyroms, it too is now out of date, what with the rapid development in new Python tools. I am hardly the expert on this stuff any more.
While we have some plotting capability in pyroms, it too is now out of date, what with the rapid development in new Python tools. I am hardly the expert on this stuff any more.
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Re: NCL
If you really want to stick to NCL, still you can.
Getting on the NCL web site and going on Models/ROMS:
https://www.ncl.ucar.edu/Applications/roms.shtml
You can have basic scripts (and roms_utils.ncl) that Kate and myself contributed long time ago.
PyNGL is advertised as future development of NCL and it is quite easy to step forward (even if you don't want to use other python tools).
I am using pyNGL in my operational setup and developed whole suite around it to produce automatic plots etc...
Ivica
Getting on the NCL web site and going on Models/ROMS:
https://www.ncl.ucar.edu/Applications/roms.shtml
You can have basic scripts (and roms_utils.ncl) that Kate and myself contributed long time ago.
PyNGL is advertised as future development of NCL and it is quite easy to step forward (even if you don't want to use other python tools).
I am using pyNGL in my operational setup and developed whole suite around it to produce automatic plots etc...
Ivica
Re: NCL
Dear Ivica,
Can you kindly give me some scripts to plot the output of the ROMS model.
I've tried to compile the plotting package of ROMS but it still failed.
Thank you very much!
Best regards,
Manh
Can you kindly give me some scripts to plot the output of the ROMS model.
I've tried to compile the plotting package of ROMS but it still failed.
Thank you very much!
Best regards,
Manh
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Re: NCL
Mate,
you should familiarize with ROMS and python if you want to use pyNGL (and on top of that some knowledge of NCL would help).
My scripts, as I wrote you before, are elaborated version with multi model config files etc. and are not easily transferable to your (or any) system without effort.
For example, operational systems https://oceangliders.ecm.uwa.edu.au/Model/model.php is using pyNGL engine to plot ROMS and WRF model outputs, similar in http://bora.gekom.hr/ but on top of that unstructured waves.
You can use any pyNGL example (from the web page, do the homework), load in python any ROMS field and then do NGL.contour or vecotr or whatever you want (even overlays). There is no silver bullet that will do all for you.
Good luck,
I
you should familiarize with ROMS and python if you want to use pyNGL (and on top of that some knowledge of NCL would help).
My scripts, as I wrote you before, are elaborated version with multi model config files etc. and are not easily transferable to your (or any) system without effort.
For example, operational systems https://oceangliders.ecm.uwa.edu.au/Model/model.php is using pyNGL engine to plot ROMS and WRF model outputs, similar in http://bora.gekom.hr/ but on top of that unstructured waves.
You can use any pyNGL example (from the web page, do the homework), load in python any ROMS field and then do NGL.contour or vecotr or whatever you want (even overlays). There is no silver bullet that will do all for you.
Good luck,
I