def test_CGI_detector_position(): """ Test existence of the CGI detector position etc, and that you can't set it.""" cgi = wfirst.CGI() valid_pos = (512, 512) assert cgi.detector_position == valid_pos, "CGI detector position isn't as expected" with pytest.raises(RuntimeError) as excinfo: cgi.detector_position = valid_pos assert 'not adjustable' in str(excinfo.value), ("Failed to raise exception for"\ "trying to change CGI detector position.")
def test_CGI_psf(display=False): """ Just test that instantiating CGI works and can compute a PSF without raising any exceptions """ char_spc = wfirst.CGI() char_spc.mode = 'CHARSPC_F660' #print('Reading instrument data from {:s}'.format(charspc._WebbPSF_basepath) #print('Filter list: {:}'.format(charspc.filter_list)) monopsf = char_spc.calcPSF(nlambda=1, display=False) if display: wfirst.poppy.display_PSF(monopsf)