Hide keyboard shortcuts

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

# LSST Data Management System 

# Copyright 2016 AURA/LSST. 

# 

# This product includes software developed by the 

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

# 

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

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

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

# (at your option) any later version. 

# 

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

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

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

# GNU General Public License for more details. 

# 

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

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

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

 

 

import numpy as np 

import astropy.units as u 

 

from lsst.verify import Measurement, Datum 

 

 

def measurePF1(metric, pa1, pa2_spec): 

"""Measurement of PF1: fraction of samples between median RMS (PA1) and 

PA2 specification. 

 

Parameters 

---------- 

metric : `lsst.verify.Metric` 

A PF1 `~lsst.verify.Metric` instance. 

pa1 : `lsst.verify.Measurement` 

A PA1 measurement instance. 

pa2_spec : `lsst.verify.Spec` 

An `lsst.verify.Spec` that holds the threshold at which to measure PF1 

 

Returns 

------- 

measurement : `lsst.verify.Measurement` 

Measurement of PF1 and associated metadata. 

 

Notes 

----- 

The LSST Science Requirements Document (LPM-17) is commonly referred 

to as the SRD. The SRD puts a limit that no more than PF1 % of difference 

will vary by more than PA2 millimag. The design, minimum, and stretch 

goals are PF1 = (10, 20, 5) % at PA2 = (15, 15, 10) millimag following 

LPM-17 as of 2011-07-06, available at http://ls.st/LPM-17. 

""" 

 

datums = {} 

datums['pa2_spec'] = Datum(quantity=pa2_spec.threshold, description="Threshold applied to PA2") 

# Use first random sample from original PA1 measurement 

magDiff = pa1.extras['magDiff'].quantity 

magDiffs = magDiff[0, :] 

 

quantity = 100 * np.mean(np.abs(magDiffs) > pa2_spec.threshold) * u.Unit('percent') 

return Measurement(metric, quantity, extras=datums)