imap-processing 0.19.4__py3-none-any.whl → 1.0.0__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.

@@ -236,8 +236,9 @@ HI_COUNTERS_AGGREGATED_VARIABLE_NAMES = [
236
236
  REQUIRES_DESPINNING = [
237
237
  "imap_codice_l1a_lo-sw-angular",
238
238
  "imap_codice_l1a_lo-nsw-angular",
239
- "imap_codice_l1a_lo-sw-priority",
240
- "imap_codice_l1a_lo-nsw-priority",
239
+ # TBD if this requires despinning
240
+ # "imap_codice_l1a_lo-sw-priority",
241
+ # "imap_codice_l1a_lo-nsw-priority",
241
242
  ]
242
243
 
243
244
  # Energy tables for CoDICE-Hi data products. These values represent the edges
@@ -268,149 +269,158 @@ IALIRT_ENERGY_TABLE = {
268
269
 
269
270
  OMNI_ENERGY_TABLE = {
270
271
  "h": [
271
- 0.05,
272
- 0.070710678,
273
- 0.1,
274
- 0.141421356,
275
- 0.2,
276
- 0.282842712,
277
- 0.4,
278
- 0.565685425,
279
- 0.8,
280
- 1.13137085,
281
- 1.6,
282
- 2.2627417,
283
- 3.2,
284
- 4.5254834,
285
- 6.4,
286
- 9.050966799,
272
+ 0.0200000000,
273
+ 0.0282842712,
274
+ 0.0400000000,
275
+ 0.0565685425,
276
+ 0.0800000000,
277
+ 0.1131370850,
278
+ 0.1600000000,
279
+ 0.2262741700,
280
+ 0.3200000000,
281
+ 0.4525483400,
282
+ 0.6400000000,
283
+ 0.9050966799,
284
+ 1.2800000000,
285
+ 1.8101933598,
286
+ 2.5600000000,
287
+ 3.6203867197,
287
288
  ],
288
289
  "he3": [
289
- 0.035355339,
290
- 0.05,
291
- 0.070710678,
292
- 0.1,
293
- 0.141421356,
294
- 0.2,
295
- 0.282842712,
296
- 0.4,
297
- 0.565685425,
298
- 0.8,
299
- 1.13137085,
300
- 1.6,
301
- 2.2627417,
302
- 3.2,
303
- 4.5254834,
304
- 6.4,
290
+ 0.0200000000,
291
+ 0.0282842712,
292
+ 0.0400000000,
293
+ 0.0565685425,
294
+ 0.0800000000,
295
+ 0.1131370850,
296
+ 0.1600000000,
297
+ 0.2262741700,
298
+ 0.3200000000,
299
+ 0.4525483400,
300
+ 0.6400000000,
301
+ 0.9050966799,
302
+ 1.2800000000,
303
+ 1.8101933598,
304
+ 2.5600000000,
305
+ 3.6203867197,
305
306
  ],
306
307
  "he4": [
307
- 0.035355339,
308
- 0.05,
309
- 0.070710678,
310
- 0.1,
311
- 0.141421356,
312
- 0.2,
313
- 0.282842712,
314
- 0.4,
315
- 0.565685425,
316
- 0.8,
317
- 1.13137085,
318
- 1.6,
319
- 2.2627417,
320
- 3.2,
321
- 4.5254834,
322
- 6.4,
308
+ 0.0200000000,
309
+ 0.0282842712,
310
+ 0.0400000000,
311
+ 0.0565685425,
312
+ 0.0800000000,
313
+ 0.1131370850,
314
+ 0.1600000000,
315
+ 0.2262741700,
316
+ 0.3200000000,
317
+ 0.4525483400,
318
+ 0.6400000000,
319
+ 0.9050966799,
320
+ 1.2800000000,
321
+ 1.8101933598,
322
+ 2.5600000000,
323
+ 3.6203867197,
323
324
  ],
324
325
  "c": [
325
- 0.025,
326
- 0.035355339,
327
- 0.05,
328
- 0.070710678,
329
- 0.1,
330
- 0.141421356,
331
- 0.2,
332
- 0.282842712,
333
- 0.4,
334
- 0.565685425,
335
- 0.8,
336
- 1.13137085,
337
- 1.6,
338
- 2.2627417,
339
- 3.2,
340
- 4.5254834,
341
- 6.4,
342
- 9.050966799,
343
- 12.8,
326
+ 0.0200000000,
327
+ 0.0282842712,
328
+ 0.0400000000,
329
+ 0.0565685425,
330
+ 0.0800000000,
331
+ 0.1131370850,
332
+ 0.1600000000,
333
+ 0.2262741700,
334
+ 0.3200000000,
335
+ 0.4525483400,
336
+ 0.6400000000,
337
+ 0.9050966799,
338
+ 1.2800000000,
339
+ 1.8101933598,
340
+ 2.5600000000,
341
+ 3.6203867197,
342
+ 5.1200000000,
343
+ 7.2407734394,
344
+ 10.2400000000,
344
345
  ],
345
346
  "o": [
346
- 0.025,
347
- 0.035355339,
348
- 0.05,
349
- 0.070710678,
350
- 0.1,
351
- 0.141421356,
352
- 0.2,
353
- 0.282842712,
354
- 0.4,
355
- 0.565685425,
356
- 0.8,
357
- 1.13137085,
358
- 1.6,
359
- 2.2627417,
360
- 3.2,
361
- 4.5254834,
362
- 6.4,
363
- 9.050966799,
364
- 12.8,
347
+ 0.0200000000,
348
+ 0.0282842712,
349
+ 0.0400000000,
350
+ 0.0565685425,
351
+ 0.0800000000,
352
+ 0.1131370850,
353
+ 0.1600000000,
354
+ 0.2262741700,
355
+ 0.3200000000,
356
+ 0.4525483400,
357
+ 0.6400000000,
358
+ 0.9050966799,
359
+ 1.2800000000,
360
+ 1.8101933598,
361
+ 2.5600000000,
362
+ 3.6203867197,
363
+ 5.1200000000,
364
+ 7.2407734394,
365
+ 10.2400000000,
365
366
  ],
366
367
  "ne_mg_si": [
367
- 0.01767767,
368
- 0.025,
369
- 0.035355339,
370
- 0.05,
371
- 0.070710678,
372
- 0.1,
373
- 0.141421356,
374
- 0.2,
375
- 0.282842712,
376
- 0.4,
377
- 0.565685425,
378
- 0.8,
379
- 1.13137085,
380
- 1.6,
381
- 2.2627417,
382
- 3.2,
368
+ 0.0200000000,
369
+ 0.0282842712,
370
+ 0.0400000000,
371
+ 0.0565685425,
372
+ 0.0800000000,
373
+ 0.1131370850,
374
+ 0.1600000000,
375
+ 0.2262741700,
376
+ 0.3200000000,
377
+ 0.4525483400,
378
+ 0.6400000000,
379
+ 0.9050966799,
380
+ 1.2800000000,
381
+ 1.8101933598,
382
+ 2.5600000000,
383
+ 3.6203867197,
383
384
  ],
384
385
  "fe": [
385
- 0.01767767,
386
- 0.025,
387
- 0.035355339,
388
- 0.05,
389
- 0.070710678,
390
- 0.1,
391
- 0.141421356,
392
- 0.2,
393
- 0.282842712,
394
- 0.4,
395
- 0.565685425,
396
- 0.8,
397
- 1.13137085,
398
- 1.6,
399
- 2.2627417,
400
- 3.2,
401
- 4.5254834,
402
- 6.4,
403
- 9.050966799,
386
+ 0.0200000000,
387
+ 0.0282842712,
388
+ 0.0400000000,
389
+ 0.0565685425,
390
+ 0.0800000000,
391
+ 0.1131370850,
392
+ 0.1600000000,
393
+ 0.2262741700,
394
+ 0.3200000000,
395
+ 0.4525483400,
396
+ 0.6400000000,
397
+ 0.9050966799,
398
+ 1.2800000000,
399
+ 1.8101933598,
400
+ 2.5600000000,
401
+ 3.6203867197,
402
+ 5.1200000000,
403
+ 7.2407734394,
404
+ 10.2400000000,
404
405
  ],
405
- "uh": [0.01767767, 0.025, 0.035355339, 0.05, 0.070710678, 0.1],
406
- "junk": [0.05, 0.070710678],
406
+ "uh": [
407
+ 0.0200000000,
408
+ 0.0282842712,
409
+ 0.0400000000,
410
+ 0.0565685425,
411
+ 0.0800000000,
412
+ 0.1131370850,
413
+ ],
414
+ "junk": [0.0200000000, 0.0282842712],
407
415
  }
408
416
 
417
+ # In the future, we get csv file with these column:
418
+ # species, min_energy, max_energy, product (descriptor of the product)
409
419
  SECTORED_ENERGY_TABLE = {
410
- "h": [0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4, 12.8],
411
- "he3he4": [0.025, 0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4],
412
- "cno": [0.025, 0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4],
413
- "fe": [0.0125, 0.025, 0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2],
420
+ "h": [0.020, 0.040, 0.080, 0.160, 0.320, 0.640, 1.280, 2.560, 5.120],
421
+ "he3he4": [0.020, 0.040, 0.080, 0.160, 0.320, 0.640, 1.280, 2.560, 5.120],
422
+ "cno": [0.020, 0.040, 0.080, 0.160, 0.320, 0.640, 1.280, 2.560, 5.120],
423
+ "fe": [0.020, 0.040, 0.080, 0.160, 0.320, 0.640, 1.280, 2.560, 5.120],
414
424
  }
415
425
 
416
426
  # Various configurations to support processing of individual data products
@@ -2185,6 +2195,30 @@ ACQUISITION_TIMES = {
2185
2195
  ],
2186
2196
  }
2187
2197
 
2198
+ # These are for product that requires despinning in l1b.
2199
+ SW_INDEX_TO_POSITION = [1, 2, 3, 23, 24]
2200
+ NSW_INDEX_TO_POSITION = [
2201
+ 4,
2202
+ 5,
2203
+ 6,
2204
+ 7,
2205
+ 8,
2206
+ 9,
2207
+ 10,
2208
+ 11,
2209
+ 12,
2210
+ 13,
2211
+ 14,
2212
+ 15,
2213
+ 16,
2214
+ 17,
2215
+ 18,
2216
+ 19,
2217
+ 20,
2218
+ 21,
2219
+ 22,
2220
+ ]
2221
+
2188
2222
  # TODO: Update EFFICIENCY value when better information is available.
2189
2223
  # Constant for CoDICE Intensity calculations.
2190
2224
  EFFICIENCY = 1
@@ -1331,25 +1331,28 @@ class RectangularSkyMap(AbstractSkyMap):
1331
1331
  )
