How can I extract specific weather data from a 3D grid?

15 ビュー (過去 30 日間)
Jake
Jake 2025 年 2 月 10 日 15:49
コメント済み: Star Strider 2025 年 2 月 11 日 15:18
I have two sets of data - one is measured data, and the other is obtained from The THREDDS Data Server (files are too big to attach, so I'll try to explain as much as I can).
The measured data include time (measured time in datatime format), latitude coordinates and longitude coordinates, and the parameter I'm interested in. All are column vectors. From THREDDS data, I have time (in datetime format), latitude coordinates and longitude coordinates, and the parameter as follows.
Name Size Bytes Class Attributes
dates 24x1 192 datetime
ff 2379x1995x24 455626080 single
lat 2379x1995 18984420 single
lon 2379x1995 18984420 single
What I want to do is extract the data from this THREADDS data for the given (or measured) time, lat, lot points. How can I do this?

採用された回答

Star Strider
Star Strider 2025 年 2 月 10 日 16:56
Without even representative data, I’m not certain even how to simulate this.
I would use the scatteredInterpolant function first with the THREADDS data (time, latitude, longitude and parameter) and then use the time, latitude, and longitude from the ‘measured’ data to interpolate the desired paramter at the ‘measured’ times and locations. (If I got this backwards, change my approach approproately.)
I don’t remember using scatteredInterpolant with datetime arrays, and the scatteredInterpolant documentation states that all the data have to be double, so first convert those to datenum or other numerical date representations that scattteredInterpolant can work with. You can change them back later.
.
  6 件のコメント
Jake
Jake 2025 年 2 月 11 日 15:12
Thank you, this seems to work with the samples I ran so far :)
Star Strider
Star Strider 2025 年 2 月 11 日 15:18
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by