-
Notifications
You must be signed in to change notification settings - Fork 0
Implement WSA-Enlil NOAA client #7
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4abf1af
Integrations: add WSA-ENLIL client and animation functionality
alex1ozr 559da80
-
alex1ozr 693dae4
-
alex1ozr 9a0f1cf
Integrations: update WSA-ENLIL client to return WebP animation stream
alex1ozr 1022a06
-
alex1ozr 8f47dbb
Integrations: update WSA-ENLIL client to generate MP4 animations and …
alex1ozr 0c60e84
Integrations: update WSA-ENLIL client to validate maxWidth parameter …
alex1ozr 02d4aa8
Apply suggestions from code review
alex1ozr 141b3f9
Integrations: add unit test for GetEnlilAnimationAsync to validate ma…
alex1ozr dc82a28
Merge remote-tracking branch 'origin/wsa_enlil' into wsa_enlil
alex1ozr 3d420b0
Integrations: add GetLastFrameTimeAsync method to WSA-ENLIL client an…
alex1ozr 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -354,3 +354,6 @@ MigrationBackup/ | |
|
|
||
| # JetBrains IDEA files | ||
| .idea/ | ||
|
|
||
| # Serena MCP files | ||
| .serena/ | ||
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
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
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
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,38 @@ | ||
| namespace AuroraScienceHub.Integrations.NoaaClient.WsaEnlil; | ||
|
|
||
| /// <summary> | ||
| /// Client for creating WSA-ENLIL solar wind forecast animations from NOAA SWPC imagery. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Requires FFmpeg to be installed on the system and available in PATH. | ||
| /// See README for platform-specific installation instructions. | ||
| /// </remarks> | ||
| public interface IWsaEnlilClient | ||
| { | ||
| /// <summary> | ||
| /// Downloads the WSA-ENLIL animation manifest and all frames, assembling them into an optimized MP4 (H.264) video. | ||
| /// </summary> | ||
| /// <param name="maxWidth">Maximum output width in pixels. Frames are resized proportionally. Default 480.</param> | ||
| /// <param name="cancellationToken">Cancellation token.</param> | ||
| /// <returns>A stream containing the MP4 video data. The caller is responsible for disposing this stream.</returns> | ||
| /// <remarks> | ||
| /// The returned stream is a MemoryStream containing the complete MP4 data. | ||
| /// Typical usage: <c>await using var stream = await GetEnlilAnimationAsync(cancellationToken: cancellationToken);</c> | ||
| /// </remarks> | ||
| Task<Stream> GetEnlilAnimationAsync( | ||
| int maxWidth = 480, | ||
| CancellationToken cancellationToken = default); | ||
|
Demosfen marked this conversation as resolved.
|
||
|
|
||
| /// <summary> | ||
| /// Returns the timestamp of the last frame in the WSA-ENLIL animation, without downloading frames or encoding video. | ||
| /// </summary> | ||
| /// <param name="cancellationToken">Cancellation token.</param> | ||
| /// <returns> | ||
| /// The timestamp extracted from the last frame's URL, or <see langword="null"/> if the manifest is empty or unavailable. | ||
| /// </returns> | ||
| /// <remarks> | ||
| /// Fetches only the manifest JSON (~1 KB). Use this to check whether the animation has been updated | ||
| /// before calling <see cref="GetEnlilAnimationAsync"/>. | ||
| /// </remarks> | ||
| Task<DateTime?> GetLastFrameTimeAsync(CancellationToken cancellationToken = default); | ||
| } | ||
11 changes: 11 additions & 0 deletions
11
src/NoaaClient/WsaEnlil/Responses/WsaEnlilManifestEntry.cs
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,11 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace AuroraScienceHub.Integrations.NoaaClient.WsaEnlil.Responses; | ||
|
|
||
| /// <summary> | ||
| /// A single frame entry in the WSA-ENLIL animation manifest. | ||
| /// </summary> | ||
| /// <param name="Url">Relative frame URL, e.g. "/images/animations/enlil/enlil_com2_58426_20250118T120000.jpg".</param> | ||
| public sealed record WsaEnlilManifestEntry( | ||
| [property: JsonPropertyName("url")] string Url | ||
|
Demosfen marked this conversation as resolved.
|
||
| ); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.