[ncl-talk] Read ascii file error
Mary Haley
haley at ucar.edu
Sat Nov 1 17:18:40 MDT 2014
Nisha,
It would help if you indicate what you think the correct behavior of the
code should be.
As far as I can tell, NCL is producing the correct output when I run your
script. The output is:
dimsizes(MSL_all) = 32558
min(MSL_all) = 0.1
max(MSL_all) = 5
typeof(index1) = integer
This should basically be 32558
6956
integer
This should basically be zero
25602
The MSL_all variable is the second column of data. When I look at your
ASCII file, this second column has lots of missing (-999.99) values. In
your code you have:
index2 = ind(ismissing(MSL_all))
and then:
print("This should basically be zero")
print(dimsizes(index2))
"index2" is the index locations of all your missing values, and the value
of "25602" is correct.
--Mary
On Fri, Oct 31, 2014 at 5:16 PM, Manisha Ganeshan <
manisha.ganeshan86 at gmail.com> wrote:
> Hello,
>
> I am trying to read an ascii file with missing values = -999.99. I set the
> default "float" fill value to this number, and try reading the file but for
> some reason it doesn't recognize real (not missing) values.
>
> Here is a sample code, and my ascii input file.
>
> The code works when I don't set the default missing value to -999.99. And
> funnily enough, I have other similar ascii files which are perfectly read
> with this piece of code. Not sure why it fails in this case.
>
> Hope someone can throw light on this.
>
> Thanks,
> Nisha
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20141101/2e72a80c/attachment.html
More information about the ncl-talk
mailing list