Skip to content

Commit 9d908a2

Browse files
authored
HIT: comment out sectored_dataset for release 1 prep (IMAP-Science-Operations-Center#3216)
1 parent f9f18d0 commit 9d908a2

7 files changed

Lines changed: 24 additions & 10 deletions

File tree

imap_processing/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,10 @@ def do_processing(
995995
f"L0 and time kernels."
996996
)
997997
# process data to L1A products
998-
science_files = dependencies.get_file_paths(source="hit", descriptor="raw")
998+
# TODO: revert to 'raw' in issue #3215 work
999+
science_files = dependencies.get_file_paths(
1000+
source="hit", descriptor="pha-telemetry-corrected"
1001+
)
9991002
datasets = hit_l1a(science_files[0], self.start_date)
10001003

10011004
elif self.data_level == "l1b":

imap_processing/hit/l1a/hit_l1a.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def subcom_sectorates(sci_dataset: xr.Dataset) -> xr.Dataset:
150150

151151
# Update counts for science frames where data is available
152152
for i, mod_10 in enumerate(hdr_min_count_mod_10):
153+
# NOTE: this ignore is needed to avoid a mypy error in Git
154+
# tests.
153155
data_by_species_and_energy_range[mod_10]["counts"][i] = updated_dataset[ # type: ignore[index]
154156
"sectorates"
155157
].values[i]
@@ -389,8 +391,6 @@ def subset_sectored_counts(
389391
A dataset of complete sectored counts and corresponding livetime values
390392
for the processing day.
391393
"""
392-
# TODO: Update to use fill values for partial frames rather than drop them
393-
394394
# Modify livetime_counter to use a new epoch coordinate
395395
# that is aligned with the original epoch dimension. This
396396
# ensures that livetime doesn't get filtered when the original
@@ -612,10 +612,10 @@ def process_science(
612612
sci_dataset = decom_hit(dataset)
613613

614614
# Create dataset for sectored data organized by species type
615-
sectored_dataset = subcom_sectorates(sci_dataset)
615+
# sectored_dataset = subcom_sectorates(sci_dataset)
616616

617617
# Subset sectored data for complete sets (10 min intervals covering all species)
618-
sectored_dataset = subset_sectored_counts(sectored_dataset, packet_date)
618+
# sectored_dataset = subset_sectored_counts(sectored_dataset, packet_date)
619619

620620
# TODO:
621621
# - headers are values per packet rather than per frame. Do these need to align
@@ -637,11 +637,11 @@ def process_science(
637637

638638
# Calculate uncertainties for count rates
639639
count_rates_dataset = calculate_uncertainties(count_rates_dataset)
640-
sectored_count_rates_dataset = calculate_uncertainties(sectored_dataset)
640+
# sectored_count_rates_dataset = calculate_uncertainties(sectored_dataset)
641641

642642
l1a_datasets: dict = {
643643
"imap_hit_l1a_counts-standard": count_rates_dataset,
644-
"imap_hit_l1a_counts-sectored": sectored_count_rates_dataset,
644+
# "imap_hit_l1a_counts-sectored": sectored_count_rates_dataset,
645645
"imap_hit_l1a_direct-events": pha_raw_dataset,
646646
}
647647

imap_processing/tests/hit/test_hit_l1a.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ def test_validate_l1a_housekeeping_data(hk_packet_filepath):
576576
)
577577

578578

579+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
579580
def test_validate_l1a_counts_data(sci_packet_filepath, validation_data):
580581
"""Compare the output of the L1A processing to the validation data.
581582
@@ -822,6 +823,7 @@ def test_validate_l1a_counts_data(sci_packet_filepath, validation_data):
822823
)
823824

824825

826+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
825827
def test_hit_l1a(hk_packet_filepath, sci_packet_filepath):
826828
"""Create L1A datasets from packet files.
827829

imap_processing/tests/hit/test_hit_l1b.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_sum_livetime_10min():
155155
xr.testing.assert_equal(result, expected_livetime)
156156

157157

158+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
158159
def test_process_summed_rates_data(dependencies):
159160
"""Test the variables in the summed rates dataset"""
160161

@@ -199,6 +200,7 @@ def test_process_summed_rates_data(dependencies):
199200
assert f"{particle}_energy_delta_plus" in l1b_summed_rates_dataset.data_vars
200201

201202

203+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
202204
def test_process_standard_rates_data(dependencies):
203205
"""Test the variables in the standard rates dataset"""
204206

@@ -291,6 +293,7 @@ def test_process_standard_rates_data(dependencies):
291293
)
292294

293295

296+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
294297
def test_process_sectored_rates_data(dependencies):
295298
"""Test the variables in the sectored rates dataset"""
296299

@@ -338,6 +341,7 @@ def test_process_sectored_rates_data(dependencies):
338341
assert f"{particle}_energy_delta_plus" in l1b_sectored_rates_dataset.data_vars
339342

340343

344+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
341345
def test_hit_l1b_hk_dataset_variables(l1b_hk_dataset):
342346
"""Test the variables in the housekeeping dataset"""
343347
# Define the keys that should have dropped from the housekeeping dataset
@@ -425,6 +429,7 @@ def test_hit_l1b_hk_dataset_variables(l1b_hk_dataset):
425429
assert l1b_hk_dataset.coords.keys() == dataset_coords_dims
426430

427431

432+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
428433
def test_validate_l1b_hk_data(l1b_hk_dataset):
429434
"""Test to validate the housekeeping dataset created by the L1B processing.
430435
@@ -535,6 +540,7 @@ def test_livetime_fraction():
535540

536541

537542
@mock.patch("imap_processing.hit.l1b.hit_l1b.livetime_fraction_calculation")
543+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
538544
def test_validate_l1b_standard_rates_data(
539545
livetime_fraction_calculation_mock, dependencies
540546
):
@@ -612,6 +618,7 @@ def test_hit_l1b_unsupported_descriptor():
612618
("sectored-rates", "imap_hit_l1b_sectored-rates"),
613619
],
614620
)
621+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
615622
def test_hit_l1b(dependencies, dependency_key, expected_logical_source):
616623
"""Test creating L1B CDF files
617624

imap_processing/tests/hit/test_hit_l2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ def test_add_total_uncertainties():
687687
)
688688

689689

690+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
690691
def test_process_macropixel_intensity(
691692
l1b_sectored_rates_dataset, ancillary_dependencies
692693
):
@@ -852,10 +853,11 @@ def test_process_standard_intensity(l1b_standard_rates_dataset, ancillary_depend
852853
[
853854
("imap_hit_l1b_summed-rates", "summed", "imap_hit_l2_summed-intensity"),
854855
("imap_hit_l1b_standard-rates", "standard", "imap_hit_l2_standard-intensity"),
855-
(
856+
pytest.param(
856857
"imap_hit_l1b_sectored-rates",
857858
"macropixel",
858859
"imap_hit_l2_macropixel-intensity",
860+
marks=pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False),
859861
),
860862
],
861863
)

imap_processing/tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ def test_idex_l2b(mock_idex_l2b, mock_instrument_dependencies):
708708
assert mock_instrument_dependencies["mock_write_cdf"].call_count == 2
709709

710710

711+
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
711712
@mock.patch("imap_processing.cli.hit_l1a")
712713
def test_hit_l1a(mock_hit_l1a, mock_instrument_dependencies):
713714
"""Test coverage for cli.Hit class with l1a data level"""

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ dynamic = ["version"]
1212
description = "IMAP Science Operations Center Processing"
1313
authors = [{name = "IMAP SDC Developers", email = "imap-sdc@lists.lasp.colorado.edu"}]
1414
readme = "README.md"
15-
license = {text = "MIT"}
15+
license = "MIT"
1616
keywords = ["IMAP", "SDC", "SOC", "Science Operations"]
1717
requires-python = ">=3.10,<3.13" # upper bound due to scipy wheel availability; bump when scipy supports 3.14
1818
classifiers = [
1919
"Development Status :: 3 - Alpha",
2020
"Intended Audience :: Developers",
21-
"License :: OSI Approved :: MIT License",
2221
"Natural Language :: English",
2322
"Programming Language :: Python :: 3",
2423
"Programming Language :: Python :: 3.10",

0 commit comments

Comments
 (0)