Skip to content

Commit ad8334a

Browse files
authored
Merge pull request #155 from ImperialCollegeLondon/feat/helioswarm-2.0.0
feat: Add support HelioSwarm `hs-mag` 2.0.0
2 parents 573712e + 77f5da2 commit ad8334a

File tree

15 files changed

+16749
-157
lines changed

15 files changed

+16749
-157
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MAG_DATA_VISUALIZATION_VERSION=7.6.2
1+
MAG_DATA_VISUALIZATION_VERSION=7.7.0

app/mission/imap/+mag/+app/+imap/+control/HK.m renamed to app/core/+mag/+app/+control/HK.m

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
11
classdef HK < mag.app.Control & mag.app.mixin.StartEndDate
2-
% HK View-controller for generating "mag.imap.view.HK".
2+
% HK View-controller for generating housekeeping view.
33

44
properties (Constant)
55
Name = "HK"
66
end
77

8+
properties (SetAccess = immutable)
9+
ViewType function_handle {mustBeScalarOrEmpty}
10+
end
11+
812
properties (SetAccess = private)
913
Layout matlab.ui.container.GridLayout
1014
end
1115

1216
methods
1317

18+
function this = HK(viewType)
19+
20+
arguments
21+
viewType (1, 1) function_handle
22+
end
23+
24+
this.ViewType = viewType;
25+
end
26+
1427
function instantiate(this, parent)
1528

1629
this.Layout = this.createDefaultGridLayout(parent);
30+
31+
% Start and end dates.
1732
this.addStartEndDateButtons(this.Layout, StartDateRow = 1, EndDateRow = 2);
1833
end
1934

2035
function supported = isSupported(~, results)
21-
supported = results.HasHK;
36+
supported = results.HasHK && any(results.HK.isPlottable());
2237
end
2338

2439
function command = getVisualizeCommand(this, results)
2540

2641
arguments (Input)
2742
this
28-
results (1, 1) mag.imap.Instrument
43+
results (1, 1) mag.Instrument
2944
end
3045

3146
arguments (Output)
@@ -35,7 +50,7 @@ function instantiate(this, parent)
3550
[startTime, endTime] = this.getStartEndTimes();
3651
results = mag.app.internal.cropResults(results, startTime, endTime);
3752

