How to read a netcdf file and convert it to time table

8 visualizaciones (últimos 30 días)
Hamed Hedayatnia
Hamed Hedayatnia el 17 de Nov. de 2020
Comentada: Hamed Hedayatnia el 21 de Nov. de 2020
Hi guys,
I have a climate data file in netsdf format containing long, lat, time and temperature. The issue is that temperature has been shown for 9 lang and 5 lat during 3 years.
As can be observed. I need to extract t2m variable during the time for each lat,long(9*5=45 different point).
The question is how can I do that?
Thanks in advsnce

Respuestas (1)

Peter Perkins
Peter Perkins el 19 de Nov. de 2020
Hamed, it's not currently possible to create a timetable that is 3-D (lat-by-lon-by-time). One thing you can do is make a 45*8759x3 timetable, with variables for lat, lon, and temp. Another possibility is to make an 8759x45 timetable with one var for each grid point. Or an 8759x9 timetable each of whose variables is itself 8759x5.
Hard to say which of these might work for you, it depends on what you need to do next.
  3 comentarios
Peter Perkins
Peter Perkins el 19 de Nov. de 2020
I think in all cases you first need permute to turn 9x5x8759 into 8759x9x5.
You would use ndgrid to create the repeated lat/lon for the 45*8759x3 option, and yes, reshape on the temperatures. Reshape and and array2table would get you the 8759x45 version. Subscripting and the table constructor would get you the 8759x9 version.
Hamed Hedayatnia
Hamed Hedayatnia el 21 de Nov. de 2020
How can I create an 8759x45 timetable with one var for each grid point?

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by