[ncl-talk] Reading and plotting ASCII data (TRMM 3G68)
Lyndz
olagueralyndonmark429 at gmail.com
Wed Mar 25 09:24:28 MDT 2020
Dear Sir Dennis,
Thank you so much for your help.
Actually, I was trying to use the ncl script used to read asc5.txt in the
example page (https://www.ncl.ucar.edu/Applications/read_ascii.shtml)
But I am getting the following error:
(0) nfields = 9
fatal:Subscript out of range, error in subscript #0
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 186 in
file read_3G68.ncl
I'm not sure how to assign the variable type per column and in cases when
there is missing data. The number of fields should be 16. Not all columns
are "float", some are integer.
int hr,min, row, col, tmiTotal,tmiRain;
int prTotal,prRain;
int combTotal,combRain;
float tmiMean,tmiPercent;
float prMean,prPercent;
float combMean,combPercent;
I am attaching the modified script. I'll appreciate any help on
pointing out the problem in my modified script.
Sincerely,
On Wed, Mar 25, 2020 at 10:40 PM Dennis Shea <shea at ucar.edu> wrote:
> In any language: NCL, GrADS, Python, Matlab .... there are
> text/ascii/string handling functions.
> I think you would learn a lot by trying to read the text file with code
> you have written in your favorite language.
> The 3G68 text file is not 'regular' as noted in the documentation.. The
> different line types are intermingled.
> This makes it a nuisance to read correctly. You have to determine an input
> strategy:
> Read documentation (carefully) ...Think ... Code
> i) There are header lines. Is there information that needs to be read?
> ii) How to determine what line 'Type' ? The differing line lengths make
> reading a nuisance.
> iii) You have to devise a book keeping strategy. It ia all about detail.
> ---
> Type A. (Case when there is no PR pixel in cell)
> 0 5 106 59 24 24 0.87 0 0
>
> ...
> Type B. (Case when a line has both TMI and PR data)
> 10 109 109 48 0 0 0 133 32 0.39 34 133 32 0.35 28
> ...
> Type C. (Case when a line has no TMI but has PR). *-9* is missing.
> 2 0 157 196 0 0 *-9 -9* 33 3 0.04 0 33 3 0.03 0
> ========================================================================
>
> Attached is something that works (I think).
>
> It generates some plots.
>
> %> ncl 3G68.ncl
>
>
> On Mon, Mar 23, 2020 at 9:18 AM Lyndz via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>> Dear NCL-expert,
>>
>> I am reading an ascii file, which I uploaded here:
>>
>> https://www.dropbox.com/s/47t7ue9j1rx08x7/3G68.20090113.7.txt?dl=0
>>
>> http://apdrc.soest.hawaii.edu/doc/README.3G68
>>
>> http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/TRMM/TRMM_PR/3G68_hourly
>>
>> [Problem]
>> I am confused as to how to convert the row and column into a lat on
>> coordinates after reading the file.
>> I just want to read and plot the PR_mean variable.
>>
>> Anyone here who has processed this file before?
>> I'll appreciate any help on this matter.
>>
>> Sincerely,
>> Lyndz
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200325/e3a7697a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read_3G68.ncl
Type: application/octet-stream
Size: 9156 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200325/e3a7697a/attachment.obj>
More information about the ncl-talk
mailing list