Skip to content

Commit 4f9464f

Browse files
committed
lint
1 parent 7b1e7a1 commit 4f9464f

File tree

16 files changed

+142
-142
lines changed

16 files changed

+142
-142
lines changed

+gemini3d/+efield/Efield_BCs.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ function Efield_BCs(p, xg)
6161
end
6262
end
6363

64-
thetamin = min(xg.theta(:));
65-
thetamax = max(xg.theta(:));
66-
mlatmin = 90-thetamax*180/pi;
67-
mlatmax = 90-thetamin*180/pi;
68-
mlonmin = min(xg.phi(:))*180/pi;
69-
mlonmax = max(xg.phi(:))*180/pi;
64+
thetamin = min(xg.theta, 'all');
65+
thetamax = max(xg.theta, 'all');
66+
mlatmin = 90- rad2deg(thetamax);
67+
mlatmax = 90- rad2deg(thetamin);
68+
mlonmin = rad2deg(min(xg.phi, 'all'));
69+
mlonmax = rad2deg(max(xg.phi, 'all'));
7070

7171
% add a 1% buff
7272
latbuf = 1/100 * (mlatmax-mlatmin);

+gemini3d/+grid/model2geocoords.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
lalt (1,1) {mustBePositive,mustBeInteger} = 150
66
llon (1,1) {mustBePositive,mustBeInteger} = 150
77
llat (1,1) {mustBePositive,mustBeInteger} = 150
8-
altlims (1,2) {mustBeReal} = [min(xg.alt, 'all')+0.0001, max(xg.alt, 'all')-0.0001]
8+
altlims (1,2) {mustBeReal} = [min(xg.alt, [], 'all')+0.0001, max(xg.alt, [], 'all')-0.0001]
99
glonlims (1,2) {mustBeReal} = [nan,nan]
1010
glatlims (1,2) {mustBeReal} = [nan,nan]
1111
end
@@ -36,10 +36,10 @@
3636
%end %if
3737

3838
if any(isnan(glonlims))
39-
glonlims=[min(double(glon(:))), max(double(glon(:)))];
39+
glonlims=[min(glon, [], 'all'), max(glon, [], 'all')];
4040
end
4141
if any(isnan(glatlims))
42-
glatlims=[min(double(glat(:))), max(double(glat(:)))];
42+
glatlims=[min(glat, [], 'all'), max(glat, [], 'all')];
4343
end
4444

4545
%% Define a regular mesh of a set number of points that encompasses the grid (or part of the grid)
@@ -50,8 +50,8 @@
5050

5151

5252
%% Identify the type of grid that we are using
53-
minh1=min(xg.h1(:));
54-
maxh1=max(xg.h1(:));
53+
minh1=min(xg.h1, [], 'all');
54+
maxh1=max(xg.h1, [], 'all');
5555
if (abs(minh1-1)>1e-4 || abs(maxh1-1)>1e-4) %curvilinear grid
5656
flagcurv=1;
5757
else %cartesian grid

+gemini3d/+grid/model2magUENcoords.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
lz=150; lx=150; ly=150;
2424
end %if
2525
if (nargin<8) %default to using grid limits if not given
26-
zlims=[min(zUEN(:))+1,max(zUEN(:))-1]; %stay just inside given grid
27-
xlims=[min(xUEN(:))+1,max(xUEN(:))-1];
28-
ylims=[min(yUEN(:))+1,max(yUEN(:))-1];
26+
zlims=[min(zUEN, 'all')+1,max(zUEN, 'all')-1]; %stay just inside given grid
27+
xlims=[min(xUEN, 'all')+1,max(xUEN, 'all')-1];
28+
ylims=[min(yUEN, 'all')+1,max(yUEN, 'all')-1];
2929
end %if
3030

3131

@@ -37,8 +37,8 @@
3737

3838

3939
%% Identify the type of grid that we are using
40-
minh1=min(xg.h1(:));
41-
maxh1=max(xg.h1(:));
40+
minh1=min(xg.h1, 'all');
41+
maxh1=max(xg.h1, 'all');
4242
if (abs(minh1-1)>1e-4 || abs(maxh1-1)>1e-4) %curvilinear grid
4343
flagcurv=1;
4444
else %cartesian grid

+gemini3d/+model/magcalc.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ function magcalc(direc, dang, xg)
3939

