mirror of https://github.com/ecmwf/eccodes.git
ECC-482 changed variables name (JulianDate -> DateTime)
This commit is contained in:
parent
b1e6b44851
commit
f26599924b
|
@ -45,7 +45,7 @@ transient extractDateTimeDayStart=1 : hidden;
|
|||
transient extractDateTimeHourStart=1 : hidden;
|
||||
transient extractDateTimeMinuteStart=1 : hidden;
|
||||
transient extractDateTimeSecondStart=1 : hidden;
|
||||
meta extractJulianDateStart julian_date(extractDateTimeYearStart,extractDateTimeMonthStart,extractDateTimeDayStart,
|
||||
meta extractDateTimeStart julian_date(extractDateTimeYearStart,extractDateTimeMonthStart,extractDateTimeDayStart,
|
||||
extractDateTimeHourStart,extractDateTimeMinuteStart,extractDateTimeSecondStart) : hidden;
|
||||
|
||||
transient extractDateTimeYearEnd=2016 : hidden;
|
||||
|
@ -54,7 +54,7 @@ transient extractDateTimeDayEnd=1 : hidden;
|
|||
transient extractDateTimeHourEnd=1 : hidden;
|
||||
transient extractDateTimeMinuteEnd=1 : hidden;
|
||||
transient extractDateTimeSecondEnd=1 : hidden;
|
||||
meta extractJulianDateEnd julian_date(extractDateTimeYearEnd,extractDateTimeMonthEnd,extractDateTimeDayEnd,
|
||||
meta extractDateTimeEnd julian_date(extractDateTimeYearEnd,extractDateTimeMonthEnd,extractDateTimeDayEnd,
|
||||
extractDateTimeHourEnd,extractDateTimeMinuteEnd,extractDateTimeSecondEnd) : hidden;
|
||||
|
||||
transient extractDateTimeYearRank=1 : hidden;
|
||||
|
@ -74,11 +74,11 @@ meta doSimpleThinning bufr_simple_thinning(doExtractSubsets,numberOfSubsets,extr
|
|||
|
||||
transient userDateStart = 0 : hidden;
|
||||
transient userTimeStart = 0 : hidden;
|
||||
meta userJulianDateStart julian_date(userDateStart,userTimeStart) : hidden;
|
||||
meta userDateTimeStart julian_date(userDateStart,userTimeStart) : hidden;
|
||||
|
||||
transient userDateEnd = 0 : hidden;
|
||||
transient userTimeEnd = 0 : hidden;
|
||||
meta userJulianDateEnd julian_date(userDateEnd,userTimeEnd) : hidden;
|
||||
meta userDateTimeEnd julian_date(userDateEnd,userTimeEnd) : hidden;
|
||||
|
||||
template boot_edition "bufr/boot_edition_[ed:l].def";
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ meta localMinute bits(keyData,27,6) : long_type,no_copy;
|
|||
meta localSecond bits(keyData,33,6) : long_type,no_copy;
|
||||
meta spare bits(keyData,39,1) : no_copy; # 40 bits = 5 bytes
|
||||
|
||||
meta localJulianDate julian_date(localYear,localMonth,localDay,localHour,localMinute,localSecond) : no_copy;
|
||||
meta localDateTime julian_date(localYear,localMonth,localDay,localHour,localMinute,localSecond) : no_copy;
|
||||
|
||||
# isSatellite and other stuff moved to section 3
|
||||
ascii[8] keyMore : hidden;
|
||||
|
@ -33,7 +33,7 @@ meta rdbtimeMonth rdbtime_guess_date(typicalYear,typicalMonth,typicalDay,rdbtime
|
|||
meta ls.rdbtimeDate sprintf("%.4d%.2d%.2d",rdbtimeYear,rdbtimeMonth,rdbtimeDay) : no_copy,read_only;
|
||||
meta ls.rdbtimeTime sprintf("%.2d%.2d%.2d",rdbtimeHour,rdbtimeMinute,rdbtimeSecond) :dump,no_copy,read_only;
|
||||
|
||||
meta rdbtimeJulianDate julian_date(rdbtimeYear,rdbtimeMonth,rdbtimeDay,rdbtimeHour,rdbtimeMinute,rdbtimeSecond) : no_copy;
|
||||
meta rdbDateTime julian_date(rdbtimeYear,rdbtimeMonth,rdbtimeDay,rdbtimeHour,rdbtimeMinute,rdbtimeSecond) : no_copy;
|
||||
|
||||
byte[3] rectime;
|
||||
meta rectimeDay bits(rectime,0,6) : dump,long_type,no_copy;
|
||||
|
@ -41,7 +41,7 @@ meta rectimeHour bits(rectime,6,5) : dump,long_type,no_copy;
|
|||
meta rectimeMinute bits(rectime,11,6) : dump,long_type,no_copy;
|
||||
meta rectimeSecond bits(rectime,17,6) : dump,long_type,no_copy;
|
||||
|
||||
meta rectimeJulianDate julian_date(rdbtimeYear,rdbtimeMonth,rectimeDay,rectimeHour,rectimeMinute,rectimeSecond) : no_copy;
|
||||
meta recDateTime julian_date(rdbtimeYear,rdbtimeMonth,rectimeDay,rectimeHour,rectimeMinute,rectimeSecond) : no_copy;
|
||||
|
||||
byte[1] corr1Data;
|
||||
meta correction1 bits(corr1Data,0,6) : dump,long_type,no_copy;
|
||||
|
|
|
@ -1543,7 +1543,7 @@ diff ${f}.log.ref ${f}.log
|
|||
|
||||
rm -f ${f}.log ${f}.log.ref ${f}.out $fLog $fRules
|
||||
#-----------------------------------------------------------
|
||||
# Test: Julian Date
|
||||
# Test: DateTime
|
||||
#-----------------------------------------------------------
|
||||
cat > $fRules <<EOF
|
||||
transient myStartYear=2012;
|
||||
|
@ -1556,30 +1556,30 @@ transient myStartSecond=0;
|
|||
transient myEndDate=20121030;
|
||||
transient myEndTime=050000;
|
||||
|
||||
meta myStartJulianDate julian_date(myStartYear,myStartMonth,myStartDay,myStartHour,myStartMinute,myStartSecond);
|
||||
meta myEndJulianDate julian_date(myEndDate,myEndTime);
|
||||
meta myStartDateTime julian_date(myStartYear,myStartMonth,myStartDay,myStartHour,myStartMinute,myStartSecond);
|
||||
meta myEndDateTime julian_date(myEndDate,myEndTime);
|
||||
|
||||
if (rdbtimeJulianDate > myStartJulianDate && rdbtimeJulianDate < myEndJulianDate) {
|
||||
if (rdbDateTime > myStartDateTime && rdbDateTime < myEndDateTime) {
|
||||
print "match";
|
||||
} else {
|
||||
print "no match";
|
||||
}
|
||||
print "rdbtimeDate=[rdbtimeDate] rdbtimeTime=[rdbtimeTime] rdbtimeJulianDate=[rdbtimeJulianDate%f] mystart=[myEndJulianDate] myend=[myEndJulianDate]";
|
||||
print "rdbtimeDate=[rdbtimeDate] rdbtimeTime=[rdbtimeTime] rdbDateTime=[rdbDateTime%f] mystart=[myEndDateTime] myend=[myEndDateTime]";
|
||||
|
||||
print "rdbtimeJulianDate=[rdbtimeJulianDate:s]";
|
||||
print "rdbDateTime=[rdbDateTime:s]";
|
||||
|
||||
set myEndJulianDate="2017-05-22 12:15:23";
|
||||
print "myEndDate=[myEndJulianDate:s] myEndJulianDate=[myEndJulianDate] myEndDate=[myEndDate] myEndTime=[myEndTime]";
|
||||
set myEndDateTime="2017-05-22 12:15:23";
|
||||
print "myEndDate=[myEndDateTime:s] myEndDateTime=[myEndDateTime] myEndDate=[myEndDate] myEndTime=[myEndTime]";
|
||||
|
||||
set myEndJulianDate=rdbtimeJulianDate;
|
||||
print "myEndDate=[myEndJulianDate:s] myEndJulianDate=[myEndJulianDate] myEndDate=[myEndDate] myEndTime=[myEndTime]";
|
||||
set myEndDateTime=rdbDateTime;
|
||||
print "myEndDate=[myEndDateTime:s] myEndDateTime=[myEndDateTime] myEndDate=[myEndDate] myEndTime=[myEndTime]";
|
||||
|
||||
set userJulianDateStart="2017/05/23 09-12:12";
|
||||
print "userJulianDateStart=[userJulianDateStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userJulianDateStart:s]";
|
||||
set userJulianDateStart="20170523 091212";
|
||||
print "userJulianDateStart=[userJulianDateStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userJulianDateStart:s]";
|
||||
set userJulianDateStart="20170523091212";
|
||||
print "userJulianDateStart=[userJulianDateStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userJulianDateStart:s]";
|
||||
set userDateTimeStart="2017/05/23 09-12:12";
|
||||
print "userDateTimeStart=[userDateTimeStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userDateTimeStart:s]";
|
||||
set userDateTimeStart="20170523 091212";
|
||||
print "userDateTimeStart=[userDateTimeStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userDateTimeStart:s]";
|
||||
set userDateTimeStart="20170523091212";
|
||||
print "userDateTimeStart=[userDateTimeStart] userDateStart=[userDateStart] userTimeStart=[userTimeStart] [userDateTimeStart:s]";
|
||||
EOF
|
||||
|
||||
f="syno_1.bufr"
|
||||
|
@ -1591,13 +1591,13 @@ ${tools_dir}/bufr_filter $fRules $f > ${f}.log
|
|||
|
||||
cat > ${f}.log.ref <<EOF
|
||||
match
|
||||
rdbtimeDate=20121030 rdbtimeTime=001019 rdbtimeJulianDate=2456230.507164 mystart=2456230.708333 myend=2456230.708333
|
||||
rdbtimeJulianDate=20121030 001019
|
||||
myEndDate=2017-05-22 12:15:23 myEndJulianDate=2457896.01068 myEndDate=20170522 myEndTime=121523
|
||||
myEndDate=2012-10-30 00:10:19 myEndJulianDate=2456230.50716 myEndDate=20121030 myEndTime=1019
|
||||
userJulianDateStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 2017/05/23 09-12:12
|
||||
userJulianDateStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 20170523 091212
|
||||
userJulianDateStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 20170523091212
|
||||
rdbtimeDate=20121030 rdbtimeTime=001019 rdbDateTime=2456230.507164 mystart=2456230.708333 myend=2456230.708333
|
||||
rdbDateTime=20121030 001019
|
||||
myEndDate=2017-05-22 12:15:23 myEndDateTime=2457896.01068 myEndDate=20170522 myEndTime=121523
|
||||
myEndDate=2012-10-30 00:10:19 myEndDateTime=2456230.50716 myEndDate=20121030 myEndTime=1019
|
||||
userDateTimeStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 2017/05/23 09-12:12
|
||||
userDateTimeStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 20170523 091212
|
||||
userDateTimeStart=2457896.88347 userDateStart=20170523 userTimeStart=91212 20170523091212
|
||||
EOF
|
||||
|
||||
diff ${f}.log.ref ${f}.log
|
||||
|
|
Loading…
Reference in New Issue