Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] columns filter for t.rast.list fails with method=gran #2205

Closed
chaedri opened this issue Feb 13, 2022 · 7 comments
Closed

[Bug] columns filter for t.rast.list fails with method=gran #2205

chaedri opened this issue Feb 13, 2022 · 7 comments
Labels
bug Something isn't working temporal Related to temporal data processing
Milestone

Comments

@chaedri
Copy link
Contributor

chaedri commented Feb 13, 2022

Describe the bug
When using t.rast.list with the method=gran option, the columns filter does not work. Instead of filtering the table to just the columns selected, it returns the whole table, unfiltered.

To Reproduce
Steps to reproduce the behavior:

  1. Use sample temporal dataset from: http://ncsu-geoforall-lab.github.io/grass-temporal-workshop/
  2. Run t.create output=NagsHead_99_08 type=strds temporaltype=relative title="Nags Head elevation series" description="from 1999 to 2008 with gaps"
  3. Register rasters NH_1999_1m, NH_2001_1m, NH_2004_1m, NH_2005_1m, NH_2007_1m and NH_2008_1m to NagsHead_99_08, the new space time dataset, with unit of years.
  4. Run t.rast.list input=NagsHead_99_08 columns=name to see expected behavior of columns filter
  5. See expected output:
name
NH_1999_1m
NH_2001_1m
NH_2004_1m
NH_2005_1m
NH_2007_1m
NH_2008_1m
  1. Run same as above but with method=gran to see unexpected behavior (t.rast.list input=NagsHead_99_08 method=gran columns=name):
id|name|mapset|start_time|end_time|interval_length|distance_from_begin
NH_1999_1m@NagsHead_series|NH_1999_1m|NagsHead_series|1999|2000|1|0
None|None|None|2000|2001|1|1
NH_2001_1m@NagsHead_series|NH_2001_1m|NagsHead_series|2001|2002|1|2
None|None|None|2002|2003|1|3
None|None|None|2003|2004|1|4
NH_2004_1m@NagsHead_series|NH_2004_1m|NagsHead_series|2004|2005|1|5
NH_2005_1m@NagsHead_series|NH_2005_1m|NagsHead_series|2005|2006|1|6
None|None|None|2006|2007|1|7
NH_2007_1m@NagsHead_series|NH_2007_1m|NagsHead_series|2007|2008|1|8
NH_2008_1m@NagsHead_series|NH_2008_1m|NagsHead_series|2008|2009|1|9

Expected behavior
Expected t.rast.list to return only name column.

System description (please complete the following information):

  • Operating System: Windows and Linux; haven't tested on Mac
  • GRASS GIS version: 8.0 and 7.8
@chaedri chaedri added the bug Something isn't working label Feb 13, 2022
@veroandreo
Copy link
Contributor

I confirm this. However, it does work as you would expect if you remove method=gran. Do you need this method of printing for some special reason? I'm thinking this is probably the expected behavior if you use granularity as method, since it prints interval length and distance from beginning of the time series for each map.

@petrasovaa
Copy link
Contributor

I confirm this. However, it does work as you would expect if you remove method=gran. Do you need this method of printing for some special reason? I'm thinking this is probably the expected behavior if you use granularity as method, since it prints interval length and distance from beginning of the time series for each map.

I agree that was the intention and it seems it's also documented in the manual:

Method col is the default option and sensitive to the column,order and where options.

On the other hand, it is not expected behavior and I don't see a big reason for this behavior. Seems columns should be customizable in any case, potentially with different defaults.

@neteler
Copy link
Member

neteler commented Dec 14, 2022