4040
%TABULATE THE SOURCE OR GRID CENTER LOCATION
4141
if isempty(cfg.sourcemlon)
42-
thdist=mean(xg.theta(:));
43-
phidist=mean(xg.phi(:));
42+
thdist=mean(xg.theta, 'all');
43+
phidist=mean(xg.phi, 'all');
4444
else
4545
thdist= pi/2 - deg2rad(cfg.sourcemlat); %zenith angle of source location
4646
phidist= deg2rad(cfg.sourcemlon);

+gemini3d/+particles/grid.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@
6464
pg.Qit = zeros(pg.llon, pg.llat, Nt);
6565
pg.E0it = nan(pg.llon, pg.llat, Nt);
6666

67-
thetamin = min(xg.theta(:));
68-
thetamax = max(xg.theta(:));
69-
mlatmin = 90-thetamax*180/pi;
70-
mlatmax = 90-thetamin*180/pi;
71-
mlonmin = min(xg.phi(:))*180/pi;
72-
mlonmax = max(xg.phi(:))*180/pi;
67+
thetamin = min(xg.theta, 'all');
68+
thetamax = max(xg.theta, 'all');
69+
mlatmin = 90- rad2deg(thetamax);
70+
mlatmax = 90- rad2deg(thetamin);
71+
mlonmin = rad2deg(min(xg.phi, 'all'));
72+
mlonmax = rad2deg(max(xg.phi, 'all'));
7373

7474
% add a 1% buffer
7575
latbuf = 1/100*(mlatmax-mlatmin);

+gemini3d/+plot/cart2d.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ function cart2d(time,xg,parm,parmlbl,caxlims,sourceloc, h, cmap)
4646

4747

