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 21, 2023
2 parents 2371173 + 5c0885e commit 6e651ac
Show file tree
Hide file tree
Showing 46 changed files with 736 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If working on a special development branch (e.g. [MMSdevel](https://github.com/i

1. According to [Matlab Style Guidelines](https://web.archive.org/web/20210424065750/http://www.datatool.com/downloads/matlab_style_guidelines.pdf "MATLAB Programming Style Guidelines")
2. Help follows matlab style, see [irf_template.m](https://github.com/irfu/irfu-matlab/blob/master/irf/irf_template.m)
3. Matlab code files checked for possible problems, using [checkcode](https://www.mathworks.com/help/matlab/ref/checkcode.html)
3. Matlab code files checked for possible problems, using [checkcode](https://www.mathworks.com/help/matlab/ref/checkcode.html) (or [codeIssues](https://www.mathworks.com/help/matlab/ref/codeissues.html) if using a modern Matlab release).
4. For new code written, use only two spaces as indentation.

## Git
Expand Down
2 changes: 1 addition & 1 deletion .github/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.43.0.0</version>
<version>3.44.0.0</version>
</dependency>
<!-- https://github.com/PRBEM/IRBEM -->
<dependency>
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.m~
*.DS_Store
*.asv
*.swp
fort.6
.caa.log
# Path for report (created by tests_before_release.m)
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:

## Some pre-commit out-of-the-box hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v4.5.0"
hooks:
- id: check-case-conflict
- id: check-json
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added contrib/nasa_cdf_patch/spdfcdfinfoc.mexmaca64
Binary file not shown.
Binary file not shown.
Binary file added contrib/nasa_cdf_patch/spdfcdfreadc.mexmaca64
Binary file not shown.
Binary file added contrib/nasa_cdf_patch/spdfcdfupdatec.mexmaca64
Binary file not shown.
Binary file added contrib/nasa_cdf_patch/spdfcdfwritec.mexmaca64
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added contrib/nasa_cdf_patch/spdfparseepochc.mexmaca64
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions mission/cluster/caa/caa-control/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ XSLTPROC=xsltproc
all: html txt cef

html: check ns_ops_epo.xml
${XSLTPROC} html.xsl ns_ops_epo.xml > ns_ops.html
${XSLTPROC} --stringparam current-date `date +%Y-%m-%d` html.xsl ns_ops_epo.xml > ns_ops.html

txt: ns_ops_epo.xml
${XSLTPROC} text.xsl ns_ops_epo.xml

cef: ns_ops_epo.xml
for cln in 1 2 3 4 ; do \
${XSLTPROC} --param clusterno $$cln caveatscef.xsl ns_ops_epo.xml > C$${cln}_CQ_EFW_INST_V00.cef ; \
${XSLTPROC} --param clusterno $$cln caveatscef.xsl ns_ops_epo.xml > C$${cln}_CQ_EFW_INST__20010128_V02.cef ; \
done

ns_ops_epo.xml: ns_ops.xml
${XSLTPROC} addepoch.xsl ns_ops.xml > ns_ops_epo.xml

clean:
rm -f ns_ops.html ns_ops_epo.xml ns_ops_c[1-4].dat C?_CQ_EFW_INST_V00.cef
rm -f ns_ops.html ns_ops_epo.xml ns_ops_c[1-4].dat C[1-4]_CQ_EFW_INST__20010128_V[0-9][0-9].cef

test: test_epoch.xml test_epoch.xsl
echo "Tesing iso2epoch..."
Expand Down
16 changes: 8 additions & 8 deletions mission/cluster/caa/caa-control/caveatscef.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Valid parameter clusterno: values 1-4
Uses exslt date & time and dynamic functions. Works with xsltproc.
Copyright 2011-15 Jan Karlsson
Copyright (c) 2011-23 Jan Karlsson
Updated to exclude infinity (-1) stop time items
Expand All @@ -24,7 +24,7 @@ $Id$
<xsl:text> </xsl:text>
<xsl:value-of select="substring(date:time(),1,8)"/>
!--------------------------------------------------------|
FILE_NAME = "C<xsl:value-of select="$clusterno"/>_CQ_EFW_INST_V00.cef"
FILE_NAME = "C<xsl:value-of select="$clusterno"/>_CQ_EFW_INST__20010128_V02.cef"
FILE_FORMAT_VERSION = "CEF-2.0"
END_OF_RECORD_MARKER = "$"
include = "CL_CH_MISSION.ceh"
Expand All @@ -39,21 +39,21 @@ START_META = DATASET_VERSION
ENTRY = "3"
END_META = DATASET_VERSION
START_META = LOGICAL_FILE_ID
ENTRY = "C<xsl:value-of select="$clusterno"/>_CQ_EFW_INST_V00"
ENTRY = "C<xsl:value-of select="$clusterno"/>_CQ_EFW_INST__20010128_V02"
END_META = LOGICAL_FILE_ID
START_META = VERSION_NUMBER
ENTRY = "00"
ENTRY = 02
END_META = VERSION_NUMBER
START_META = FILE_TIME_SPAN
VALUE_TYPE = ISO_TIME_RANGE
ENTRY = 2001-02-01T00:00:00Z/2020-01-01T00:00:00Z
ENTRY = 2001-01-28T00:00:00Z/2022-01-01T00:00:00Z
END_META = FILE_TIME_SPAN
START_META = GENERATION_DATE
VALUE_TYPE = ISO_TIME
ENTRY = <xsl:value-of select="substring(date:date-time(),1,19)"/>Z
END_META = GENERATION_DATE
START_META = FILE_CAVEATS
ENTRY = "Cluster <xsl:value-of select="$clusterno"/>. TBD stop time: 2020-01-01T00:00:00Z"
ENTRY = "Cluster <xsl:value-of select="$clusterno"/>. TBD stop time: 2022-01-01T00:00:00Z"
END_META = FILE_CAVEATS
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand All @@ -79,8 +79,8 @@ DATA_UNTIL = "END_OF_DATA"
<xsl:variable name="dt" select="@dt"/>
<xsl:if test="$dt != -1">
<xsl:value-of select="@start"/>/<xsl:choose>
<!-- <xsl:when test="$dt = -1">2020-01-01T00:00:00Z</xsl:when> Infinity removed -->
<xsl:when test="$dt = -157">2020-01-01T00:00:00Z</xsl:when> <!-- TBD -->
<!-- <xsl:when test="$dt = -1">2025-01-01T00:00:00Z</xsl:when> Infinity removed -->
<xsl:when test="$dt = -157">2022-01-01T00:00:00Z</xsl:when> <!-- TBD -->
<xsl:otherwise><xsl:value-of select="date:add(@start,concat('PT',$dt,'S'))"/></xsl:otherwise>
</xsl:choose>,"<xsl:value-of select="@sdesc"/>","<xsl:apply-templates select="@plan"/>","<xsl:value-of select="translate(translate(child::desc,'&#x9;&#xa;',''),'&#x22;',&quot;&#x27;&quot;)"/>" $
</xsl:if> <!-- Not indented to not f**k up result file -->
Expand Down
2 changes: 1 addition & 1 deletion mission/cluster/caa/caa-control/html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $Id$
</HEAD>
<BODY>
<H1 ALIGN="center">
Non-Standard Operations
EFW Non-Standard Operations Created (branch devel): <xsl:value-of select="$current-date"/>
</H1>
<H2>
<xsl:value-of select="//description"/>
Expand Down
2 changes: 1 addition & 1 deletion mission/cluster/caa/caa-control/ns_ops_c1.dat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
1013799300 604800 1 12
1013982300 1500 1 261
1014187380 2100 1 261
1014392580 -157 1 261
1014392580 2400 1 261
1021175637 1800 1 261
1028658000 10800 0 1
1032571080 11340 0 1
Expand Down
7 changes: 3 additions & 4 deletions mission/cluster/caa/caa-control/ns_ops_c2.dat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
1010749500 230 1 2
1013982300 1500 1 261
1014187380 2100 1 261
1014392580 -157 1 261
1014392580 2400 1 261
1016618340 85440 1 0
1021175637 1800 1 261
1028643000 1200 1 1
Expand All @@ -39,8 +39,8 @@
1033574400 34200 1 9999
1033785000 23400 1 9999
1034017200 300 1 2
1035774000 -157 1 261
1035896400 -157 1 261
1035774000 240 1 261
1035896400 240 1 261
1036484820 20 0 1
1036484840 820 0 2
1037145384 40 0 13
Expand All @@ -58,7 +58,6 @@
1044304200 115500 1 134
1045047720 10740 0 0
1046073060 14400 0 1
1047542160 -157 0 999
1048087896 32258 0 0
1048546887 85221 0 11
1048741920 14400 0 1
Expand Down
4 changes: 2 additions & 2 deletions mission/cluster/caa/caa-control/ns_ops_c3.dat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
1013982300 1500 1 261
1013983200 120 1 261
1014187380 2100 1 261
1014392580 -157 1 261
1014392580 2400 1 261
1018947600 240 1 2
1020074100 772560 0 1
1020846660 2280 1 0
Expand Down Expand Up @@ -47,7 +47,7 @@
1042653600 300 1 2
1043309587 65644 0 0
1043412636 3606 0 999
1044098046 -157 0 999
1044098046 294 0 999
1045047720 10740 0 0
1047079856 1200 1 261
1047628394 3 0 0
Expand Down
8 changes: 4 additions & 4 deletions mission/cluster/caa/caa-control/ns_ops_c4.dat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
1010770221 8 1 2
1013982300 1500 1 261
1014187380 2100 1 261
1014392580 -157 1 261
1014392580 2400 1 261
1018962000 240 1 2
1021175637 1800 1 261
1024066924 2 0 1
Expand All @@ -31,15 +31,15 @@
1033785000 23400 1 9999
1034020800 300 1 2
1035120112 75345 0 0
1035774000 -157 1 261
1035896400 -157 1 261
1035774000 240 1 261
1035896400 240 1 261
1038499800 16200 0 0
1039572126 2 0 1
1040056320 45960 0 261
1040501112 12474 1 261
1040738700 16200 0 0
1042635600 300 1 2
1043434440 -157 0 0
1043434440 71280 0 0
1044216000 85320 1 134
1044304200 115500 1 134
1045047720 10740 0 0
Expand Down
18 changes: 16 additions & 2 deletions mission/cluster/caa/caa_download.m
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,14 @@
end
urlListDatasets = csa_parse_url(urlListDatasets);
irf.log('warning',['Patience! Requesting "' dataset '" ' urlListDatasets]);
caalog=urlread(urlListDatasets); %#ok<URLRD> webread introduced in R2014b
if verLessThan('matlab', '8.4') % 8.4 = R2014b
caalog=urlread(urlListDatasets); %#ok<URLRD> webread introduced in R2014b
else
options = weboptions;
options.Timeout = 50; % seconds, default "5" is too short
options.ContentType = 'text'; % plaintext, don't have Matlab automatically decode it
caalog=webread(urlListDatasets, options);
end
if isempty(caalog) % return empty output
downloadStatus = [];
return
Expand All @@ -500,7 +507,14 @@
urlListDatasets = csa_parse_url(urlListDatasets);
irf.log('warning','Patience! Requesting list of files.');
irf.log('notice',['URL: ' urlListDatasets]);
caalist=urlread(urlListDatasets); %#ok<URLRD> webread introduced in R2014b
if verLessThan('matlab', '8.4') % 8.4 = R2014b
caalist=urlread(urlListDatasets); %#ok<URLRD> webread introduced in R2014b
else
options = weboptions;
options.Timeout = 50; % seconds, default 5 is too short
options.ContentType = 'text'; % plaintext, don't have Matlab automatically decode it
caalist=webread(urlListDatasets, options);
end
irf.log('debug',['returned: ' caalist]);
if isempty(caalist) % no datasets available
irf.log('warning','There are no data sets available!');
Expand Down
21 changes: 5 additions & 16 deletions mission/cluster/caa/ceh/CL_CH_EFW_EXP.ceh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ END_META = INVESTIGATOR_COORDINATES
! List of standard reference documents for the experiment
!
START_META = EXPERIMENT_REFERENCES
ENTRY = "http://www.cluster.irfu.se/"
ENTRY = "https://doi.org/10.5270/esa-rp1zebe"
ENTRY = "https://cluster.irfu.se"
END_META = EXPERIMENT_REFERENCES
!
! Name, role and coordinates of experiment key personnel
Expand All @@ -51,16 +52,16 @@ START_META = EXPERIMENT_CAVEATS
ENTRY = "Caveats for the Cluster EFW experiment:"
ENTRY = ""
ENTRY = "For general information on EFW, please visit the EFW home page"
ENTRY = "http://www.cluster.irfu.se"
ENTRY = "https://cluster.irfu.se"
ENTRY = ""
ENTRY = "For general information on EFW operations, both standard operations and"
ENTRY = "anomalies, please visit the EFW operations home page"
ENTRY = "http://www.cluster.irfu.se/efw/ops"
ENTRY = "https://cluster.irfu.se/efw/ops"
ENTRY = ""
ENTRY = "For a chronological table of all non-standard operations and known"
ENTRY = "instrument anomalies, please visit the EFW non-standard operations home"
ENTRY = "page"
ENTRY = "http://www.cluster.irfu.se/efw/ops/ns_ops.html"
ENTRY = "https://cluster.irfu.se/efw/ops/ns_ops.html"
ENTRY = ""
ENTRY = "For more information on data quality and how the CAA data are processed"
ENTRY = "please consult the EFW CAA Users Guide and the EFW CAA Interface Control"
Expand All @@ -76,16 +77,4 @@ END_META = INSTRUMENT_TYPE
START_META = MEASUREMENT_TYPE
ENTRY = "Electric_Field"
END_META = MEASUREMENT_TYPE
!
! Name of dataset contact
!
START_META = CONTACT_COORDINATES
ENTRY = "Mats Andre>PI>[email protected]"
END_META = CONTACT_COORDINATES
!
START_META = ACKNOWLEDGEMENT
ENTRY = "Please acknowledge the EFW team and ESA CAA in any"
ENTRY = "publication based upon use of these data"
END_META = ACKNOWLEDGEMENT


10 changes: 10 additions & 0 deletions mission/cluster/caa/ceh/CX_CQ_EFW_INST.ceh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ END_META = DATA_TYPE
START_META = DATASET_TITLE
ENTRY = "EFWXXX operations caveats"
END_META = DATASET_TITLE
START_META = DATASET_TYPE
ENTRY = "Caveats"
END_META = DATASET_TYPE
START_META = DATASET_DESCRIPTION
ENTRY = "This dataset contains operation caveats information"
ENTRY = "from the EFW experiment on the Cluster CXXX spacecraft"
END_META = DATASET_DESCRIPTION
START_META = PROCESSING_LEVEL
ENTRY = "Auxiliary"
END_META = PROCESSING_LEVEL
START_META = CONTACT_COORDINATES
ENTRY = "Mats Andre>PI>[email protected]"
END_META = CONTACT_COORDINATES
START_META = ACKNOWLEDGEMENT
ENTRY = "Please acknowledge the EFW team and the ESA Cluster Active Archive in any"
ENTRY = "publication based upon use of these data"
END_META = ACKNOWLEDGEMENT
START_META = METADATA_TYPE
ENTRY = "CAA"
END_META = METADATA_TYPE
Expand Down
8 changes: 4 additions & 4 deletions mission/solar_orbiter/+solo/+adm/create_dataset_filename.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,25 @@


function s = create_time_interval_str(R)
function b = isfv(fnName, nComp)
function b = is_FV(fnName, nComp)
b = isfield(R, fnName) && (numel(R.(fnName)) == nComp);
end

dv = isfield(R, 'dateVec');
dv1 = isfield(R, 'dateVec1');
dv2 = isfield(R, 'dateVec2');

if isfv('dateVec', 3) && ~dv1 && ~dv2
if is_FV('dateVec', 3) && ~dv1 && ~dv2
s = sprintf(...
'%04i%02i%02i', ...
R.dateVec);

elseif ~dv && isfv('dateVec1', 3) && isfv('dateVec2', 3)
elseif ~dv && is_FV('dateVec1', 3) && is_FV('dateVec2', 3)
s = sprintf(...
'%04i%02i%02i-%04i%02i%02i', ...
R.dateVec1(:), R.dateVec2(:));

elseif ~dv && isfv('dateVec1', 6) && isfv('dateVec2', 6)
elseif ~dv && is_FV('dateVec1', 6) && is_FV('dateVec2', 6)
s = sprintf(...
'%04i%02i%02iT%02i%02i%02i-%04i%02i%02iT%02i%02i%02i', ...
R.dateVec1(:), R.dateVec2(:));
Expand Down
4 changes: 2 additions & 2 deletions mission/solar_orbiter/+solo/+sp/plot_LFR_CWF.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
zvName = 'E';
end

fillValue = getfillval(D, zvName);
fv = getfillval(D, zvName);
zv = D.data.(zvName).data(:, i2);
zv = changem(zv, NaN, fillValue);
zv = changem(zv, NaN, fv);
end
4 changes: 2 additions & 2 deletions mission/solar_orbiter/+solo/+sp/plot_LFR_SWF.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
zvName = 'E';
end

fillValue = getfillval(D, zvName);
fv = getfillval(D, zvName);
zv = D.data.(zvName).data(:, :, i3);
zv = changem(zv, NaN, fillValue);
zv = changem(zv, NaN, fv);
end
Binary file modified mission/solar_orbiter/+solo/irf_solo_gui.mlapp
Binary file not shown.
Loading

0 comments on commit 6e651ac

Please sign in to comment.