File: knots_for_splined_models.docstring

package info (click to toggle)
mrcal 2.5.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,548 kB
  • sloc: python: 40,828; ansic: 15,809; cpp: 1,754; perl: 303; makefile: 163; sh: 99; lisp: 84
file content (40 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download | duplicates (3)
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
Return a tuple of locations of x and y spline knots

SYNOPSIS

    print(mrcal.knots_for_splined_models('LENSMODEL_SPLINED_STEREOGRAPHIC_order=2_Nx=4_Ny=3_fov_x_deg=200'))

    ( array([-3.57526078, -1.19175359,  1.19175359,  3.57526078]),
      array([-2.38350719,  0.        ,  2.38350719]))

Splined models are defined by the locations of their control points. These are
arranged in a grid, the size and density of which is set by the model
configuration. This function returns a tuple:

- the locations of the knots along the x axis
- the locations of the knots along the y axis

The values in these arrays correspond to whatever is used to index the splined
surface. In the case of LENSMODEL_SPLINED_STEREOGRAPHIC, these are the
normalized stereographic projection coordinates. These can be unprojected to
observation vectors at the knots:

    ux,uy = mrcal.knots_for_splined_models('LENSMODEL_SPLINED_STEREOGRAPHIC_order=2_Nx=4_Ny=3_fov_x_deg=200')
    u  = np.ascontiguousarray(nps.mv(nps.cat(*np.meshgrid(ux,uy)), 0, -1))
    v  = mrcal.unproject_stereographic(u)

    # v[index_y, index_x] is now an observation vector that will project to this
    # knot

ARGUMENTS

- lensmodel: the "LENSMODEL_..." string we're querying. This function only makes
  sense for "LENSMODEL_SPLINED_..." models

RETURNED VALUE

A tuple:

- An array of shape (Nx,) representing the knot locations along the x axis

- An array of shape (Ny,) representing the knot locations along the y axis