4848
%SIZE OF PLOT GRID THAT WE ARE INTERPOLATING ONTO
49-
meantheta=mean(xg.theta(:));
50-
%meanphi=mean(xg.phi(:));
49+
meantheta=mean(xg.theta, 'all');
50+
%meanphi=mean(xg.phi, 'all');
5151
y=-1*(xg.theta-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below, runs backward from north distance, hence the negative sign
5252
%x=(xg.phi-meanphi); %mag. lon coordinate, pos. eastward
5353
x=xg.x2(inds2)/Re/sin(meantheta);
5454
z=xg.alt;
5555
lxp=500;
5656
lyp=500;
5757
lzp=500;
58-
minx=min(x(:));
59-
maxx=max(x(:));
60-
miny=min(y(:));
61-
maxy=max(y(:));
62-
minz=min(z(:));
63-
maxz=max(z(:));
58+
minx=min(x, 'all');
59+
maxx=max(x, 'all');
60+
miny=min(y, 'all');
61+
maxy=max(y, 'all');
62+
minz=min(z, 'all');
63+
maxz=max(z, 'all');
6464
xp=linspace(minx,maxx,lxp); %eastward distance (rads.)
6565
yp=linspace(miny,maxy,lyp); %should be interpreted as northward distance (in rads.). Irrespective of ordering of xg.theta, this will be monotonic increasing!!!
6666
zp=linspace(minz,maxz,lzp)'; %altitude (meters)

+gemini3d/+plot/cart3d_long.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ function cart3d_long(time, xg, parm, parmlbl, caxlims, sourceloc, hf, cmap)
4646
plotparams.altref=110;
4747

4848
%% SIZE OF PLOT GRID THAT WE ARE INTERPOLATING ONTO
49-
meantheta=mean(xg.theta(:));
50-
meanphi=mean(xg.phi(:));
49+
meantheta=mean(xg.theta, 'all');
50+
meanphi=mean(xg.phi, 'all');
5151
y=-1*(xg.theta-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below, runs backward from north distance, hence the negative sign
5252
x=(xg.phi-meanphi); %mag. lon coordinate, pos. eastward
5353
z=xg.alt/1e3;
5454
lxp=500;
5555
lyp=500;
5656
lzp=500;
57-
minx=min(x(:));
58-
maxx=max(x(:));
59-
miny=min(y(:));
60-
maxy=max(y(:));
61-
minz=min(z(:));
62-
maxz=max(z(:));
57+
minx=min(x, 'all');
58+
maxx=max(x, 'all');
59+
miny=min(y, 'all');
60+
maxy=max(y, 'all');
61+
minz=min(z, 'all');
62+
maxz=max(z, 'all');
6363
xp=linspace(minx,maxx,lxp); %eastward distance (rads.)
6464
yp=linspace(miny,maxy,lyp); %should be interpreted as northward distance (in rads.). Irrespective of ordering of xg.theta, this will be monotonic increasing!!!
6565
zp=linspace(minz,maxz,lzp)'; %altitude (meters)
@@ -68,23 +68,23 @@ function cart3d_long(time, xg, parm, parmlbl, caxlims, sourceloc, hf, cmap)
6868
%ix1s=floor(lx1/2):lx1; %only valide for a grid which is symmetric aboutu magnetic equator... (I think)
6969
ix1s=find(xg.x1(inds1)>=0); %works for asymmetric grids
7070
minz=0;
71-
maxz=max(xg.alt(:));
71+
maxz=max(xg.alt, 'all');
7272
[tmp,ix1]=min(abs(xg.alt(ix1s,1,1)-maxz*1e3));
7373
ix1=ix1s(ix1);
7474
thetavals=xg.theta(ix1:lx1,:,:);
75-
meantheta=mean(thetavals(:));
75+
meantheta=mean(thetavals, 'all');
7676
phivals=xg.phi(ix1:lx1,:,:);
77-
meanphi=mean(phivals(:));
77+
meanphi=mean(phivals, 'all');
7878
x=(thetavals-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below and the parametric surfaces in the plots
7979
y=(phivals-meanphi); %mag. lon coordinate
8080
z=xg.alt(ix1:lx1,:,:)/1e3; %altitude
8181
lxp=500;
8282
lyp=500;
8383
lzp=500;
84-
minx=min(x(:));
85-
maxx=max(x(:));%+0.5*(max(x(:))-min(x(:)));
86-
miny=min(y(:));
87-
maxy=max(y(:));
84+
minx=min(x, 'all');
85+
maxx=max(x, 'all');%+0.5*(max(x, 'all')-min(x, 'all'));
86+
miny=min(y, 'all');
87+
maxy=max(y, 'all');
8888
xp=linspace(minx,maxx,lxp);
8989
yp=linspace(miny,maxy,lyp);
9090
zp=linspace(minz,maxz,lzp)';

+gemini3d/+plot/cart3d_long_enu.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ function cart3d_long_enu(time,xg,parm,parmlbl,caxlims,sourceloc,hf,cmap)
4646
plotparams.altref=300;
4747

4848
%% SIZE OF PLOT GRID THAT WE ARE INTERPOLATING ONTO
49-
meantheta=mean(xg.theta(:));
50-
%meanphi=mean(xg.phi(:));
49+
meantheta=mean(xg.theta, 'all');
50+
%meanphi=mean(xg.phi, 'all');
5151
y=-1*(xg.theta-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below, runs backward from north distance, hence the negative sign
5252
%x=(xg.phi-meanphi); %mag. lon coordinate, pos. eastward
5353
x=xg.x2(inds2)/Re/sin(meantheta);
5454
z=xg.alt/1e3;
5555
lxp=500;
5656
lyp=500;
5757
lzp=500;
58-
minx=min(x(:));
59-
maxx=max(x(:));
60-
miny=min(y(:));
61-
maxy=max(y(:));
62-
minz=min(z(:));
63-
maxz=max(z(:));
58+
minx=min(x, 'all');
59+
maxx=max(x, 'all');
60+
miny=min(y, 'all');
61+
maxy=max(y, 'all');
62+
minz=min(z, 'all');
63+
maxz=max(z, 'all');
6464
xp=linspace(minx,maxx,lxp); %eastward distance (rads.)
6565
yp=linspace(miny,maxy,lyp); %should be interpreted as northward distance (in rads.). Irrespective of ordering of xg.theta, this will be monotonic increasing!!!
6666
zp=linspace(minz,maxz,lzp)'; %altitude (kilometers)
@@ -69,23 +69,23 @@ function cart3d_long_enu(time,xg,parm,parmlbl,caxlims,sourceloc,hf,cmap)
6969
%ix1s=floor(lx1/2):lx1; %only valide for a grid which is symmetric aboutu magnetic equator... (I think)
7070
ix1s=find(xg.x1(inds1)>=0); %works for asymmetric grids
7171
minz=0;
72-
maxz=max(xg.alt(:));
72+
maxz=max(xg.alt, 'all');
7373
[tmp,ix1]=min(abs(xg.alt(ix1s,1,1)-maxz*1e3));
7474
ix1=ix1s(ix1);
7575
thetavals=xg.theta(ix1:lx1,:,:);
76-
meantheta=mean(thetavals(:));
76+
meantheta=mean(thetavals, 'all');
7777
phivals=xg.phi(ix1:lx1,:,:);
78-
meanphi=mean(phivals(:));
78+
meanphi=mean(phivals, 'all');
7979
x=(thetavals-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below and the parametric surfaces in the plots
8080
y=(phivals-meanphi); %mag. lon coordinate
8181
z=xg.alt(ix1:lx1,:,:)/1e3; %altitude
8282
lxp=500;
8383
lyp=500;
8484
lzp=500;
85-
minx=min(x(:));
86-
maxx=max(x(:));%+0.5*(max(x(:))-min(x(:)));
87-
miny=min(y(:));
88-
maxy=max(y(:));
85+
minx=min(x, 'all');
86+
maxx=max(x, 'all');%+0.5*(max(x, 'all')-min(x, 'all'));
87+
miny=min(y, 'all');
88+
maxy=max(y, 'all');
8989
xp=linspace(minx,maxx,lxp);
9090
yp=linspace(miny,maxy,lyp);
9191
zp=linspace(minz,maxz,lzp)';

+gemini3d/+plot/curv2d.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function curv2d(time,xg,parm,parmlbl,caxlims, sourceloc, h, cmap)
2626
sourcemlat=sourceloc(1);
2727
%sourcemlon=sourceloc(2);
2828
else
29-
sourcemlat=mean(90-xg.theta(:)*180/pi); %just take avg. over the grid
29+
sourcemlat=mean(90-rad2deg(xg.theta), 'all'); %just take avg. over the grid
3030
end %if
3131

3232

@@ -45,22 +45,22 @@ function curv2d(time,xg,parm,parmlbl,caxlims, sourceloc, h, cmap)
4545

4646

4747
%SIZE OF PLOT GRID THAT WE ARE INTERPOLATING ONTO
48-
meantheta=mean(xg.theta(:));
49-
%meanphi=mean(xg.phi(:));
48+
meantheta=mean(xg.theta, 'all');
49+
%meanphi=mean(xg.phi, 'all');
5050
%meanphi=xg.x3(inds3(1)); %dont' forget that x3 has ghost cells!!!
5151
x=(xg.theta-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below
5252
%y=(xg.phi-meanphi); %mag. lon coordinate
5353
z=xg.alt/1e3;
5454
lxp=1500;
5555
%lyp=500;
5656
lzp=1500;
57-
minx=min(x(:));
58-
maxx=max(x(:));
59-
%miny=min(y(:));
60-
%maxy=max(y(:));
61-
%minz=min(z(:));
57+
minx=min(x, 'all');
58+
maxx=max(x, 'all');
59+
%miny=min(y, 'all');
60+
%maxy=max(y, 'all');
61+
%minz=min(z, 'all');
6262
minz=0;
63-
maxz=max(z(:));
63+
maxz=max(z, 'all');
6464
xp=linspace(minx,maxx,lxp);
6565
%yp=linspace(miny,maxy,lyp);
6666
zp=linspace(minz,maxz,lzp)';
@@ -69,23 +69,23 @@ function curv2d(time,xg,parm,parmlbl,caxlims, sourceloc, h, cmap)
6969
%ix1s=floor(lx1/2):lx1; %only valide for a grid which is symmetric aboutu magnetic equator... (I think)
7070
ix1s=find(xg.x1(inds1)>=0); %works for asymmetric grids
7171
minz=0;
72-
maxz=max(xg.alt(:));
72+
maxz=max(xg.alt, 'all');
7373
[tmp,ix1]=min(abs(xg.alt(ix1s,1,1)-maxz*1e3));
7474
ix1=ix1s(ix1);
7575
thetavals=xg.theta(ix1:lx1,:,:);
76-
meantheta=mean(thetavals(:));
76+
meantheta=mean(thetavals, 'all');
7777
phivals=xg.phi(ix1:lx1,:,:);
78-
meanphi=mean(phivals(:));
78+
meanphi=mean(phivals, 'all');
7979
x=(thetavals-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below and the parametric surfaces in the plots
8080
y=(phivals-meanphi); %mag. lon coordinate
8181
z=xg.alt(ix1:lx1,:,:)/1e3; %altitude
8282
lxp=500;
8383
lyp=500;
8484
lzp=500;
85-
minx=min(x(:));
86-
maxx=max(x(:));%+0.5*(max(x(:))-min(x(:)));
87-
miny=min(y(:));
88-
maxy=max(y(:));
85+
minx=min(x, 'all');
86+
maxx=max(x, 'all');%+0.5*(max(x, 'all')-min(x, 'all'));
87+
miny=min(y, 'all');
88+
maxy=max(y, 'all');
8989
xp=linspace(minx,maxx,lxp);
9090
yp=linspace(miny,maxy,lyp);
9191
zp=linspace(minz,maxz,lzp)';

+gemini3d/+plot/curv3d_long.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ function curv3d_long(time, xg, parm, parmlbl, caxlims, sourceloc, hf, cmap)
6666
plotparams.altref=375;
6767

6868
%% SIZE OF PLOT GRID THAT WE ARE INTERPOLATING ONTO
69-
meantheta=mean(xg.theta(:));
70-
meanphi=mean(xg.phi(:));
69+
meantheta=mean(xg.theta, 'all');
70+
meanphi=mean(xg.phi, 'all');
7171
x=(xg.theta-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below
7272
y=(xg.phi-meanphi); %mag. lon coordinate
7373
z=xg.alt/1e3;
7474
%lxp=500;
7575
lxp=1500;
7676
lyp=500;
7777
lzp=500;
78-
minx=min(x(:));
79-
maxx=max(x(:));
80-
miny=min(y(:));
81-
maxy=max(y(:));
82-
%minz=min(z(:));
78+
minx=min(x, 'all');
79+
maxx=max(x, 'all');
80+
miny=min(y, 'all');
81+
maxy=max(y, 'all');
82+
%minz=min(z, 'all');
8383
minz=-10e0; %to give some space for the marker on th plots
84-
maxz=max(z(:));
84+
maxz=max(z, 'all');
8585
xp=linspace(minx,maxx,lxp);
8686
yp=linspace(miny,maxy,lyp);
8787
zp=linspace(minz,maxz,lzp)';
@@ -90,23 +90,23 @@ function curv3d_long(time, xg, parm, parmlbl, caxlims, sourceloc, hf, cmap)
9090
%ix1s=floor(lx1/2):lx1; %only valide for a grid which is symmetric aboutu magnetic equator... (I think)
9191
ix1s=find(xg.x1(inds1)>=0); %works for asymmetric grids
9292
minz=0;
93-
maxz=max(xg.alt(:));
93+
maxz=max(xg.alt, 'all');
9494
[tmp,ix1]=min(abs(xg.alt(ix1s,1,1)-maxz*1e3));
9595
ix1=ix1s(ix1);
9696
thetavals=xg.theta(ix1:lx1,:,:);
97-
meantheta=mean(thetavals(:));
97+
meantheta=mean(thetavals, 'all');
9898
phivals=xg.phi(ix1:lx1,:,:);
99-
meanphi=mean(phivals(:));
99+
meanphi=mean(phivals, 'all');
100100
x=(thetavals-meantheta); %this is a mag colat. coordinate and is only used for defining grid in linspaces below and the parametric surfaces in the plots
101101
y=(phivals-meanphi); %mag. lon coordinate
102102
z=xg.alt(ix1:lx1,:,:)/1e3; %altitude
103103
lxp=500;
104104
lyp=500;
105105
lzp=500;
106-
minx=min(x(:));
107-
maxx=max(x(:));%+0.5*(max(x(:))-min(x(:)));
108-
miny=min(y(:));
109-
maxy=max(y(:));
106+
minx=min(x, 'all');
107+
maxx=max(x, 'all');%+0.5*(max(x, 'all')-min(x, 'all'));
108+
miny=min(y, 'all');
109+
maxy=max(y, 'all');
110110
xp=linspace(minx,maxx,lxp);
111111
yp=linspace(miny,maxy,lyp);
112112
zp=linspace(minz,maxz,lzp)';
@@ -161,7 +161,7 @@ function curv3d_long(time, xg, parm, parmlbl, caxlims, sourceloc, hf, cmap)
161161
if (flagsource)
162162
sourcetheta=pi/2-sourcemlat*pi/180;
163163
else
164-
thetaref=mean(mean(xg.theta(1:floor(end/2),:,:)));
164+
thetaref=mean(xg.theta(1:floor(end/2),:,:), 'all');
165165
sourcetheta=thetaref;
166166
end
167167
sourcex=sourcetheta-meantheta;

0 commit comments

Comments
 (0)