国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

1. 常規(guī)數(shù)據(jù)處理—nc轉(zhuǎn)tif

2023-03-23 21:38 作者:z某人oo  | 我要投稿

我這里的nc格式的數(shù)據(jù)轉(zhuǎn)tif,與CMIP模式的nc數(shù)據(jù)是不同的,這里的nc數(shù)據(jù)是等間距投影,與CMIP6的模式數(shù)據(jù)相比要更簡(jiǎn)單。

這里我使用的是matlab來處理。

咱們也不是專門搞編程的,怎么簡(jiǎn)單怎么處理,網(wǎng)上的教程很多,復(fù)雜的語言,代碼也很多。我們的目的就是為了得到這個(gè)數(shù)據(jù),會(huì)處理,會(huì)使用,那就OK了。

直接上代碼,粘貼到matlab,改改路徑,就可以直接運(yùn)行,沒有編程基礎(chǔ)的人也可以輕松上手,代碼不難。

datadir = 'G:\1901_2021\1960-2020month_pcp\2_nc\'; %指定批量數(shù)據(jù)所在的文件夾

filelist = dir([datadir,'*.nc']); %列出所有滿足指定類型的文件

? ? for year=1960:1984

? ? ? ? ncFilePath=['G:\1901_2021\1960-2020month_pcp\2_nc\CN_Prec_MonthlyMean_1km_',num2str(year),'.nc'];

? ? ? ? lon=ncread(ncFilePath,'longitude');

? ? ? ? lat=ncread(ncFilePath,'latitude');

? ? ? ? time=ncread(ncFilePath,'time');

? ? ? ? tmp=ncread(ncFilePath,'pre');

? ? ? ? k=0;? ? ? ??

? ? ? ? datasum = zeros(4251,7397);

? ? ? ? datasum=double(datasum);

? ? ? ? ?for j=1:12

? ? ? ? ? ? ?k=k+1;

? ? ? ? ?tmp1=tmp(:,:,k);?

? ? ? ? ?data=flipud(tmp1);

? ? ? ? ?data(data==-32768)=NaN;

? ? ? ? ?R = georasterref('RasterSize', size(data),'Latlim', [double(min(lat)) double(max(lat))], 'Lonlim', [double(min(lon)) double(max(lon))]);%地理柵格數(shù)據(jù)參考對(duì)象(類)

? ? ? ? ?if j==1||3||5||7||8||10||12

? ? ? ? ? ? ?data=data*31;

? ? ? ? ?elseif j==4||6||9||11

? ? ? ? ? ? ?data=data*30;

? ? ? ? ?else

? ? ? ? ? ? ?data=data*28;

? ? ? ? ?end

? ? ? ? ?filename1=['G:\1901_2021\1960-2020month_pcp\3_tif\pcp_',num2str(year),'_',num2str(j),'.tif'];

? ? ? ? ?geotiffwrite(filename1,data,R);

? ? ? ? ?datasum = data + datasum;

? ? ? ? ?end

? ? ? ? ?filename1=['G:\1901_2021\1960-2020month_pcp\3_tif\pcpyearsum_',num2str(year),'.tif'];

? ? ? ? ?geotiffwrite(filename1,datasum,R);

? ? ? ? ?datasum = datasum./12.0;

? ? ? ? ?filename1=['G:\1901_2021\1960-2020month_pcp\3_tif\pcpyearavg_',num2str(year),'.tif'];

? ? ? ? ?geotiffwrite(filename1,datasum,R);

? ? ?end

上述代碼處理的數(shù)據(jù)集為如下:1960-2020年中國1公里分辨率月降水?dāng)?shù)據(jù)集

瞿莉莎, 朱求安, 朱超凡, 等. 1960-2020年中國1公里分辨率月降水?dāng)?shù)據(jù)集[DS/OL]. Science Data Bank,2022[2022-03-31].http://www.scidb.cn/cstr/31253.11.sciencedb.01607. CSTR:31253.11.sciencedb.01607.

代碼可以參考的博客鏈接為:

https://zhuanlan.zhihu.com/p/396339178

再次基礎(chǔ)上做了修改,我們處理的是不同數(shù)據(jù)源的nc格式的降水?dāng)?shù)據(jù),所以代碼略有不同,但中心思想是一致的,代買簡(jiǎn)單,易懂。還可以查查其他文獻(xiàn)來學(xué)習(xí)。

1. 常規(guī)數(shù)據(jù)處理—nc轉(zhuǎn)tif的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
德安县| 钦州市| 那曲县| 仁化县| 江源县| 句容市| 烟台市| 利川市| 来宾市| 黄平县| 浪卡子县| 宿松县| 泗水县| 淳安县| 宜春市| 罗源县| 阜阳市| 福建省| 伊春市| 太仆寺旗| 长春市| 孟连| 昌都县| 梅州市| 尤溪县| 应用必备| 泽库县| 崇阳县| 娄烦县| 洛川县| 十堰市| 凉城县| 墨竹工卡县| 富宁县| 福清市| 永福县| 湘西| 偃师市| 河北区| 广宁县| 麟游县|