Skip to content

Commit

Permalink
SolO QLI: Function argument for logo path (again...)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPGJ committed Mar 7, 2024
1 parent f81fa30 commit 4f20acd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 34 deletions.
10 changes: 8 additions & 2 deletions mission/solar_orbiter/+solo/+qli/+cron/generate_quicklooks.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@
function generate_quicklooks(...
outputDir, generateNonweeklyQuicklooks, generateWeeklyQuicklooks, DaysDtArray)

VHT_DIR = '/data/solo/data_yuri/';
VHT_DIR = '/data/solo/data_yuri/';

% NOTE: The IRF logo is not part of the irfu-matlab git repo, but this code still
% requires it to be located inside the corresponding directory.
IRF_LOGO_RPATH = 'mission/solar_orbiter/+solo/+qli/+cron/irf_logo.png';
IRF_LOGO_PATH = fullfile(solo.qli.utils.get_irfumatlab_root_path(), IRF_LOGO_RPATH);
irf.assert.file_exists(IRF_LOGO_PATH)



Expand Down Expand Up @@ -116,6 +122,6 @@ function generate_quicklooks(...
% Generate quicklooks
%=====================
solo.qli.generate_quicklooks_all_types(...
VHT_DIR, outputDir, ...
IRF_LOGO_PATH, VHT_DIR, outputDir, ...
generateNonweeklyQuicklooks, generateWeeklyQuicklooks, DaysDtArray)
end
3 changes: 0 additions & 3 deletions mission/solar_orbiter/+solo/+qli/const.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
% Should be enabled by default.
CATCH_PLOT_EXCEPTIONS_ENABLED = true;

% Path to IRF logo, relative to irfu-matlab root.
IRF_LOGO_RPATH = 'mission/solar_orbiter/+solo/irf_logo.png';

% NOTE: Usually found at /data/solo/data_yuri/.
VHT_1H_DATA_FILENAME = 'V_RPW_1h.mat';
VHT_6H_DATA_FILENAME = 'V_RPW.mat';
Expand Down
32 changes: 19 additions & 13 deletions mission/solar_orbiter/+solo/+qli/generate_quicklooks_all_types.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
%
% ARGUMENTS
% =========
% irfLogoPath
% Path to IRF logo. Empty ==> Do not plot any logo.
% IMPLEMENTATION NOTE: The IRF logo should only be used for official
% quicklooks.
% vhtDataDir
% Path to directory containing VHT (velocity) .mat files
% V_RPW_1h.mat and V_RPW.mat. Typically brain:/data/solo/data_yuri/
Expand All @@ -46,7 +50,7 @@
% Uppsala, Sweden. Modified by Erik P G Johansson, IRF, Uppsala, Sweden.
%
function generate_quicklooks_all_types(...
vhtDataDir, outputDir, ...
irfLogoPath, vhtDataDir, outputDir, ...
generateNonweeklyQuicklooks, generateWeeklyQuicklooks, DaysDtArray)
%
% NOTE: Mission begins on 2020-02-12=Wednesday.
Expand Down Expand Up @@ -104,6 +108,20 @@ function generate_quicklooks_all_types(...
%
% PROPOSAL: Move quicklooks_24_6_2.m constants here. Submit values as arguments.
%
% PROBLEM: How handle IRF logo file?!
% NOTE: Is not in the git repo itself, only the directory structure.
% PROPOSAL: Argument to generate_quicklooks* functions. cron code hardcodes
% it.
% TODO-DEC: Which default location to use (for cron.*)?
% NOTE: Should work for both nas and locally.
% PROPOSAL: In git repo. -- IMPLEMENTED
% PRO: Connects file with s/w.
% CON: File is not part of git repo.
% PROPOSAL: Directly under git repo root.
% PROPOSAL: Under home directory.
% CON: Risks forgetting why it is needed to be there.
% CON: No direct connection between QLI s/w and file.
%
%
% generate_quicklooks_24h_6h_2h.m(), quicklooks_7day()
% ==========================================
Expand Down Expand Up @@ -164,18 +182,6 @@ function generate_quicklooks_all_types(...
end
end

% Derive full path to IRF logo image if it seems that it should be used
% ---------------------------------------------------------------------
% Empty ==> Do not plot any logo.
% IMPLEMENTATION NOTE: The IRF logo should only be used for official quicklooks.
% The path is therefore only automatically set if it appears that the quicklooks
% being generated are "official".
if isOfficialProcessing
irfLogoPath = solo.qli.utils.get_IRF_logo_path();
else
irfLogoPath = [];
end



tSec = tic();
Expand Down
9 changes: 1 addition & 8 deletions mission/solar_orbiter/+solo/+qli/utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,7 @@ function assert_UTC_midnight_datetime(Dt)
function irfumatlabRootPath = get_irfumatlab_root_path()
% PROPOSAL: Convert into generic function.
parentDir = fileparts(mfilename('fullpath'));
irfumatlabRootPath = fullfile(parentDir, '../../../../');
end



function irfLogoPath = get_IRF_logo_path()
irfumatlabRootPath = solo.qli.utils.get_irfumatlab_root_path();
irfLogoPath = fullfile(irfumatlabRootPath, solo.qli.const.IRF_LOGO_RPATH);
irfumatlabRootPath = fullfile(parentDir, '..', '..', '..', '..');
end


Expand Down
8 changes: 0 additions & 8 deletions mission/solar_orbiter/+solo/+qli/utils___UTEST.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ function test_get_irfumatlab_root_path(testCase)



function test_get_IRF_logo_path(testCase)
irfLogoPath = solo.qli.utils.get_IRF_logo_path();

irf.assert.file_exists(irfLogoPath)
end



function test_derive_weeks(testCase)

function test(DayBeginDtArray, firstDayOfWeek, ExpWeekBeginDtArray)
Expand Down

0 comments on commit 4f20acd

Please sign in to comment.