[ncl-talk] Supported file types for asciiread

Ryan Connelly rconne01 at gmail.com
Sat Apr 23 18:47:22 MDT 2016


Thanks, that works.

On Fri, Apr 22, 2016 at 5:16 PM, Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:

> Ryan,
>
> Do not use addfile with asciiread.  Just call asciiread directly, with the
> actual file name in the first argument.  See the asciiread function docs.
>
> --Dave
>
>
> On Fri, Apr 22, 2016 at 3:13 PM, Ryan Connelly <rconne01 at gmail.com> wrote:
>
>> Hi all,
>>
>> Trying to read in sounding data that I have in a .txt file using the
>> asciiread function (
>> https://www.ncl.ucar.edu/Document/Functions/Built-in/asciiread.shtml):
>>
>> f = addfile("../2016020512_sounding.asc","r")
>>
>>   data_obs = asciiread(f,-1,"string")               % Loads text file
>>   p_obs = tofloat(str_get_field(data_obs,1,"     "))    % Reads in first
>> column, which is pressure in hPa
>> etc...
>>
>> But I get:
>>
>> warning:["FileSupport.c":3026]:NCL does not know anything about file
>> suffix <txt>.
>> But NCL will try its best to figure out the file format.
>>
>> fatal:An internal error has occurred. The file format requested does not
>> appear to be supported, could not open (../2016020500_sounding_OKX.txt)
>> fatal:Argument type mismatch on argument (0) of (asciiread) can not coerce
>>
>>
>> Even the examples on this page use .txt files, and I've tried .asc and
>> .csv with the same error message, so what is the problem here?
>>
>> Ryan
>>
>> --
>> Ryan Connelly
>> M.S. Student in Atmospheric Sciences, Stony Brook University
>> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
>> University
>> rconne01 at gmail.com
>> ryan.connelly at stonybrook.edu
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
Ryan Connelly
M.S. Student in Atmospheric Sciences, Stony Brook University
B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
University
rconne01 at gmail.com
ryan.connelly at stonybrook.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160423/f06e69d5/attachment.html 


More information about the ncl-talk mailing list