Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,10 @@ def do_processing(
f"L0 and time kernels."
)
# process data to L1A products
science_files = dependencies.get_file_paths(source="hit", descriptor="raw")
# TODO: revert to 'raw' in issue #3215 work
science_files = dependencies.get_file_paths(
source="hit", descriptor="pha-telemetry-corrected"
)
datasets = hit_l1a(science_files[0], self.start_date)

elif self.data_level == "l1b":
Expand Down
12 changes: 6 additions & 6 deletions imap_processing/hit/l1a/hit_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def subcom_sectorates(sci_dataset: xr.Dataset) -> xr.Dataset:

# Update counts for science frames where data is available
for i, mod_10 in enumerate(hdr_min_count_mod_10):
# NOTE: this ignore is needed to avoid a mypy error in Git
# tests.
data_by_species_and_energy_range[mod_10]["counts"][i] = updated_dataset[ # type: ignore[index]
"sectorates"
].values[i]
Expand Down Expand Up @@ -389,8 +391,6 @@ def subset_sectored_counts(
A dataset of complete sectored counts and corresponding livetime values
for the processing day.
"""
# TODO: Update to use fill values for partial frames rather than drop them

# Modify livetime_counter to use a new epoch coordinate
# that is aligned with the original epoch dimension. This
# ensures that livetime doesn't get filtered when the original
Expand Down Expand Up @@ -612,10 +612,10 @@ def process_science(
sci_dataset = decom_hit(dataset)

# Create dataset for sectored data organized by species type
sectored_dataset = subcom_sectorates(sci_dataset)
# sectored_dataset = subcom_sectorates(sci_dataset)

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

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

# Calculate uncertainties for count rates
count_rates_dataset = calculate_uncertainties(count_rates_dataset)
sectored_count_rates_dataset = calculate_uncertainties(sectored_dataset)
# sectored_count_rates_dataset = calculate_uncertainties(sectored_dataset)

l1a_datasets: dict = {
"imap_hit_l1a_counts-standard": count_rates_dataset,
"imap_hit_l1a_counts-sectored": sectored_count_rates_dataset,
# "imap_hit_l1a_counts-sectored": sectored_count_rates_dataset,
"imap_hit_l1a_direct-events": pha_raw_dataset,
}

Expand Down
2 changes: 2 additions & 0 deletions imap_processing/tests/hit/test_hit_l1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ def test_validate_l1a_housekeeping_data(hk_packet_filepath):
)


@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
Comment thread
tech3371 marked this conversation as resolved.
def test_validate_l1a_counts_data(sci_packet_filepath, validation_data):
"""Compare the output of the L1A processing to the validation data.

Expand Down Expand Up @@ -822,6 +823,7 @@ def test_validate_l1a_counts_data(sci_packet_filepath, validation_data):
)


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

Expand Down
7 changes: 7 additions & 0 deletions imap_processing/tests/hit/test_hit_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def test_sum_livetime_10min():
xr.testing.assert_equal(result, expected_livetime)


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

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


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

Expand Down Expand Up @@ -291,6 +293,7 @@ def test_process_standard_rates_data(dependencies):
)


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

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


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


@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
def test_validate_l1b_hk_data(l1b_hk_dataset):
"""Test to validate the housekeeping dataset created by the L1B processing.

Expand Down Expand Up @@ -535,6 +540,7 @@ def test_livetime_fraction():


@mock.patch("imap_processing.hit.l1b.hit_l1b.livetime_fraction_calculation")
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
def test_validate_l1b_standard_rates_data(
livetime_fraction_calculation_mock, dependencies
):
Expand Down Expand Up @@ -612,6 +618,7 @@ def test_hit_l1b_unsupported_descriptor():
("sectored-rates", "imap_hit_l1b_sectored-rates"),
],
)
@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
def test_hit_l1b(dependencies, dependency_key, expected_logical_source):
"""Test creating L1B CDF files

Expand Down
4 changes: 3 additions & 1 deletion imap_processing/tests/hit/test_hit_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ def test_add_total_uncertainties():
)


@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
def test_process_macropixel_intensity(
l1b_sectored_rates_dataset, ancillary_dependencies
):
Expand Down Expand Up @@ -852,10 +853,11 @@ def test_process_standard_intensity(l1b_standard_rates_dataset, ancillary_depend
[
("imap_hit_l1b_summed-rates", "summed", "imap_hit_l2_summed-intensity"),
("imap_hit_l1b_standard-rates", "standard", "imap_hit_l2_standard-intensity"),
(
pytest.param(
"imap_hit_l1b_sectored-rates",
"macropixel",
"imap_hit_l2_macropixel-intensity",
marks=pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False),
),
],
)
Expand Down
1 change: 1 addition & 0 deletions imap_processing/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ def test_idex_l2b(mock_idex_l2b, mock_instrument_dependencies):
assert mock_instrument_dependencies["mock_write_cdf"].call_count == 2


@pytest.mark.xfail(reason="To be fixed in ticket #3215", strict=False)
@mock.patch("imap_processing.cli.hit_l1a")
def test_hit_l1a(mock_hit_l1a, mock_instrument_dependencies):
"""Test coverage for cli.Hit class with l1a data level"""
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ dynamic = ["version"]
description = "IMAP Science Operations Center Processing"
authors = [{name = "IMAP SDC Developers", email = "imap-sdc@lists.lasp.colorado.edu"}]
readme = "README.md"
license = {text = "MIT"}
license = "MIT"
keywords = ["IMAP", "SDC", "SOC", "Science Operations"]
requires-python = ">=3.10,<3.13" # upper bound due to scipy wheel availability; bump when scipy supports 3.14
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
Expand Down
Loading