[GRASS-user] Practical examples for t.select

nik at nikosalexandris.net nik at nikosalexandris.net
Wed Apr 14 06:51:21 PDT 2021


Dears, are there real-world examples that show-case t.select?

I cannot select maps from an absolute raster space-time dataset (in a 
local Mapset)
that have the same starting dates (only, not time) as maps in another 
raster space-time
dataset (stored however in the PERMANENT Mapset).

Is the different Mapset a problem?
I can't make it work, however, for space-time dataset within the same 
Mapset.

Shouldn't the expression
```
t.select -d expression="D = if(start_date(A) == start_date(B), A)"
```
work?

I.e., I want to select maps from `milano_mod09gq_qc_250m at modis`

→ trl milano_mod09gq_qc_250m at modis |head
name|mapset|start_time|end_time
milano_mod09gq_QC_250m_1_doy2019001|modis|2019-01-01 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019002|modis|2019-01-02 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019003|modis|2019-01-03 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019004|modis|2019-01-04 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019005|modis|2019-01-05 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019006|modis|2019-01-06 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019007|modis|2019-01-07 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019008|modis|2019-01-08 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019009|modis|2019-01-09 10:30:00|None

whose starting dates (only, not time) coincide with maps from 
`test_myd11a2_emissivity_average`

→ trl test_myd11a2_emissivity_average at PERMANENT |head
name|mapset|start_time|end_time
test_myd11a2_emissivity_average_2019_01_01T00_00_00|PERMANENT|2019-01-01 
00:00:00|None
test_myd11a2_emissivity_average_2019_01_09T00_00_00|PERMANENT|2019-01-09 
00:00:00|None
test_myd11a2_emissivity_average_2019_01_17T00_00_00|PERMANENT|2019-01-17 
00:00:00|None
test_myd11a2_emissivity_average_2019_01_25T00_00_00|PERMANENT|2019-01-25 
00:00:00|None
test_myd11a2_emissivity_average_2019_02_02T00_00_00|PERMANENT|2019-02-02 
00:00:00|None
test_myd11a2_emissivity_average_2019_02_10T00_00_00|PERMANENT|2019-02-10 
00:00:00|None
test_myd11a2_emissivity_average_2019_02_18T00_00_00|PERMANENT|2019-02-18 
00:00:00|None
test_myd11a2_emissivity_average_2019_02_26T00_00_00|PERMANENT|2019-02-26 
00:00:00|None
test_myd11a2_emissivity_average_2019_03_06T00_00_00|PERMANENT|2019-03-06 
00:00:00|None

Given the selection works, and for the maps listed above (just an 
example, notice the `|head`),
I would expect the maps

milano_mod09gq_QC_250m_1_doy2019001|modis|2019-01-01 10:30:00|None
milano_mod09gq_QC_250m_1_doy2019009|modis|2019-01-09 10:30:00|None

to be picked-up.

I can't work this out.  Example:

```
t.select -d expression="C = if( 
start_date(milano_mod09gq_surface_reflectance_1) == 
start_date(myd21a1_emissivity_29_best_above_09_low_zenith at PERMANENT, 
milano_mod09gq_surface_reflectance_1)"
```
gives an error.


Any concrete examples?
The manual covers in theory all cases.
In practice however and in this case, I don't find it easy to follow.

Thanks, Nikos


More information about the grass-user mailing list