[Go-essp-tech] DRS question - temporal subset
stephen.pascoe at stfc.ac.uk
stephen.pascoe at stfc.ac.uk
Thu Feb 9 09:48:41 MST 2012
Thanks Karl,
The code is fixed in the repository to do the right thing with only one time-slice but I'm glad we shouldn't be seeing these files in general as other bits of the pipeline could be affected.
Stephen.
---
Stephen Pascoe +44 (0)1235 445980
Centre of Environmental Data Archival
STFC Rutherford Appleton Laboratory, Harwell Oxford, Didcot OX11 0QX, UK
From: Karl Taylor [mailto:taylor13 at llnl.gov]
Sent: 09 February 2012 16:40
To: Estanislao Gonzalez
Cc: Pascoe, Stephen (STFC,RAL,RALSP); legutke at dkrz.de; go-essp-tech at ucar.edu; Charles Doutriaux
Subject: Re: [Go-essp-tech] DRS question - temporal subset
Hi Estani and Charles,
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).
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?
Charles can tell us if I've said anything incorrect.
thanks,
Karl
On 2/9/12 4:30 AM, Estanislao Gonzalez wrote:
Sure,
trans.filename_to_drs('clmcalipso_cf3hr_MPI-ESM-LR_amip_r1i1p1_200810221030.nc')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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 stephen.pascoe at stfc.ac.uk:<mailto:stephen.pascoe at stfc.ac.uk:>
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: go-essp-tech-bounces at ucar.edu<mailto:go-essp-tech-bounces at ucar.edu> [mailto:go-essp-tech-bounces at ucar.edu] On Behalf Of Estanislao Gonzalez
Sent: 09 February 2012 11:06
To: go-essp-tech at ucar.edu<mailto:go-essp-tech at ucar.edu>
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] - http://cmip-pcmdi.llnl.gov/cmip5/docs/cmip5_data_reference_syntax.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/go-essp-tech/attachments/20120209/a9a2b0eb/attachment-0001.html
More information about the GO-ESSP-TECH
mailing list