pyTomoAO.slodar.slodarResult

class pyTomoAO.slodar.slodarResult(altitude, altitude_zenith, r0m53, cn2dh, fractionalCn2, r0, r0_zenith, L0, wavelength, zenithAngleInDeg=0.0, noiseVariance=<factory>, residualRms=nan, L0Grid=<factory>, L0Cost=<factory>, measured=<factory>, model=<factory>)[source]

Bases: object

Turbulence profile returned by slodarProfiler.fit_profile().

Parameters:
altitude

Layer ranges along the line of sight [m].

Type:

numpy.ndarray

altitude_zenith

Layer altitudes above the telescope, altitude * cos(zenith) [m].

Type:

numpy.ndarray

r0m53

Layer strengths as \(r_0^{-5/3}\) at wavelength [m^-5/3], line of sight.

Type:

numpy.ndarray

cn2dh

Integrated \(C_n^2\,dh\) per layer [m^1/3], line of sight.

Type:

numpy.ndarray

fractionalCn2

Normalised layer weights (sum to one); pyTomoAO’s fractionnalR0.

Type:

numpy.ndarray

r0

Total Fried parameter along the line of sight at wavelength [m].

Type:

float

r0_zenith

Total Fried parameter scaled to zenith [m].

Type:

float

L0

Outer scale used (or estimated) for the fit [m].

Type:

float

wavelength

Wavelength at which r0 is given [m].

Type:

float

zenithAngleInDeg

Zenith angle used to convert ranges to altitudes.

Type:

float

noiseVariance

Per-WFS slope noise variance estimated from the auto-covariance [rad^2], or an empty array when the auto-covariance was not fitted.

Type:

numpy.ndarray

residualRms

Weighted RMS of the fit residual, relative to the weighted RMS of the data.

Type:

float

L0Grid, L0Cost

Outer scales tried and their fit cost when fitL0 was requested (else empty). See L0AtGridEdge.

Type:

numpy.ndarray

measured, model

The fitted data vector and the best-fit model, for diagnostics.

Type:

numpy.ndarray

property L0AtGridEdge

True when L0 was fitted and the best value is at an end of L0Grid.

The fit minimum then lies outside the grid, so L0 is not constrained by the data. This is typical of short telemetry records, where it can ruin the profile.

to_atmosphere_config(windSpeed=None, windDirection=None, minFraction=0.0)[source]

Express the profile as an atmosphere_parameters configuration section.

The result can be dropped into a pyTomoAO YAML configuration (or passed to atmosphereParameters inside a {"atmosphere_parameters": ...} dictionary) so that a reconstructor can be rebuilt on the measured profile.

Parameters:
  • windSpeed (array_like, optional) – Per-layer wind; SLODAR from spatial covariances does not measure it, so zeros are used by default.

  • windDirection (array_like, optional) – Per-layer wind; SLODAR from spatial covariances does not measure it, so zeros are used by default.

  • minFraction (float, optional) – Layers with a fractional strength below this are dropped (default 0, keep all).

Returns:

dict – Keys as documented for atmosphere_parameters. Altitudes are zenith altitudes in km and r0 is the zenith value, as the configuration expects.

Notes

Dropping layers with minFraction renormalises the remaining fractions but keeps the total r0, so the strength of the dropped layers is shared out over the kept ones in proportion to their own.

noise_covariance(d=None, nValidSubap=None, wavelength=None, reconstructor=None)[source]

Per-slope noise variances from this fit, for build_reconstructor.

See slope_noise_covariance(); wavelength defaults to the reconstructor’s atmosphere wavelength when reconstructor is given, else to the profile’s.

Caution

On real Shack-Hartmann data the noise fitted here, from the zero-offset excess of the auto-covariance, absorbs any mismatch between the sensor and the geometric slope model at zero offset. In SPECULA simulations with a physical Shack-Hartmann it overestimated the noise by up to 5x. For the reconstructor, prefer slodarProfiler.temporal_noise_variance() on the (pseudo-)open-loop slopes. At low flux, also calibrate the centroid gain first (see the SLODAR user guide).

Parameters:
Returns:

numpy.ndarray – (nGS * 2 * nValidSubap,) variances.

plot(ax=None, reference=None, label='SLODAR')[source]

Plot the fractional profile against altitude.

Parameters:
  • ax (matplotlib.axes.Axes, optional) – Axes to draw into; a new figure is created by default.

  • reference (tuple of array_like, optional) – (altitude_m, fraction) of a reference profile to overplot.

  • label (str, optional) – Legend label of the SLODAR profile.

Returns:

matplotlib.axes.Axes