[ncl-talk] data match days before plot
Dave Allured - NOAA Affiliate
dave.allured at noaa.gov
Sun Aug 30 09:56:13 MDT 2026
Oops, I forgot that you are making a scatter plot. This means that you
need an X axis that is linear in time. Therefore, you must use a numeric
time line, not a decimal coded time line. So use the method that I
mentioned first, to convert both inputs to a common time line such as "days
since".
On Sat, Aug 29, 2026 at 10:53 AM Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:
> Put both the obs and model data on a common time line. For the obs
> (station) data, it looks like you need to combine the year number into the
> calculation. You did not show any time information for the model data, but
> I am sure it is something simple like "days since" or "hours since". I
> suggest convert both to "days since", since the obs data is already based
> on day numbers.
>
> Also when calculating the new time lines, you must pick a common starting
> point. I suggest YYYY January 1, where YYYY is the starting year of either
> data set.
>
> Alternatively, you could use a decimal coded time line such as YYYYDDD or
> YYYYMMDD, rather than a pure numeric time line. With this type, dates are
> absolute in one sense, so there is no need to pick a common starting date.
>
> For the scatter plot, you compare both time lines and pick out the dates
> in common. This is possible with any kind of time line, as long as both
> are computed accurately, and roundoff error is resolved. My final advice
> is, pick whichever method seems easiest to create the time lines.
>
> NCL has date functions to assist with creating and converting time lines.
> https://www.ncl.ucar.edu/Document/Functions/date.shtml
>
>
> On Thu, Aug 27, 2026 at 2:20 PM Debasish Hazra via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Hi,
>> I am trying to plot a scatter plot using Ncl and plotting daily averaged
>> station data vs model output using more than 2 years data. However, I am
>> seeing more than one data gaps in station data, like below (first value is
>> in Julian days, second is precip value for a station of that day), but
>> model data has values in all days.
>>
>> 350,0.418833
>> 351,0.494576
>> 355,0.389460
>> 356,0.406334
>> ...SNIP...
>> 362,0.113083
>> 363,0.124250
>> 364,0.081895
>> 365,0.159218
>> 2,0.125749
>> 3,0.217326
>> 4,0.276310
>>
>> How to match those two data set in terms of exact days before the
>> scatter plot ? Any help ?
>> Thanks
>> Debasish
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260830/7035a841/attachment.htm>
More information about the ncl-talk
mailing list