Skip to content

Commit

Permalink
changed lo and swapi to use common epoch_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
tech3371 committed Jul 25, 2024
1 parent 9a903dc commit 4541f05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion imap_processing/lo/l1a/lo_l1a_write_cdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]),
Expand Down
3 changes: 2 additions & 1 deletion imap_processing/swapi/l1/swapi_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4541f05

Please sign in to comment.