Coverage for python/lsst/sims/maf/utils/astrometryUtils.py : 29%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Some simple functions that are useful for astrometry calculations. """
""" Calculate the uncertainty in fitting a line, as given by the spread in x values and the uncertainties in the y values.
Parameters ---------- x : numpy.ndarray The x values of the data sigma_y : numpy.ndarray The uncertainty in the y values
Returns ------- float The uncertainty in the line fit """ w = 1./sigma_y**2 denom = np.sum(w)*np.sum(w*x**2)-np.sum(w*x)**2 if denom <= 0: return np.nan else: result = np.sqrt(np.sum(w)/denom ) return result
""" Calculate the SNR for a star of magnitude m in an observation with 5-sigma limiting magnitude depth m5. Assumes gaussian distribution of photons and might not be strictly due in bluer filters. See table 2 and equation 5 in astroph/0805.2366.
Parameters ---------- m : float or numpy.ndarray The magnitude of the star m5 : float or numpy.ndarray The m5 limiting magnitude of the observation
Returns ------- float or numpy.ndarray The SNR """ snr = 5.*10.**(-0.4*(m-m5)) return snr
""" Calculate the approximate precision of astrometric measurements, given a particular seeing and SNR value.
Parameters ---------- fwhm : float or numpy.ndarray The seeing (FWHMgeom) of the observation. snr : float or numpy.ndarray The SNR of the object.
Returns ------- float or numpy.ndarray The astrometric precision. """ result = fwhm/(snr) return result |