[GRASS-user] DOY support in t.register?

Sören Gebbert soerengebbert at googlemail.com
Wed Mar 5 12:21:51 PST 2014


Hi Veronica,

2014-03-05 20:49 GMT+01:00 Veronica Andreo <veroandreo at gmail.com>:
> Dear list
>
> I'm working with ocean color data set from MODIS and starting to use t.*
> modules... I'm trying now to register the strds and as i'm working with
> 8-day products i specified start date as 2003-01-01 and interval as 8 days
> for a list of 506 maps. The time series should end by 2013-12-31 and t.info
> says
>
> ...
>  +-------------------- Absolute time
> -----------------------------------------+
>  | Start time:................. 2003-01-01 00:00:00
>  | End time:................... 2014-01-31 00:00:00
>  | Granularity:................ 8 days
>  | Temporal type of maps:...... interval
> ....

Using Python shows that in case of an 8 day's interval, the end date
is computed correctly:

{{{
import datetime
print datetime.datetime(2003,1,1) + datetime.timedelta(506*8)
2014-01-31 00:00:00
}}}


> The problem arise because all products at the end of the year don't really
> cover an 8-days period... So, i understand i should add starting and ending
> date to each file in the list i use as input for t.register... Question is:
> Is it possible to use DOY instead of dates?? or what would be a (reasonably)
> easy way of transforming DOY in map names (for example:
> A20030732003080.L3m_8D_CHL_chlor_a_4km_arg) into the corresponding dates????

So your time series has unequal time intervals? I would suggest to use
a single input file that lists all maps with time stamps as input for
a single t.register call.
DOY is not supported by t.register. I would suggest that you use the
following Python code to extract the exact start and end time from the
map names:

{{{
import datetime

#           012345678901234567890123456789012345678901
map_name = "A20030732003080.L3m_8D_CHL_chlor_a_4km_arg"
start_year = int(map_name[1:5])
start_day  = int(map_name[5:8])
end_year   = int(map_name[8:12])
end_day    = int(map_name[12:15])

start = datetime.datetime(start_year, 1, 1) + datetime.timedelta(start_day - 1)
end = datetime.datetime(int(end_year), 1, 1) + datetime.timedelta(end_day - 1)

print map_name, "|", start, "|", end

}}}

Write each map name with start and end time into one file (a single
map name with start and end time each line) and register all maps at
once with "t.register input=my_strds file=my_maps.txt".

Best regards
Soeren

>
> Thanks a lot in advance!
>
> Best,
> Vero
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list