Opened 8 years ago

Closed 8 years ago

#3152 closed defect (fixed)

g.gui.animation issues with stvds and list of vector maps

Reported by: veroandreo Owned by: grass-dev@…
Priority: normal Milestone: 7.2.0
Component: wxGUI Version: svn-trunk
Keywords: g.gui.animation Cc:
CPU: Unspecified Platform: Linux

Description

I want to create an animation for a weekly STVDS covering a total time span of 5 years. However, the STVDS only consist of 62 maps, given that there's no data in every week but only in those 62 weeks (summer weeks over the years).

When I pass my STVDS to g.gui.animation (using the GUI or the CLI), I either get a lot of black screens for those time periods in which my STVDS has no maps or the last map with data remains there until a new map with data comes. Is there a way to only get the background raster in those periods without data, instead of the last vector with data??? As these are cases of a disease, it has no sense (and it represents something that it is not true) to keep the last point for an X period of time until new cases appear.

I thought that maybe only passing the list of 62 maps (not as a time series) would suffice, but I found I cannot use '?' in the GUI for the selection, and then I have to manually click on maps with no possibility to scroll. Is it feasible to add support for the '?' or a file parameter, as in other modules, to pass a file with the list of maps?

The next thing I tried was to pass the list of files with the CLI, using

g.gui.animation vector=`g.list type=vector mapset=. pattern=cases_20??_??_??_* separator=comma` 

but I get the following error:

Traceback (most recent call last):
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 141, in <module>
    main()
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 112, in main
    layer.cmd = ['d.vect', 'map={name=}'.format(name=vect.split(',')[0])]
KeyError: 'name='

Listing the maps, however, works as expected, and I get the corresponding list of maps. I'm using trunk r69455M under fedora 24.

Change History (4)

in reply to:  description ; comment:1 by annakrat, 8 years ago

Replying to veroandreo:

I want to create an animation for a weekly STVDS covering a total time span of 5 years. However, the STVDS only consist of 62 maps, given that there's no data in every week but only in those 62 weeks (summer weeks over the years).

When I pass my STVDS to g.gui.animation (using the GUI or the CLI), I either get a lot of black screens for those time periods in which my STVDS has no maps or the last map with data remains there until a new map with data comes. Is there a way to only get the background raster in those periods without data, instead of the last vector with data??? As these are cases of a disease, it has no sense (and it represents something that it is not true) to keep the last point for an X period of time until new cases appear.

I am not sure how do you want it to be? In settings, Time tab there is option to not show no data, but I guess that's not what you want. If you don't want it to use the time information, load it as series of maps.

I thought that maybe only passing the list of 62 maps (not as a time series) would suffice, but I found I cannot use '?' in the GUI for the selection, and then I have to manually click on maps with no possibility to scroll. Is it feasible to add support for the '?' or a file parameter, as in other modules, to pass a file with the list of maps?

The gui uses python regular expressions, so check what ? means there, it works but maybe it has different meaning?

The next thing I tried was to pass the list of files with the CLI, using

g.gui.animation vector=`g.list type=vector mapset=. pattern=cases_20??_??_??_* separator=comma` 

but I get the following error:

Traceback (most recent call last):
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 141, in <module>
    main()
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 112, in main
    layer.cmd = ['d.vect', 'map={name=}'.format(name=vect.split(',')[0])]
KeyError: 'name='

Thanks, I fixed that, please try again.

Listing the maps, however, works as expected, and I get the corresponding list of maps. I'm using trunk r69455M under fedora 24.

in reply to:  1 ; comment:2 by veroandreo, 8 years ago

Replying to annakrat:

Replying to veroandreo:

I want to create an animation for a weekly STVDS covering a total time span of 5 years. However, the STVDS only consist of 62 maps, given that there's no data in every week but only in those 62 weeks (summer weeks over the years).

When I pass my STVDS to g.gui.animation (using the GUI or the CLI), I either get a lot of black screens for those time periods in which my STVDS has no maps or the last map with data remains there until a new map with data comes. Is there a way to only get the background raster in those periods without data, instead of the last vector with data??? As these are cases of a disease, it has no sense (and it represents something that it is not true) to keep the last point for an X period of time until new cases appear.

I am not sure how do you want it to be? In settings, Time tab there is option to not show no data, but I guess that's not what you want. If you don't want it to use the time information, load it as series of maps.

Maybe I was not clear. I'll try better this time. So, I have weekly vector maps that represent disease cases. These cases appear only in certain weeks of the year. Then I register my weekly vectors of disease cases as a STVDS to make use of time information. However, none of the solutions provided in the animation is optimal to display this kind of data (stvds). If I choose to display no data time periods, I get black screens when there are no cases (most of the year). That makes the animation a bit ugly. On the other hand, if I choose not to display no data time periods, what I get is the last case that appeared frozen there for most of the year. And, as I said before, at least for this particular case, that is not correct nor desirable. It would mean that there's always someone reporting a disease case in that place, which is not true in the data.

So, dunno if it is possible or not, but what I would expect is to only see the background raster I choose during those periods with no disease cases, i.e.: no frozen last vector map, only the raster I add as background.

Well, loading as a list of maps kinda solves the issue of no data periods, because I loose time info which was the whole point...

I thought that maybe only passing the list of 62 maps (not as a time series) would suffice, but I found I cannot use '?' in the GUI for the selection, and then I have to manually click on maps with no possibility to scroll. Is it feasible to add support for the '?' or a file parameter, as in other modules, to pass a file with the list of maps?

The gui uses python regular expressions, so check what ? means there, it works but maybe it has different meaning?

I found the equivalent for '????'. In python reg expressions is '[0-9][0-9][0-9][0-9]'. I should have tried harder before... but thanks for the hint :)

The next thing I tried was to pass the list of files with the CLI, using

g.gui.animation vector=`g.list type=vector mapset=. pattern=cases_20??_??_??_* separator=comma` 

but I get the following error:

Traceback (most recent call last):
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 141, in <module>
    main()
  File "/home/veroandreo/software/grass-7.3.svn/dist.x86_64-pc-linux-gnu/scripts/g.gui.animation", line 112, in main
    layer.cmd = ['d.vect', 'map={name=}'.format(name=vect.split(',')[0])]
KeyError: 'name='

Thanks, I fixed that, please try again.

It works now! Thanks much!

in reply to:  2 comment:3 by annakrat, 8 years ago

Replying to veroandreo:

Maybe I was not clear. I'll try better this time. So, I have weekly vector maps that represent disease cases. These cases appear only in certain weeks of the year. Then I register my weekly vectors of disease cases as a STVDS to make use of time information. However, none of the solutions provided in the animation is optimal to display this kind of data (stvds). If I choose to display no data time periods, I get black screens when there are no cases (most of the year). That makes the animation a bit ugly. On the other hand, if I choose not to display no data time periods, what I get is the last case that appeared frozen there for most of the year. And, as I said before, at least for this particular case, that is not correct nor desirable. It would mean that there's always someone reporting a disease case in that place, which is not true in the data.

So, dunno if it is possible or not, but what I would expect is to only see the background raster I choose during those periods with no disease cases, i.e.: no frozen last vector map, only the raster I add as background.

makes sense now, could you please close this and create a new enhancement ticket just with the relevant information? Thank you

comment:4 by veroandreo, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.