[ncl-talk] Subset Returning Wrong Values

Zach Rieck zrr817 at gmail.com
Mon Apr 22 21:54:58 MDT 2019


Thanks for helping with this Rick!

I simplified what I have down considerably and now I think I'm much closer
to getting it working. For my WRF data, I have it translating to a grid,
and this returns variables called S_time and e_time that have the correct
values. For some reason, when I try calling them in my gridpoint function I
get an error though and I'm not sure why.

For the SNOTEL data, I have precip and time values subsetted (using
TL_start and TL_end as my variables), but when I put them into cd_calendar
it outputs an integer (that I believe to be hours since 1900). Using string
to integer outputs the same.

So my 2 questions are 1. Why am I getting this error on my WRF data and 2.
What is the easiest way to make the time values for my SNOTEL data plotable
(since we cannot plot date strings).

I'll attach the data file here and my new code file. Thank you so much for
the help!
-Zach Rieck
zrr817 at gmail.com
(513)-502-5652


On Mon, Apr 22, 2019 at 9:58 AM Rick Brownrigg <brownrig at ucar.edu> wrote:

> 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/b8e4f0be/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF_SNOTEL.ncl
Type: application/octet-stream
Size: 2176 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190422/b8e4f0be/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Trial Lake-daily.csv
Type: application/octet-stream
Size: 411628 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190422/b8e4f0be/attachment-0003.obj>


More information about the ncl-talk mailing list