[Matlab] Matlab三维涡旋温度、盐度、流速以及合成图

[复制链接]

本文作者:波哥

工作单位:中国海洋大学海洋与大气学院

联系邮箱:916490285@qq.com


1 三维涡旋温度、盐度、流速以及合成图:

1.1 三维涡旋盐度图:


* o0 F/ R) a) _. z+ ?0 y

[C] 纯文本查看 复制代码
clc;clear;close all

fig_h=figure;

set(fig_h,'position',[50,50,1200,1200])

for j=1:2

    if j==1

        load('cyc_lat_lon.mat')%读取已经切好的数据;cyc 气旋

        load('cyc_data.mat')%读取已经切好的数据;TSUV3

        lev=1;

        [c,i]=min(abs(lat-lat_cyc_bowl(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_cyc_bowl(3,1)));

        Lat=lat(:,i(1));

        llat=lat_cyc_bowl(3,:);

        llon=lon_cyc_bowl(3,:);

    else

        load('anti_lat.mat')%anti反气旋数据

        load('anti_data.mat')%anti反气旋数据

        [c,i]=min(abs(lat-lat_anti_lense(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_anti_lense(3,1)));

        Lat=lat(:,i(1));

        llat=lat_anti_lense(8,:);

        llon=lon_anti_lense(8,:);

    end

    % meshgrid 网格化数据;

    [X1,Y1,Z1]=meshgrid(Lon,Lat,level);% level 是深度;

    T=sst3d;

    u=u3d;

    v=v3d;

    Sal=salt3d;

    %% plot sal

    subplot(1,2,j)

    slice(X1,Y1,Z1,Sal,[],[],-1*depth(1:5))%(1:5)画5层的盐度图;

    shading interp

    colormap jet

    hold on

    plot3(llon(1:5),llat(1:5),-1*depth(1:5),'o--b')% 判断出来涡旋中心的位置,进行画线条;

    xlabel('Longitude')

    ylabel('Latitude')

    zlabel('Depth(m)')

    set(gca,'ztick',[-200 -150 -100 -50 -10])

    view(-44,15)

    if j==1

        title('气旋 盐度')

    else

        title('反气旋 盐度')

    end

end

colorbar

saveas(fig_h,'3d_salt.png')

7 w6 s0 B( s; Q. Q

4525be5566d35f9c7b8c071df5218d88.png


1.2 三维涡旋温度、盐度、流速以及合成图:

, T$ ]7 g' T! S4 d( \  X6 n

[C] 纯文本查看 复制代码
%% temp

clc;clear;close all

fig_h=figure;

set(fig_h,'position',[50,50,1200,1200])

for j=1:2

    if j==1

        load('cyc_lat_lon.mat')%读取已经切好的数据;cyc 气旋

        load('cyc_data.mat')%读取已经切好的数据;TSUV3

        lev=1;

        [c,i]=min(abs(lat-lat_cyc_bowl(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_cyc_bowl(3,1)));

        Lat=lat(:,i(1));

        llat=lat_cyc_bowl(3,:);

        llon=lon_cyc_bowl(3,:);

    else

        load('anti_lat.mat')%anti反气旋数据

        load('anti_data.mat')%anti反气旋数据

        [c,i]=min(abs(lat-lat_anti_lense(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_anti_lense(3,1)));

        Lat=lat(:,i(1));

        llat=lat_anti_lense(8,:);

        llon=lon_anti_lense(8,:);

    end

    % meshgrid 网格化数据;

    [X1,Y1,Z1]=meshgrid(Lon,Lat,level);% level 是深度;

    T=sst3d;

    u=u3d;

    v=v3d;

    Sal=salt3d;

    %% plot sal

    subplot(1,2,j)

    slice(X1,Y1,Z1,T,[],[],-1*depth(1:5))%(1:5)画5层的盐度图;

    shading interp

    colormap jet

    hold on

    plot3(llon(1:5),llat(1:5),-1*depth(1:5),'o--b')% 判断出来涡旋中心的位置,进行画线条;

    xlabel('Longitude')

    ylabel('Latitude')

    zlabel('Depth(m)')

    set(gca,'ztick',[-200 -150 -100 -50 -10])

    view(-44,15)

    if j==1

        title('气旋 温度')

    else

        title('反气旋 温度')

    end

end

colorbar

saveas(fig_h,'3d_temp.png')

853399e093fecbd2f2de7284d3294f08.png


1.3 三维涡旋温度、盐度、流速以及合成图:

+ E, g3 J7 I" n+ Q. ]0 V

[C] 纯文本查看 复制代码
%% u v

clc;clear;close all

fig_h=figure;

set(fig_h,'position',[50,50,1200,1200])

for j=1:2

    if j==1

        load('cyc_lat_lon.mat')%读取已经切好的数据;cyc 气旋

        load('cyc_data.mat')%读取已经切好的数据;TSUV3

        lev=1;

        [c,i]=min(abs(lat-lat_cyc_bowl(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_cyc_bowl(3,1)));

        Lat=lat(:,i(1));

        llat=lat_cyc_bowl(3,:);

        llon=lon_cyc_bowl(3,:);

    else

        load('anti_lat.mat')%anti反气旋数据

        load('anti_data.mat')%anti反气旋数据

        [c,i]=min(abs(lat-lat_anti_lense(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_anti_lense(3,1)));

        Lat=lat(:,i(1));

        llat=lat_anti_lense(8,:);

        llon=lon_anti_lense(8,:);

    end

    % meshgrid 网格化数据;

    [X1,Y1,Z1]=meshgrid(Lon,Lat,level);% level 是深度;

    T=sst3d;

    u=u3d;

    v=v3d;

    [m,n,p]=size(u);

    w=zeros(m,n,p);

    Sal=salt3d;

    %% plot uv    

    subplot(1,2,j)

    for i=1:5

        loc(i) = find(level==-depth(i));        

        quiver3(X1(1:4:end,1:4:end,loc(i)),Y1(1:4:end,1:4:end,loc(i)),Z1(1:4:end,1:4:end,loc(i)),u(1:4:end,1:4:end,loc(i)),v(1:4:end,1:4:end,loc(i)),w(1:4:end,1:4:end,loc(i)),2)%(1:5)画5层的uv图;

    hold on

    end

%     colormap jet

    hold on

    plot3(llon(1:5),llat(1:5),-1*depth(1:5),'o--b')% 判断出来涡旋中心的位置,进行画线条;

    xlabel('Longitude')

    ylabel('Latitude')

    zlabel('Depth(m)')

    set(gca,'ztick',[-200 -150 -100 -50 -10])

    view(-44,15)

    if j==1

        title('气旋 流速')

    else

        title('反气旋 流速')

    end

end

saveas(fig_h,'3d_uv.png')


4 `! H& ~- J, I+ E. ^

e31d17ae226c998e37a8f6e9a09ea863.png


1.4 三维涡旋温度、盐度、流速以及合成图:


# X) ?: F; S% T$ H% _+ E# q
[C] 纯文本查看 复制代码
%% u v temp

clc;clear;close all

fig_h=figure;

set(fig_h,'position',[50,50,1200,1200])

for j=1:2

    if j==1

        load('cyc_lat_lon.mat')%读取已经切好的数据;cyc 气旋

        load('cyc_data.mat')%读取已经切好的数据;TSUV3

        lev=1;

        [c,i]=min(abs(lat-lat_cyc_bowl(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_cyc_bowl(3,1)));

        Lat=lat(:,i(1));

        llat=lat_cyc_bowl(3,:);

        llon=lon_cyc_bowl(3,:);

    else

        load('anti_lat.mat')%anti反气旋数据

        load('anti_data.mat')%anti反气旋数据

        [c,i]=min(abs(lat-lat_anti_lense(3,1)));

        Lon=lon(i(1),:);

        [c,i]=min(abs(lon-lon_anti_lense(3,1)));

        Lat=lat(:,i(1));

        llat=lat_anti_lense(8,:);

        llon=lon_anti_lense(8,:);

    end

    % meshgrid 网格化数据;

    [X1,Y1,Z1]=meshgrid(Lon,Lat,level);% level 是深度;

    T=sst3d;

    u=u3d;

    v=v3d;

    [m,n,p]=size(u);

    w=zeros(m,n,p);

    Sal=salt3d;

    %% plot uv    

    subplot(1,2,j)

    for i=1:5

        loc(i) = find(level==-depth(i));        

        quiver3(X1(1:4:end,1:4:end,loc(i)),Y1(1:4:end,1:4:end,loc(i)),Z1(1:4:end,1:4:end,loc(i)),u(1:4:end,1:4:end,loc(i)),v(1:4:end,1:4:end,loc(i)),w(1:4:end,1:4:end,loc(i)),2,'k')%(1:5)画5层的uv图;

    hold on

    end

    slice(X1,Y1,Z1,T,[],[],-1*depth(1:5))%(1:5)画5层的盐度图;

    shading interp

    colormap jet

    hold on

    plot3(llon(1:5),llat(1:5),-1*depth(1:5),'o--b')% 判断出来涡旋中心的位置,进行画线条;

    xlabel('Longitude')

    ylabel('Latitude')

    zlabel('Depth(m)')

    set(gca,'ztick',[-200 -150 -100 -50 -10])

    view(-44,15)

    if j==1

        title('气旋 温度+流速')

    else

        title('反气旋 温度+流速')

    end

end

colorbar

saveas(fig_h,'3d_uv_temp.png')

[p=null, 2, center][color=rgb(0, 0, 0)][font=sans-serif][size=16px]

090230b9d180956e138405da89dc0b45.png

获取本文Matlab三维涡旋温度、盐度、流速以及合成图源代码和数据的途径:

游客,如果您要查看本帖隐藏内容请回复


- q& E- T( F1 J* {2 f
回复

举报 使用道具

相关帖子

全部回帖
感谢大佬!膜拜!8 l' d) M% |: j/ h2 J5 I
发表于 2023-5-27 17:16:54

举报 回复 使用道具

厉害!

发表于 2023-10-21 23:07:45

举报 回复 使用道具

懒得打字?点击右侧快捷回复 【吾爱海洋论坛发文有奖】
您需要登录后才可以回帖 登录 | 立即注册
胡知恩
活跃在2022-5-26
快速回复 返回顶部 返回列表