% cd('/project/meteo/data/miraMACS/mom')
% dir('*.nc')

clear all;close all;
fn='20230801_0000.nc';
z=ncread(fn,'Ze');

Z=10*log10(z);
ht=ncread(fn,'range')/1000;



msd0=10*log10(ht.^2)-68;
msd1=10*log10(ht.^2)-60;
msd2=10*log10(ht.^2)-53;
msd3=10*log10(ht.^2)-52;
msd5=10*log10(ht.^2)-51;

threshold=nanmean(Z')-msd2';
Z(:,find(threshold<20))=NaN;

figure
contourf(1:size(Z,2),(ht+0.520),Z,'linestyle','none')
caxis([-50 30])
colormap('jet')
ylim([0 12])
colorbar('north')
set(gca,'Tickdir','in','Ticklength',([0.015 0.015]),'Xminortick','on','Yminortick','on','fontsize',15,'fontweight','bold','linewidth',2.5);