一、实验目的
使用National Data Buoy Center提供的某一站点浮标数据,画出该站点一年中每月的风矢量分布图。
二、实验数据
数据来源:National Data Buoy Center 第41013号浮标(33.441 N 77.764 W)2021年的Standard meteorological data其中包含了风向和风速数据,每十分钟报告一次数据。数据格式:txt格式
三、实验方法
1.从matlab社区下载Daniel Pereira提供的Wind Rose函数包
Wind Rose - File Exchange - MATLAB Central (mathworks.cn);
2.下载数据,查看data descriptions,使用matlab读取所需要的数据
NDBC - Measurement Descriptions and Units (noaa.gov);
3.使用WindRose函数作图。
由Daniel Pereira提供的Wind Rose函数包截图 函数使用说明截图 Standard meteorological data的数据描述截图
四、实验代码
clc;clear all;data=importdata('41013h2021.txt');save data.mat data;load('data.mat');months={'January';'February';'March';'April';'May';'June';...'July';'August';'September';'October';'November';'December'}; %月份表用于成标题Options .anglenorth=0; %确定正方向Options .angleeast= 90; %确定正方向Options .freqlabelangle='auto'; %百分比标签角度自动在case较少方向Options .lablegend= "Wind Speeds m/s"; %图例名称Options.labels = {'N ', 'E ', 'S ', 'W '}; %径向标签Options.LegendType= 1; %选择图例模式Options.nFreq=2; %圆形网格线数量Options.cmap='jet'; %颜色表inv+'hot','parula','jet','hat','cool','spring'...Options.vWinds=[0 5 10 15 20]; %风速分隔值wind_all=data.data(:,[1:3,6:7]);%提取数据 年,月,日,风向,风速set(gcf,'outerposition',get(0,'screensize'),'Name','station 44013(33.441 N 77.764 W) '); %定义窗口为屏幕大小和名称for month=1:12W_dir_sp=wind_all(wind_all(:,2)==month,4:5); %提取相应月份数据Options.TitleString=['Wind Rose for 2021 ',char(months(month))]; %根据月份生成标题Options.axes=subplot(3, 4, month); %划分3行4列,放置每月图像WindRose(W_dir_sp(:,1),W_dir_sp(:,2), Options); %生成WindRose图end%%% month=2;%直接画出某月图像% W_dir_sp=wind_all(wind_all(:,month)==2,4:5); % Options.TitleString=['Wind Rose for 2021 ',char(months(month))]; %根据月份生成标题% WindRose(W_dir_sp(:,1),W_dir_sp(:,2), Options); %生成WindRose图
五、实验结果
station 44013(33.441 N 77.764 W)
另外该函数包还有可以直接使用的ExcelImportExport函数完成对数据的分析并生成Excel文件。
欢迎交流!