Hi Miguel,
If you have NaNs in your data, this will indeed be a problem for NCL. You need to convert these NaN values to missing values.
This is covered in our FAQ:
http://www.ncl.ucar.edu/FAQ/#data_hand_004
and I'll include the FAQ question and its answer here:
Question: "Can NCL deal with NaN (not-a-number) values in my data?"
Answer: The computational and plotting functions in NCL cannot handle NaN values directly. You must first convert the NaN values to missing values.
To do this, use the "replace_ieeenan" function to convert the NaNs to missing values. You can optionally use "isnan_ieee" to first determine if any of your values are equal to NaN:
If "x" already has a _FillValue attribute:
if (any(isnan_ieee(x))) then
replace_ieeenan (x, x@_FillValue, 0)
end if
If "x" doesn't have a _FillValue attribute:
if (any(isnan_ieee(x))) then
x@_FillValue = 1.e20 ; or whatever value you want to use
replace_ieeenan (x, x@_FillValue, 0)
end if
http://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml
--Mary
On Feb 12, 2014, at 9:22 AM, Miguel Tasambay Salazar <miguel.tasambay@gmail.com> wrote:
> Hi Everybody. I'm beginner in NCL however I want to use it in my tasks. My problem is the following. I've been working with Matlab and I got an EOF field of SST like a matrix (121x159, with numbers and NaNs), now, I wish to drawing over a map in NCL. It's converted the file (.mat) to ascii (.dat) for to read it in ncl,then i've used asciiread and gsn_cnm_countour_map and its parameters,but, I haven't got my goal yet. The errors messages are about the lat and long coordinates. I don't know how to set that information correctly or how to build a file (.nc) with that information. By another hand, I've thinking that the problem may be the NaNs. Perhaps, somebody of us could help me.
> Your comments and suggestions will be very appreciated.
> best wishes
> Miguel
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 12 10:25:46 2014
This archive was generated by hypermail 2.1.8 : Wed Feb 19 2014 - 15:58:35 MST