def teste_initPyrWfs(self): config = confParse.Configurator("../conf/sh_8x8.py") config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize/2., config.sim.simSize) wfs = WFS.Pyramid(config.sim, config.wfss[0], config.atmos, config.lgss[0], mask)
def testf_PyrWfsFrame(self): config = confParse.Configurator("../conf/sh_8x8.py") config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize/2., config.sim.simSize) wfs = WFS.Pyramid(config.sim, config.wfss[0], config.atmos, config.lgss[0], mask) wfs.frame(numpy.zeros((config.sim.simSize, config.sim.simSize)))
def testa_initWfs(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) wfs = WFS.WFS(config, mask=mask)
def test_sciInit(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) sci = SCI.PSF(config, 0, mask)
def testd_GradWfsFrame(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) wfs = WFS.Gradient(config, mask=mask) wfs.frame(numpy.zeros((config.sim.simSize, config.sim.simSize)))
def testa_initDM(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) wfs = WFS.ShackHartmann(config, mask=mask) dm = DM.DM(config, wfss=[wfs], mask=mask)
def testa_initLgs(self): config = confParse.Configurator( os.path.join(CONFIG_PATH, "sh_8x8_lgs-uplink.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) lgs = LGS.LGS(config.wfss[1], config)
def testd_initPhysLgs(self): config = confParse.Configurator( os.path.join(CONFIG_PATH, "sh_8x8_lgs-uplink.py")) config.loadSimParams() config.wfss[1].lgs.propagationMode = "Physical" mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) lgs = LGS.LGS_Physical(config.wfss[1], config)
def testc_geoLgsPsf(self): config = confParse.Configurator( os.path.join(CONFIG_PATH, "sh_8x8_lgs-uplink.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) config.wfss[1].lgs.propagationMode = "Geometric" lgs = LGS.LGS_Geometric(config.wfss[1], config) psf = lgs.getLgsPsf( [numpy.zeros((config.sim.simSize, config.sim.simSize))])
def test_runLOS(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() # mask = aoSimLib.circle(config.sim.pupilSize/2., config.sim.simSize) los = lineofsight.LineOfSight(config.wfss[0], config) testPhase = numpy.arange(config.sim.simSize**2).reshape( (config.sim.simSize, ) * 2) phs = los.frame(testPhase)
def test_sciStrehl(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) sci = SCI.PSF(config, 0, mask) sci.frame(numpy.ones((config.sim.simSize, config.sim.simSize))) self.assertTrue(numpy.allclose(sci.instStrehl, 1.))
def teste_physLgsPsf(self): config = confParse.Configurator( os.path.join(CONFIG_PATH, "sh_8x8_lgs-uplink.py")) config.loadSimParams() config.wfss[1].lgs.propagationMode = "Physical" mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) lgs = LGS.LGS_Physical(config.wfss[1], config, nOutPxls=10) psf = lgs.getLgsPsf( [numpy.zeros((config.sim.simSize, config.sim.simSize))])
def test_PhysWfs(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() config.wfss[0].propagationMode = "Physical" mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize) wfs = WFS.WFS(config, mask=mask) wfs.frame([numpy.zeros( (config.sim.scrnSize, ) * 2)] * config.atmos.scrnNo)
def test_saveloadScrn(self): # test the saving and loading phase screens config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() config.atmos.wholeScrnSize = 512 atmos = atmosphere.atmos(config) # Make a directory to save the screens in if os.path.exists('testscrns'): shutil.rmtree('testscrns') os.makedirs('testscrns') atmos.saveScrns('testscrns') try: # change config to load scrns config.atmos.scrnNames = [] for i in range(config.atmos.scrnNo): config.atmos.scrnNames.append( 'testscrns/scrn{}.fits'.format(i)) atmos2 = atmosphere.atmos(config) # Check that all scrns are identical for i in range(config.atmos.scrnNo): assert numpy.allclose(atmos.wholeScrns[i], atmos2.wholeScrns[i]) # delete that dir shutil.rmtree('testscrns') except: # always delete that dir - even in case of failure shutil.rmtree('testscrns') raise
def test_randomAtmos(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() atmos = atmosphere.atmos(config) atmos.randomScrns()
def test_initLOS(self): config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py")) config.loadSimParams() # mask = aoSimLib.circle(config.sim.pupilSize/2., config.sim.simSize) los = lineofsight.LineOfSight(config.wfss[0], config)