Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel' into MMSdevel
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nilsson-irfu committed Nov 25, 2024
2 parents 6072307 + 7b8771f commit 494dce9
Show file tree
Hide file tree
Showing 6 changed files with 930 additions and 231 deletions.
2 changes: 1 addition & 1 deletion +model/igrf.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
persistent hIGRF gIGRF yearsIGRF

if isempty(hIGRF)
fileIGRF = [fileparts(which('irf.m')), filesep, '+model', filesep, 'igrf13coeffs.txt'];
fileIGRF = [fileparts(which('irf.m')), filesep, '+model', filesep, 'igrf14coeffs.txt'];
irf.log('warning',['Reading IGRF coefficients from file:' fileIGRF]);
%file reading
fid = fopen(fileIGRF);
Expand Down
396 changes: 198 additions & 198 deletions +model/igrf13coeffs.txt → +model/igrf14coeffs.txt

Large diffs are not rendered by default.

69 changes: 37 additions & 32 deletions irf/add_position.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,38 @@ function add_position(h, r, varargin)
if isempty(args), break, end
end


switch lower(obj)
case 'mercury'
obj_radius = Units.Mercury.radius/1e3;
obj_label = '[R_M]';
case 'venus'
obj_radius = Units.Venus.radius/1e3;
obj_label = '[R_V]';
case 'earth'
obj_radius = Units.RE/1e3;
obj_label = '[R_E]';
case 'mars'
obj_radius = Units.Mars.radius/1e3;
obj_label = '[R_M]';
case 'jupiter'
obj_radius = Units.Jupiter.radius/1e3;
obj_label = '[R_J]';
case 'saturn'
obj_radius = Units.Saturn.radius/1e3;
obj_label = '[R_S]';
case 'ganymede'
obj_radius = Units.Ganymede.radius/1e3;
obj_label = '[R_G]';
case 'europa'
obj_radius = Units.Europa.radius/1e3;
obj_label = '[R_e]';
case 'callisto'
obj_radius = Units.Callisto.radius/1e3;
obj_label = '[R_c]';
otherwise
return;
if have_options
switch lower(obj)
case 'mercury'
obj_radius = Units.Mercury.radius/1e3;
obj_label = '[R_M]';
case 'venus'
obj_radius = Units.Venus.radius/1e3;
obj_label = '[R_V]';
case 'earth'
obj_radius = Units.RE/1e3;
obj_label = '[R_E]';
case 'mars'
obj_radius = Units.Mars.radius/1e3;
obj_label = '[R_M]';
case 'jupiter'
obj_radius = Units.Jupiter.radius/1e3;
obj_label = '[R_J]';
case 'saturn'
obj_radius = Units.Saturn.radius/1e3;
obj_label = '[R_S]';
case 'ganymede'
obj_radius = Units.Ganymede.radius/1e3;
obj_label = '[R_G]';
case 'europa'
obj_radius = Units.Europa.radius/1e3;
obj_label = '[R_e]';
case 'callisto'
obj_radius = Units.Callisto.radius/1e3;
obj_label = '[R_c]';
otherwise
return;
end
end

if isa(r,'TSeries'), r = irf.ts2mat(r); end
Expand All @@ -74,7 +75,11 @@ function add_position(h, r, varargin)
error('R has bad size')
end

TF = issorted(r(:, 1), 'strictascend'); % check time is in ascending order;
if(verLessThan('matlab','9.0')) % Fix for old ML 2014a plots
TF = issorted(r(:, 1));
else
TF = issorted(r(:, 1), 'strictascend'); % check time is in ascending order;
end
if ~TF
r = unique(r, 'rows'); % remove duplicated data;
irf.log('warning', 'Time is not in strict ascending order, UNIQUE is used. ');
Expand Down
Loading

0 comments on commit 494dce9

Please sign in to comment.