Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIT Data_version fixes #626

Merged
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
2 changes: 1 addition & 1 deletion imap_processing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def do_processing(self, dependencies):
)
# process data and write all processed data to CDF files
l1a_dataset = load_cdf(dependencies[0])
products = hit_l1b(l1a_dataset)
products = hit_l1b(l1a_dataset, self.version)
return products


Expand Down
5 changes: 4 additions & 1 deletion imap_processing/hit/l1b/hit_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
# TODO review logging levels to use (debug vs. info)


def hit_l1b(l1a_dataset: xr.Dataset):
def hit_l1b(l1a_dataset: xr.Dataset, data_version: str):
"""Process HIT data to L1B.

Parameters
----------
l1a_dataset : xarray.Dataset
l1A data
data_version : str
Version of the data product being created

Returns
-------
Expand All @@ -47,6 +49,7 @@ def hit_l1b(l1a_dataset: xr.Dataset):
logger.info("Creating CDF files for HIT L1B data")
cdf_filepaths = []
for dataset in datasets:
dataset.attrs["Data_version"] = data_version
cdf_file = write_cdf(dataset)
cdf_filepaths.append(cdf_file)
logger.info(f"L1B CDF files created: {cdf_filepaths}")
Expand Down
2 changes: 1 addition & 1 deletion imap_processing/tests/hit/test_hit_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_hit_l1b(dependency):
dependency : xr.dataset
L1A data
"""
cdf_filepaths = hit_l1b.hit_l1b(dependency)
cdf_filepaths = hit_l1b.hit_l1b(dependency, "001")
assert len(cdf_filepaths) == 1
assert isinstance(cdf_filepaths[0], pathlib.PurePath)
assert cdf_filepaths[0].name == "imap_hit_l1b_hk_20100101_v001.cdf"
Loading