Commit 33bad698 authored by vertighel's avatar vertighel
Browse files

fits viewer: auto checkbox fix, display latest button; temp.fits to data/fits/



- fits-viewer.js: listen directly on 'fits-preview' CustomEvent (was buried
  inside noctua-telemetry, never received); fix ctrl-auto id extraction so
  checkbox correctly toggles autoUpdate; wire btn-refresh-all to refresh()
- control_panel.html: static ids ctrl-auto-primary / ctrl-auto-{cam} (Jinja2
  variables were undefined at render time); remove stray </div>; added
  telemetry to stage snippet
- viewer.html: same ctrl-auto id scheme for consistency
- constants.py: temp_fits / temp_fits0 now absolute paths under data/fits/
- mako.py: use temp_fits constant as default for download()
- viewer.ini: station1/scicam points to fits/temp.fits

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent fce177b8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5,6 +5,10 @@
Constants used in the whole project
'''

from pathlib import Path

_DATA_DIR = Path(__file__).parents[2] / "data"

# Telescope

lat = 44.5912  # [°] Latitude North from Greenwich.
@@ -56,8 +60,8 @@ ymax = [0, 4126] # max yrange in binning 1.
pixscale = 0.283  # arcsec/px in binning 1. From a resolved FITS
rotangle = -89.67  # -90 # typical rotation angle. From a resolved FITS

temp_fits = "temp.fits"
temp_fits0 = "temp0.fits"
temp_fits  = str(_DATA_DIR / "fits" / "temp.fits")
temp_fits0 = str(_DATA_DIR / "fits" / "temp0.fits")

filter_state = {
    0: "Idle",
+3 −3
Original line number Diff line number Diff line
@@ -12,9 +12,9 @@
module = mercury
class = Stage
node = MERCURY
pos_imaging = 120
pos_spectro = 110
pos_echelle = 100
pos_imaging = 1
pos_spectro = 68
pos_echelle = 110

[ao]
module = stx
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
# A typical observatory with three stations and two cameras each:

[station1/scicam]
path = test_stx.fits
path = fits/temp.fits

[station1/teccam]
path = temp2.fits
+4 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ from vmbpy import VmbSystem, FrameStatus
from .basedevice import BaseDevice
from ..utils.image import array_to_png, Streamer
from ..utils.logger import log
from ..config.constants import temp_fits


class Mako(BaseDevice):
@@ -166,9 +167,10 @@ class Guider(Mako):
        return filename

    
    def download(self, filename="temp.fits"):
    def download(self, filename=None):
        """Save the current frame as a FITS file."""
        
        if filename is None:
            filename = temp_fits
        raw = self.matrix
        if raw is not None:
            # Squeeze or reshape to 2D if it's a mono image with a channel dim
+5 −3
Original line number Diff line number Diff line
@@ -352,9 +352,11 @@ class Stage(Mercury):
        """

        current = self.position
        if current:
            for name, pos in self.named_positions.items():
                if abs(current - pos) < self.tolerance:
                    return name
                
        return None


Loading