-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updating mag CDF generation to generate two files * PR updates, naming changes
- Loading branch information
1 parent
72d1a65
commit 73fd702
Showing
6 changed files
with
163 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+27.8 KB
imap_processing/data/imap/mag/l0/2023/12/imap_mag_l0_test_20231212_20231212_v00-01.pkts
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
"""Methods for decomming packets, processing to level 1A, and writing CDFs for MAG.""" | ||
import logging | ||
from pathlib import Path | ||
|
||
from imap_processing.cdf.utils import write_cdf | ||
from imap_processing.mag.l0 import decom_mag | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
def mag_l1a(packet_filepath, output_filepath): | ||
|
||
def mag_l1a(packet_filepath, output_filepath_norm, ouptput_filepath_burst): | ||
""" | ||
Process MAG L0 data into L1A CDF files at cdf_filepath. | ||
Parameters | ||
---------- | ||
packet_filepath: | ||
packet_filepath : | ||
Packet files for processing | ||
output_filepath: | ||
Directory for output | ||
output_filepath_norm : | ||
Full directory and filename for raw-norm CDF file | ||
ouptput_filepath_burst : | ||
Full directory and filename for raw-burst CDF file | ||
""" | ||
mag_l0 = decom_mag.decom_packets(packet_filepath) | ||
|
||
mag_datasets = decom_mag.export_to_xarray(mag_l0) | ||
mag_norm, mag_burst = decom_mag.export_to_xarray(mag_l0) | ||
|
||
if mag_norm is not None: | ||
write_cdf(mag_norm, Path(output_filepath_norm)) | ||
logging.info(f"Created CDF file at {output_filepath_norm}") | ||
|
||
write_cdf(mag_datasets, Path(output_filepath)) | ||
if mag_burst is not None: | ||
write_cdf(mag_burst, Path(ouptput_filepath_burst)) | ||
logging.info(f"Created CDF file at {output_filepath_norm}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters