From 4541f053f7fdd5f17c103029af765850d64f2086 Mon Sep 17 00:00:00 2001 From: Tenzin Choedon Date: Thu, 25 Jul 2024 14:33:04 -0600 Subject: [PATCH] changed lo and swapi to use common epoch_attrs --- imap_processing/lo/l1a/lo_l1a_write_cdfs.py | 3 ++- imap_processing/swapi/l1/swapi_l1.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/imap_processing/lo/l1a/lo_l1a_write_cdfs.py b/imap_processing/lo/l1a/lo_l1a_write_cdfs.py index e845edaee..9608b737b 100644 --- a/imap_processing/lo/l1a/lo_l1a_write_cdfs.py +++ b/imap_processing/lo/l1a/lo_l1a_write_cdfs.py @@ -3,6 +3,7 @@ import numpy as np import xarray as xr +from imap_processing.cdf import epoch_attrs from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes from imap_processing.cdf.utils import J2000_EPOCH from imap_processing.lo.l0.lo_apid import LoAPID @@ -70,7 +71,7 @@ def create_lo_scide_dataset(sci_de: list) -> xr.Dataset: epoch_times, dims=["epoch"], name="epoch", - attrs=cdf_manager.get_variable_attributes("epoch"), + attrs=epoch_attrs, ) sci_de_energy = xr.DataArray( np.concatenate([sci_de_data.ENERGY for sci_de_data in sci_de]), diff --git a/imap_processing/swapi/l1/swapi_l1.py b/imap_processing/swapi/l1/swapi_l1.py index dcfffbc70..4f65f0a05 100644 --- a/imap_processing/swapi/l1/swapi_l1.py +++ b/imap_processing/swapi/l1/swapi_l1.py @@ -6,6 +6,7 @@ import xarray as xr from imap_processing import imap_module_directory +from imap_processing.cdf import epoch_attrs from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes from imap_processing.swapi.swapi_utils import SWAPIAPID, SWAPIMODE from imap_processing.utils import packet_file_to_datasets @@ -469,7 +470,7 @@ def process_swapi_science(sci_dataset: xr.Dataset, data_version: str) -> xr.Data epoch_values, name="epoch", dims=["epoch"], - attrs=cdf_manager.get_variable_attributes("epoch"), + attrs=epoch_attrs, ) # There are 72 energy steps