-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportant Matlab Scripts.m
More file actions
66 lines (48 loc) · 2.07 KB
/
Copy pathImportant Matlab Scripts.m
File metadata and controls
66 lines (48 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% t-test for spatial level pixel data %%%%%%%%%%%%%%%%%%%%%
for ii = 1:41 %%%%%% For Longitudes
for jj = 1:41 %%%% For Latitudes
h_Trend_Diff_DJF(ii,jj) = ttest(Trend_Mag_Wind_1999_2019_DJF(ii,jj,:),Trend_Mag_Wind_1979_1999_DJF(ii,jj,:),0.1);
end
end
%%% location of the places where h=1
[i_sig_DJF,j_sig_DJF] = find(h_Trend_Diff_DJF == 1);
t1 = longitude(i_sig_DJF);
t2 = latitude(j_sig_DJF);
scatter(t1,t2,'filled',0.5)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% load multiple nc files %%%%%%%%%%%%%%%%%%%%%
files= dir('wrfout_*')
filename = files(1).name;
for k = 1:length(files)
filename = files(k).name;
t1 = ncread(filename,'SNOWH'); %bias corrected precipitation
wrf_NSSL_SNOWH(:,:,k)= t1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% load multiple hdf files %%%%%%%%%%%%%%%%%%%%
Longitude = double(hdfread(filename,'/mod08/Data Fields/XDim','Index',{[1],[1],[360]}));
Latitude = double(hdfread(filename,'/mod08/Data Fields/YDim','Index',{[1],[1],[180]}));
for k = 1:length(files)
filename = files(k).name;
t1 = double(hdfread(filename,'/mod08/Data Fields/Cloud_Fraction_Mean_Mean','Index',{[1 1],[1 1],[180 360]}));
CFr(:,:,k)= t1;
end
CFr(CFr<0)=NaN; CFr_mean = nanmean(CFr,3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% Clip any shapefile from nc file %%%%%%%%%%%%%%%%
k1=shaperead('Jammu_Kashmir.shp');
lon_lad=extractfield(k1,'X');
lat_lad=extractfield(k1,'Y')
t1=imread('J&K_Clip_0.25.tif');
t1(t1<0)=NaN; t1(t1>0)=1;
invert_clip = t1'; %%% (size = 31,20)
for ii=1:13
for jj=1:12
if (invert_clip(ii,jj)==1)
specific_snow_water_content_JK_extracted(ii,jj,:)=specific_snow_water_content_JK(ii,jj,:);
else
specific_snow_water_content_JK_extracted(ii,jj,:)=invert_clip(ii,jj);
end
end
end