1332
1332
  cdf_ds.attrs.update(map_attrs)
1333
1333
 
1334
- # Set the variable attributes
1335
- for var in [*cdf_ds.data_vars, *cdf_ds.coords]:
1334
+ # Set the variable and coordinate attributes
1335
+ for name, data_array in {**cdf_ds.data_vars, **cdf_ds.coords}.items():
1336
1336
  try:
1337
- # Don't check schema on label or delta variables
1338
- ignore_schema_substrings = ["_label", "_delta"]
1339
- check_schema = (
1340
- False if any(s in var for s in ignore_schema_substrings) else True
1341
- )
1337
+ # We only check the schema on data variables that include "epoch"
1338
+ # in their list of dimensions (But not epoch itself).
1339
+ check_schema = name != "epoch" and "epoch" in data_array.dims
1342
1340
  var_attrs = cdf_attrs.get_variable_attributes(
1343
- variable_name=var,
1341
+ variable_name=name,
1344
1342
  check_schema=check_schema,
1345
1343
  )
1346
1344
  except KeyError as e:
1347
1345
  raise KeyError(
1348
- f"Attributes for variable {var} not found in "
1346
+ f"Attributes for variable {name} not found in "
1349
1347
  f"loaded variable attributes."
1350
1348
  ) from e
