1 | Project='/.fsnet/project/coriolis/2024/24PLUME/0_REF_FILES'; |
---|
2 | npx_ima=2560;npy_ima=2160; |
---|
3 | Dx=10; |
---|
4 | nbinterv_x=floor((npx_ima-1)/Dx); |
---|
5 | gridlength_x=nbinterv_x*Dx; |
---|
6 | minix=ceil((npx_ima-gridlength_x)/2); |
---|
7 | xpos=minix:Dx:npx_ima-1; |
---|
8 | ypos=[120:2:130 135:5:400 410:10:npy_ima]; |
---|
9 | ydiff=diff(ypos); |
---|
10 | corrbox_y=2*[ydiff ydiff(end)]; |
---|
11 | [GridX,GridY]=meshgrid(xpos,ypos); |
---|
12 | [~,CorrBoxY]=meshgrid(ones(size(xpos)),corrbox_y); |
---|
13 | CorrBoxX=400./CorrBoxY+1; |
---|
14 | max(max(CorrBoxX)) |
---|
15 | |
---|
16 | figure |
---|
17 | plot(GridX,GridY,'+') |
---|
18 | Data.ListVarName={'Grid','CorrBox'}; |
---|
19 | Data.VarDimName={{'nbvec','NbDim'},{'nbvec','NbDim'}}; |
---|
20 | Data.Grid=zeros(numel(CorrBoxX),2); |
---|
21 | Data.Grid(:,1)=reshape(GridX,[],1); |
---|
22 | Data.Grid(:,2)=reshape(GridY,[],1);% increases with array index |
---|
23 | Data.CorrBoxSize=zeros(numel(CorrBoxX),2); |
---|
24 | Data.CorrBoxSize(:,1)=reshape(CorrBoxX,[],1); |
---|
25 | Data.CorrBoxSize(:,2)=reshape(CorrBoxY,[],1);% increases with array index |
---|
26 | |
---|
27 | struct2nc(fullfile(Project,'grid.nc'),Data) |
---|