38-
command = mag.app.Command(Functional = @(varargin) mag.imap.view.HK(varargin{:}).visualizeAll(), ...
53+
command = mag.app.Command(Functional = @(varargin) this.ViewType(varargin{:}).visualizeAll(), ...
3954
PositionalArguments = {results});
4055
end
4156
end

app/mission/hs/+mag/+app/+hs/AnalysisManager.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ function instantiate(this, parent)
5050
this.MetadataPatternEditFieldLabel.Text = "Metadata pattern:";
5151

5252
% Create MetadataPatternEditField.
53-
this.MetadataPatternEditField = uieditfield(this.AnalyzeSettingsLayout, "text");
53+
this.MetadataPatternEditField = uieditfield(this.AnalyzeSettingsLayout, "text", Enable = "off");
5454
this.MetadataPatternEditField.Layout.Row = 2;
5555
this.MetadataPatternEditField.Layout.Column = [2, 3];
56+
this.MetadataPatternEditField.Placeholder = "Not supported for HelioSwarm yet";
5657

5758
% Create SciencePatternEditFieldLabel.
5859
this.SciencePatternEditFieldLabel = uilabel(this.AnalyzeSettingsLayout);

app/mission/hs/+mag/+app/+hs/VisualizationManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function supportedVisualizations = getSupportedVisualizations(~, ~)
1111

1212
supportedVisualizations = [mag.app.control.Field(@mag.hs.view.Field), ...
13+
mag.app.control.HK(@mag.hs.view.HK), ...
1314
mag.app.control.PSD(@mag.hs.view.PSD), ...
1415
mag.app.control.Spectrogram(@mag.hs.view.Spectrogram), ...
1516
mag.app.control.SignalAnalyzer("Science"), ...

app/mission/imap/+mag/+app/+imap/VisualizationManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
mag.app.imap.control.Field(), ...
1515
mag.app.imap.control.IALiRT(), ...
1616
mag.app.imap.control.Timestamp(), ...
17-
mag.app.imap.control.HK(), ...
17+
mag.app.control.HK(@mag.imap.view.HK), ...
1818
mag.app.control.PSD(@mag.imap.view.PSD), ...
1919
mag.app.control.Spectrogram(@mag.imap.view.Spectrogram), ...
2020
mag.app.control.SignalAnalyzer(["Outboard", "Inboard"]), ...

resources/release-notes.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
## Software
2-
3-
- (Bartington, HelioSwarm, IMAP) Add support for more date formats for metadata readers
4-
- (IMAP) Add sensor activation attempts and activation status to SID15 (`mag.imap.hk.SID15`)
1+
## App
52

6-
## Project
3+
- (HelioSwarm) Add HK plot
74

8-
- Remove opening of project in `buildfile`
9-
- Add custom code analyzer configuration
10-
11-
## CI
5+
## Software
126

13-
- Add support for testing on MATLAB R2025a
14-
- Add SARIF file
7+
- (HelioSwarm) Add support for `hs-mag` v2.0.0 artifacts

src/mission/hs/+mag/+hs/+in/ScienceCSV.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
metadata = mag.meta.Science(metadataArgs{:}, Primary = true);
3535

3636
% Remove variables.
37-
rawData = removevars(rawData, regexpPattern("uprange_\w"));
37+
rawData = removevars(rawData, regexpPattern("\w_saturation"));
3838

3939
% Add compression and quality flags.
4040
if ismember("compression", rawData.Properties.VariableNames)

src/mission/hs/+mag/+hs/+view/Field.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function visualize(this)
2626

2727
this.Figures = this.Factory.assemble( ...
2828
science, mag.graphics.style.Stackedplot(Title = this.getFieldTitle(science), YLabels = ["x [nT]", "y [nT]", "z [nT]", "|B| [nT]"], Layout = [3, 1], Charts = mag.graphics.chart.Stackedplot(YVariables = ["X", "Y", "Z", "B"], Filter = science.Quality.isPlottable())), ...
29-
hk, mag.graphics.style.Default(Title = "Sensor Temperatures", YLabel = this.TLabel, Legend = ["Temperature 1", "Temperature 2"], Charts = mag.graphics.chart.Plot(YVariables = "Temperature" + [1, 2])), ...
29+
hk, mag.graphics.style.Default(Title = "Temperatures", YLabel = this.TLabel, Legend = ["Board", "Sensor"], Charts = mag.graphics.chart.Plot(YVariables = ["Board", "Sensor"] + "Temperature")), ...
3030
Title = this.getFigureTitle(science), ...
3131
Name = this.getFigureName(science), ...
3232
Arrangement = [4, 1], ...

src/mission/hs/+mag/+hs/+view/HK.m

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
classdef HK < mag.graphics.view.View
2+
% HK Show housekeeping for HelioSwarm.
3+
4+
methods
5+
6+
function this = HK(results, options)
7+
8+
arguments
9+
results
10+
options.?mag.hs.view.HK
11+
end
12+
13+
this.Results = results;
14+
15+
this.assignProperties(options);
16+
end
17+
18+
function visualize(this)
19+
20+
this.Figures = matlab.ui.Figure.empty();
21+
22+
hk = this.Results.HK;
23+
24+
this.Figures = this.Factory.assemble( ...
25+
hk, ...
26+
[mag.graphics.style.Default(Title = "1.5 V", YLabel = "[V]", Charts = mag.graphics.chart.Plot(YVariables = "P1V5V")), ...
27+
mag.graphics.style.Default(Title = "2.5 V", YLabel = "[V]", Charts = mag.graphics.chart.Plot(YVariables = "P2V5V")), ...
28+
mag.graphics.style.LeftRight(Title = "+8.5 V", LeftLabel = "[V]", RightLabel = "[mA]", Charts = [mag.graphics.chart.Plot(YVariables = "P8V5V"), mag.graphics.chart.Plot(YVariables = "P8V5I")]), ...
29+
mag.graphics.style.LeftRight(Title = "-8.5 V", LeftLabel = "[V]", RightLabel = "[mA]", Charts = [mag.graphics.chart.Plot(YVariables = "N8V5V"), mag.graphics.chart.Plot(YVariables = "N8V5I")]), ...
30+
mag.graphics.style.Stackedplot(Title = "Temperature", YLabels = ["Board " + this.TLabel, "Sensor " + this.TLabel], Layout = [2, 2], Charts = mag.graphics.chart.Stackedplot(YVariables = ["Board", "Sensor"] + "Temperature"))], ...
31+
Name = "HK Time Series", ...
32+
Arrangement = [4, 2], ...
33+
TileIndexing = "rowmajor", ...
34+
LinkXAxes = true, ...
35+
WindowState = "maximized");
36+
end
37+
end
38+
end

src/mission/hs/+mag/+hs/HK.m

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,52 @@
66
P1V5V (:, 1) double
77
% P2V5V +2.5 V voltage.
88
P2V5V (:, 1) double
9-
% P2V2I +2.2 V current.
10-
P2V2I (:, 1) double
11-
% P12I +12 V current.
12-
P12I (:, 1) double
13-
% P8V +8.0 V voltage.
14-
P8V (:, 1) double
15-
% P8I +8.0 V current.
16-
P8VI (:, 1) double
17-
% TEMPERATURE1 Temperature 1.
18-
Temperature1 (:, 1) double
19-
% TEMPERATURE2 Temperature 2.
20-
Temperature2 (:, 1) double
21-
% FILTERTYPE Filter type.
22-
FilterType (:, 1) double
9+
% P8V5V +8.0 V voltage.
10+
P8V5V (:, 1) double
11+
% P8V5I +8.0 V current.
12+
P8V5I (:, 1) double
13+
% N8V5V -8.5 V voltage.
14+
N8V5V (:, 1) double
15+
% N8V5I -8.5 V current.
16+
N8V5I (:, 1) double
17+
% BOARDTEMPERATURE Board temperature.
18+
BoardTemperature (:, 1) double
19+
% SENSORTEMPERATURE Sensor temperature.
20+
SensorTemperature (:, 1) double
2321
end
2422

2523
methods
2624

2725
function p1v5v = get.P1V5V(this)
28-
p1v5v = this.Data.p1p5v;
26+
p1v5v = this.Data.ana_1p5_vlt;
2927
end
3028

3129
function p2v5v = get.P2V5V(this)
32-
p2v5v = this.Data.p2p5v;
30+
p2v5v = this.Data.ana_2p5_vlt;
3331
end
3432

35-
function p2v2i = get.P2V2I(this)
36-
p2v2i = this.Data.p2p2i;
33+
function p8v5v = get.P8V5V(this)
34+
p8v5v = this.Data.ana_p8p5_vlt;
3735
end
3836

39-
function p12i = get.P12I(this)
40-
p12i = this.Data.p12i;
37+
function p8v5vi = get.P8V5I(this)
38+
p8v5vi = this.Data.ana_p8p5_cur;
4139
end
4240

43-
function p8v = get.P8V(this)
44-
p8v = this.Data.p8v;
41+
function n8v5v = get.N8V5V(this)
42+
n8v5v = this.Data.ana_n8p5_vlt;
4543
end
4644

47-
function p8vi = get.P8VI(this)
48-
p8vi = this.Data.p8i;
45+
function n8v5v = get.N8V5I(this)
46+
n8v5v = this.Data.ana_n8p5_cur;
4947
end
5048

51-
function temperature1 = get.Temperature1(this)
52-
temperature1 = this.Data.temp1;
49+
function boardTemperature = get.BoardTemperature(this)
50+
boardTemperature = this.Data.ana_brd_tmp;
5351
end
5452

55-
function temperature2 = get.Temperature2(this)
56-
temperature2 = this.Data.temp2;
57-
end
58-
59-
function filterType = get.FilterType(this)
60-
filterType = this.Data.filter_type;
53+
function sensorTemperature = get.SensorTemperature(this)
54+
sensorTemperature = this.Data.ana_sns_tmp;
6155
end
6256
end
6357
end

0 commit comments

Comments
 (0)