<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Times New Roman">Hi Estani and Charles,<br>
      <br>
      Unless only a single time-slice is stored, both the beginning and
      ending times should be included in the file name, so the file you
      are considering has an incorrect name.  The bit about "sufficient
      suffixes" relates to the precision with which the times are
      specified (stopping, for example, at month for monthly means, but
      going all the way to minutes for sub-hourly).  <br>
      <br>
      I don't think drslib needs to handle the case of a single
      time-slice for CMIP5 because I think CMOR invariably includes both
      the beginning and ending times (even if they are identical).  Were
      the files written with CMOR?  <br>
      <br>
      Charles can tell us if I've said anything incorrect.<br>
      <br>
      thanks,<br>
      Karl  <br>
      <br>
      <br>
      <br>
    </font><br>
    On 2/9/12 4:30 AM, Estanislao Gonzalez wrote:
    <blockquote cite="mid:4F33BC63.3010700@dkrz.de" type="cite">
      <pre wrap="">Sure,

trans.filename_to_drs('clmcalipso_cf3hr_MPI-ESM-LR_amip_r1i1p1_200810221030.nc')
Traceback (most recent call last):
   File "&lt;stdin&gt;", line 1, in &lt;module&gt;
   File 
"/usr/local/cdat/lib/python2.6/site-packages/drslib-0.3.0a3-py2.6.egg/drslib/translate.py", 
line 413, in filename_to_drs
     t.filename_to_drs(context)
   File 
"/usr/local/cdat/lib/python2.6/site-packages/drslib-0.3.0a3-py2.6.egg/drslib/translate.py", 
line 355, in filename_to_drs
     context.drs.subset = (_to_date(n1), _to_date(n2), clim)
   File 
"/usr/local/cdat/lib/python2.6/site-packages/drslib-0.3.0a3-py2.6.egg/drslib/translate.py", 
line 503, in _to_date
     mo = re.match(r'(\d{4})(\d{2})?(\d{2})?(\d{2})?(\d{2})?', date_str)
   File "/usr/local/cdat/lib/python2.6/re.py", line 137, in match
     return _compile(pattern, flags).match(string)
TypeError: expected string or buffer


But I'm more concern with the question of how should it be. Missing that 
info will cause that in some particular cases you can't infer the end 
date, and thus the start date of the next junk, without knowing the 
calender type. If you need to get the file to read the calender type and 
*then* infer the name, the usefulness of having a naming scheme would be 
diminished.

As always I think we should comply with whatever rules and guidelines we 
have, as a computer scientist I can't help but seeing the benefits of 
homogeneity and the burden caused by exceptions.
That's why my question is: how should it be? I'm not sure I'm 
interpreting the documentation properly.

Thanks,
Estani

Am 09.02.2012 13:14, schrieb <a class="moz-txt-link-abbreviated" href="mailto:stephen.pascoe@stfc.ac.uk:">stephen.pascoe@stfc.ac.uk:</a>
</pre>
      <blockquote type="cite">
        <pre wrap="">I think drslib will cope -- if not it's a bug -- but the product deduction code often needs both time bounds.

Can you send me the error message.

Thanks,
Stephen.

---
Stephen Pascoe  +44 (0)1235 445980
Centre of Environmental Data Archival
STFC Rutherford Appleton Laboratory, Harwell Oxford, Didcot OX11 0QX, UK


-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:go-essp-tech-bounces@ucar.edu">go-essp-tech-bounces@ucar.edu</a> [<a class="moz-txt-link-freetext" href="mailto:go-essp-tech-bounces@ucar.edu">mailto:go-essp-tech-bounces@ucar.edu</a>] On Behalf Of Estanislao Gonzalez
Sent: 09 February 2012 11:06
To: <a class="moz-txt-link-abbreviated" href="mailto:go-essp-tech@ucar.edu">go-essp-tech@ucar.edu</a>
Cc: Stephanie Legutke
Subject: [Go-essp-tech] DRS question - temporal subset

Hi all,

This is what the DRS reference says:
"Temporal Subsets: Time instants and periods (N1(-N2))

Time instants and periods will be represented by
‘yyyy[mm[dd[hh][mm]]][-clim]’, where ‘yyyy’,
‘mm’, ‘dd’, ‘hh’ ‘mm’ are integer year, month, day, hour, and minute,
respectively, and enough
(and just enough) of the suffixes should be added to unambiguously
resolve the interval between
time-samples contained in the file or virtual file URL. (For example,
monthly mean data would
include “mm”, but not “dd”, “hh”, or “mm”; “subhr” data would include
all suffixes.) The
optional “-clim” is appended when the file contains a climatology. For
example, a file with
sampling frequency of “mo” and the time designation 196001-198912-clim
represents the
monthly mean climatology (12 time values) computed for the period
extending from 1/1960-
12/1989. Note that the DRS does not explicitly specify the calendar type
(e.g., Julian,
Gregorian), but the calendar will be indicated by one of the attributes
in each netCDF file."[1]

  From the title I infer that only the start point is required as part of
the temporal subset, though the text speaks about "enough information to
unambiguously resolve the interval between
time-samples".

The problem is that I get 3hr and subhr data with only the starting
time-stamp, the drslib cannot cope with this.
Should the drslib be adapted to accept that case or all files renamed?

What about the rest of the system? Have anyone already tried publishing
such files? Make sense?
And what was the intention with the parenthesis in the Temporal Subsets
title?

Thanks,
Estani

[1] - <a class="moz-txt-link-freetext" href="http://cmip-pcmdi.llnl.gov/cmip5/docs/cmip5_data_reference_syntax.pdf">http://cmip-pcmdi.llnl.gov/cmip5/docs/cmip5_data_reference_syntax.pdf</a>

</pre>
      </blockquote>
      <pre wrap="">

</pre>
    </blockquote>
  </body>
</html>