[Qgis-user] Get Time-vector from Mesh (netcdf/mdal) in pyqgis

Richard Duivenvoorde rdmailings at duif.net
Mon Jan 13 07:31:17 PST 2025


Hi,

Anybody experience getting the actual time-data from a QGIS MeshLayer as some kind of data array?

Context: my netcdf's contains negative(!) time values (a model calculating back in time):

ncdump/info tell's me:

time:units = "minutes since 2024-01-31 22:00:00.0Z" ;
time = -27240, -27120, -27000, -26880, -26760, -26640, -26520, -26400,
     -26280, -26160, -26040, -25920, -25800, -25680, -25560, -25440, -25320,
     -25200, -25080, -24960, -24840, -24720, -24600, -24480, -24360, -24240,
     ...
     -5280, -5160, -5040, -4920, -4800, -4680, -4560, -4440, -4320, -4200,
     -4080, -3960, -3840, -3720, -3600, -3480, -3360, -3240, -3120, -3000,
     -2880, -2760, -2640, -2520, -2400, -2280, -2160, -2040, -1920, -1800,
     -1680, -1560, -1440, -1320, -1200, -1080, -960, -840, -720, -600, -480,
     -360, -240, -120 ;

And I want to be able to calculate the right start time for the temporal controller (as QGIS/MDAL is not aware of negative values. It returns a 2024-01-31 22:00:00.0Z - 2024-01-31 22:00:00.0Z TimeExtent).

It looks like the time parameter is not part of the list you get from: layer.datasetGroupsIndexes()
And layer.timeSettings() is not helpful either :-(

Any pointers appreciated,

Regards,

Richard Duivenvoorde




More information about the QGIS-User mailing list