-
Notifications
You must be signed in to change notification settings - Fork 16
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
Added SWAPI science data CDF attribute #394
Merged
tech3371
merged 3 commits into
IMAP-Science-Operations-Center:dev
from
tech3371:swapi_cdf
Apr 11, 2024
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "001" |
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 |
---|---|---|
@@ -0,0 +1,106 @@ | ||
"""Shared attribute values for SWAPI CDF files.""" | ||
|
||
from imap_processing.cdf.defaults import GlobalConstants | ||
from imap_processing.cdf.global_attrs import ( | ||
AttrBase, | ||
GlobalDataLevelAttrs, | ||
GlobalInstrumentAttrs, | ||
ScienceAttrs, | ||
) | ||
from imap_processing.swapi import __version__ | ||
|
||
text = ( | ||
"The Solar Wind and Pickup Ion (SWAPI) instrument " | ||
"measures several different elements of the solar " | ||
"wind, including hydrogen (H) and helium (He) ions," | ||
" and, on occasion, heavy ions produced by large " | ||
"events from the Sun. SWAPI also measures " | ||
"interstellar pickup ions (PUIs), whose material " | ||
"comes from beyond our solar system and moves along" | ||
" with the solar wind. Its data will provide " | ||
"information about the local ion conditions, such " | ||
"as temperature, density, and speed. This will also" | ||
" be used in the I-ALiRT data stream allowing space" | ||
" weather to be measured in real-time. The data from" | ||
" SWAPI will be valuable for understanding how the " | ||
"solar wind changes in response to the Sun's behavior" | ||
" over time. SWAPI's first-ever high time resolution " | ||
"measurements of helium PUIs will provide new insights" | ||
" into physical processes that accelerate charged " | ||
"particles and shape and change our global heliosphere." | ||
"See https://imap.princeton.edu/instruments/swapi for " | ||
"more details." | ||
) | ||
|
||
swapi_base = GlobalInstrumentAttrs( | ||
__version__, | ||
"SWAPI>The Solar Wind and Pickup Ion", | ||
text, | ||
"Particles (space)", | ||
) | ||
|
||
# dimensions attributes | ||
energy_dim_attrs = AttrBase( | ||
validmin=0, | ||
validmax=72, | ||
format="I2", | ||
var_type="support_data", | ||
fieldname="Energy Step", | ||
catdesc="Energy step number.", | ||
tech3371 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
label_axis="Energy Step", | ||
) | ||
|
||
# science data attributes | ||
counts_attrs = ScienceAttrs( | ||
validmin=GlobalConstants.INT_FILLVAL, | ||
tech3371 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
validmax=GlobalConstants.INT_MAXVAL, | ||
format="I12", | ||
units="Counts", | ||
label_axis="Counts", | ||
display_type="spectrogram", | ||
catdesc=("Primary, secondary CEM or coincidence counts."), | ||
fieldname="Counts", | ||
fill_val=GlobalConstants.INT_FILLVAL, | ||
var_type="data", | ||
depend_0="epoch", | ||
depend_1="energy", | ||
) | ||
|
||
# Uncertainty data is in Float and requires a different fill value, | ||
# format, min value. | ||
uncertainty_attrs = ScienceAttrs( | ||
validmin=GlobalConstants.DOUBLE_FILLVAL, | ||
validmax=GlobalConstants.INT_MAXVAL, | ||
format="E13.5", | ||
label_axis="Counts Uncertainty", | ||
tech3371 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
display_type="spectrogram", | ||
catdesc=("Uncertainty in the counts."), | ||
fieldname="Counts Uncertainty", | ||
fill_val=GlobalConstants.DOUBLE_FILLVAL, | ||
var_type="data", | ||
depend_0="epoch", | ||
depend_1="energy", | ||
) | ||
|
||
compression_attrs = ScienceAttrs( | ||
validmin=0, | ||
validmax=1, | ||
format="I1", | ||
label_axis="Compression Flag", | ||
tech3371 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
display_type="spectrogram", | ||
catdesc=("Data compression flag. 0 if no compression, 1 if compressed."), | ||
fieldname="Compression Flag", | ||
fill_val=GlobalConstants.INT_FILLVAL, | ||
var_type="data", | ||
depend_0="epoch", | ||
depend_1="energy", | ||
) | ||
|
||
swapi_l1_sci_attrs = GlobalDataLevelAttrs( | ||
data_type="L1_sci-1min>Level-1 Science data in 1 minute resolution", | ||
logical_source="imap_swapi_l1_sci-1min", | ||
logical_source_desc=( | ||
"SWAPI Instrument Level-1 Science Data in 1 minute resolution." | ||
), | ||
instrument_base=swapi_base, | ||
) |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the way this is organized, I am going to steal some ideas from this for CoDICE :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure!