Re: drawing from binary(grads) format file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 4 Dec 2006 09:41:22 -0700 (MST)

Hello,

You did not state the problem.
I do not see anything obviously wrong.

I speculate you are reading a file created on a
"big endian" machine" on a "little endian machine"
or vice-versa. See commented code below/

If this does not appear to be the problem, then
make the file available via the WWW or you can ftp to:

ftp ftp.cgd.ucar.edu
anonymous
email
cd incoming
put na_ano_cru_ts2_19502002_djfm.dat
quit

---
Also, I made some minor changes to your code.
Good luck
> Hi , 
> I'm NCL beginner. 
> I need help .
> 
> data period : 212 
> lat : 121 (20N-90N, 0.5 interval) grids
> lon : 241 (190-310, 0.5 interval ) grids
> Data value for North America except ocean is non-missing. 
> 
> I drew contour plot for 1st time. 
> But the figure using NCL was different from using Grads. 
> 
> I use the following NCL script. 
> 
> I want to draw exactly. 
> 
> Help me~
> Thank you ~
> 
> 
> 
********************************************************************************
***
>   latS   =  20 
>   latN   =  80 
>   lonL   = 190 
>   lonR   = 310 
    dlat   = 0.5
    dlon   = 0.5
    nlat   = floattoint((latN-latS)/dlat) + 1
    nlon   = floattoint((lonR-lonL)/dlon) + 1
    ntim   = 212
    yrStrt = 1950
    yrLast = 2161
   ;setfileoption("bin","ReadByteOrder","LittleEndian")
   ;setfileoption("bin","ReadByteOrder","BigEndian")
    
>   file1="na_ano_cru_ts2_19502002_djfm.dat"
    SLP   =  fbindirread(file1,0,(/ntim,nlat,nlon/),"float")
> 
>   SLP!0 = "time"
>   SLP!1 = "lat"
>   SLP!2 = "lon"
>   SLP@_FillValue = -999.999
    SLP_at_long_name  = "SLP"
    SLP_at_units      = "hPa"
 
    lat   = fspan(latS,latN,nlat)    
    lon   = fspan(lonL,lonR,nlon)
    time  = ispan(yrStrt,yrLast,1)
  
>   SLP&lat  = lat
>   SLP&lon  = lon
>   SLP&time = time
> 
>   res =  True
> 
>   res_at_mpMinLatF         = latS        
>   res_at_mpMaxLatF         = latN
>   res_at_mpMinLonF         = lonL
>   res_at_mpMaxLonF         = lonR
> 
>   res_at_cnFillOn          = True              
>   res_at_cnLineLabelsOn    = False            
>   res_at_gsnSpreadColors   = True           
> 
>   wks = gsn_open_wks("X11","SLP")
>   gsn_define_colormap(wks,"gui_default")       ; choose colormap
>   contour = gsn_csm_contour_map(wks,SLP(0,:,:),res)
  
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Dec 04 2006 - 09:41:22 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 05 2006 - 13:29:24 MST