|
Modelling clouds and climate |
Plotting |
| Path: Single Column Model > Plotting | |
|
Site Map
MOC2 Links:
Web Contact: Phil Austin Site created with Cheetah. Last updated: Mar 13 2003 |
UBC SCM uses NetCDF as a format for its data output. The plotting is done using the NCAR Command Language (NCL), designed specifically for the access, analysis, and visualization of data. It uses a publicly-available software packages that can very easily read NetCDF files. Plots Generated During the RunIf the plotting option in the scm run in turned on, a web page
sample_plots.html will be created right after the run. The page will contain
some selected plots at the start and at the end of the run's time steps located in
plots directory. Generating Plots After the RunThe code used, to generate plots for ubcscm is in the ubcscm model directory. The PathsThe first thing to set is the inputpath where the model NetCDF output files
can be found, and outputpath where the generated plots will be recorded to.
The defaults are set to be the current directory. Plot Info Listscmplot.py has a list plotinfo that has information for running different plots. The list takes the following vaules. First item in the list is filename. It is a NetCDF file with the ".nc" extension whose data will be used for plotting. The next item is outputfilename. This is what ncl will save it's output as. Then, it is the list of times in case timeplot is used. It specifies what time step of a variable to plot. It can contain multiple times and for each one a seperate plot will be drawn. If timeplot is not used, this value will be ingnored. Further, the kind of a plot (timeplot - plots data values against their pressure levels for a specific time step, dataplot - plots data value vs time, valueplot - makes a contour plot). Finally the wokrstation(skip, X11, eps, ps, ncgm, jpg, png, tif, pgf), which will either skip the plot, output it on the screen or save it in a given data format.The script will look into the list and it will make plots starting from the top of the list. If all workstations are set to 'skip', it will skip all the items in the list. Executing scmplot.pyTo generate plots, set the path and edit the list in the scmplot.py file and then type: Example of UBC SCM runshttp://www.eos.ubc.ca/research/moc2/report_index.html gives a short report on the outcome of the ubcscm runs for different data input cases with plots generated using scmplot.py. Converting to Other FormatsIf the plotting workstation is set to ps, eps, or ncgm, ncl will output the plots into
files with these formats. > ghostview thts.out.0.ps > ghostview thts.out.0.eps > idt thts.out.0.eps.ncgmTo convert ps and eps files into jpg and pdf, use the following scripts: > convert thts.out.0.ps thts.out.0.ps.jpg > ps2pdf thts.out.0.ps thts.out.0.ps.pdfHere are some extra tips when using these conversions:
convert multiple files: > for i in *.eps; do convert -append ${i} ${i}.jpg; done
make a small image: > convert -geometry 15% thts.out.0.eps thts.out.0.eps.jpg
append multiple pages: > convert -append thts.out.0.eps thts.out.0.eps.jpg
To view jpg or pdf files:> xv thts.out.0.eps.jpg > acroread thts.out.0.eps.pdf Reading NetCDF files using NCLIf a NetCDF file contains, say, two variables data and levels, ncl script can easily read this: afile = addfile(filename,"r") data = afile->data levels = afile->levels It can also very easily read the NetCDF global and variable attributes: varname = afile->data@name descrip = afile@description |