獵風者衛星 Triton
(使用Octave)
以下內容使用獵風者衛星目前公開資料中最早的一天(2023/11/14、2023年第318天)的資料數據,風速為海面上10公尺高的風速資料(資料說明來自檔案中的描述),使用風速參數為"wind3_5"。
獵風者衛星接收從海面反射的美國GPS和日本QZSS訊號,根據海面波浪強弱、所造成的反射強度不同,推導出海面風速。
資料下載:https://tacc.cwa.gov.tw/v2/triton_download.html,需註冊後經回信始可下載。
pkg load netcdf
#設定要分析的檔案名稱,並打開
filename = 'C:\fs7data\triton\20231114\TRITON_011718_20231113235048_roughness_windspeed_v1.0_nc';
ncid = netcdf.open(filename, 'NC_NOWRITE');
#資料參數的代號、格式
more
ncdisp(filename);
參數代號:
year:年
month:月
day:日
hour:時
minute:分
second:秒
wind1_1:風速(m/s),1*1網格點
wind3_5:風速(m/s),3*5網格點
wind13_21:風速(m/s),13*21網格點
splon:經度(0°~360°)
splat:緯度(-90°~+90°)
Vp:水氣壓 [hPa]
風速說明:
wind1_1:"m/s" "wind speed at 10 meter height" retrieved by using 1*1 grid with SP corresponding delay and Doppler frequency at ... "
wind3_5:"m/s" "wind speed at 10 meter height" "retrieved by using 3*5 grid with SP corresponding delay and Doppler frequency at ... "
wind13_21:"m/s" "wind speed at 10 meter height" "retrieved by using 13*21 grid with SP corresponding delay and Doppler frequency at ... "
pkg load netcdf
pkg load io
pkg load mapping
folder_path = 'C:\fs7data\triton'; % 資料夾路徑
file_list = dir(fullfile(folder_path, '*_nc')); % 所有 .nc 檔案
results = []; % 用於存儲結果的數組
for i = 1:length(file_list)
file_path = fullfile(folder_path, file_list(i).name);
ncid = netcdf.open(file_path, 'NC_NOWRITE');
try
% 設定變數名稱
wind_varid = netcdf.inqVarID(ncid, 'wind13_21');
lon_varid = netcdf.inqVarID(ncid, 'splon');
lat_varid = netcdf.inqVarID(ncid, 'splat');
% 讀取數據
wind_speed = netcdf.getVar(ncid, wind_varid);
lon = netcdf.getVar(ncid, lon_varid);
lat = netcdf.getVar(ncid, lat_varid);
% 將經度從0-360範圍轉換為-180到180範圍
lon(lon > 180) = lon(lon > 180) - 360;
% 過濾風速小於0的數據
valid_indices = find(wind_speed >= 0);
wind_speed = wind_speed(valid_indices);
lon = lon(valid_indices);
lat = lat(valid_indices);
% 合併數據到結果數組
results = [results; lon(:), lat(:), wind_speed(:)];
catch
warning(['Error reading variables from file: ', file_list(i).name]);
end
% 關閉 NetCDF 文件
netcdf.close(ncid);
end
% 將結果寫入 CSV 文件
csvwrite('C:\fs7data\results.csv', results);
% 繪製二維散點圖,使用風速進行著色
figure;
scatter(results(:, 1), results(:, 2), 36, results(:, 3), 'filled'); % 36 是點的大小
xlabel('Longitude');
ylabel('Latitude');
title('2023/11/14 TRITON wind speed (m/s)');
colorbar; % 添加顏色條
% 調整x軸和y軸範圍
xlim([-180 180]);
ylim([-90 90]);
% 讀取 Shapefile 文件
coastline = shaperead('C:\fs7data\ne_110m_coastline.shp');
% 繪製海岸線
hold on;
for k = 1:length(coastline)
plot(coastline(k).X, coastline(k).Y, 'k'); % 使用黑色繪製海岸線
end
hold off;
% 設置 x 軸和 y 軸比例相同
axis equal;
2023/11/14-2023/12/31
全部的海面風速資料