Coverage for python/lsst/validate/drp/calcsrd/afx.py: 31%

Shortcuts 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

11 statements  

1# LSST Data Management System 

2# Copyright 2016 AURA/LSST. 

3# 

4# This product includes software developed by the 

5# LSST Project (http://www.lsst.org/). 

6# 

7# This program is free software: you can redistribute it and/or modify 

8# it under the terms of the GNU General Public License as published by 

9# the Free Software Foundation, either version 3 of the License, or 

10# (at your option) any later version. 

11# 

12# This program is distributed in the hope that it will be useful, 

13# but WITHOUT ANY WARRANTY; without even the implied warranty of 

14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

15# GNU General Public License for more details. 

16# 

17# You should have received a copy of the LSST License Statement and 

18# the GNU General Public License along with this program. If not, 

19# see <https://www.lsstcorp.org/LegalNotices/>. 

20 

21 

22import numpy as np 

23import astropy.units as u 

24 

25from lsst.verify import Measurement 

26 

27 

28def measureAFx(metric, amx, adx, adx_spec): 

29 r"""Measurement of AFx (x=1,2,3): The maximum fraction of astrometric 

30 distances which deviate by more than ADx milliarcsec (see AMx) (%). 

31 

32 Parameters 

33 ---------- 

34 metric : `lsst.verify.Metric` 

35 AF1, AF2 or AF3 `~lsst.verify.Metric` instance. 

36 amx : `lsst.verify.Measurement` 

37 An AMx measurement, providing the median astrometric scatter in 

38 the annulus. 

39 adx : `lsst.verify.Measurement` 

40 An ADx measurement 

41 adx_spec : `lsst.verify.Spec` 

42 An instance of a `lsst.verify.Spec` containing the threshold against 

43 which to measure. 

44 

45 Returns 

46 ------- 

47 measurement : `lsst.verify.Measurement` 

48 Measurement of AFx (x=1,2,3) and associated metadata. 

49 

50 Notes 

51 ----- 

52 This table below is provided ``validate_drp``\ 's :file:`metrics.yaml`. 

53 

54 LPM-17 dated 2011-07-06 

55 

56 Specification: 

57 The rms of the astrometric distance distribution for 

58 stellar pairs with separation of D arcmin (repeatability) 

59 will not exceed AMx milliarcsec (median distribution for a large number 

60 of sources). No more than AFx % of the sample will deviate by more than 

61 ADx milliarcsec from the median. AMx, AFx, and ADx are specified for 

62 D=5, 20 and 200 arcmin for x= 1, 2, and 3, in the same order (Table 18). 

63 

64 The three selected characteristic distances reflect the size of an 

65 individual sensor, a raft, and the camera. The required median astrometric 

66 precision is driven by the desire to achieve a proper motion accuracy of 

67 0.2 mas/yr and parallax accuracy of 1.0 mas over the course of the survey. 

68 These two requirements correspond to relative astrometric precision for a 

69 single image of 10 mas (per coordinate). 

70 

71 ========================= ====== ======= ======= 

72 Astrometric Repeatability Specification 

73 ------------------------- ---------------------- 

74 Metric Design Minimum Stretch 

75 ========================= ====== ======= ======= 

76 AM1 (milliarcsec) 10 20 5 

77 AF1 (%) 10 20 5 

78 AD1 (milliarcsec) 20 40 10 

79 AM2 (milliarcsec) 10 20 5 

80 AF2 (%) 10 20 5 

81 AD2 (milliarcsec) 20 40 10 

82 AM3 (milliarcsec) 15 30 10 

83 AF3 (%) 10 20 5 

84 AD3 (milliarcsec) 30 50 20 

85 ========================= ====== ======= ======= 

86 

87 Table 18: The specifications for astrometric precision. 

88 The three blocks of values correspond to D=5, 20 and 200 arcmin, 

89 and to astrometric measurements performed in the r and i bands. 

90 """ 

91 

92 datums = {} 

93 datums['ADx'] = adx.datum 

94 if not np.isnan(amx.quantity): 

95 quantity = 100.*np.mean(amx.extras['rmsDistMas'].quantity > amx.quantity 

96 + adx_spec.threshold)*u.Unit('percent') 

97 else: 

98 quantity = np.nan*u.Unit('percent') 

99 datums.update(amx.extras) 

100 return Measurement(metric, quantity, extras=datums)