No problem Erik. Good Luck.
Mary, thank you. I tried sending the printVarSummaries as an
attachment. The cmorph page says that the arrays of data go from
0.125E eastward and from 59.875N southward at .25 grid increments. I
tried using the area_hi2lores to grid this data at 1/2 degree grid
increments.
-Bold
On Fri, Jun 12, 2009 at 11:22 PM, Erik Noble<enoble_at_giss.nasa.gov> wrote:
> My sincere apologies Bold. I responded to your email string thinking it was
> answer to my question. I think we are working on the same thing.
> -Erik
>
>> On Fri, Jun 12, 2009 at 4:56 PM, Mary Haley <haley_at_ucar.edu> wrote:
>>>
>>> I can't tell from your script which variable you're trying to plot.
>>> Some of your latitude values are going from -179.625 to 59.875
>>> which is not correct.
>>>
>>> However, it looks like from your graphic that the longitude values are
>>> not quite right.
>>>
>>> Do a "printVarSummary" on the variable you're plotting to make sure
>>> your latitude and longitude ranges are what you'd expect. You can
>>> email me the output if you're not sure.
>>>
>>> --Mary
>>>
>>>
>>>
>>> On Fri, 12 Jun 2009, B N wrote:
>>>
>>> > Hi. Thank for all of the earlier help to help this newbie. 100 thank
>>> > you's :-)
>>> >
>>> > I am now using the area_hi2lores to regrid precipitation data (CMORPH)
>>> > from a hi resolution grid to a lo resolution grid.
>>> > Although I'm not getting an immediate error with my script, I am
>>> > getting bad output. I use the script below to extract the global
>>> > cmorph data from its original binary format, create meta data, then I
>>> > try to use the area_hi2lores function. (po = area_hi2lores_Wrap
>>> > (CMORPH_rate&lon,CMORPH_rate&lat, CMORPH_rate , True, 1, LON, LAT,
>>> > False) in the script).
>>> >
>>> > When I look at my results only cover half of the world. Its supposed
>>> > to be global.
>>> > Picture is attached to show my result. My terminal log is attached too.
>>> >
>>> > Could I have a few suggestions on how to fix this?
>>> > Sincerely,
>>> > BOLD
>>> >
>>> > ; NCL script that reads in multiple NOAA CMORH precipitation where
>>> > each file contains
>>> > ; 16 direct access binary ("big_endian") records, which are 2
>>> > variables at 3-hourly
>>> > ; intervals for 1 day (8 pairs)
>>> > ; MAKE SURE ONLY CMORPH FILES YOU WANT TO PROCESS ARE PRESENT IN
>>> > DIRECTORY
>>> > ;************************************************
>>> > 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"
>>> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>>> > load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>>> > ;************************************************
>>> > DATADir = "./" ; path to your data must have trailing "/"
>>> > InFILE = "*_3hr-025deg_cpc+comb"
>>> > FILES = systemfunc("ls " + DATADir + InFILE ) ; root of data file
>>> > numFILES = dimsizes(FILES)
>>> > ;=============================
>>> > ; create lat and long coordinate variables from CMORPH
>>> > documentation
>>> > ;============================
>>> > nlat = 480
>>> > mlon = 1440
>>> > lat = 59.875 - ispan(0,nlat-1,1)*0.25
>>> > lon = 0.125 + ispan(0,mlon-1,1)*0.25
>>> > lat!0 = "lat"
>>> > lat&lat = lat
>>> > lat_at_units = "degrees_north"
>>> > lon!0 = "lon"
>>> > lon&lon = lon
>>> > lon_at_units = "degrees_east"
>>> >
>>> > count = 0
>>> > do ifil = 0, numFILES-1 ; BIG FILES LOOP ; NEW file loop
>>> > ;===================
>>> > ; create time variable
>>> > ;===================
>>> > year = 2006 ; start year or make part of the loop
>>> > month = 09 ; start month or make part of loop
>>> > day = ifil+1
>>> > ;print(day)
>>> > yyyymmdd = year*10000 + month*100 + day
>>> > ntime = 8
>>> > time = yyyymmdd*100 + ispan(0,21,3)
>>> > time!0 = "time"
>>> > time_at_units = "yyyymmddhh"
>>> > time&time = time
>>> > ;print(time)
>>> > ;=======================================
>>> > ;Create Array of Variables in binary data
>>> > ;=======================================
>>> > ntimes = 8 ; 3hourly data in 1 day equals eight intervals
>>> > CMORPH_rate = new ( (/ntime,nlat,mlon/), "float")
>>> > comb_MW_global = CMORPH_rate
>>> > ;========================================
>>> > ;Read in Binary
>>> > ;========================================
>>> > fName = FILES(ifil)
>>> > setfileoption ("bin", "ReadByteOrder", "BigEndian")
>>> > ntim = 1
>>> > do i = 0, 14,2 ; CMORPH binary file contains 16 records.
>>> > NCL
>>> > starts at counting at 0
>>> > print ("====== Binary Record= "+(i+1) +"/ NCL Record Counter
>>> > "+(i)+" ======")
>>> > comb_MW_global(i/2,:,:) =
>>> > fbindirread(fName,i,(/ntim,nlat,mlon/),"float")
>>> > print ("====== Binary Record= "+(i+2) +"/ NCL Record Counter
>>> > "+(i+1)+" ======")
>>> > CMORPH_rate(i/2,:,:) = fbindirread(fName,
>>> > i+1,(/ntim,nlat,mlon/),"float")
>>> > end do
>>> > ;=============================
>>> > ; name dimensions of variables
>>> > ;============================
>>> > comb_MW_global!0 = "time"
>>> > comb_MW_global!1 = "lat"
>>> > comb_MW_global!2 = "lon"
>>> > comb_MW_global&time = time
>>> > comb_MW_global&lat = lat
>>> > comb_MW_global&lon = lon
>>> > comb_MW_global_at_long_name = "merged microwave precipitation"
>>> > comb_MW_global_at_units = "mm/hr"
>>> > comb_MW_global@_FillValue = -9999
>>> > printVarSummary(comb_MW_global)
>>> >
>>> > CMORPH_rate!0 = "time"
>>> > CMORPH_rate!1 = "lat"
>>> > CMORPH_rate!2 = "lon"
>>> > CMORPH_rate&time = time
>>> > CMORPH_rate&lat = lat
>>> > CMORPH_rate&lon = lon
>>> > CMORPH_rate_at_long_name = "CMORPH"
>>> > CMORPH_rate_at_units = "mm/hr"
>>> > CMORPH_rate@_FillValue =-9999
>>> >
>>> > ;;;;;;;;;;;;;;;;;;;;;USE NCL's lonflip command to flip the longitudes
>>> > to go from -180 to 180 instead of 0 to 360
>>> > CMORPH_rate = lonFlip(CMORPH_rate)
>>> > printVarSummary(CMORPH_rate)
>>> > ;==============================
>>> > ;;;;;;;;;;;;;;USE NCL's area_hi2lores function for precipitation
>>> > ;;;;;;;;;;;;;; I want to regrid from default .25x.25 grid to 0.5x0.5
>>> > grid
>>> >
>>> > LAT = 59.875 - ispan(0,nlat-1,1)*0.50
>>> > LON = 0.125 + ispan(0,mlon-1,1)*0.50
>>> > po = area_hi2lores_Wrap (CMORPH_rate&lon,CMORPH_rate&lat, CMORPH_rate
>>> > , True, 1, LON, LAT, False)
>>> >
>>> > ;;;;DO I need to use lonFlip again?????
>>> > po = po(:,::-1,:)
>>> > po = lonFlip(po)
>>> > printVarSummary(po)
>>> > printMinMax(po,True)
>>> > ;======================
>>> > ; Create NetCDF Ouput File of day
>>> > ;======================
>>> > ncout ="Test_"+yyyymmdd+"_CMORPH_3hr-050deg.nc"
>>> > system("/bin/rm -f "+ncout)
>>> > a = addfile(ncout,"c") ; write netCDF file
>>> > a_at_title = " CMORPH and Combined MW Precipitation 3-hourly data"
>>> > a_at_source =
>>> > "ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/3-hourly_025deg"
>>> > filedimdef(a,"time",-1,True) ; make time an UNLIMITED
>>> > dimension, always recommended
>>> > ;=============================
>>> > ;Place Contents into NetCDF file
>>> > ;=============================
>>> > a->CMORPH_RATE = po;
>>> > end do
>>> >
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
Received on Sat Jun 13 2009 - 07:16:46 MDT
This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT