Re: Making BIG images

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Tue, 02 Jun 2009 15:48:59 -0600

Don,

I have had good luck making large hi-rez GIF images for web with
NCL's "experimental PNG driver". It is described as problematic,
but so far I have not had any trouble.

   http://www.ncl.ucar.edu/FAQ/#o_formats_003
   http://www.ncl.ucar.edu/Support/talk_archives/2008/1151.html

Use the special attributes on workstation type to increase the pixel
size of the PNG output frame. Then use NCL plot routines in the
usual way.

   rez = 2000 ; makes 2000 x 2000 pixel PNG
   output = "png"
   output_at_wkWidth = rez ; must be square; deviations
   output_at_wkHeight = rez ; either way seem to be wasted
   wks = gsn_open_wks (output, outfile)

Optionally, use ImageMagick to reduce or remove any unwanted white
border. The following command works for me and makes a lossless
conversion, no blurring of pixels with our current version of
convert. HTH.

   convert -trim out.png out.gif

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/psd1/

Don Morton wrote:
> Hi,
>
> I'm sure this must be trivial, and perhaps not an NCL issue, but the
> solution has eluded me.
>
> I'm posting some forecast graphics to the web, and users would like them
> to be larger, but without a sacrifice in resolution. To date, I've been
> able to use gsnPaperWidth and gsnPaperHeight resources to accomplish
> this, but I end up with only a portion of the image - it seems like my
> viewing device wants to continue treating the image as if it were being
> displayed on 8.5" x 11.0" media.
>
> I've reduced the problem to a very simple script (see below). I run the
> script to produce "Big.ps" and when I view it using "gs" or "gv" it only
> shows me the left bottom section. However, by playing with page sizes
> in "gv" I can get more or less of the image. So, I suspect that NCL is
> probably doing what it should, and that my problems stem from my
> ignorance in dealing with different media types.
>
> Once I get "Big.ps" I try to use ImageMagick to convert to GIF
>
> convert Big.ps Big.jpg
>
> but Big.jpg ends up, again, being only a partial image.
>
> Is there something I should be setting in NCL, or are there a set of
> flags I should use with "convert" to ultimately get the full, but
> bigger, image in GIF or PNG format?
>
> Thanks for any help. My simplified script follows:
>
> ; Include files
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
>
> wrfoutFile =
> "/projects/ARSCWTHR/ForecastProducts/AKTrial2/wrfout/2009052612/wrfout_d03_2009-05-30_09:00:00.nc"
> ; Full path to the wrfout file
>
> f = addfile(wrfoutFile,"r") ; Opens the netCDF file
>
> wks = gsn_open_wks("ps", "Big") ; Open a workstation for plotting
>
> gsn_define_colormap(wks,"WhViBlGrYeOrReWh") ; Define the colormap
>
> ;;;;;;;;;;;;;; Temperature plot ;;;;;;;;;;;;;;;
>
> tc = wrf_user_getvar(f, "tc", 0) ; T in deg C
> tc2d = tc(0,:,:)
>
> res = True
> res_at_gsnMaximize = True ; Maximize size of plot
> res_at_gsnPaperOrientation = "auto"
> res_at_gsnPaperWidth = 17.0
> res_at_gsnPaperHeight = 22.0
>
> plot = gsn_contour(wks, tc2d, res) ; Plot the data
>
> end
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 02 2009 - 15:48:59 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 03 2009 - 12:52:48 MDT