Re: plotting subset of a grid

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 02 2012 - 16:00:05 MDT

Are you getting any kind of error message?

If you are running this interactively, and trying to view the image while you are still in interactive mode, then you may need to do:

  delete(wks)

before you try to view the file.

Can you put the file on our anonymous ftp?

http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP

Thanks,

--Mary

On Jul 2, 2012, at 9:59 AM, ousmane ndiaye wrote:

> Hi Mary
> Thank you unfortunately the ps file is 0K (ie nothing in there)
> ==
> 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/csm/contributed.ncl"
>
> in = addfile("EnsECMWFoutput2011_.grib2","r");
> rr=in->tp_P11_L1_GLL0_acc(1,92,1,{12.5:17},{342:349})
>
> wks = gsn_open_wks("ps","test") ;
> gsn_define_colormap(wks,"rainbow")
> res = True
> res@mpMinLatF = min(rr&lat_0)
> res@mpMaxLatF = max(rr&lat_0)
> res@mpMinLonF = min(rr&lon_0)
> res@mpMaxLonF = max(rr&lon_0)
> res@tiMainString = "This is a title"
> res@gsnMaximize = True
> res@gsnAddCyclic=False
> plot = gsn_csm_contour_map(wks,rr,res)
>
> ===
> ncl 21> print(rr)
>
> Variable: rr
> Type: float
> Total Size: 600 bytes
> 150 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat_0 | 10] x [lon_0 | 15]
> Coordinates:
> lat_0: [12.5..17]
> lon_0: [342..349]
> Number Of Attributes: 14
> forecast_time0 : 48
> initial_time0_hours : 1854684
> ensemble0 : 1
> center : European Center for Medium-Range Weather Forecasts
> production_status : TIGGE Operational products
> long_name : total precipitation
> units : kg/m^2
> _FillValue : 1e+20
> grid_type : Latitude/longitude
> parameter_discipline_and_category : Meteorological products, Moisture
> parameter_template_discipline_category_number : ( 11, 0, 1, 52 )
> level_type : Ground or water surface
> type_of_statistical_processing : Accumulation
> statistical_process_duration : initial time to forecast time
>
>
> On Mon, Jul 2, 2012 at 2:47 PM, Mary Haley <haley@ucar.edu> wrote:
> Hi,
>
> Thanks for providing your short script and the output from printVarSummary.
> I don't have quite enough information, though.
>
> What kind of plot do you get when you run this script? Do you get any errors?
> If you get errors, please cut-and-paste the full error and include that in
> an email to nc-talk.
>
> If you can also include the test.ps file, that would be helpful.
>
> One thing you can try: if you are looking at a very small area on the map,
> then you may need to set some resources to zoom in on the map.
>
> The "easiest" way to do this is with these resources:
>
> res@mpMinLatF = min(rr&lat_0)
> res@mpMaxLatF = max(rr&lat_0)
> res@mpMinLonF = min(rr&lon_0)
> res@mpMaxLonF = max(rr&lon_0)
>
> --Mary
>
>
> On Jul 1, 2012, at 4:34 PM, ousmane ndiaye wrote:
>
> > Hi all,
> > I try to extract data over senegal (country) but I cannot plot the data, any help ?
> > here is my script and the content of the variable rr
> > ==
> >
> > 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/csm/contributed.ncl"
> > in = addfile("EnsECMWFoutput2011_.grib2","r");
> > rr=in->tp_P11_L1_GLL0_acc(1,92,1,{12.5:17},{342:349})
> > wks = gsn_open_wks("ps","test") ;
> > gsn_define_colormap(wks,"rainbow")
> > res = True
> > res@gsnAddCyclic=False
> > plot = gsn_csm_contour_map(wks,rr,res)
> >
> > ==
> > ncl 11> print(rr)
> > Variable: rr
> > Type: float
> > Total Size: 600 bytes
> > 150 values
> > Number of Dimensions: 2
> > Dimensions and sizes: [lat_0 | 10] x [lon_0 | 15]
> > Coordinates:
> > lat_0: [12.5..17]
> > lon_0: [342..349]
> > Number Of Attributes: 14
> > forecast_time0 : 48
> > initial_time0_hours : 1854684
> > ensemble0 : 1
> > center : European Center for Medium-Range Weather Forecasts
> > production_status : TIGGE Operational products
> > long_name : total precipitation
> > units : kg/m^2
> > _FillValue : 1e+20
> > grid_type : Latitude/longitude
> > parameter_discipline_and_category : Meteorological products, Moisture
> > parameter_template_discipline_category_number : ( 11, 0, 1, 52 )
> > level_type : Ground or water surface
> > type_of_statistical_processing : Accumulation
> > statistical_process_duration : initial time to forecast time
> > ===
> >
> >
> > _______________________________________________
> > 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 2 16:00:19 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 03 2012 - 15:40:39 MDT