[ncl-talk] adding Cmorph binary files
Geeta Geeta
geetag54 at yahoo.com
Sun Jan 24 09:57:04 MST 2016
I have to add the 24 binary rainfall files (cmorph) and get one rainfall variable that has 24 hours data.
Following the part of the script used for reading the rainfall.
; ----Defining for Once -----
wks = gsn_open_wks("ps","cmorph-v2") gsn_define_colormap(wks,"prcp_2")
plot = new(24,graphic)
files = systemfunc("ls CMORPH_8KM-30MIN_20151130*"); print(files); print(files(0)) no_of_files = dimsizes(files) print(no_of_files)
ntim = 1 nlat = 1649 nlon = 4948
lat = 59.963614 - ispan(0,nlat-1,1)*0.072771377 lat!0 = "latitude" lat at units = "degrees_north"; printVarSummary(lat); print(lat)
lon = 0.036378335 + ispan(0,nlon-1,1)*0.072756669 lon!0 = "longitude" lon at units = "degrees_east"; printVarSummary(lon); print(lon); Reading File-----------------
cmordaily= new(8159252,float,255) printVarSummary(cmordaily)
do n = 0, no_of_files outfile = "cmorph" outfile = outfile+n+".txt" drf = "cmori" drf = drf+n+".txt"
rf = fbindirread(files(0),0,(/ntim,nlat,nlon/),"ubyte") printVarSummary(rf)
; temp = str_split(files(n),"_") ; For date of the data file; date_time = temp(1)+temp(2); print(date_time); date_time!0 = "time"
cmorrf = where(rf.eq.255,255,rf*0.2) printVarSummary(cmorrf) cmorrf at units = "mm" cmorrf at _FillValue = 255 asciiwrite(outfile,cmorrf)
cmor1d = ndtooned(cmorrf) asciiwrite("cmor1d_after1d.txt",cmor1d) printVarSummary(cmor1d)
cmordaily = cmor1d+cmordaily; cmordaily at _FillValue = 255 asciiwrite(drf,cmordaily)
I am not getting getting the data added in the last file. I am attaching the cmordaily files. Following files are created-rw-rw-r-- 1 aditya aditya 3635 Jan 24 22:08 cmorph-daily.ncl-rw-rw-r-- 1 aditya aditya 25048562 Jan 24 22:11 cmorph0.txt-rw-rw-r-- 1 aditya aditya 25048562 Jan 24 22:11 cmor1d_after1d.txt-rw-rw-r-- 1 aditya aditya 32637008 Jan 24 22:12 cmori0.txt
cmori0.txt file has only 8199252 values each equal to 255.can someone suggest...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160124/afbce04e/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmorph-daily.ncl
Type: application/octet-stream
Size: 3635 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160124/afbce04e/attachment.obj
More information about the ncl-talk
mailing list