LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst.meas.astrom.pessimistic_pattern_matcher_b_3D Namespace Reference

Classes

class  PessimisticPatternMatcherB
 

Functions

 _rotation_matrix_chi_sq (flattened_rot_matrix, pattern_a, pattern_b, max_dist_rad)
 

Function Documentation

◆ _rotation_matrix_chi_sq()

lsst.meas.astrom.pessimistic_pattern_matcher_b_3D._rotation_matrix_chi_sq ( flattened_rot_matrix,
pattern_a,
pattern_b,
max_dist_rad )
protected
Compute the squared differences for least squares fitting.

Given a flattened rotation matrix, one N point pattern and another N point
pattern to transform into to, compute the squared differences between the
points in the two patterns after the rotation.

Parameters
----------
flattened_rot_matrix : `numpy.ndarray`, (9, )
    A flattened array representing a 3x3 rotation matrix. The array is
    flattened to comply with the API of scipy.optimize.least_squares.
    Flattened elements are [[0, 0], [0, 1], [0, 2], [1, 0]...]
pattern_a : `numpy.ndarray`, (N, 3)
    A array containing N, 3 vectors representing the objects we would like
    to transform into the frame of pattern_b.
pattern_b : `numpy.ndarray`, (N, 3)
    A array containing N, 3 vectors representing the reference frame we
    would like to transform pattern_a into.
max_dist_rad : `float`
    The maximum distance allowed from the pattern matching. This value is
    used as the standard error for the resultant chi values.

Returns
-------
noralized_diff : `numpy.ndarray`, (9,)
    Array of differences between the vectors representing of the source
    pattern rotated into the reference frame and the converse. This is
    used to minimize in a least squares fitter.

Definition at line 34 of file pessimistic_pattern_matcher_b_3D.py.

37 max_dist_rad):
38 """Compute the squared differences for least squares fitting.
39
40 Given a flattened rotation matrix, one N point pattern and another N point
41 pattern to transform into to, compute the squared differences between the
42 points in the two patterns after the rotation.
43
44 Parameters
45 ----------
46 flattened_rot_matrix : `numpy.ndarray`, (9, )
47 A flattened array representing a 3x3 rotation matrix. The array is
48 flattened to comply with the API of scipy.optimize.least_squares.
49 Flattened elements are [[0, 0], [0, 1], [0, 2], [1, 0]...]
50 pattern_a : `numpy.ndarray`, (N, 3)
51 A array containing N, 3 vectors representing the objects we would like
52 to transform into the frame of pattern_b.
53 pattern_b : `numpy.ndarray`, (N, 3)
54 A array containing N, 3 vectors representing the reference frame we
55 would like to transform pattern_a into.
56 max_dist_rad : `float`
57 The maximum distance allowed from the pattern matching. This value is
58 used as the standard error for the resultant chi values.
59
60 Returns
61 -------
62 noralized_diff : `numpy.ndarray`, (9,)
63 Array of differences between the vectors representing of the source
64 pattern rotated into the reference frame and the converse. This is
65 used to minimize in a least squares fitter.
66 """
67 # Unflatten the rotation matrix
68 rot_matrix = flattened_rot_matrix.reshape((3, 3))
69 # Compare the rotated source pattern to the references.
70 rot_pattern_a = np.dot(rot_matrix, pattern_a.transpose()).transpose()
71 diff_pattern_a_to_b = rot_pattern_a - pattern_b
72 # Return the flattened differences and length tolerances for use in a least
73 # squares fitter.
74 return diff_pattern_a_to_b.flatten() / max_dist_rad
75
76