Skip to content

Add datetime, search window, and method flags to Argus example - #64

Open
SBFRF wants to merge 1 commit into
mainfrom
feature/argus-example-time-flags
Open

Add datetime, search window, and method flags to Argus example#64
SBFRF wants to merge 1 commit into
mainfrom
feature/argus-example-time-flags

Conversation

@SBFRF

@SBFRF SBFRF commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

examples/get_latest_argus.py hardcoded the time of interest to now, a 48-hour search window, and method=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 argparse type so 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}.tif to argus_{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:

  • Exact hit: python examples/get_latest_argus.py timex --datetime 20250815T160000Z --search-window-hours 620250815_1600Z_argus_timex.tif
  • Offset hit: python examples/get_latest_argus.py bright --datetime 20250815T060000Z --search-window-hours 12 → fell back 7 hours to 20250814_2300Z_argus_bright.tif
  • Bad format: --datetime 2026-09-02 → argparse error, exit 2
  • Neither run left a stray intermediate file behind

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings September 2, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 --method CLI 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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants