Skip to content

makewfs 1.2.0

Choose a tag to compare

@jacotay7 jacotay7 released this 07 Oct 03:35
· 8 commits to main since this release
de2ab3d
  • Fixed: phase input was reported as metres. With
    input.quantity = "phase", OpticalResult.opd_m and the
    wfs_input_opd_rms_m frame metadata held the raw phase in radians, so a
    13 nm wavefront was recorded as 0.083 m. Both now carry the input converted
    to OPD metres at input.reference_wavelength_m. Images were never affected,
    and OPD input is unchanged.

  • Changed: generic optics helpers now come from
    aocore.
    aocore>=0.1.2,<0.2 moves
    from the dev extra to a core dependency. Under CONVENTIONS.md §9, makewfs
    now imports these primitives instead of keeping its own copies:
    centered_coordinates for the pupil, field-stop and DFT detector grids;
    ARCSEC_TO_RAD/RAD_TO_ARCSEC for source angles and the Shack-Hartmann
    plate scale; opd_to_phase/phase_to_opd for phase input and the sensor
    phasors; and block_sum for pixel integration. No public name changes.
    makewfs.sampling.block_sum keeps its signature, error messages and
    factor-two fast path, and delegates other factors to aocore. The behaviour
    already followed the conventions. Float32 renders of the example
    configurations are bit-for-bit unchanged, and float64 renders differ only by
    floating-point rounding (at most about 6e-16 relative), from the changed
    operation order in the angle and phase conversions and, for oversampling
    factors above two, in pixel binning. The pupil masks, the
    ArrayBackend and its fftshift-convention centred FFTs stay local
    because aocore has no equivalent for them; the module docstrings say why.

  • Tests: conformance with the AO stack conventions. tests/test_conformance.py
    runs aocore's checks against both
    sensors. Shack-Hartmann spots centre between pixels for a flat wavefront and
    move towards +x for a +x OPD ramp, and pyramid images are centred
    (CONVENTIONS.md 1.3 and 3.1). aocore joins the dev extra.

  • Fixed: magnitude-normalized photon rates ignored spiders, segment gaps and
    custom masks.
    The rate came from the analytic annulus area
    pi / 4 D^2 (1 - eps^2) and was then distributed over the sampled pupil's own
    flux, so obstructions inside the annulus never removed photons. Both sensors
    now scale a magnitude-normalized rate by the sampled pupil's clear fraction
    of the annulus, exposed as engine.clear_aperture_fraction: about 0.96 for
    four 2 % wedge spiders, and exactly 1 for a plain annulus, so such
    configurations are unchanged. Direct detector_photon_rate sources are never
    rescaled; the Keck HAKA example already computes its rate from the masked
    area and is unaffected.

  • Fixed: Shack-Hartmann flux creation and ghost spots for wide subaperture
    windows
    (#4). A lenslet
    field sampled at s points per lenslet has a far field that repeats every
    s lenslet lambda/d; when the detector window
    pixels_per_subaperture / spot_sampling_pixels_per_lambda_over_d exceeded
    s, the sampled DFT summed the replicas as light. A 20x20 sensor with 4
    pixels at 0.25 pixel per lambda/d and 6 pupil samples per lenslet returned
    8.6 times the configured photon rate (79 times for 16 pixels at 0.32), and
    tilts beyond +-s/2 lambda/d aliased to the wrong side. Each lenslet field is
    now propagated on the smallest integer refinement of the configured pupil
    grid that is at least as fine as the widest window, evaluated at the shortest
    configured wavelength and bounded by any field stop. The configured grid,
    custom masks, and lenslet illumination are unchanged; the OPD is interpolated
    linearly onto the refined grid. Configurations that already satisfied the
    rule are bit-for-bit unchanged, and the CPU reference path and the compiled
    CUDA executor share the fix. The engine reports pupil_samples_per_lenslet,
    field_upsampling, samples_per_lenslet, and
    detector_window_lambda_over_d; see the new "Lenslet-field sampling"
    section of the Shack-Hartmann guide.

    The Keck HAKA example changes. Its 4 samples per lenslet were below the
    4.4 lambda/d window at 673 nm and the 7.2 lambda/d window at its 411 nm
    quadrature node, which captured 1.56 times the light at that node and 1.06
    times the configured rate overall at zero OPD. It now propagates at 8 samples
    per lenslet and captures 0.93 (about 12% less signal; warm optical render
    1.29 to 1.66 ms on GPU, 671 to 751 ms on CPU). The checked-in HAKA
    real-versus-simulation and LUT artifacts were produced before this fix and
    have not been regenerated.