[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20021011: LDM Date/Time Template Question



Kathy,

The LDM templates \n:yy, \n:yyyy, and \n:mm base the year and
month on the day being passed. Your \3 refers to a long time string
(eg everything in the third pair of parentheses), not just the day. 

In fact, since your LDM product names already have the
year, month and day in them, you can just grab it out of the 
product name, eg:


^L2-([^/]*)/(....)/([0-9][0-9])([0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9][0-5][0-9][0-9][0-9])
        FILE
        /ll/itws/projects/ldm/data/\2/\4\5\6/NEXRADII_\2.\3\4\5\6\7.bz

Using the extra pathentheses, now the century is \3,
the year is \4, the month is \5, the day is \6, and the rest of the hour, min, 
sec is \7.

Steve Chiswell

>From: Kathy Carusone <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200210112111.g9BLBm105047

>I spoke with Anne Wilson at the NEXRAD Users workshop at OU a few weeks
>ago, and mentioned that I had a problem with LDM date templates and
>NEXRAD Archive II data. She recommended I email the details.
>
>The following part of my pqact file does not work as I expect; the
>(\3:yy), etc., do not get interpreted. In the resulting filename, I get
>the full expansion of the date-time string, which is \3, with the 
>:yy and parentheses uninterpreted. E.g.
>
>/ll/itws/projects/ldm/data/KBOX/(20021011182217:yy)(20021011182217:mm)(2002101
> 1182217:dd)/NEXRADII_KOKX.20021011182217.bz2
>
>NEXRD2
>        ^L2-([^/]*)/(....)/([0-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9][0-2][0-9]
> [0-5][0-9][0-9][0-9])
>        FILE
>        /ll/itws/projects/ldm/data/\2/(\3:yy)(\3:mm)(\3:dd)/NEXRADII_\2.\3.bz2
>
>What I use for a workaround, to get the YYMMDD dated directory, is to
>use the strfttime templates. Using the following template, I almost get
>what I want, but I run into problems at the start and end of day. (One
>volume gets split, another goes into the wrong day):
>
>NEXRD2
>        ^L2-([^/]*)/(....)/([0-9][0-9][0-9][0-9][0-1][0-9][0-3][0-9][0-2][0-9]
> [0-5][0-9][0-9][0-9])
>        FILE
>        /ll/itws/projects/ldm/data/\2/%y%m%d/NEXRADII_\2.\3.bz2
>
>This example filename is the format I want:
>
>/ll/itws/projects/ldm/data/KBOX/021011/NEXRADII_KOKX.20021011182217.bz2
>
>Is this feature supposed to work for the NEXRD2 feed, or is it only
>applicable to the WMO headers? (Or did I do it wrong?) Reference the LDM
>Site Manager's Guide, section on Configuration/Adding Dates to
>Filenames, p37. Thanks for any help you can provide.
>
>Kathy
>
>            Kathy Carusone  |  address@hidden                  
>    MIT Lincoln Laboratory  |  (781) 981-5039 
>       Lexington, MA 02420  |  (781) 981-0632 FAX
>