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

CDF attrs bug fix #393

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
17 changes: 16 additions & 1 deletion imap_processing/cdf/global_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ class GlobalConstantAttrs:

"""

# TODO: ask about how to add optional parameter in File_naming_convention.
# Need optional parameter for date range and repoint number.
# If File_naming_convention was not set, it uses default setting:
# source_datatype_descriptor_yyyyMMdd
# which would result in a file name like:
# imap_l1_sci_idex_20220101_v001.cdf
# For IMAP naming convention, it should be:
# source_descriptor_datatype_yyyyMMdd_vNNN
# which would result in a file name like:
# imap_idex_l1_sci_20220101_v001.cdf
GLOBAL_BASE: Final[dict] = {
"Project": "STP>Solar-Terrestrial Physics",
"Source_name": "IMAP>Interstellar Mapping and Acceleration Probe",
Expand All @@ -49,6 +59,7 @@ class GlobalConstantAttrs:
"Princeton Plasma Physics Laboratory",
"100 Stellarator Road, Princeton, NJ 08540",
),
"File_naming_convention": "source_descriptor_datatype_yyyyMMdd_vNNN",
}

def output(self):
Expand Down Expand Up @@ -102,6 +113,9 @@ class GlobalInstrumentAttrs:
The software version
descriptor : str
Descriptor of the instrument (Ex: "IDEX>Interstellar Dust Experiment")
NOTE:
Instrument name on the left side of the ">" will need to match what it
appears in the filename.
text : str
Explanation of the instrument, usually as a paragraph.
instrument_type : str default="Particles (space)"
Expand Down Expand Up @@ -147,7 +161,8 @@ class GlobalDataLevelAttrs:
Attributes
----------
data_type : str
The level of data, ex "L1>Level-1"
The data level and descriptor separated by underscore.
Eg. "L1A_DE>Level-1A Direct Event"
logical_source : str
The source of the data, ex "imap_idex_l1_sci"
logical_source_desc : str
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/codice/cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
)

codice_l1a_global_attrs = GlobalDataLevelAttrs(
data_type="L1A->Level-1A",
data_type="L1A_SCI->Level-1A Science Data",
logical_source="imap_codice_l1a_sci",
logical_source_desc="IMAP Mission CoDICE Instrument Level-1A Data",
instrument_base=codice_base,
)

codice_l1b_global_attrs = GlobalDataLevelAttrs(
data_type="L1B->Level-1B",
data_type="L1B_SCI->Level-1B Science Data",
logical_source="imap_codice_l1b_sci",
logical_source_desc="IMAP Mission CoDICE Instrument Level-1B Data",
instrument_base=codice_base,
Expand Down
14 changes: 6 additions & 8 deletions imap_processing/hi/hi_cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
)

hi_base = GlobalInstrumentAttrs(
__version__,
"IMAP-Hi>IMAP High-Energy Energetic Neutral Atom Imager",
text,
"Particles (space)",
version=__version__,
descriptor="Hi>IMAP High-Energy (IMAP-Hi) Energetic Neutral Atom Imager",
text=text,
instrument_type="Particles (space)",
)

# Direct event attrs
Expand Down Expand Up @@ -134,18 +134,16 @@
)

# Note from SPDF about Logical_source_id breakdown:
# source_name: imap - This is in global attributes
# descriptor: instrument name - This is in global attributes
# data_type: <data_level>_<descriptor> - this is here in DataLevelAttrs
hi_de_l1a_attrs = GlobalDataLevelAttrs(
data_type="L1A-de>Level-1A Direct Event",
data_type="L1A_DE>Level-1A Direct Event",
logical_source="imap_hi_l1a_de",
logical_source_desc=("IMAP-HI Instrument Level-1A Direct Event Data."),
instrument_base=hi_base,
)

hi_hk_l1a_attrs = GlobalDataLevelAttrs(
data_type="L1A-hk>Level-1A Housekeeping",
data_type="L1A_HK>Level-1A Housekeeping",
logical_source="imap_hi_l1a_hk",
logical_source_desc=("IMAP-HI Instrument Level-1A Housekeeping Data."),
instrument_base=hi_base,
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/idex/idex_cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
)

idex_l1_global_attrs = GlobalDataLevelAttrs(
"L1>Level-1",
"L1_SCI>Level-1 Science Data",
"imap_idex_l1_sci",
"IMAP Mission IDEX Instrument Level-1 Data.",
idex_base,
)

idex_l2_global_attrs = GlobalDataLevelAttrs(
"L2>Level-2",
"L2_SCI>Level-2 Science Data",
"imap_idex_l2_sci",
"IMAP Mission IDEX Instrument Level-2 Data",
idex_base,
Expand Down
8 changes: 4 additions & 4 deletions imap_processing/mag/mag_cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
)

mag_l1a_norm_raw_attrs = GlobalDataLevelAttrs(
"L1A-raw-norm>Level-1A-raw-normal-rate",
"L1A_raw-norm>Level-1A raw normal rate",
# Should also include data type
logical_source="imap_mag_l1a_norm-raw",
logical_source_desc="IMAP Mission MAG Instrument Level-1A Data.",
instrument_base=mag_base,
)

mag_l1a_burst_raw_attrs = GlobalDataLevelAttrs(
"L1A-raw-burst>Level-1A-raw-burst-rate",
"L1A_raw-burst>Level-1A raw burst rate",
# Should also include data type
logical_source="imap_mag_l1a_burst-raw",
logical_source_desc="IMAP Mission MAG Instrument Level-1A Data.",
Expand All @@ -44,15 +44,15 @@


mag_l1b_attrs = GlobalDataLevelAttrs(
"L1A>Level-1B",
"L1B_SCI>Level-1B Science Data",
# TODO: replace "sci" with descriptor "norm" / "burst"
logical_source="imap_mag_l1b_sci",
logical_source_desc="IMAP Mission MAG Instrument Level-1B Data.",
instrument_base=mag_base,
)

mag_l1c_attrs = GlobalDataLevelAttrs(
"L1A>Level-1C",
"L1A_SCI>Level-1C Science Data",
tech3371 marked this conversation as resolved.
Show resolved Hide resolved
# TODO: replace "sci" with descriptor "norm" / "burst"
logical_source="imap_mag_l1c_sci",
logical_source_desc="IMAP Mission MAG Instrument Level-1C Data.",
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/swe/swe_cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@


swe_l1a_global_attrs = GlobalDataLevelAttrs(
data_type="L1A->Level-1A",
data_type="L1A_SCI>Level-1A Science Data",
# TODO: replace "sci" with proper descriptor
logical_source="imap_swe_l1a_sci",
logical_source_desc="IMAP Mission SWE Instrument Level-1A Data",
instrument_base=swe_base,
)

swe_l1b_global_attrs = GlobalDataLevelAttrs(
data_type="L1B->Level-1B",
data_type="L1B_SCI>Level-1B Science Data",
# TODO: replace "sci" with proper descriptor
logical_source="imap_swe_l1b_sci",
logical_source_desc="IMAP Mission SWE Instrument Level-1B Data",
Expand Down
2 changes: 1 addition & 1 deletion imap_processing/ultra/ultra_cdf_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)

ultra_l1a_attrs = GlobalDataLevelAttrs(
data_type="L1A->Level-1A",
data_type="L1A_SCI>Level-1A Science Data",
# TODO: update descriptor "sci" field with proper descriptor
logical_source="imap_ultra_l1a_sci",
logical_source_desc="IMAP Mission ULTRA Instrument Level-1A Data",
Expand Down
Loading