1351
1349
 
1352
- cdf_ds[var].attrs.update(var_attrs)
1350
+ cdf_ds[name].attrs.update(var_attrs)
1351
+
1352
+ # Manually adjust epoch attributes
1353
+ cdf_ds["epoch"].attrs.update(
1354
+ {"DELTA_PLUS_VAR": "epoch_delta", "BIN_LOCATION": 0}
1355
+ )
1353
1356
 
1354
1357
  return cdf_ds
1355
1358
 
@@ -229,7 +229,7 @@ def calculate_ena_intensity(
229
229
  Returns
230
230
  -------
231
231
  map_ds : xarray.Dataset
232
- Map dataset with new variables: ena_intensity, ena_intensity_stat_unc,
232
+ Map dataset with new variables: ena_intensity, ena_intensity_stat_uncert,
233
233
  ena_intensity_sys_err.
234
234
  """
235
235
  # read calibration product configuration file
@@ -248,7 +248,7 @@ def calculate_ena_intensity(
248
248
  # Convert ENA Signal Rate to Flux
249
249
  flux_conversion_divisor = geometric_factor * esa_energy
250
250
  map_ds["ena_intensity"] = map_ds["ena_signal_rates"] / flux_conversion_divisor
251
- map_ds["ena_intensity_stat_unc"] = (
251
+ map_ds["ena_intensity_stat_uncert"] = (
252
252
  map_ds["ena_signal_rate_stat_unc"] / flux_conversion_divisor
253
253
  )
254
254
  map_ds["ena_intensity_sys_err"] = map_ds["bg_rates_unc"] / flux_conversion_divisor
@@ -268,12 +268,12 @@ def calculate_ena_intensity(
268
268
  # dimension by passing the zeroth element.
269
269
  corrected_intensity, corrected_stat_unc = corrector.apply_flux_correction(
270
270
  map_ds["ena_intensity"].values[0],
271
- map_ds["ena_intensity_stat_unc"].values[0],
271
+ map_ds["ena_intensity_stat_uncert"].values[0],
272
272
  esa_energy.data,
273
273
  )
274
274
  # Add the size 1 epoch dimension back in to the corrected fluxes.
275
275
  map_ds["ena_intensity"].data = corrected_intensity[np.newaxis, ...]
276
- map_ds["ena_intensity_stat_unc"].data = corrected_stat_unc[np.newaxis, ...]
276
+ map_ds["ena_intensity_stat_uncert"].data = corrected_stat_unc[np.newaxis, ...]
277
277
 
278
278
  return map_ds
279
279
 
@@ -302,7 +302,7 @@ def combine_calibration_products(
302
302
  Returns
303
303
  -------
304
304
  map_ds : xarray.Dataset
305
- Map dataset with updated variables: ena_intensity, ena_intensity_stat_unc,
305
+ Map dataset with updated variables: ena_intensity, ena_intensity_stat_uncert,
306
306
  ena_intensity_sys_err now combined across calibration products at each
307
307
  energy level.
308
308
  """
@@ -336,7 +336,7 @@ def combine_calibration_products(
336
336
  combined_flux = weighted_flux_sum / flux_weights.sum(dim="calibration_prod")
337
337
 
338
338
  map_ds["ena_intensity"] = combined_flux
339
- map_ds["ena_intensity_stat_unc"] = combined_stat_unc
339
+ map_ds["ena_intensity_stat_uncert"] = combined_stat_unc
340
340
  # For systematic error, just do quadrature sum over the systematic error for
341
341
  # each calibration product.
342
342
  map_ds["ena_intensity_sys_err"] = np.sqrt((sys_err**2).sum(dim="calibration_prod"))
@@ -377,7 +377,7 @@ def _calculate_improved_stat_variance(
377
377
 
378
378
  if n_calib_prods <= 1:
379
379
  # No improvement possible with single calibration product
380
- return map_ds["ena_intensity_stat_unc"] ** 2
380
+ return map_ds["ena_intensity_stat_uncert"] ** 2
381
381
 
382
382
  logger.debug("Computing geometric factor normalized signal rates")
383
383
 
@@ -417,7 +417,7 @@ def _calculate_improved_stat_variance(
417
417
  # Handle invalid cases by falling back to original uncertainties
418
418
  improved_variance = xr.where(
419
419
  ~np.isfinite(improved_variance) | (geometric_factors == 0),
420
- map_ds["ena_intensity_stat_unc"],
420
+ map_ds["ena_intensity_stat_uncert"],
421
421
  improved_variance,
422
422
  )
423
423
 
@@ -177,7 +177,7 @@ def transform_instrument_vectors_to_inertial(
177
177
  )
178
178
 
179
179
  # Get static mount matrix
180
- mount_matrix = spice.pxform(instrument_frame.name, spacecraft_frame.name, 0.0)
180
+ mount_matrix = spice.pxform(instrument_frame.name, spacecraft_frame.name, 0.0).T
181
181
 
182
182
  # Compute total rotations
183
183
  total_rotations = compute_total_rotation(
@@ -719,6 +719,39 @@ def process_packet(
719
719
  "mag_theta_B_GSM": Decimal(str(theta_gsm[i])),
720
720
  "mag_phi_B_GSE": Decimal(str(phi_gse[i])),
721
721
  "mag_theta_B_GSE": Decimal(str(theta_gse[i])),
722
+ "mag_hk_status": {
723
+ "hk1v5_warn": bool(status_data["hk1v5_warn"]),
724
+ "hk1v5_danger": bool(status_data["hk1v5_danger"]),
725
+ "hk1v5c_warn": bool(status_data["hk1v5c_warn"]),
726
+ "hk1v5c_danger": bool(status_data["hk1v5c_danger"]),
727
+ "hk1v8_warn": bool(status_data["hk1v8_warn"]),
728
+ "hk1v8_danger": bool(status_data["hk1v8_danger"]),
729
+ "hk1v8c_warn": bool(status_data["hk1v8c_warn"]),
730
+ "hk1v8c_danger": bool(status_data["hk1v8c_danger"]),
731
+ "fob_saturated": bool(status_data["fob_saturated"]),
732
+ "fib_saturated": bool(status_data["fib_saturated"]),
733
+ "mode": int(status_data["mode"]),
734
+ "icu_temp": int(status_data["icu_temp"]),
735
+ "hk2v5_warn": bool(status_data["hk2v5_warn"]),
736
+ "hk2v5_danger": bool(status_data["hk2v5_danger"]),
737
+ "hk2v5c_warn": bool(status_data["hk2v5c_warn"]),
738
+ "hk2v5c_danger": bool(status_data["hk2v5c_danger"]),
739
+ "hk3v3": int(status_data["hk3v3"]),
740
+ "hk3v3_current": int(status_data["hk3v3_current"]),
741
+ "pri_isvalid": bool(status_data["pri_isvalid"]),
742
+ "hkp8v5_warn": bool(status_data["hkp8v5_warn"]),
743
+ "hkp8v5_danger": bool(status_data["hkp8v5_danger"]),
744
+ "hkp8v5c_warn": bool(status_data["hkp8v5c_warn"]),
745
+ "hkp8v5c_danger": bool(status_data["hkp8v5c_danger"]),
746
+ "hkn8v5": int(status_data["hkn8v5"]),
747
+ "hkn8v5_current": int(status_data["hkn8v5_current"]),
748
+ "fob_temp": int(status_data["fob_temp"]),
749
+ "fib_temp": int(status_data["fib_temp"]),
750
+ "fob_range": int(status_data["fob_range"]),
751
+ "fib_range": int(status_data["fib_range"]),
752
+ "multbit_errs": bool(status_data["multbit_errs"]),
753
+ "sec_isvalid": bool(status_data["sec_isvalid"]),
754
+ },
722
755
  }
723
756
  )
724
757
 
@@ -154,6 +154,7 @@ def create_xarray_from_records(records: list[dict]) -> xr.Dataset: # noqa: PLR0
154
154
  "sc_position_GSE",
155
155
  "sc_velocity_GSM",
156
156
  "sc_velocity_GSE",
157
+ "mag_hk_status",
157
158
  ]:
158
159
  continue
159
160
  elif key in ["mag_B_GSE", "mag_B_GSM", "mag_B_RTN"]:
@@ -21,7 +21,7 @@ from numpy.typing import NDArray
21
21
  class SpiceBody(IntEnum):
22
22
  """Enum containing SPICE IDs for bodies that we use."""
23
23
 
24
- # A subset of IMAP Specific bodies as defined in imap_001.tf
24
+ # A subset of IMAP Specific bodies as defined in imap_xxx.tf
25
25
  IMAP = -43
26
26
  IMAP_SPACECRAFT = -43000
27
27
  # IMAP Pointing Frame (Despun) as defined in imap_science_xxx.tf
@@ -58,7 +58,7 @@ class SpiceFrame(IntEnum):
58
58
  IMAP_CODICE = -43400
59
59
  IMAP_HIT = -43500
60
60
  IMAP_IDEX = -43700
61
- IMAP_GLOWS = -43751
61
+ IMAP_GLOWS = -43750
62
62
 
63
63
  # IMAP Science Frames (new additions from imap_science_xxx.tf)
64
64
  IMAP_OMD = -43900
@@ -85,6 +85,8 @@ class SpiceFrame(IntEnum):
85
85
 
86
86
  BORESIGHT_LOOKUP = {
87
87
  SpiceFrame.IMAP_LO_BASE: np.array([0, -1, 0]),
88
+ SpiceFrame.IMAP_LO: np.array([0, -1, 0]),
89
+ SpiceFrame.IMAP_LO_STAR_SENSOR: np.array([0, -1, 0]),
88
90
  SpiceFrame.IMAP_HI_45: np.array([0, 1, 0]),
89
91
  SpiceFrame.IMAP_HI_90: np.array([0, 1, 0]),
90
92
  SpiceFrame.IMAP_ULTRA_45: np.array([0, 0, 1]),
@@ -160,7 +162,7 @@ def get_instrument_mounting_az_el(instrument: SpiceFrame) -> np.ndarray:
160
162
  # frame that is used to compute the s/c to instrument mounting.
161
163
  # Most of these vectors are the same as the instrument boresight vector.
162
164
  mounting_normal_vector = {
163
- SpiceFrame.IMAP_LO_BASE: np.array([0, -1, 0]),
165
+ SpiceFrame.IMAP_LO_BASE: np.array([0, 0, -1]),
164
166
  SpiceFrame.IMAP_HI_45: np.array([0, 1, 0]),
165
167
  SpiceFrame.IMAP_HI_90: np.array([0, 1, 0]),
166
168
  SpiceFrame.IMAP_ULTRA_45: np.array([0, 0, 1]),
@@ -190,11 +192,16 @@ def get_spacecraft_to_instrument_spin_phase_offset(instrument: SpiceFrame) -> fl
190
192
  """
191
193
  Get the spin phase offset from the spacecraft to the instrument.
192
194
 
193
- For now, the offset is a fixed lookup based on `Table 1: Nominal Instrument
195
+ Nominal offset values were determined using `Table 1: Nominal Instrument
194
196
  to S/C CS Transformations` in document `7516-0011_drw.pdf`. That Table
195
- defines the angle from the spacecraft y-axis. We add 90 and take the modulous
196
- with 360 in order to get the angle from the spacecraft x-axis. These fixed
197
- values will need to be updated based on calibration data.
197
+ defines the angle from the spacecraft y-axis. We add 90-degrees and take the
198
+ modulus with 360 to get the angle from the spacecraft x-axis. This math is
199
+ shown in the comments after each key value pair in the dictionary defined
200
+ in code. The true values differ slightly from the nominal values. True
201
+ values are derived from the frame definitions in the IMAP frames kernel
202
+ which uses ground calibration measurements to define the as-built mounting
203
+ of each instrument. The function in this module, `get_instrument_mounting_az_el`,
204
+ was used to retrieve the true azimuth angles from the IMAP frames kernel.
198
205
 
199
206
  Parameters
200
207
  ----------
@@ -207,19 +214,21 @@ def get_spacecraft_to_instrument_spin_phase_offset(instrument: SpiceFrame) -> fl
207
214
  The spin phase offset from the spacecraft to the instrument.
208
215
  """
209
216
  phase_offset_lookup = {
210
- SpiceFrame.IMAP_LO_BASE: 60 / 360, # (330 + 90) % 360 = 60
211
- SpiceFrame.IMAP_HI_45: 345 / 360, # 255 + 90 = 345
212
- SpiceFrame.IMAP_HI_90: 15 / 360, # (285 + 90) % 360 = 15
213
- SpiceFrame.IMAP_ULTRA_45: 123 / 360, # 33 + 90 = 123
214
- SpiceFrame.IMAP_ULTRA_90: 300 / 360, # 210 + 90 = 300
217
+ # Phase offset values based on imap_100.tf frame kernel
218
+ # See docstring notes for details on how these values were determined.
219
+ SpiceFrame.IMAP_LO: 60 / 360, # (330 + 90) % 360 = 60
220
+ SpiceFrame.IMAP_HI_45: 344.8264 / 360, # 255 + 90 = 345
221
+ SpiceFrame.IMAP_HI_90: 15.1649 / 360, # (285 + 90) % 360 = 15
222
+ SpiceFrame.IMAP_ULTRA_45: 122.8642 / 360, # 33 + 90 = 123
223
+ SpiceFrame.IMAP_ULTRA_90: 299.9511 / 360, # 210 + 90 = 300
215
224
  SpiceFrame.IMAP_SWAPI: 258 / 360, # 168 + 90 = 258
216
- SpiceFrame.IMAP_IDEX: 180 / 360, # 90 + 90 = 180
217
- SpiceFrame.IMAP_CODICE: 226 / 360, # 136 + 90 = 226
218
- SpiceFrame.IMAP_HIT: 120 / 360, # 30 + 90 = 120
219
- SpiceFrame.IMAP_SWE: 243 / 360, # 153 + 90 = 243
220
- SpiceFrame.IMAP_GLOWS: 217 / 360, # 127 + 90 = 217
221
- SpiceFrame.IMAP_MAG_I: 90 / 360, # 0 + 90 = 90
222
- SpiceFrame.IMAP_MAG_O: 90 / 360, # 0 + 90 = 90
225
+ SpiceFrame.IMAP_IDEX: 179.9229 / 360, # 90 + 90 = 180
226
+ SpiceFrame.IMAP_CODICE: 225.9086 / 360, # 136 + 90 = 226
227
+ SpiceFrame.IMAP_HIT: 119.6452 / 360, # 30 + 90 = 120
228
+ SpiceFrame.IMAP_SWE: 243.0155 / 360, # 153 + 90 = 243
229
+ SpiceFrame.IMAP_GLOWS: 217.1384 / 360, # 127 + 90 = 217
230
+ SpiceFrame.IMAP_MAG_I: 89.9709 / 360, # 0 + 90 = 90
231
+ SpiceFrame.IMAP_MAG_O: 89.4077 / 360, # 0 + 90 = 90
223
232
  }
224
233
  return phase_offset_lookup[instrument]
225
234
 
@@ -160,7 +160,7 @@ def generate_ultra_healpix_skymap( # noqa: PLR0912
160
160
  This function combines IMAP Ultra L1C pointing sets into a single L2 HealpixSkyMap.
161
161
  It handles the projection of values from pointing sets to the map, applies necessary
162
162
  weighting and background subtraction, and calculates ena_intensity
163
- and ena_intensity_stat_unc.
163
+ and ena_intensity_stat_uncert.
164
164
 
165
165
  Parameters
166
166
  ----------
@@ -391,7 +391,7 @@ def generate_ultra_healpix_skymap( # noqa: PLR0912
391
391
  skymap.data_1d["sensitivity"] * skymap.solid_angle * delta_energy
392
392
  )
393
393
 
394
- skymap.data_1d["ena_intensity_stat_unc"] = (
394
+ skymap.data_1d["ena_intensity_stat_uncert"] = (
395
395
  skymap.data_1d["counts"].astype(float) ** 0.5
396
396
  ) / (
397
397
  skymap.data_1d["exposure_factor"]
@@ -630,7 +630,7 @@ def ultra_l2(
630
630
  # Add systematic error as all zeros with shape matching statistical unc
631
631
  # TODO: update once we have information from the instrument team
632
632
  map_dataset["ena_intensity_sys_err"] = xr.zeros_like(
633
- map_dataset["ena_intensity_stat_unc"],
633
+ map_dataset["ena_intensity_stat_uncert"],
634
634
  )
635
635
 
636
636
  # Add epoch_delta
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imap-processing
3
- Version: 0.19.4
3
+ Version: 1.0.0
4
4
  Summary: IMAP Science Operations Center Processing
5
5
  License: MIT
6
6
  Keywords: IMAP,SDC,SOC,Science Operations