(see also issue #2688)

@veroandreo
Copy link
Contributor

Coming back here... seems to work as expected in 8.2... Was there any change fixing this?

My tests:

name
MOD11B3.A2015001.h11v05.single_LST_Day_6km
MOD11B3.A2015032.h11v05.single_LST_Day_6km
MOD11B3.A2015060.h11v05.single_LST_Day_6km
MOD11B3.A2015091.h11v05.single_LST_Day_6km
MOD11B3.A2015121.h11v05.single_LST_Day_6km
MOD11B3.A2015152.h11v05.single_LST_Day_6km
MOD11B3.A2015182.h11v05.single_LST_Day_6km
MOD11B3.A2015213.h11v05.single_LST_Day_6km
MOD11B3.A2015244.h11v05.single_LST_Day_6km
MOD11B3.A2015274.h11v05.single_LST_Day_6km
MOD11B3.A2015305.h11v05.single_LST_Day_6km
MOD11B3.A2015335.h11v05.single_LST_Day_6km
MOD11B3.A2016001.h11v05.single_LST_Day_6km
MOD11B3.A2016032.h11v05.single_LST_Day_6km
MOD11B3.A2016061.h11v05.single_LST_Day_6km

GRASS nc_spm_08_grass7/modis_lst:~ > t.rast.list LST_Day_monthly method=gran
id|name|mapset|start_time|end_time|interval_length|distance_from_begin
MOD11B3.A2015001.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015001.h11v05.single_LST_Day_6km|modis_lst|2015-01-01 00:00:00|2015-02-01 00:00:00|31.0|0.0
MOD11B3.A2015032.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015032.h11v05.single_LST_Day_6km|modis_lst|2015-02-01 00:00:00|2015-03-01 00:00:00|28.0|31.0
MOD11B3.A2015060.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015060.h11v05.single_LST_Day_6km|modis_lst|2015-03-01 00:00:00|2015-04-01 00:00:00|31.0|59.0
MOD11B3.A2015091.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015091.h11v05.single_LST_Day_6km|modis_lst|2015-04-01 00:00:00|2015-05-01 00:00:00|30.0|90.0
MOD11B3.A2015121.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015121.h11v05.single_LST_Day_6km|modis_lst|2015-05-01 00:00:00|2015-06-01 00:00:00|31.0|120.0
MOD11B3.A2015152.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015152.h11v05.single_LST_Day_6km|modis_lst|2015-06-01 00:00:00|2015-07-01 00:00:00|30.0|151.0
MOD11B3.A2015182.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015182.h11v05.single_LST_Day_6km|modis_lst|2015-07-01 00:00:00|2015-08-01 00:00:00|31.0|181.0
MOD11B3.A2015213.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015213.h11v05.single_LST_Day_6km|modis_lst|2015-08-01 00:00:00|2015-09-01 00:00:00|31.0|212.0
MOD11B3.A2015244.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015244.h11v05.single_LST_Day_6km|modis_lst|2015-09-01 00:00:00|2015-10-01 00:00:00|30.0|243.0
MOD11B3.A2015274.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015274.h11v05.single_LST_Day_6km|modis_lst|2015-10-01 00:00:00|2015-11-01 00:00:00|31.0|273.0
MOD11B3.A2015305.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015305.h11v05.single_LST_Day_6km|modis_lst|2015-11-01 00:00:00|2015-12-01 00:00:00|30.0|304.0
MOD11B3.A2015335.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2015335.h11v05.single_LST_Day_6km|modis_lst|2015-12-01 00:00:00|2016-01-01 00:00:00|31.0|334.0
MOD11B3.A2016001.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2016001.h11v05.single_LST_Day_6km|modis_lst|2016-01-01 00:00:00|2016-02-01 00:00:00|31.0|365.0
MOD11B3.A2016032.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2016032.h11v05.single_LST_Day_6km|modis_lst|2016-02-01 00:00:00|2016-03-01 00:00:00|29.0|396.0
MOD11B3.A2016061.h11v05.single_LST_Day_6km@modis_lst|MOD11B3.A2016061.h11v05.single_LST_Day_6km|modis_lst|2016-03-01 00:00:00|2016-04-01 00:00:00|31.0|425.0

GRASS nc_spm_08_grass7/modis_lst:~ > t.rast.list LST_Day_monthly method=gran columns=name
name
MOD11B3.A2015001.h11v05.single_LST_Day_6km
MOD11B3.A2015032.h11v05.single_LST_Day_6km
MOD11B3.A2015060.h11v05.single_LST_Day_6km
MOD11B3.A2015091.h11v05.single_LST_Day_6km
MOD11B3.A2015121.h11v05.single_LST_Day_6km
MOD11B3.A2015152.h11v05.single_LST_Day_6km
MOD11B3.A2015182.h11v05.single_LST_Day_6km
MOD11B3.A2015213.h11v05.single_LST_Day_6km
MOD11B3.A2015244.h11v05.single_LST_Day_6km
MOD11B3.A2015274.h11v05.single_LST_Day_6km
MOD11B3.A2015305.h11v05.single_LST_Day_6km
MOD11B3.A2015335.h11v05.single_LST_Day_6km
MOD11B3.A2016001.h11v05.single_LST_Day_6km
MOD11B3.A2016032.h11v05.single_LST_Day_6km
MOD11B3.A2016061.h11v05.single_LST_Day_6km

GRASS nc_spm_08_grass7/modis_lst:~ > t.unregister LST_Day_monthly type=raster maps=MOD11B3.A2016001.h11v05.single_LST_Day_6km
Unregister maps
 100%
Unregister maps from space time dataset <LST_Day_monthly>

GRASS nc_spm_08_grass7/modis_lst:~ > t.rast.list LST_Day_monthly columns=name
name
MOD11B3.A2015001.h11v05.single_LST_Day_6km
MOD11B3.A2015032.h11v05.single_LST_Day_6km
MOD11B3.A2015060.h11v05.single_LST_Day_6km
MOD11B3.A2015091.h11v05.single_LST_Day_6km
MOD11B3.A2015121.h11v05.single_LST_Day_6km
MOD11B3.A2015152.h11v05.single_LST_Day_6km
MOD11B3.A2015182.h11v05.single_LST_Day_6km
MOD11B3.A2015213.h11v05.single_LST_Day_6km
MOD11B3.A2015244.h11v05.single_LST_Day_6km
MOD11B3.A2015274.h11v05.single_LST_Day_6km
MOD11B3.A2015305.h11v05.single_LST_Day_6km
MOD11B3.A2015335.h11v05.single_LST_Day_6km
MOD11B3.A2016032.h11v05.single_LST_Day_6km
MOD11B3.A2016061.h11v05.single_LST_Day_6km

GRASS nc_spm_08_grass7/modis_lst:~ > t.rast.list LST_Day_monthly method=gran columns=name
name
MOD11B3.A2015001.h11v05.single_LST_Day_6km
MOD11B3.A2015032.h11v05.single_LST_Day_6km
MOD11B3.A2015060.h11v05.single_LST_Day_6km
MOD11B3.A2015091.h11v05.single_LST_Day_6km
MOD11B3.A2015121.h11v05.single_LST_Day_6km
MOD11B3.A2015152.h11v05.single_LST_Day_6km
MOD11B3.A2015182.h11v05.single_LST_Day_6km
MOD11B3.A2015213.h11v05.single_LST_Day_6km
MOD11B3.A2015244.h11v05.single_LST_Day_6km
MOD11B3.A2015274.h11v05.single_LST_Day_6km
MOD11B3.A2015305.h11v05.single_LST_Day_6km
MOD11B3.A2015335.h11v05.single_LST_Day_6km
None
MOD11B3.A2016032.h11v05.single_LST_Day_6km
MOD11B3.A2016061.h11v05.single_LST_Day_6km

I tried with unregistering a map in case the problem could be related to missing timestamps... but, it seems to work ok, am I right?

@ninsbl
Copy link
Member

ninsbl commented May 24, 2024

I can confirm that columns can be selected in 8.4. So, I would suggest to close this issue...

@echoix
Copy link
Member

echoix commented May 25, 2024

It's always a bit worrisome to have a bug that is magically fixed. That means that we don't know where it was from. But seeing the age of the issue, and the amount of work done on so much parts of the code, it might be the right thing to close as it isn't an issue anymore. Wasn't found in December 2022. (Grass 8.2), and isn't an issue in May 2024 (almost grass 8.4).

If needed, we can reopen this issue, or have a new one.

@echoix echoix added the temporal Related to temporal data processing label May 25, 2024
@echoix echoix closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
@wenzeslaus
Copy link
Member

The report says 8.0. I made a big rewrite for 8.2 in #2258. The description says:

Columns can be now specified for any option (previously only for cols/list and partially for comma/line output).

And also:

Most code is shared between the two main branches of code (simple list versus delta/gran methods code).

I would say, I fixed this. 😄

@neteler neteler added this to the 8.3.3 milestone May 26, 2024
@neteler neteler modified the milestones: 8.3.3, 8.4.0 Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working temporal Related to temporal data processing
Projects
None yet
Development

No branches or pull requests

7 participants