Added Space Weather Data loader module#1306
Conversation
658fb7a to
3797009
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fdc62418e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/simulation/environment/spaceWeatherData/spaceWeatherData.cpp
Outdated
Show resolved
Hide resolved
src/simulation/environment/spaceWeatherData/spaceWeatherData.cpp
Outdated
Show resolved
Hide resolved
src/simulation/environment/spaceWeatherData/_UnitTest/test_spaceWeatherData.py
Outdated
Show resolved
Hide resolved
6fdc624 to
2d31f29
Compare
2d31f29 to
f31dbda
Compare
f31dbda to
bec3a73
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bec3a7372c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bec3a73 to
d1d7885
Compare
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Description
Implements the
spaceWeatherDataBasilisk simulation module, which reads a CelesTrak-style space-weather CSV file and publishes the 23SwDataMsgPayloadoutput messages required by themsisAtmospheremodule.Key implementation details reviewers should be aware of:
Date arithmetic: The module converts a Gregorian calendar date from the linked
EpochMsgPayloadto a signed Unix day number, which serves as the unique lookup key into the weather table. On eachUpdateStatecall, the BSK simulation time is added to the epoch to derive the current UTC instant, whole-day offset, and the current 3-hour Ap bin index.23-channel output mapping: Channel 0 maps
AP_AVGfor the current day; channels 1-20 map 20 consecutive 3-hour Ap values stepping back one bin at a time (wrapping across day boundaries up to D-3); channel 21 mapsF10.7_OBS_CENTER81; channel 22 mapsF10.7_OBSfrom the previous day.loadSpaceWeatherFilevalidation pipeline: Opens the file, checks all required columns (DATE,AP1-AP8,AP_AVG,F10.7_OBS,F10.7_OBS_CENTER81), parses rows until the first unparseable line (intentionally stops before the predicted section that omits AP values), and enforces strictly ascending, duplicate-freeDATEvalues. Any failure throws an error.Resetguard: AtReset, the module verifies that the simulation start date and its three preceding days are all present in the loaded table. ABSK_ERRORis emitted immediately rather than failing silently at runtime. A zero-state message is always published atReset.Task ordering requirement:
swModulemust be added to the task beforeatmoModule(or given higher priority) so output messages are written before the atmosphere module reads them within the same step.No interpolation: All indices are taken directly from the nearest table row; no temporal interpolation is performed.
Verification
epochInMsgeach produce the correctBSK_ERRORlog.BSK_WARNINGis not checked as it is not thrown.Documentation
spaceWeatherData.rst.Future work
setFallbackApValuePython setter so users can override the zero-state fallback with a mission-specific quiet-time Ap.msisAtmosphere.