diff --git a/irf.m b/irf.m index 43de714dc..588dc16be 100644 --- a/irf.m +++ b/irf.m @@ -25,6 +25,9 @@ % version = IRF('version') return IRF version number % [versionNumber, versionDate] = IRF('version') return also date % +% [out] = IRF('path') returns the path to the current irfu-matlab root +% directory. +% % IRF('demo') demonstration how to use IRF %this is an edit to load BLAS diff --git a/irf/+irf/+cdf/datevec_to_TT2000.m b/irf/+irf/+cdf/datevec_to_TT2000.m index 4ef8753b8..8411385fa 100644 --- a/irf/+irf/+cdf/datevec_to_TT2000.m +++ b/irf/+irf/+cdf/datevec_to_TT2000.m @@ -22,11 +22,17 @@ % function tt2000 = datevec_to_TT2000(dateVecUtc) % PROPOSAL: Separate wrapper function to handle spdfcomputett2000 special case. - % PROPOSAL: Make handle failed conversions when spdfcomputett2000 returns a too low value. % ~CON: spdfcomputett2000 already returns special value. +% +% PROPOSAL: Refactor to take datetime as argument. +% PRO: More standard time format. +% PRO: The only (irfu-matlab) applications so far effectively use datetime as +% argument for this function. /2024-03-05 +% PRO: Already easy to convert between datetime and date vector. +% NOTE: Might want to similarily convert irf.cdf.TT2000_to_datevec(). -irf.assert.sizes(dateVecUtc, [NaN,6]) +irf.assert.sizes(dateVecUtc, [NaN, 6]) % IMPLEMENTATION NOTE: Using integer precision is good for automatic testing % (empirically it is needed for predictable, reversible results). diff --git a/irf/+irf/+cdf/write_dataobj.m b/irf/+irf/+cdf/write_dataobj.m index a1d930340..ab448a24d 100644 --- a/irf/+irf/+cdf/write_dataobj.m +++ b/irf/+irf/+cdf/write_dataobj.m @@ -331,7 +331,7 @@ function write_dataobj(filePath, ... %============================================================================ % Convert specific VariableAttributes values - % + % ------------------------------------------ % Case 1: tt2000 values as UTC strings : Convert to tt2000. % Case 2: All other : Convert to the zVariable data type. % -------------------------------------------------------------------------- diff --git a/irf/+irf/+utils/mixed_radix.m b/irf/+irf/+utils/mixed_radix.m index de63850ac..f1bd2d97a 100644 --- a/irf/+irf/+utils/mixed_radix.m +++ b/irf/+irf/+utils/mixed_radix.m @@ -6,6 +6,8 @@ % Ex: Can interpret [seconds, milliseconds, microseconds, nanoseconds] as used % by the spdf* TT2000 functions. % +% See e.g. https://en.wikipedia.org/wiki/Mixed_radix . +% % % NOTES % ===== @@ -21,7 +23,7 @@ % % CONVENTIONS % =========== -% MRD = Mixed Radix Digits, i.e. the digits in mixed radix number. +% MRD = Mixed Radix Digits, i.e. the digits in a mixed radix number. % -- % iDigit=1 <==> Least significant digit. % NOTE: This means that digits are in the opposite order to what is diff --git a/mission/solar_orbiter/solo_local_file_db.m b/mission/solar_orbiter/solo_local_file_db.m index d64a4b398..b51595cd2 100644 --- a/mission/solar_orbiter/solo_local_file_db.m +++ b/mission/solar_orbiter/solo_local_file_db.m @@ -103,8 +103,10 @@ function list_sci_tint() t.min = str2double(utc(15:16)); t.sec = str2double(utc(18:end-1)); end + function limited_sci_list() - listingD = dir([fullfile(curDir, dPref) '*.cdf']); % SolO have only latest file of each type. + listingD = dir([fullfile(curDir, dPref) '*.cdf']); % SolO directories only have the latest version datasets (files). + if isempty(listingD), return, end if isempty(dateFormat) % Are we looking for files with 8 or the full 14 digits @@ -190,13 +192,14 @@ function list_sci() end end end % LIST_SCI + %% ADD2LIST_SCI function add2list_sci(name,curDir) Entry = struct('name', name, 'ver', str2double(name(end-5:end-4)), ... 'start',[], 'stop',[],... 'path', curDir, 'dbId', obj.id); Entry = add_ss(Entry); - % Check time limits of the file + % Check if time range in file is within specified time limits. if isempty(Entry) || ~isempty(tint) && ... (Entry.start>tint.stop || Entry.stop Use RPW BIAS data (L2, L3) processed at IRFU. % % Ex: obj.dbRoot == /data/solo/data_irfu/ % ==> /data/solo/data_irfu/latest/rpw/ - rDir = fullfile(dbRoot, 'latest', 'rpw'); + rDir = fullfile(dbRootDir, 'latest', 'rpw'); else % CASE: obj.dbRoot DOES NOT have subdirectory "latest/". % ==> Use RPW data (all subsystems) mirrored from ROC/LESIA. % % Ex: obj.dbRoot == /data/solo/ % ==> /data/solo/remote/data/ - rDir = fullfile(dbRoot, 'remote', 'data'); + rDir = fullfile(dbRootDir, 'remote', 'data'); end else %================================== % CASE: Searching for non-RPW data %================================== - rDir = fullfile(dbRoot, 'soar', instrument); + rDir = fullfile(dbRootDir, 'soar', instrument); if exist(rDir, 'dir') % CASE: obj.dbRoot has subdirectory "soar". % ==> Use (presumed) SOAR mirror. @@ -342,7 +349,7 @@ function add2list_sci(name,curDir) return end - rDir = fullfile(dbRoot, instrument); + rDir = fullfile(dbRootDir, instrument); if exist(rDir, 'dir') % CASE: obj.dbRoot has subdirectory named after instrument. % ==> obj.dbRoot is a general folder for (multiple) non-RPW