Skip to content

Change the ImageQuality conditions to use a continuous range - #788

Merged
dngomez merged 5 commits into
mainfrom
GSCHED-1042/improve-gpp-iq-constraint-to-percentile-conversion
Sep 29, 2026
Merged

dngomez merged 5 commits into
mainfrom
GSCHED-1042/improve-gpp-iq-constraint-to-percentile-conversion

Conversation

@dngomez

@dngomez dngomez commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Changelog

feature (GSCHED-1042): Start using ImageQuality as a continuous range instead of bins and keep it retro-compatible

Should resolve the last lucupy PR modifications.

Scope

  • Backend (backend/)
  • Frontend (frontend/)
  • Docs (docs/)
  • CI/Infra (.github/)

Jira

GSCHED-1042

Checklist

  • Changelog fragment added to changelog.d/
  • Commit messages follow conventional commits (feat(backend):, fix(frontend):, etc.)
  • No breaking changes (or breaking fragment added)

@dngomez
dngomez requested a review from stroncod September 24, 2026 15:20
@dngomez
dngomez force-pushed the GSCHED-1042/improve-gpp-iq-constraint-to-percentile-conversion branch from abf61ef to 9c2cb44 Compare September 24, 2026 15:39

@stroncod stroncod left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How are we going to handle IQ in the UI as well. is going to show up old bins or gpp?

Comment thread backend/scheduler/core/programprovider/gpp/gppprogramprovider.py
@dngomez
dngomez requested a review from stroncod September 25, 2026 20:17
elif cond == GppProgramProvider._ConstraintKeys.IQ:
if wavelength is not None:
percentile_iq = Conditions.percentile_iq(value, wavelength, x_max)
return percentile_iq / 100.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One thing Claude flagged: percentile_iq might return IQ 0.0 and this would make the observation to get a 0 score, maybe we need to floor this to IQ20?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Where is that happening, I can't find the place were the score is being computed and uses the IQ. The only place in the selector match_conditions function the IQ is being used to compare and generate a boolean vector based in a comparison (which won't be affected by the 0.0 percentile) and in the adjusted which penalizes if a better than needed conditions are used, in equation the value is 1.0 - value, so a better IQ (lower number) returns a bigger result.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes on match_conditions:
if required_iq = 0.0 that would always be considered bad_iq regardless of the actual condition, actually anything from 0 to 0.19 would be left out as actual_iq is binned at 0.2 . I guess is more than we also need to modify the weather service to reflect on this or just assume something lower than 0.2 is 0.2 for the sake of comparison.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is more a question for @bryanmiller, my initial guess is having an actual result of 0.0 is not feasible and the values of the zenith_fwhm and wavelength won't allow it.

@stroncod stroncod left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes were already discuss. Left approved for convenience. Thanks for the changes.

@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@dngomez
dngomez merged commit 776d274 into main Sep 29, 2026
13 of 14 checks passed
@dngomez
dngomez deleted the GSCHED-1042/improve-gpp-iq-constraint-to-percentile-conversion branch September 29, 2026 19:56
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