Image resize problem

From: Sahidul <sahidul_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 17 2010 - 06:29:05 MDT

Dear NCL users forum,

I am facing problem to resize the image created by following script:

We are not able to print the "text" using this following script i.e.,
required text is not writing in image file. Kindly help me to sort out this
problem

=================================
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

datadir = "/WRF/output/2010061600/"
date1="2010-06-16_00"
date2="2010-06-16_23"
date3="2010-06-17_23"
date4="2010-06-18_23"

FILES1 = systemfunc ("ls -1 " + datadir + "wrfout_d02_"+date1)
FILES2 = systemfunc ("ls -1 " + datadir + "wrfout_d02_"+date2)
FILES3 = systemfunc ("ls -1 " + datadir + "wrfout_d02_"+date3)
FILES4 = systemfunc ("ls -1 " + datadir + "wrfout_d02_"+date4)

wrf_out = addfile(FILES1+".nc","r")

  res = True
  opts = res
  opts@InitTime = False
  opts@Footer = False

; Total Rainfall calculation
;***********************************************************************
 rainc1 = wrf_user_getvar(wrf_out,"RAINC",0)
 rainnc1 = wrf_user_getvar(wrf_out,"RAINNC",0)

 wrf_out2 = addfile(FILES2+".nc","r")

; Total Rainfall calculation
;***********************************************************************
 rainc2 = wrf_user_getvar(wrf_out2,"RAINC",0)
 rainnc2 = wrf_user_getvar(wrf_out2,"RAINNC",0)
rain_tot2=((rainc2+rainnc2)-(rainnc1+rainc1))/10.
;***********************************************************************
 wrf_out3 = addfile(FILES3+".nc","r")

; Total Rainfall calculation
;***********************************************************************
 rainc3 = wrf_user_getvar(wrf_out3,"RAINC",0)
 rainnc3 = wrf_user_getvar(wrf_out3,"RAINNC",0)
rain_tot3=((rainc3+rainnc3)-(rainnc2+rainc2))/10.
;***********************************************************************
   wrf_out4 = addfile(FILES4+".nc","r")

; Total Rainfall calculation
;***********************************************************************
 rainc4 = wrf_user_getvar(wrf_out4,"RAINC",0)
 rainnc4 = wrf_user_getvar(wrf_out4,"RAINNC",0)
rain_tot4=((rainc4+rainnc4)-(rainnc3+rainc3))/10.

rain_tot2@description = ""
rain_tot3@description = ""
rain_tot4@description = ""
;***********************************************************************
;Open Workstation ps,eps,X11,pdf,ncgm
;***********************************************************************
 wks2 = gsn_open_wks("ps","precip_surf_day1")

  res@InitTime = False
  res@Footer = False
  res@gsnMaximize = True
  res@MainTitle = "Total Precipitation"

  opts@cnLinesOn = False
  opts@cnFillOn = True
  opts@cnLevelSelectionMode = "ExplicitLevels"
  ;opts@UnitLabel = "cm"
 ; opts@description = "Precipitation Rate"

  opts@cnLevels = (/ 1., 2., 5., 10., 15., 20., 25., 30.,
35., 40., 50./)
  opts@cnFillColors =
(/"white","seagreen1","green4","greenyellow","yellow","goldenrod1","goldenrod2","tomato","orangered",\
                                        "red","red2","red4"/)
  opts@cnInfoLabelOn = False
  opts@cnConstFLabelOn = False
  res@gsnMaximize = True ; must include w/ Paper Orientation
  res@gsnPanelBottom = 0.2 ; save space at bottom

   txres = True ; text mods desired

  pltres = True
  mpres = True
  mpres@mpOutlineBoundarySets = "National"
  mpres@mpNationalLineThicknessF = 1.5
  mpres@mpNationalLineColor = "Black"
  mpres@mpGeophysicalLineColor = "Black"
  mpres@mpGeophysicalLineThicknessF = 1.5
;***********************************************************************
     contour_tot2 = wrf_contour(wrf_out,wks2,rain_tot2,opts)
     plot = wrf_map_overlays(wrf_out,wks2,(/contour_tot2/),pltres,mpres)

;*********************plot1**************************************************
  txres@txFontHeightF = 0.013 ; font smaller. default big
  txres@txFont = "text-symbols"
  gsn_text_ndc(wks2,"S",0.12,.19,txres)
; page coordinates are normalized. go from 0->1 not 0->8" etc.
  txres@txFontHeightF = 0.015 ; font smaller. default big
  txres@txFont = "courier-bold"
  gsn_text_ndc(wks2,"CDAC",0.17,.19,txres)
  txres@txFontHeightF = 0.01 ; font smaller. default big
  txres@txFont = "courier"
  gsn_text_ndc(wks2,"(Continent Boundary may differ from Political boundary)
",0.6,.19,txres)
  frame(wks2) ; now advance frame
end
=================================

Thanking you in advance

Sahidul

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 17 06:29:12 2010

This archive was generated by hypermail 2.1.8 : Thu Jun 24 2010 - 14:10:27 MDT