Can I set variable TSK to NaN in WRF output file?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi there,
Basically, I need to produce a surface temperature plot with a certain colour scheme, but as you can see below, I have a few points which are way hotter than expected and are throwing off the rest of the map;

I'm using the TSK variable from WRF to make this plot. I was wondering if there might be anyway to set TSK values in the WRF output file to NaN when TSK exceeds 328 K?
Thank you!
댓글 수: 0
채택된 답변
Voss
2022년 12월 10일
Code adapted from your other question.
filename=('wrfout_d03_2018-07-03_12:00:00');
temp=ncread(filename, 'TSK');
temp(temp > 328) = NaN; % set any temp > 328 to NaN
% temp(temp > 328 | temp < 283) = NaN; % or if you wanted to set any temp
% outside the range 283->328 to NaN
longitude=ncread(filename, 'XLONG');
latitude=ncread(filename, 'XLAT');
mycolours = [0 0 168/255; 0 0 250/255; 0 52/255 1; 0 129/255 1; 0 200/255 1; 35/255 1 212/255; 93/255 1 154/255; 154/255 1 93/255; 212/255 1 35/255; 1 219/255 0; 1 148/255 0; 1 82/255 0; 250/255 15/255 0; 168/255 0 0]
colormap(mycolours);
contourf(longitude, latitude, temp, 283:328);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!