imap-processing 0.15.0__py3-none-any.whl → 0.16.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of imap-processing might be problematic. Click here for more details.
- imap_processing/_version.py +2 -2
- imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml +1404 -93
- imap_processing/cdf/config/imap_ialirt_l1_variable_attrs.yaml +113 -130
- imap_processing/cli.py +1 -4
- imap_processing/codice/codice_l1a.py +87 -62
- imap_processing/codice/codice_l2.py +0 -8
- imap_processing/codice/constants.py +16 -5
- imap_processing/hi/hi_l1a.py +447 -0
- imap_processing/hi/{l1b/hi_l1b.py → hi_l1b.py} +1 -1
- imap_processing/hi/{l1c/hi_l1c.py → hi_l1c.py} +21 -21
- imap_processing/hi/{l2/hi_l2.py → hi_l2.py} +13 -13
- imap_processing/hi/utils.py +10 -9
- imap_processing/hit/l0/constants.py +3 -1
- imap_processing/hit/l0/decom_hit.py +45 -11
- imap_processing/hit/l1a/hit_l1a.py +31 -24
- imap_processing/hit/l1b/hit_l1b.py +30 -11
- imap_processing/hit/l2/hit_l2.py +8 -11
- imap_processing/ialirt/constants.py +38 -0
- imap_processing/ialirt/l0/parse_mag.py +1 -1
- imap_processing/ialirt/l0/process_codice.py +91 -0
- imap_processing/ialirt/l0/process_hit.py +12 -21
- imap_processing/ialirt/l0/process_swapi.py +172 -23
- imap_processing/ialirt/l0/process_swe.py +3 -10
- imap_processing/ialirt/utils/constants.py +16 -2
- imap_processing/ialirt/utils/create_xarray.py +59 -11
- imap_processing/ultra/utils/ultra_l1_utils.py +4 -2
- {imap_processing-0.15.0.dist-info → imap_processing-0.16.1.dist-info}/METADATA +1 -1
- {imap_processing-0.15.0.dist-info → imap_processing-0.16.1.dist-info}/RECORD +31 -37
- imap_processing/hi/l1a/__init__.py +0 -0
- imap_processing/hi/l1a/hi_l1a.py +0 -98
- imap_processing/hi/l1a/histogram.py +0 -152
- imap_processing/hi/l1a/science_direct_event.py +0 -214
- imap_processing/hi/l1b/__init__.py +0 -0
- imap_processing/hi/l1c/__init__.py +0 -0
- imap_processing/hi/l2/__init__.py +0 -0
- imap_processing/ialirt/l0/process_codicehi.py +0 -156
- imap_processing/ialirt/l0/process_codicelo.py +0 -41
- {imap_processing-0.15.0.dist-info → imap_processing-0.16.1.dist-info}/LICENSE +0 -0
- {imap_processing-0.15.0.dist-info → imap_processing-0.16.1.dist-info}/WHEEL +0 -0
- {imap_processing-0.15.0.dist-info → imap_processing-0.16.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,20 +1,144 @@
|
|
|
1
1
|
"""Functions to support I-ALiRT SWAPI processing."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from decimal import Decimal
|
|
5
|
+
from typing import Optional
|
|
4
6
|
|
|
5
7
|
import numpy as np
|
|
8
|
+
import pandas as pd
|
|
6
9
|
import xarray as xr
|
|
7
|
-
from
|
|
10
|
+
from scipy.optimize import curve_fit
|
|
11
|
+
from scipy.special import erf
|
|
8
12
|
|
|
13
|
+
from imap_processing import imap_module_directory
|
|
14
|
+
from imap_processing.ialirt.constants import IalirtSwapiConstants as Consts
|
|
9
15
|
from imap_processing.ialirt.utils.grouping import find_groups
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
from imap_processing.ialirt.utils.time import calculate_time
|
|
17
|
+
from imap_processing.spice.time import met_to_ttj2000ns, met_to_utc
|
|
18
|
+
from imap_processing.swapi.l1.swapi_l1 import process_sweep_data
|
|
19
|
+
from imap_processing.swapi.l2.swapi_l2 import TIME_PER_BIN
|
|
13
20
|
|
|
14
21
|
logger = logging.getLogger(__name__)
|
|
15
22
|
|
|
16
23
|
|
|
17
|
-
def
|
|
24
|
+
def count_rate(
|
|
25
|
+
energy_pass: float, speed: float, density: float, temp: float
|
|
26
|
+
) -> float | np.ndarray:
|
|
27
|
+
"""
|
|
28
|
+
Compute SWAPI count rate for provided energy passband, speed, density and temp.
|
|
29
|
+
|
|
30
|
+
This model for coincidence count rate was developed by the SWAPI instrument
|
|
31
|
+
science team, detailed on page 52 of the IMAP SWAPI Instrument Algorithms Document.
|
|
32
|
+
|
|
33
|
+
Parameters
|
|
34
|
+
----------
|
|
35
|
+
energy_pass : float
|
|
36
|
+
Energy passband [eV].
|
|
37
|
+
speed : float
|
|
38
|
+
Bulk solar wind speed [km/s].
|
|
39
|
+
density : float
|
|
40
|
+
Proton density [cm^-3].
|
|
41
|
+
temp : float
|
|
42
|
+
Temperature [K].
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
count_rate : float | np.ndarray
|
|
47
|
+
Particle coincidence count rate.
|
|
48
|
+
"""
|
|
49
|
+
# thermal velocity of solar wind ions
|
|
50
|
+
thermal_velocity = np.sqrt(2 * Consts.boltz * temp / Consts.prot_mass)
|
|
51
|
+
beta = 1 / (thermal_velocity**2)
|
|
52
|
+
# convert energy to Joules
|
|
53
|
+
center_speed = np.sqrt(2 * energy_pass * 1.60218e-19 / Consts.prot_mass)
|
|
54
|
+
speed = speed * 1000 # convert km/s to m/s
|
|
55
|
+
density = density * 1e6 # convert 1/cm**3 to 1/m**3
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
(density * Consts.eff_area * (beta / np.pi) ** (3 / 2))
|
|
59
|
+
* (np.exp(-beta * (center_speed**2 + speed**2 - 2 * center_speed * speed)))
|
|
60
|
+
* np.sqrt(np.pi / (beta * speed * center_speed))
|
|
61
|
+
* erf(np.sqrt(beta * speed * center_speed) * (Consts.az_fov / 2))
|
|
62
|
+
* (
|
|
63
|
+
center_speed**4
|
|
64
|
+
* Consts.speed_ew
|
|
65
|
+
* np.arcsin(thermal_velocity / center_speed)
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def optimize_pseudo_parameters(
|
|
71
|
+
count_rates: np.ndarray,
|
|
72
|
+
count_rate_error: np.ndarray,
|
|
73
|
+
energy_passbands: Optional[np.ndarray] = None,
|
|
74
|
+
) -> (dict)[str, list[float]]:
|
|
75
|
+
"""
|
|
76
|
+
Find the pseudo speed (u), density (n) and temperature (T) of solar wind particles.
|
|
77
|
+
|
|
78
|
+
Fit a curve to calculated count rate values as a function of energy passband.
|
|
79
|
+
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
count_rates : np.ndarray
|
|
83
|
+
Particle coincidence count rates.
|
|
84
|
+
count_rate_error : np.ndarray
|
|
85
|
+
Standard deviation of the coincidence count rates parameter.
|
|
86
|
+
energy_passbands : np.ndarray, default None
|
|
87
|
+
Energy passbands, passed in only for testing purposes.
|
|
88
|
+
|
|
89
|
+
Returns
|
|
90
|
+
-------
|
|
91
|
+
solution_dict : dict
|
|
92
|
+
Dictionary containing the optimized speed, density, and temperature values for
|
|
93
|
+
each sweep included in the input count_rates array.
|
|
94
|
+
"""
|
|
95
|
+
if not energy_passbands:
|
|
96
|
+
# Read in energy passbands
|
|
97
|
+
energy_data = pd.read_csv(
|
|
98
|
+
f"{imap_module_directory}/tests/swapi/lut/imap_swapi_esa-unit"
|
|
99
|
+
f"-conversion_20250211_v000.csv"
|
|
100
|
+
)
|
|
101
|
+
energy_passbands = (
|
|
102
|
+
energy_data["Energy"][0:63]
|
|
103
|
+
.replace(",", "", regex=True)
|
|
104
|
+
.to_numpy()
|
|
105
|
+
.astype(float)
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# Initial guess pulled from page 52 of the IMAP SWAPI Instrument Algorithms Document
|
|
109
|
+
initial_param_guess = np.array([550, 5.27, 1e5])
|
|
110
|
+
solution_dict = { # type: ignore
|
|
111
|
+
"pseudo_speed": [],
|
|
112
|
+
"pseudo_density": [],
|
|
113
|
+
"pseudo_temperature": [],
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for sweep in np.arange(count_rates.shape[0]):
|
|
117
|
+
current_sweep_count_rates = count_rates[sweep, :]
|
|
118
|
+
current_sweep_count_rate_errors = count_rate_error[sweep, :]
|
|
119
|
+
# Find the max count rate, and use the 6 points surrounding it (inclusive)
|
|
120
|
+
max_index = np.argmax(current_sweep_count_rates)
|
|
121
|
+
sol = curve_fit(
|
|
122
|
+
f=count_rate,
|
|
123
|
+
xdata=energy_passbands.take(
|
|
124
|
+
range(max_index - 3, max_index + 3), mode="wrap"
|
|
125
|
+
),
|
|
126
|
+
ydata=current_sweep_count_rates.take(
|
|
127
|
+
range(max_index - 3, max_index + 3), mode="wrap"
|
|
128
|
+
),
|
|
129
|
+
sigma=current_sweep_count_rate_errors.take(
|
|
130
|
+
range(max_index - 3, max_index + 3), mode="wrap"
|
|
131
|
+
),
|
|
132
|
+
p0=initial_param_guess,
|
|
133
|
+
)
|
|
134
|
+
solution_dict["pseudo_speed"].append(sol[0][0])
|
|
135
|
+
solution_dict["pseudo_density"].append(sol[0][1])
|
|
136
|
+
solution_dict["pseudo_temperature"].append(sol[0][2])
|
|
137
|
+
|
|
138
|
+
return solution_dict
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def process_swapi_ialirt(unpacked_data: xr.Dataset) -> list[dict]:
|
|
18
142
|
"""
|
|
19
143
|
Extract I-ALiRT variables and calculate coincidence count rate.
|
|
20
144
|
|
|
@@ -32,7 +156,21 @@ def process_swapi_ialirt(unpacked_data: xr.Dataset) -> dict[str, DataArray]:
|
|
|
32
156
|
|
|
33
157
|
sci_dataset = unpacked_data.sortby("epoch", ascending=True)
|
|
34
158
|
|
|
35
|
-
|
|
159
|
+
met = calculate_time(
|
|
160
|
+
sci_dataset["sc_sclk_sec"], sci_dataset["sc_sclk_sub_sec"], 256
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Add required parameters.
|
|
164
|
+
sci_dataset["met"] = met
|
|
165
|
+
met_values = []
|
|
166
|
+
|
|
167
|
+
grouped_dataset = find_groups(sci_dataset, (0, 11), "swapi_seq_number", "met")
|
|
168
|
+
|
|
169
|
+
if grouped_dataset.group.size == 0:
|
|
170
|
+
logger.warning(
|
|
171
|
+
"There was an issue with the SWAPI grouping process, returning empty data."
|
|
172
|
+
)
|
|
173
|
+
return []
|
|
36
174
|
|
|
37
175
|
for group in np.unique(grouped_dataset["group"]):
|
|
38
176
|
# Sequence values for the group should be 0-11 with no duplicates.
|
|
@@ -40,6 +178,10 @@ def process_swapi_ialirt(unpacked_data: xr.Dataset) -> dict[str, DataArray]:
|
|
|
40
178
|
(grouped_dataset["group"] == group)
|
|
41
179
|
]
|
|
42
180
|
|
|
181
|
+
met_values.append(
|
|
182
|
+
int(grouped_dataset["met"][(grouped_dataset["group"] == group).values][0])
|
|
183
|
+
)
|
|
184
|
+
|
|
43
185
|
# Ensure no duplicates and all values from 0 to 11 are present
|
|
44
186
|
if not np.array_equal(seq_values.astype(int), np.arange(12)):
|
|
45
187
|
logger.info(
|
|
@@ -48,22 +190,29 @@ def process_swapi_ialirt(unpacked_data: xr.Dataset) -> dict[str, DataArray]:
|
|
|
48
190
|
)
|
|
49
191
|
continue
|
|
50
192
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
193
|
+
raw_coin_count = process_sweep_data(grouped_dataset, "swapi_coin_cnt")
|
|
194
|
+
raw_coin_rate = raw_coin_count / TIME_PER_BIN
|
|
195
|
+
count_rate_error = np.sqrt(raw_coin_count) / TIME_PER_BIN
|
|
196
|
+
|
|
197
|
+
solution = optimize_pseudo_parameters(raw_coin_rate, count_rate_error)
|
|
198
|
+
|
|
199
|
+
swapi_data = []
|
|
200
|
+
|
|
201
|
+
for entry in np.arange(0, len(solution["pseudo_speed"])):
|
|
202
|
+
swapi_data.append(
|
|
203
|
+
{
|
|
204
|
+
"apid": 478,
|
|
205
|
+
"met": int(met_values[entry]),
|
|
206
|
+
"met_in_utc": met_to_utc(met_values[entry]).split(".")[0],
|
|
207
|
+
"ttj2000ns": int(met_to_ttj2000ns(met_values[entry])),
|
|
208
|
+
"swapi_pseudo_proton_speed": Decimal(solution["pseudo_speed"][entry]),
|
|
209
|
+
"swapi_pseudo_proton_density": Decimal(
|
|
210
|
+
solution["pseudo_density"][entry]
|
|
211
|
+
),
|
|
212
|
+
"swapi_pseudo_proton_temperature": Decimal(
|
|
213
|
+
solution["pseudo_temperature"][entry]
|
|
214
|
+
),
|
|
215
|
+
}
|
|
216
|
+
)
|
|
68
217
|
|
|
69
218
|
return swapi_data
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Functions to support I-ALiRT SWE processing."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
from decimal import Decimal
|
|
5
4
|
|
|
6
5
|
import numpy as np
|
|
7
6
|
import pandas as pd
|
|
@@ -547,16 +546,10 @@ def process_swe(accumulated_data: xr.Dataset, in_flight_cal_files: list) -> list
|
|
|
547
546
|
{
|
|
548
547
|
"apid": 478,
|
|
549
548
|
"met": int(grouped["met"].min()),
|
|
550
|
-
"
|
|
549
|
+
"met_in_utc": met_to_utc(grouped["met"].min()).split(".")[0],
|
|
551
550
|
"ttj2000ns": int(met_to_ttj2000ns(grouped["met"].min())),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
for i, val in enumerate(summed_first)
|
|
555
|
-
},
|
|
556
|
-
**{
|
|
557
|
-
f"swe_normalized_counts_half_2_esa_{i}": Decimal(str(val))
|
|
558
|
-
for i, val in enumerate(summed_second)
|
|
559
|
-
},
|
|
551
|
+
"swe_normalized_counts_half_1_esa": [int(val) for val in summed_first],
|
|
552
|
+
"swe_normalized_counts_half_2_esa": [int(val) for val in summed_second],
|
|
560
553
|
"swe_counterstreaming_electrons": max(bde_first_half, bde_second_half),
|
|
561
554
|
}
|
|
562
555
|
)
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"""Keys for I-ALiRT data products."""
|
|
2
2
|
|
|
3
3
|
IALIRT_KEYS = [
|
|
4
|
+
# H intensities in 15 energy ranges and binned into 4 azimuths and 4 spin angle bins
|
|
5
|
+
"codicehi_h",
|
|
6
|
+
# C/O abundance ratio
|
|
7
|
+
"codicelo_c_over_o_abundance",
|
|
8
|
+
# Mg/O abundance ratio
|
|
9
|
+
"codicelo_mg_over_o_abundance",
|
|
10
|
+
# Fe/O abundance ratio
|
|
11
|
+
"codicelo_fe_over_o_abundance",
|
|
12
|
+
# C+6/C+5 charge state ratio
|
|
13
|
+
"codicelo_c_plus_6_over_c_plus_5_ratio",
|
|
14
|
+
# O+7/O+6 charge state ratio
|
|
15
|
+
"codicelo_o_plus_7_over_o_plus_6_ratio",
|
|
16
|
+
# Fe low/Fe high charge state ratio
|
|
17
|
+
"codicelo_fe_low_over_fe_high_ratio",
|
|
4
18
|
# Low energy (~300 keV) electrons (A-side)
|
|
5
19
|
"hit_e_a_side_low_en",
|
|
6
20
|
# Medium energy (~3 MeV) electrons (A-side)
|
|
@@ -40,9 +54,9 @@ IALIRT_KEYS = [
|
|
|
40
54
|
# Pseudo temperature of solar wind protons in plasma frame
|
|
41
55
|
"swapi_pseudo_proton_temperature",
|
|
42
56
|
# SWE Normalized Counts - Half Cycle 1
|
|
43
|
-
|
|
57
|
+
"swe_normalized_counts_half_1",
|
|
44
58
|
# SWE Normalized Counts - Half Cycle 2
|
|
45
|
-
|
|
59
|
+
"swe_normalized_counts_half_2",
|
|
46
60
|
# SWE Counterstreaming flag
|
|
47
61
|
"swe_counterstreaming_electrons",
|
|
48
62
|
]
|
|
@@ -7,7 +7,7 @@ from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
|
|
|
7
7
|
from imap_processing.ialirt.utils.constants import IALIRT_KEYS
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def create_xarray_from_records(records: list[dict]) -> xr.Dataset:
|
|
10
|
+
def create_xarray_from_records(records: list[dict]) -> xr.Dataset: # noqa: PLR0912
|
|
11
11
|
"""
|
|
12
12
|
Create dataset from a list of records.
|
|
13
13
|
|
|
@@ -39,16 +39,51 @@ def create_xarray_from_records(records: list[dict]) -> xr.Dataset:
|
|
|
39
39
|
data=ttj2000ns_values,
|
|
40
40
|
name="epoch",
|
|
41
41
|
dims=["epoch"],
|
|
42
|
-
attrs=cdf_manager.get_variable_attributes("epoch"),
|
|
42
|
+
attrs=cdf_manager.get_variable_attributes("epoch", check_schema=False),
|
|
43
43
|
)
|
|
44
44
|
component = xr.DataArray(
|
|
45
45
|
["x", "y", "z"],
|
|
46
46
|
name="component",
|
|
47
47
|
dims=["component"],
|
|
48
|
-
attrs=cdf_manager.get_variable_attributes("component"),
|
|
48
|
+
attrs=cdf_manager.get_variable_attributes("component", check_schema=False),
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
esa_step = xr.DataArray(
|
|
52
|
+
data=np.arange(8, dtype=np.uint8),
|
|
53
|
+
name="esa_step",
|
|
54
|
+
dims=["esa_step"],
|
|
55
|
+
attrs=cdf_manager.get_variable_attributes("esa_step", check_schema=False),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
energy_ranges = xr.DataArray(
|
|
59
|
+
data=np.arange(15, dtype=np.uint8),
|
|
60
|
+
name="energy_ranges",
|
|
61
|
+
dims=["energy_ranges"],
|
|
62
|
+
attrs=cdf_manager.get_variable_attributes("energy_ranges", check_schema=False),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
azimuth = xr.DataArray(
|
|
66
|
+
data=np.arange(4, dtype=np.uint8),
|
|
67
|
+
name="azimuth",
|
|
68
|
+
dims=["azimuth"],
|
|
69
|
+
attrs=cdf_manager.get_variable_attributes("azimuth", check_schema=False),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
spin_angle_bin = xr.DataArray(
|
|
73
|
+
data=np.arange(4, dtype=np.uint8),
|
|
74
|
+
name="spin_angle_bin",
|
|
75
|
+
dims=["spin_angle_bin"],
|
|
76
|
+
attrs=cdf_manager.get_variable_attributes("spin_angle_bin", check_schema=False),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
coords = {
|
|
80
|
+
"epoch": epoch,
|
|
81
|
+
"component": component,
|
|
82
|
+
"esa_step": esa_step,
|
|
83
|
+
"energy_ranges": energy_ranges,
|
|
84
|
+
"azimuth": azimuth,
|
|
85
|
+
"spin_angle_bin": spin_angle_bin,
|
|
86
|
+
}
|
|
52
87
|
dataset = xr.Dataset(
|
|
53
88
|
coords=coords,
|
|
54
89
|
attrs=cdf_manager.get_global_attributes("imap_ialirt_l1_realtime"),
|
|
@@ -56,17 +91,25 @@ def create_xarray_from_records(records: list[dict]) -> xr.Dataset:
|
|
|
56
91
|
|
|
57
92
|
# Create empty dataset for each key.
|
|
58
93
|
for key in instrument_keys:
|
|
59
|
-
attrs = cdf_manager.get_variable_attributes(key)
|
|
94
|
+
attrs = cdf_manager.get_variable_attributes(key, check_schema=False)
|
|
60
95
|
fillval = attrs.get("FILLVAL")
|
|
61
96
|
if key.startswith("mag"):
|
|
62
97
|
data = np.full((n, 3), fillval, dtype=np.float32)
|
|
63
98
|
dims = ["epoch", "component"]
|
|
64
99
|
dataset[key] = xr.DataArray(data, dims=dims, attrs=attrs)
|
|
100
|
+
elif key.startswith("codicehi"):
|
|
101
|
+
data = np.full((n, 15, 4, 4), fillval, dtype=np.float32)
|
|
102
|
+
dims = ["epoch", "energy", "azimuth", "spin_angle_bin"]
|
|
103
|
+
dataset[key] = xr.DataArray(data, dims=dims, attrs=attrs)
|
|
65
104
|
elif key == "swe_counterstreaming_electrons":
|
|
66
105
|
data = np.full(n, fillval, dtype=np.uint8)
|
|
67
106
|
dims = ["epoch"]
|
|
68
107
|
dataset[key] = xr.DataArray(data, dims=dims, attrs=attrs)
|
|
69
|
-
elif key.startswith(
|
|
108
|
+
elif key.startswith("swe"):
|
|
109
|
+
data = np.full((n, 8), fillval, dtype=np.uint32)
|
|
110
|
+
dims = ["epoch", "esa_step"]
|
|
111
|
+
dataset[key] = xr.DataArray(data, dims=dims, attrs=attrs)
|
|
112
|
+
elif key.startswith("hit"):
|
|
70
113
|
data = np.full(n, fillval, dtype=np.uint32)
|
|
71
114
|
dims = ["epoch"]
|
|
72
115
|
dataset[key] = xr.DataArray(data, dims=dims, attrs=attrs)
|
|
@@ -77,11 +120,16 @@ def create_xarray_from_records(records: list[dict]) -> xr.Dataset:
|
|
|
77
120
|
|
|
78
121
|
# Populate the dataset variables
|
|
79
122
|
for i, record in enumerate(records):
|
|
80
|
-
for key in record.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
123
|
+
for key, val in record.items():
|
|
124
|
+
if key in ["apid", "met", "met_in_utc", "ttj2000ns"]:
|
|
125
|
+
continue
|
|
126
|
+
elif key.startswith("mag"):
|
|
127
|
+
dataset[key].data[i, :] = val
|
|
128
|
+
elif key.startswith("swe_normalized_counts"):
|
|
129
|
+
dataset[key].data[i, :] = val
|
|
130
|
+
elif key.startswith("codicehi"):
|
|
131
|
+
dataset[key].data[i, :, :, :] = val
|
|
132
|
+
else:
|
|
85
133
|
dataset[key].data[i] = val
|
|
86
134
|
|
|
87
135
|
return dataset
|
|
@@ -57,14 +57,16 @@ def create_dataset( # noqa: PLR0912
|
|
|
57
57
|
data_dict["epoch"],
|
|
58
58
|
name="epoch",
|
|
59
59
|
dims=["epoch"],
|
|
60
|
-
attrs=cdf_manager.get_variable_attributes("epoch"),
|
|
60
|
+
attrs=cdf_manager.get_variable_attributes("epoch", check_schema=False),
|
|
61
61
|
)
|
|
62
62
|
if "sensor-de" in name:
|
|
63
63
|
component = xr.DataArray(
|
|
64
64
|
["vx", "vy", "vz"],
|
|
65
65
|
name="component",
|
|
66
66
|
dims=["component"],
|
|
67
|
-
attrs=cdf_manager.get_variable_attributes(
|
|
67
|
+
attrs=cdf_manager.get_variable_attributes(
|
|
68
|
+
"component", check_schema=False
|
|
69
|
+
),
|
|
68
70
|
)
|
|
69
71
|
coords = {"epoch": epoch_time, "component": component}
|
|
70
72
|
else:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
imap_processing/__init__.py,sha256=b9xHlf8_0OtN_OyhPlrC6ayahYR0QTt_e713NjxZObw,1305
|
|
2
|
-
imap_processing/_version.py,sha256=
|
|
2
|
+
imap_processing/_version.py,sha256=ab-yNmCvJwJgN5bAYEJTLlnA0k6zw7i42yU_-iPzIzg,127
|
|
3
3
|
imap_processing/ancillary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
imap_processing/ancillary/ancillary_dataset_combiner.py,sha256=Pxg1wQLjPKzEkgE3a4Tart5TfeuH9rqyCKTd5GbgiL0,9602
|
|
5
5
|
imap_processing/ccsds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -22,11 +22,11 @@ imap_processing/cdf/config/imap_glows_l2_variable_attrs.yaml,sha256=eHGzS5_ctJ3g
|
|
|
22
22
|
imap_processing/cdf/config/imap_hi_global_cdf_attrs.yaml,sha256=28VVPcB_dRsk24Rba-nVsyivixnCOBEEHqL6oUu61Vc,2509
|
|
23
23
|
imap_processing/cdf/config/imap_hi_variable_attrs.yaml,sha256=VsIpaOP7SrwsWqiFo-Dhcz1iBVnZE7PmzzVaGwKZ_YI,14678
|
|
24
24
|
imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml,sha256=zjHAXLlXrrQPgzKh3aTuoY1qb41J0i8zQ81xLTf7Y7g,3121
|
|
25
|
-
imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml,sha256=
|
|
25
|
+
imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml,sha256=nVphxZP1hc8EHgR9K0Qh7HZd-G8iM0C0gSXeEyRdx0M,48050
|
|
26
26
|
imap_processing/cdf/config/imap_hit_l1b_variable_attrs.yaml,sha256=gxeC7-SUKkWiy1OE6MgfKxeV-0bdXuauodOIfFtQ3JQ,11287
|
|
27
27
|
imap_processing/cdf/config/imap_hit_l2_variable_attrs.yaml,sha256=f8ZLlF9EIes8BcFrpKTO8Mb_VVnP2d9HoLtQVOgz23Q,61402
|
|
28
28
|
imap_processing/cdf/config/imap_ialirt_global_cdf_attrs.yaml,sha256=AGQ9J0zEdWRZ_AR6_AYYHkRb57mYIe2jVflhYv8SEsQ,961
|
|
29
|
-
imap_processing/cdf/config/imap_ialirt_l1_variable_attrs.yaml,sha256=
|
|
29
|
+
imap_processing/cdf/config/imap_ialirt_l1_variable_attrs.yaml,sha256=IWJwYEeIIWiL1EN8EufKc4O8BThHNDwL2CcfQWRcSPA,8362
|
|
30
30
|
imap_processing/cdf/config/imap_idex_global_cdf_attrs.yaml,sha256=b0dbQ_IJtgTHmwdD754ZHr2-kwo8KIoG3FUZdK5vMEA,2920
|
|
31
31
|
imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml,sha256=KaRu-HPqAdAJ2vrX7m54pKUJsJtPaCfofi2OBs906cs,22493
|
|
32
32
|
imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml,sha256=Cx-s8hGmUtM_7pon1EbJTP3Im4uFfNeN6gZlGW5DudE,11153
|
|
@@ -57,13 +57,13 @@ imap_processing/cdf/config/imap_ultra_l1c_variable_attrs.yaml,sha256=D4uKUqZ8G5h
|
|
|
57
57
|
imap_processing/cdf/config/imap_variable_schema.yaml,sha256=oKfSQKJ7vYh7SC9dwFeE5PzVQNXYCpcp3AZSclKUVeg,728
|
|
58
58
|
imap_processing/cdf/imap_cdf_manager.py,sha256=K2W_5SzRTxJij2D-ZoKA4UdUxcVC1H90soEloJehsUk,2086
|
|
59
59
|
imap_processing/cdf/utils.py,sha256=Go43WgJbp-BOH_5cLNAru76cCb6jW0ZzwwBCEmeV19E,7789
|
|
60
|
-
imap_processing/cli.py,sha256=
|
|
60
|
+
imap_processing/cli.py,sha256=6kvGorFaUWQeWt43INKbFCH6J7JUwZHSCMQdDTQs8-k,52921
|
|
61
61
|
imap_processing/codice/__init__.py,sha256=Ga6Ioj68HnQ4moi7SxJdOyYmGHcRvKOh4uZUEPJZHl4,20
|
|
62
62
|
imap_processing/codice/codice_l0.py,sha256=_StmC58uRLBuUKSpVaqv6Bo49CeexkcOqnt_askKtHk,1701
|
|
63
|
-
imap_processing/codice/codice_l1a.py,sha256=
|
|
63
|
+
imap_processing/codice/codice_l1a.py,sha256=3sOzARFDNpL2JhNH2PugPMuMFkOUNMcI0I3T6jt8QhQ,57489
|
|
64
64
|
imap_processing/codice/codice_l1b.py,sha256=_x--ZXHxxSknEC546hHQGqhRTanYtJTfKDsB8d9Pz_Q,5408
|
|
65
|
-
imap_processing/codice/codice_l2.py,sha256=
|
|
66
|
-
imap_processing/codice/constants.py,sha256=
|
|
65
|
+
imap_processing/codice/codice_l2.py,sha256=6bWXaEZxE-LuLv9vlvTIDlCxRWhkYMva0Re7X7-MS_4,2603
|
|
66
|
+
imap_processing/codice/constants.py,sha256=nND2C9KVVkQ1_ZmmL3T9edqIF_gdqQ8h4NyEDVr7_HY,45621
|
|
67
67
|
imap_processing/codice/data/esa_sweep_values.csv,sha256=RuRTBG_TftVKGDEslxDo5SVwLIWq2uh3WrlVsXABpfg,5336
|
|
68
68
|
imap_processing/codice/data/lo_stepping_values.csv,sha256=Z-hdv2nxTzl-RXBWTa7Y_NRXR1HyW1mJrYMmX6vDnHo,5318
|
|
69
69
|
imap_processing/codice/decompress.py,sha256=-EA7vlGIKx6d7gltfDLr8XmU-D6Q9_7FZRtzIUgW54M,5232
|
|
@@ -96,41 +96,35 @@ imap_processing/glows/packet_definitions/P_GLX_TMSCHIST.xml,sha256=Q7X5gF9jM4TA5
|
|
|
96
96
|
imap_processing/glows/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
97
|
imap_processing/glows/utils/constants.py,sha256=REjvd0NgnST_rsfFQNGDo0F3_KKDZz20Dyt-19T2txM,2837
|
|
98
98
|
imap_processing/hi/__init__.py,sha256=Ga6Ioj68HnQ4moi7SxJdOyYmGHcRvKOh4uZUEPJZHl4,20
|
|
99
|
-
imap_processing/hi/
|
|
100
|
-
imap_processing/hi/
|
|
101
|
-
imap_processing/hi/
|
|
102
|
-
imap_processing/hi/
|
|
103
|
-
imap_processing/hi/l1b/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
|
-
imap_processing/hi/l1b/hi_l1b.py,sha256=IvHoTqtAf4u8zemWQ41frARR_gwbQboskp-7hk7AltY,14777
|
|
105
|
-
imap_processing/hi/l1c/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
|
-
imap_processing/hi/l1c/hi_l1c.py,sha256=iHOmVZkKEhxwwne1T5tFMxJZjD2n5wI0-WueumTwA50,28459
|
|
107
|
-
imap_processing/hi/l2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
|
-
imap_processing/hi/l2/hi_l2.py,sha256=9Cd1FqdKk3ya6_u9f7gal-9pIxrLgEQT9EBREJ_DhOA,9288
|
|
99
|
+
imap_processing/hi/hi_l1a.py,sha256=m-KGuWw6NzRNuJJp8RVQI1zy636GS7HkXjJNSedPlJ0,14731
|
|
100
|
+
imap_processing/hi/hi_l1b.py,sha256=PegKVakMz_M73eenywiNmna_LlHPLCqRzAKkoEA5uR8,14759
|
|
101
|
+
imap_processing/hi/hi_l1c.py,sha256=lT_XFSRME1ol7Bo2y38RCHghEEXeW21oQ2Rcj2fmjDo,28529
|
|
102
|
+
imap_processing/hi/hi_l2.py,sha256=veO2FdinuiRcONQ5JucnRj8lvs6wwLVrA_oveqsFzFE,9360
|
|
109
103
|
imap_processing/hi/packet_definitions/TLM_HI_COMBINED_SCI.xml,sha256=Cwu_sE-b6lpXtuikQKuU5uQ_pMFTG9HoZeH9c-QDQgU,251743
|
|
110
104
|
imap_processing/hi/packet_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
|
-
imap_processing/hi/utils.py,sha256=
|
|
105
|
+
imap_processing/hi/utils.py,sha256=5_JowCx2jQsI58M0vCHOgtib_a6Jll9U2vOylpB26A4,8166
|
|
112
106
|
imap_processing/hit/__init__.py,sha256=Ga6Ioj68HnQ4moi7SxJdOyYmGHcRvKOh4uZUEPJZHl4,20
|
|
113
107
|
imap_processing/hit/hit_utils.py,sha256=-O8xt90w6sMPQ2t4CYmqrwkBw3rF1h1dMn58Q3Ioz3g,13371
|
|
114
108
|
imap_processing/hit/l0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
115
|
-
imap_processing/hit/l0/constants.py,sha256=
|
|
116
|
-
imap_processing/hit/l0/decom_hit.py,sha256=
|
|
109
|
+
imap_processing/hit/l0/constants.py,sha256=hJnOMvRVt3gm9mZY8iTVc1mBYq_MNuTz9twkuF4G1F0,5656
|
|
110
|
+
imap_processing/hit/l0/decom_hit.py,sha256=o8rPVfGm67v1M4GUIjtSF7FpaQnYZbVRHJR79olDZOs,16436
|
|
117
111
|
imap_processing/hit/l1a/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
|
-
imap_processing/hit/l1a/hit_l1a.py,sha256=
|
|
112
|
+
imap_processing/hit/l1a/hit_l1a.py,sha256=gy1wGEJZOxb-sZnlQACv7FVD966fek1EBvE8jzpZdWg,11345
|
|
119
113
|
imap_processing/hit/l1b/constants.py,sha256=ZL5h2GgC5j_s11YgMxtY4EHpmkfo6IXnniCv-iXdG84,9692
|
|
120
|
-
imap_processing/hit/l1b/hit_l1b.py,sha256=
|
|
114
|
+
imap_processing/hit/l1b/hit_l1b.py,sha256=nXy8SUXJujFcWOrOBufmdrxq9xzdmB9dyZQOYz3-xiM,18489
|
|
121
115
|
imap_processing/hit/l2/constants.py,sha256=jvs7Uic3Bl1wyRC01s1-F5LAsTzTwi089TpN19fvlFg,18813
|
|
122
|
-
imap_processing/hit/l2/hit_l2.py,sha256=
|
|
116
|
+
imap_processing/hit/l2/hit_l2.py,sha256=qVGTHGO6tXNmz0nqKg3MEEqjlVGHhVsff5uS4jNajsk,26998
|
|
123
117
|
imap_processing/hit/packet_definitions/hit_packet_definitions.xml,sha256=CyYmMnuObmk2y1nlrd7xOZnwZ_qZ3X__AhhKmRyNOvg,136147
|
|
124
118
|
imap_processing/ialirt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
119
|
+
imap_processing/ialirt/constants.py,sha256=mwVPgSVNuPpTO4zx3LeUW7L5a6aJG2ZrezObPvR9s1c,1241
|
|
125
120
|
imap_processing/ialirt/l0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
121
|
imap_processing/ialirt/l0/ialirt_spice.py,sha256=WNuMlxA5UDGiBd8ap2k_dHxFmi2UCFgnQ4_wEZUhVU0,5649
|
|
127
122
|
imap_processing/ialirt/l0/mag_l0_ialirt_data.py,sha256=vgIerXkk4ZoOxxVaNEgvM1ESWVkGusSZ-3k73-Cl_tI,5276
|
|
128
|
-
imap_processing/ialirt/l0/parse_mag.py,sha256=
|
|
129
|
-
imap_processing/ialirt/l0/
|
|
130
|
-
imap_processing/ialirt/l0/
|
|
131
|
-
imap_processing/ialirt/l0/
|
|
132
|
-
imap_processing/ialirt/l0/
|
|
133
|
-
imap_processing/ialirt/l0/process_swe.py,sha256=5GGQ_f6uQlaEZB4vxIxvWCUUdN28coZHStxgqleyQWg,18150
|
|
123
|
+
imap_processing/ialirt/l0/parse_mag.py,sha256=v5Efczml4s-TFdREhjg3A6PzEFTYAx4dbJyeACmkbPc,12787
|
|
124
|
+
imap_processing/ialirt/l0/process_codice.py,sha256=guLrLsk1_lk7LJY_kJ4lMQocpTWIwrx50RcYnXL6Cig,3041
|
|
125
|
+
imap_processing/ialirt/l0/process_hit.py,sha256=HJ_h8nd5Xs0NC-mWNS7Ce3D86H1408lT6ZCdXlNQv48,5408
|
|
126
|
+
imap_processing/ialirt/l0/process_swapi.py,sha256=spcxacRDdHBpga1ZoAHN5EMUz-pDHdfazuYOrvzdywE,7493
|
|
127
|
+
imap_processing/ialirt/l0/process_swe.py,sha256=QXp6rmlxw8K5M0bapKwAArCd_99qHFS8sxOnhHLVkhU,17953
|
|
134
128
|
imap_processing/ialirt/packet_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
135
129
|
imap_processing/ialirt/packet_definitions/ialirt.xml,sha256=-hlT16Mr2Q6uCUfJ3jdpw0mPdeGCcZiWiorbkiEanwA,40784
|
|
136
130
|
imap_processing/ialirt/packet_definitions/ialirt_codicehi.xml,sha256=PwzGTJj4dROXJBqbT32UZ6swaPbjvXdXXn7E_Lxch2A,11367
|
|
@@ -140,8 +134,8 @@ imap_processing/ialirt/packet_definitions/ialirt_mag.xml,sha256=Kt3t3S1gk7kqv006
|
|
|
140
134
|
imap_processing/ialirt/packet_definitions/ialirt_swapi.xml,sha256=tGC4V-IV7WO6U3HtC2rDWA-500oOubcXgidMNyeGOE4,8400
|
|
141
135
|
imap_processing/ialirt/packet_definitions/ialirt_swe.xml,sha256=FJNhfWjBjK1Ze3BCW86hvNJIiWoIK5dujt2Dw76pjF0,13442
|
|
142
136
|
imap_processing/ialirt/process_ephemeris.py,sha256=RN6rzEY4KBc0V-ZKrsKffu8MEo7k0q3zJATBqaat9OY,8073
|
|
143
|
-
imap_processing/ialirt/utils/constants.py,sha256=
|
|
144
|
-
imap_processing/ialirt/utils/create_xarray.py,sha256=
|
|
137
|
+
imap_processing/ialirt/utils/constants.py,sha256=rF9KlnVig5Xk82lwo4OGbFPgf60lYNKHRP3FrlDQ4ls,2324
|
|
138
|
+
imap_processing/ialirt/utils/create_xarray.py,sha256=mNMiFk06YTl7dUxqguNtX_qytISWfp9VqVaVm6vF-NI,4743
|
|
145
139
|
imap_processing/ialirt/utils/grouping.py,sha256=Hk5u_TC0r72fN6s2CUEsD6opGig31EiwnRepAH9oOEE,3795
|
|
146
140
|
imap_processing/ialirt/utils/time.py,sha256=fXBDKxNp2IXYJ1laSPPAIw_GTKvjFIgPwh54fnNQMEI,636
|
|
147
141
|
imap_processing/idex/__init__.py,sha256=jO9AUm6ORgQhIHszOzLb3Vb2RVyz_SDUV64peGcr20A,52
|
|
@@ -262,10 +256,10 @@ imap_processing/ultra/packet_definitions/README.md,sha256=Iam1bd6UVkRLayApXlHG_y
|
|
|
262
256
|
imap_processing/ultra/packet_definitions/ULTRA_SCI_COMBINED.xml,sha256=q1Bmz5vJTdqjBcKPExBZ_LCismlQFHOFyTUI1dJsjiY,939289
|
|
263
257
|
imap_processing/ultra/packet_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
264
258
|
imap_processing/ultra/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
265
|
-
imap_processing/ultra/utils/ultra_l1_utils.py,sha256=
|
|
259
|
+
imap_processing/ultra/utils/ultra_l1_utils.py,sha256=W1wABph96AJVkFNGrmq_0Vf6i__fIFxIVTvjCPbysY0,5321
|
|
266
260
|
imap_processing/utils.py,sha256=zdcBXBQKL2NnElJcEbd-2QPeEDz0H3Yy0hVjRy9xcCE,14062
|
|
267
|
-
imap_processing-0.
|
|
268
|
-
imap_processing-0.
|
|
269
|
-
imap_processing-0.
|
|
270
|
-
imap_processing-0.
|
|
271
|
-
imap_processing-0.
|
|
261
|
+
imap_processing-0.16.1.dist-info/LICENSE,sha256=F2rxhvc6auEI0Dk9IGjglQSQQk60EvTe8M1dORMZPOg,1098
|
|
262
|
+
imap_processing-0.16.1.dist-info/METADATA,sha256=zjyVEsFl8ALuxnGSQ8rsqCWTvwsq3zUsPaDzTCSOmKQ,9102
|
|
263
|
+
imap_processing-0.16.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
264
|
+
imap_processing-0.16.1.dist-info/entry_points.txt,sha256=5r8ijLImHSNJxr-SGDC8kJy81BtXjmeUOmNfWSfLuRs,104
|
|
265
|
+
imap_processing-0.16.1.dist-info/RECORD,,
|
|
File without changes
|