COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
test_rtcFFF_pyramid Namespace Reference

Functions

def relative_array_error (array1, array2)
 
def test_doCentroids_maskedPix ()
 

Variables

int precision = 1e-2
 
 config
 
 sup = Supervisor(config)
 
 rtc = Rtc()
 
 idx_centro
 
 ncentro
 
 centro = rtc.d_centro[0]
 
 control = rtc.d_control[0]
 
 xvalid = np.array(sup.rtc.rtc.d_centro[0].d_validx)
 
 yvalid = np.array(sup.rtc.rtc.d_centro[0].d_validy)
 
 cmat = sup.rtc.get_command_matrix(0)
 
 frame = sup.wfs.get_wfs_image(0)
 
 slp = ng.array(rtc.d_control[0].d_centroids)
 
 com = ng.array(rtc.d_control[0].d_com)
 
 dark = np.random.random(frame.shape)
 
 flat = np.random.random(frame.shape)
 

Function Documentation

◆ relative_array_error()

def test_rtcFFF_pyramid.relative_array_error (   array1,
  array2 
)

Definition at line 49 of file test_rtcFFF_pyramid.py.

49 def relative_array_error(array1, array2):
50  return np.abs((array1 - array2) / array2.max()).max()
51 
52 
Here is the caller graph for this function:

◆ test_doCentroids_maskedPix()

def test_rtcFFF_pyramid.test_doCentroids_maskedPix ( )

Definition at line 53 of file test_rtcFFF_pyramid.py.

53 def test_doCentroids_maskedPix():
54  binimg = np.array(centro.d_img)
55  slopes = np.zeros(xvalid.size)
56  psum = binimg[xvalid, yvalid].sum() / slopes.size
57  for k in range(slopes.size):
58  slopes[k] = binimg[xvalid[k], yvalid[k]] / psum
59  assert (relative_array_error(ng.array(control.d_centroids).toarray(), slopes) <
60  precision)
Here is the call graph for this function:

Variable Documentation

◆ centro

test_rtcFFF_pyramid.centro = rtc.d_centro[0]

Definition at line 24 of file test_rtcFFF_pyramid.py.

◆ cmat

test_rtcFFF_pyramid.cmat = sup.rtc.get_command_matrix(0)

Definition at line 30 of file test_rtcFFF_pyramid.py.

◆ com

test_rtcFFF_pyramid.com = ng.array(rtc.d_control[0].d_com)

Definition at line 41 of file test_rtcFFF_pyramid.py.

◆ config

test_rtcFFF_pyramid.config
Initial value:
1 = load_config_from_file(os.getenv("COMPASS_ROOT") +
2  "/shesha/tests/pytest/par/test_pyrhr.py")

Definition at line 11 of file test_rtcFFF_pyramid.py.

◆ control

test_rtcFFF_pyramid.control = rtc.d_control[0]

Definition at line 25 of file test_rtcFFF_pyramid.py.

◆ dark

test_rtcFFF_pyramid.dark = np.random.random(frame.shape)

Definition at line 43 of file test_rtcFFF_pyramid.py.

◆ flat

test_rtcFFF_pyramid.flat = np.random.random(frame.shape)

Definition at line 44 of file test_rtcFFF_pyramid.py.

◆ frame

test_rtcFFF_pyramid.frame = sup.wfs.get_wfs_image(0)

Definition at line 33 of file test_rtcFFF_pyramid.py.

◆ idx_centro

test_rtcFFF_pyramid.idx_centro

Definition at line 23 of file test_rtcFFF_pyramid.py.

◆ ncentro

test_rtcFFF_pyramid.ncentro

Definition at line 23 of file test_rtcFFF_pyramid.py.

◆ precision

int test_rtcFFF_pyramid.precision = 1e-2

Definition at line 9 of file test_rtcFFF_pyramid.py.

◆ rtc

test_rtcFFF_pyramid.rtc = Rtc()

Definition at line 18 of file test_rtcFFF_pyramid.py.

◆ slp

test_rtcFFF_pyramid.slp = ng.array(rtc.d_control[0].d_centroids)

Definition at line 39 of file test_rtcFFF_pyramid.py.

◆ sup

test_rtcFFF_pyramid.sup = Supervisor(config)

Definition at line 13 of file test_rtcFFF_pyramid.py.

◆ xvalid

test_rtcFFF_pyramid.xvalid = np.array(sup.rtc.rtc.d_centro[0].d_validx)

Definition at line 27 of file test_rtcFFF_pyramid.py.

◆ yvalid

test_rtcFFF_pyramid.yvalid = np.array(sup.rtc.rtc.d_centro[0].d_validy)

Definition at line 28 of file test_rtcFFF_pyramid.py.