Re: [idvusers] scripting question on the 'times' attribute for loading data sources

Hi Mike-

I was hoping someone from Unidata would answer this, but I hate to see your question just hanging out there so I'll jump in:

On 9/6/12 10:21 AM, Mike Umscheid wrote:
There is a data source (dods://
which has RTMA precipitation analysis for the last 3 weeks or so of hourly
analyses.  Here is what I want to do... I would like to grab the most
recent X number of hours of RTMA precipitation using ISL scripting.  I have
run into a problem using the traditional "times=" attribute for loading
this data source because the number of total times available for this data
source is not always at a constant number AND the most recent files are at
the end of the list (i.e. index value of 590 of 590 times) instead of the
beginning of the list (index value of 0).  Obviously, I wouldn't have any
problems if the most recent times were at the top and therefore could
simply code "times=0:5" for the most recent 6 hours.  As an example,
yesterday the number of times was 569 and today it's 590, so I'm not sure
when and how often this particular data source purges older files.  In the
metadata, I can see where the number of times is under the "dimensions:"
section where "time1 = 590;" for example.  Is there anyway to grab this
value from the metadata or is there another way to code this to grab the
most recent X number of times?  Thanks!

There are a couple of ways you can do this depending on how you are writing your isl script. If you are using a bundle, then before you save the bundle, go to the Data Source properties for the RTMA grid and under the Times tab, select the first 6 times and click the "Reverse Times" checkbox down below the list. This information will get saved in the bundle.

If you are using the datasource tag to load in the grid, then you can set the reverseTimes property on it:

<datasource url="dods://" times="0:5">
        <property name="reverseTimes" value="true"/>

Hope that helps!

Don Murray