-
Notifications
You must be signed in to change notification settings - Fork 33
Processing for a lo/l1b/goodtimes product #3117
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
Open
vineetbansal
wants to merge
4
commits into
IMAP-Science-Operations-Center:dev
Choose a base branch
from
vineetbansal:vb/lo_pipeline_merge
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 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 hidden or 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 hidden or 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,59 @@ | ||
| """Contains constants variables to support IMAP-Lo processing.""" | ||
|
|
||
| # ------- Constants for L1B processing ------- | ||
|
|
||
| # Ion species tracked. "H" is mandatory; any others for which we have histrates | ||
| # may be added here. | ||
| ELEMS = ("H", "O") | ||
|
|
||
| # Hours into the day (UTC) for HK data to calculate median for pivot angle estimation. | ||
| PIVOT_HK_HOUR_RANGE: tuple[int, int] = (3, 15) | ||
|
|
||
| # Per-day overrides for the anti-RAM background rate. Keyed by (year, day-of-year) | ||
| BG_RATE_ANTI_RAM_OVERRIDES: dict[tuple[int, int], float] = { | ||
| (2026, 62): 0.0014, | ||
| (2026, 64): 0.0, | ||
| (2026, 65): 0.0, | ||
| (2026, 91): 0.03, | ||
| } | ||
|
|
||
| # One histogram accumulation cycle duration [s] | ||
| HISTOGRAM_CYCLE_EPOCHS: int = 420 | ||
|
|
||
| N_CYCLE_SUM: int = 1 # Granularity of goodtime boundaries | ||
| N_CYCLE_AVE: int = 7 # Cycles to average over when estimating background rates | ||
| N_ESA_LEVELS: int = 7 # Total number of ESA levels | ||
| RAM_ESA_LEVELS: tuple[int, ...] = ( | ||
| 6, | ||
| 7, | ||
| ) # ESA levels for RAM estimation (1-indexed) | ||
|
|
||
| # Histogram angular bins (0-indexed) corresponding to the RAM and anti-RAM look | ||
| # directions | ||
| RAM_HISTOGRAM_BINS: tuple[slice, ...] = (slice(0, 20), slice(50, 60)) | ||
| ANTI_RAM_HISTOGRAM_BINS: tuple[slice, ...] = (slice(20, 50),) | ||
|
|
||
| # Nominal background rates [counts/s] for each species | ||
| BG_RATES = {"H": 0.0014925, "O": 0.000136635} | ||
| # When no exposure is available, scale the nominal rate down as a conservative estimate. | ||
| BG_RATE_FALLBACK_SCALE: dict[str, float] = {"H": 1.0, "O": 0.3} | ||
| # Minimum non-zero background rate floor = nominal / divisor | ||
| BG_RATE_FLOOR_DIVISOR: dict[str, float] = {"H": 50.0, "O": 150.0} | ||
|
|
||
| # Maximum acceptable background count rates [counts/s]. There are separate thresholds | ||
| # for RAM vs. anti-RAM, and for pivot near 90 deg vs. others. | ||
| THRESHOLD_BG_RATE_RAM_90: float = 0.014 | ||
| THRESHOLD_BG_RATE_ANTI_RAM_90: float = 0.007 | ||
| THRESHOLD_BG_RATE_RAM_NON_90: float = 0.0175 | ||
| THRESHOLD_BG_RATE_ANTI_RAM_NON_90: float = 0.00875 | ||
|
|
||
| # Maximum time gap [s] between consecutive histogram epochs before treating them as | ||
| # separate intervals. | ||
| DELAY_MAX: int = 100 | ||
| # Pivot angles within this range [degrees] are treated as "near 90". | ||
| PIVOT_90_RANGE: tuple[float, float] = 88.0, 92.0 | ||
| # Fraction of each cycle duration that contributes actual exposure. | ||
| EXPOSURE_FACTOR: float = 0.5 | ||
| # Padding [s] added to begin/end of each goodtime interval to ensure complete | ||
| # cycles are covered at interval edges. | ||
| GOODTIME_PADDING: float = 2.0 | ||
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.
Hard coded override days 😬. Two major concerns with this:
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.
Let me point @nschwadron to this comment - we could put these in a csv but that won't address your concerns. I'm not sure if these overrides are derivable from someplace..
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.
One possible approach could be to move these exception values into an ancillary file rather than hard-coding them in the algorithm.