Add datetime, search window, and method flags to Argus example - #64
Open
SBFRF wants to merge 1 commit into
Open
Conversation
examples/get_latest_argus.py previously hardcoded the time of interest
to now, a 48-hour search window, and method=1. Expose all three as CLI
flags, with --datetime taking a UTC timestamp in YYYYmmddTHHMMSSZ format
validated at parse time. Defaults preserve the prior behavior.
Also rename the intermediate GeoTIFF from latest_argus_{type}.tif to
argus_{type}_{requested_time}.tif, since "latest" is a misnomer for a
prescribed historical time and the time-keyed name avoids collisions
between concurrent runs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The updated example introduces a flake8/PEP8 keyword-argument spacing issue and leaves the module docstring inaccurate relative to the new script behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Argus imagery example script to make the “time of interest”, search window, and search method configurable via CLI flags, while keeping defaults aligned with the prior “latest image” behavior.
Changes:
- Added
--datetime,--search-window-hours, and--methodCLI flags with validation for the datetime format. - Switched the intermediate output GeoTIFF name to be keyed by the requested time to reduce collisions and better reflect non-“latest” usage.
File summaries
| File | Description |
|---|---|
| examples/get_latest_argus.py | Adds CLI flags for time/search parameters and updates intermediate output naming to be time-keyed. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
2
to
+6
| Fetch the latest Argus image and save as GeoTIFF. | ||
|
|
||
| This script retrieves the most recent Argus orthophoto from the FRF coastal imaging server | ||
| and saves it as a GeoTIFF. Supports multiple image types: 'bright', 'timex', 'snap', 'dark'. | ||
|
|
Comment on lines
65
to
68
| result = find_argus_imagery( | ||
| dateOfInterest=utc_time, | ||
| filename=output_file, | ||
| imageType= image_type, |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
examples/get_latest_argus.pyhardcoded the time of interest to now, a 48-hour search window, andmethod=1, so it could only ever fetch the latest image. This exposes all three as CLI flags. Defaults preserve the existing behavior.--datetime YYYYmmddTHHMMSSZ— UTC time of interest (e.g.20250815T160000Z), validated at parse time via a custom argparsetypeso a bad format gives a clear error instead of a traceback. Defaults to now (UTC).--search-window-hours HOURS— was hardcoded 48, still defaults to 48.--method {0,1}— 0 = nearest in time (bidirectional), 1 = most recent before target. Was hardcoded 1, still defaults to 1.Also renames the intermediate GeoTIFF from
latest_argus_{type}.tiftoargus_{type}_{requested_time}.tif— "latest" is a misnomer for a prescribed historical time, and the time-keyed name avoids collisions between concurrent runs. It is still renamed to the found-image name on success.Test plan
Verified against the live coastal imaging server:
python examples/get_latest_argus.py timex --datetime 20250815T160000Z --search-window-hours 6→20250815_1600Z_argus_timex.tifpython examples/get_latest_argus.py bright --datetime 20250815T060000Z --search-window-hours 12→ fell back 7 hours to20250814_2300Z_argus_bright.tif--datetime 2026-09-02→ argparse error, exit 2🤖 Generated with Claude Code