You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rduivenvoorde opened this issue
Jun 14, 2023
· 0 comments
Labels
BugEither a bug report, or a bug fix. Let's hope for the latter!MeshRelated to general mesh layer handling (not specific data formats)TemporalTemporal filtering or animation
Then the time data array for a dataset with 3 datasets/frames contains for example: time = 0, 24, 48 ;
or time = 24,48,72;
There is/was an issue with QGIS dropping the last timeframe, see #48942 (could be fixed by #53422).
But with (#53422) in place, both time frame examples above are working
But when the time array contain negative values AND zero time =-48,-24,0 ;
OR when the time array is not ordered: time = -72,-24,-48 ;
QGIS fails to show the right amount of frames. As in either it does not update the Temporal Controller the right way, OR it does not show data when looking on the right frame (after manually adjusting Temporal Controller)
To me it looks like this has something to do with how QGIS/MdalProvider determines the frame count and temporal extent...
I think first fix would be to handle negative values (in natural order), with a zero ending, or with zero in between
Then we could decide on how to handle ordered values in reverse order (72,48,24)
And last we could decide IF we want to handle nc's in which the time offsets are mixed/non-ordered. I'm not sure if ordering (and keeping indexes) would be easy to do, or if this would mean that non only the Time/offset array has to be re-arranged, but also the data arrays...
Steps to reproduce the issue
To reproduce, I created a python file to create a serie of 13 very small ugrid netcdf's:
# - 0,24,48 # 1 natural ordered start at 0
create_nc('01_t0_t24_t48.nc', times=[0, 24., 48.], values=values)
# - 48,24,0 # 2 reverse natural ordered start at 0
create_nc('02_t48_t24_t0.nc', times=[48., 24, 0], values=values)
# - 0,48,24 # 3 mixed order start at zero
create_nc('03_t0_t48_t24.nc', times=[0, 48., 24.], values=values)
# - 24,48,72 # 4 natural ordered start at 24
create_nc('04_t24_t48_t72.nc', times=[24., 48., 72.], values=values)
# - 72,48,24 # 5 reverse natural ordered start at 24
create_nc('05_t72_t48_t24.nc', times=[72., 48., 24.], values=values)
# - 24,72,48 # 6 mixed order start at 24
create_nc('06_t24_t72_t48.nc', times=[24., 72., 48.], values=values)
# - -48,-24,0 # 7 natural ordered negative times, start at 0
create_nc('07_t-48_t-24_t0.nc', times=[-48., -24., 0], values=values)
# - 0,-24,-48 # 8 reverse natural order negative times, start at 0
create_nc('08_t0_t-24_t-28.nc', times=[0, -24., -48.], values=values)
# - 0,-48,-24 # 9 mixed order negative times, start at 0
create_nc('09_t0_t-48_t-24.nc', times=[0, -48., -24.], values=values)
# - -72,-48,-24 # 10 natural ordered negative times, start at -72 end -24
create_nc('10_t-72_t-48_t-24.nc', times=[-72., -48., -24.], values=values)
# - -24,-48,-72 # 11 reverse natural ordered negative times, start at -72 end -24
create_nc('11_t-24_t-48_t-72.nc', times=[-24., -48., -72.], values=values)
# - -48,-24,-72 # 12 mixed order negative times, start at -72 end -24
create_nc('12_t-48_t-24_t-72.nc', times=[-48., -24., -72.], values=values)
# - -24., 0, 24. # natural order, but with negative offset and zero
create_nc('13_t-24_t0_t24.nc', times=[-24., 0, 24.], values=values)
I will attach both the script AND the created nc files here to try out or generate new ones:
The text was updated successfully, but these errors were encountered:
rduivenvoorde
added
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Mesh
Related to general mesh layer handling (not specific data formats)
Temporal
Temporal filtering or animation
labels
Jun 14, 2023
BugEither a bug report, or a bug fix. Let's hope for the latter!MeshRelated to general mesh layer handling (not specific data formats)TemporalTemporal filtering or animation
What is the bug or the crash?
Mesh layers (more specific ugrid and netcdf's) have their time dimension (often) defined as 'hours/days since ...
Eg:
Then the time data array for a dataset with 3 datasets/frames contains for example:
time = 0, 24, 48 ;
or
time = 24,48,72;
There is/was an issue with QGIS dropping the last timeframe, see #48942 (could be fixed by #53422).
But with (#53422) in place, both time frame examples above are working
But when the time array contain negative values AND zero
time =-48,-24,0 ;
OR when the time array is not ordered:
time = -72,-24,-48 ;
QGIS fails to show the right amount of frames. As in either it does not update the Temporal Controller the right way, OR it does not show data when looking on the right frame (after manually adjusting Temporal Controller)
To me it looks like this has something to do with how QGIS/MdalProvider determines the frame count and temporal extent...
I think first fix would be to handle negative values (in natural order), with a zero ending, or with zero in between
Then we could decide on how to handle ordered values in reverse order (72,48,24)
And last we could decide IF we want to handle nc's in which the time offsets are mixed/non-ordered. I'm not sure if ordering (and keeping indexes) would be easy to do, or if this would mean that non only the Time/offset array has to be re-arranged, but also the data arrays...
Steps to reproduce the issue
To reproduce, I created a python file to create a serie of 13 very small ugrid netcdf's:
I will attach both the script AND the created nc files here to try out or generate new ones:
testdata_and_scripts.zip
(There is also a 'temporal_test.py' to check framecount and temporal limit of a loaded layer)
Versions
Master and earliers
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: