Skip to content

Improve GUI controls and fix read-only crash in odd-even plot#24

Merged
jpdeleon merged 2 commits into
mainfrom
upgrade
May 12, 2026
Merged

Improve GUI controls and fix read-only crash in odd-even plot#24
jpdeleon merged 2 commits into
mainfrom
upgrade

Conversation

@jpdeleon

Copy link
Copy Markdown
Owner

GUI (quicklook/app/templates/index.html)

  • Add "Cancel All Pending" button beside the single Cancel button that
    posts to the new /cancel-all endpoint, with a confirm dialog and a
    toast showing the number of jobs cancelled.
  • Add "t16" to the Pipeline dropdown (the CLI already accepted it).
  • Persist the Batch Submission textarea across page navigation via
    localStorage; auto-expand the section when restored content is
    non-empty.
  • Replace the unreliable native title tooltip on the help "?" icons
    with a custom CSS+JS popover that works on hover, on click (toggle),
    and on keyboard focus. A positionTip() helper measures the tooltip
    via a hidden probe and sets a CSS --tip-shift variable so popovers
    near the viewport edge slide inward instead of being cropped.
  • Remove overflow:hidden from .collapsible so tooltips can escape the
    section box; preserve the rounded look with header-only
    border-radius.
  • Add help-tips with useful text to every form field that lacked one:
    Pipeline, Flux Type, Quality Bitmask, Edge Cutoff, Flatten Method,
    Periodogram Method, Period Min, Period Max, Mask Known Transits,
    Archival Survey, Filename Suffix, Output Directory, Save outputs,
    Verbose, Overwrite, and Run each available sector.
  • Disable dependent fields whose values would be ignored:
    • Sector is disabled when "Run each available sector" is checked.
    • Flux Type is disabled when Pipeline is neither spoc nor
      tess-spoc (matches the gate in quicklook/tql.py:951).
    • GP Kernel is disabled when Flatten Method is not "gp".
      Each disabled input gets a greyed-out style and an explanatory
      title attribute.
  • Convert Exposure Time from a free-form number input to a dropdown
    with options 20, 120, 200, 600, 1800 plus a blank "auto" entry.

Backend (quicklook/app/app.py)

  • Add POST /cancel-all that iterates the jobs dict, sets every
    queued/running job's cancel_event, marks status "cancelled", and
    returns {ok: true, cancelled: [names]}. Mirrors the semantics of
    the existing /cancel/ route.

Bug fix (quicklook/plot.py)

  • Fix "ValueError: output array is read-only" that killed entire
    QuickLook runs during "Plotting odd-even transit..." (e.g.
    TIC-284200852).
  • Cause: stacked boolean slices on a folded LightCurve leave its
    Time/Quantity columns non-writeable. LightCurve.bin() delegates to
    astropy.timeseries.aggregate_downsample, which uses ufuncs with
    out=; under numpy>=2.0 writing to a non-writeable view
    raises ValueError. tql.py had no try/except around the call, so
    the whole job died.
  • Fix: deep-copy even_lc and odd_lc with .copy() after slicing so the
    ufuncs have writeable buffers, and wrap each .bin().errorbar()
    block in try/except (ValueError, TypeError) with a debug-log
    fallback. Mirrors the existing pattern in plot_secondary_eclipse.

jpdeleon added 2 commits May 12, 2026 17:57
GUI (quicklook/app/templates/index.html)
- Add "Cancel All Pending" button beside the single Cancel button that
  posts to the new /cancel-all endpoint, with a confirm dialog and a
  toast showing the number of jobs cancelled.
- Add "t16" to the Pipeline dropdown (the CLI already accepted it).
- Persist the Batch Submission textarea across page navigation via
  localStorage; auto-expand the section when restored content is
  non-empty.
- Replace the unreliable native title tooltip on the help "?" icons
  with a custom CSS+JS popover that works on hover, on click (toggle),
  and on keyboard focus. A positionTip() helper measures the tooltip
  via a hidden probe and sets a CSS --tip-shift variable so popovers
  near the viewport edge slide inward instead of being cropped.
- Remove overflow:hidden from .collapsible so tooltips can escape the
  section box; preserve the rounded look with header-only
  border-radius.
- Add help-tips with useful text to every form field that lacked one:
  Pipeline, Flux Type, Quality Bitmask, Edge Cutoff, Flatten Method,
  Periodogram Method, Period Min, Period Max, Mask Known Transits,
  Archival Survey, Filename Suffix, Output Directory, Save outputs,
  Verbose, Overwrite, and Run each available sector.
- Disable dependent fields whose values would be ignored:
    * Sector is disabled when "Run each available sector" is checked.
    * Flux Type is disabled when Pipeline is neither spoc nor
      tess-spoc (matches the gate in quicklook/tql.py:951).
    * GP Kernel is disabled when Flatten Method is not "gp".
  Each disabled input gets a greyed-out style and an explanatory
  title attribute.
- Convert Exposure Time from a free-form number input to a dropdown
  with options 20, 120, 200, 600, 1800 plus a blank "auto" entry.

Backend (quicklook/app/app.py)
- Add POST /cancel-all that iterates the jobs dict, sets every
  queued/running job's cancel_event, marks status "cancelled", and
  returns {ok: true, cancelled: [names]}. Mirrors the semantics of
  the existing /cancel/<target> route.

Bug fix (quicklook/plot.py)
- Fix "ValueError: output array is read-only" that killed entire
  QuickLook runs during "Plotting odd-even transit..." (e.g.
  TIC-284200852).
- Cause: stacked boolean slices on a folded LightCurve leave its
  Time/Quantity columns non-writeable. LightCurve.bin() delegates to
  astropy.timeseries.aggregate_downsample, which uses ufuncs with
  out=<array>; under numpy>=2.0 writing to a non-writeable view
  raises ValueError. tql.py had no try/except around the call, so
  the whole job died.
- Fix: deep-copy even_lc and odd_lc with .copy() after slicing so the
  ufuncs have writeable buffers, and wrap each .bin().errorbar()
  block in try/except (ValueError, TypeError) with a debug-log
  fallback. Mirrors the existing pattern in plot_secondary_eclipse.
CLI (quicklook/cli/ql.py)
- Add --nice to lower CPU priority via os.nice (POSIX). Useful when
  running QuickLook on a shared workstation.
- Add --cores to cap TLS worker threads. Default is cpu_count//2 for a
  single run and cpu_count//jobs for --each-sector. A warning is
  printed when jobs*cores > cpu_count.
- Plumb the resolved core count through run_ql_for_sector and the main
  TessQuickLook call as tls_use_threads.
- Add "t16" to --pipeline choices.
- Add explicit choices= to --flatten_method (biweight, gp, medfilt,
  median, rspline, hspline, pspline, lowess, cofiam, supersmoother,
  savgol) and --gp_kernel (periodic_auto, periodic, squared_exp), so
  argparse rejects typos at the boundary instead of failing deep
  inside wotan.
- Link the wotan docs from --flatten_method help.

Pipeline (quicklook/tql.py)
- Accept tls_use_threads on TessQuickLook and pass it to
  transitleastsquares.power(use_threads=...) when set, building the
  kwargs dict so the default (None) preserves TLS auto-detection.
- Allow "t16" pipeline through the tesscut TPF branch.
- Stop raising NotImplementedError for the "cdips" pipeline; let it
  fall through to tesscut like the other FFI products.
- Drop dead links and a personal localhost reference from the module
  docstring; keep the open TODOs.

TGLC (quicklook/tglc.py)
- Update every reference to the Gaia DR3 catalog column from
  "DESIGNATION" to "designation" (8 sites across Source, Source_cut,
  lc_output, and epsf) to match the current astroquery / Gaia DR3
  schema. This was the root cause of column-not-found failures on
  TGLC runs.
- Fix the swapped isinstance check in get_psf, fit_lc,
  fit_lc_float_field, and epsf: was isinstance(Source, source), which
  always returned False because Source is the class and source is the
  function parameter. Now isinstance(source, Source) as intended, so
  the bg_dof=6 branch runs when appropriate.
- Fix four format-string bugs writing literal "sector_{self.sector}_x"
  / "_y" into the gaia table; use f-strings.
- Add timeout=60 to the MAST POST in mast_query so a stuck connection
  cannot hang a TGLC run indefinitely.
- Bump default cutout size in get_tglc_lc from 25 to 50 px.
- Replace bare `except Exception` with specific tuples
  ((IndexError, KeyError, TypeError, ValueError) as appropriate) and
  upgrade prints to logger.debug, matching the rest of the codebase.

Sector enumeration (quicklook/utils.py)
- Add _get_tglc_sectors_via_tesscut() that uses astroquery.mast.Tesscut
  to enumerate sectors covering a resolved coordinate. TGLC operates
  on FFI cutouts produced locally, so sector availability is driven by
  sky coverage, not by any HLSP entries in the MAST Observations
  portal.
- Route get_available_sectors() through the new helper when
  pipeline == "TGLC". This survives outages of the /api/v0/invoke
  endpoint that previously broke TGLC sector lookup.
- Remove the now-dead "missing-products" fallback that looped over
  df["mission"].

GLS (quicklook/gls.py)
- Force input time/flux/err arrays to np.asarray(..., dtype=float)
  before peak fitting. Previously, astropy MaskedNDArray slipped
  through and broke np.dot during the parabolic peak fit.
- Tighten the file-read error path: catch only (OSError, ValueError)
  from np.genfromtxt and re-raise with context instead of printing
  and silently continuing with an inconsistent self.df.
- Remove a pointless try/except around the sine model evaluation;
  compute directly and let exceptions propagate.
@jpdeleon jpdeleon merged commit 43809b6 into main May 12, 2026
5 checks passed
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.

1 participant