[ncl-talk] Subset Returning Wrong Values
Rick Brownrigg
brownrig at ucar.edu
Mon Apr 22 09:57:51 MDT 2019
Hi Zach,
Not totally sure what's going on here. With regard to the Dec 2000, when I
open your file, I see that the range Jan1-Mar31 2001 is (8192:8218). Try
printing those values and your original indices to verify. As for the
string of 5's, I'm getting 2s.
In any case, I get a string of about a dozen warning messages out of these
two lines:
time2int = stringtointeger(time2)
prec2int = stringtointeger(prec2)
Your file has a header line, so this likely should be something like:
time2int = stringtointeger(time2(1:))
prec2int = stringtointeger(prec2(1:))
prec2 is a float field -- is the truncation to integer intended? Also,
time2 is a yyyy-mm-dd-0000z field, and is getting truncated to just the
year -- is this intended too? If not perhaps take a look at the various
time/string/calendar functions at the following link to see if there's
something that better suits your requirements:
http://www.ncl.ucar.edu/Document/Functions/date.shtml
I hope that helps...
Rick
On Sun, Apr 21, 2019 at 5:45 PM Zach Rieck <zrr817 at gmail.com> wrote:
> To Whom it May Concern-
>
> I'm trying to subset my data so I can use a section of it for comparison.
> My data runs from 1978 through 2013, but I'm trying to grab just Jan 1- Mar
> 31 2001. I subsetted this by determining the range of values I needed from
> the array to accomplish this and storing them as separate functions.
> However, when I outputted the values, I saw that the prec2_f (y-axis)
> variable was only outputting a bunch of 5s, which aren't even a value
> within that range of data. I also noticed my date2_f variable (x-axis) is
> slightly off and is showing dates from Dec 2000.
>
> I was wondering if you might be able to help me determine why my values
> are off? I have attached both the code and data. Thanks in advance for the
> help!
>
> Respectfully,
>
> -Zach Rieck
> zrr817 at gmail.com
> (513)-502-5652
> _______________________________________________
> 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/20190422/f97ec141/attachment.html>
More information about the ncl-talk
mailing list