Example #1
0
    def testMainGui(self, mock_conf):
        want_mirror_root_folder = os.path.join(testDataRootDir(), 'base',
                                               'ottSim', 'MIRROR_System')
        mock_conf.MIRROR_FOLDER = want_mirror_root_folder

        conf = os.path.join(testDataRootDir(), 'base', 'Configurations',
                            'testConf.yaml')
        ott, interf = start.create_ott(conf)
Example #2
0
 def testCreationWithSimulatedDevices(self):
     #aFakeConfig.simulated = 1
     ott, interf = create_ott(
         os.path.join(testDataRootDir(), 'base', 'Configurations',
                      'testConf.yaml'))
     self.assertIsInstance(ott.parabolaSlider, FakeParabolaSlider)
     self.assertIsInstance(interf, FakeInterferometer)
Example #3
0
 def _createInterferometer(self):
     from m4.configuration.start import create_ott
     from m4.ott_sim.fake_interferometer import FakeInterferometer
     ott, interf = create_ott(
         os.path.join(testDataRootDir(), 'base', 'Configurations',
                      'testConf.yaml'))
     self.assertIsInstance(interf, FakeInterferometer)
     return interf
    def testReadingAndAnalysis(self, mock_fold_name):
        want_acc_root_folder = os.path.join(testDataRootDir(), 'base',
                                            'M4Data', 'OPTData',
                                            'AccelerometersData')
        mock_fold_name.ACC_ROOT_FOLDER = want_acc_root_folder

        tt = '20210519_160814'
        self.ana = AccelerometersDataAnalyzer(tt)
        self.ana.readAndShow()
Example #5
0
    def testDataAcquisition(self, mock_fold_name):
        want_acc_root_folder = os.path.join(testDataRootDir(), 'base',
                                            'M4Data', 'OPTData',
                                            'AccelerometersData')
        mock_fold_name.ACC_ROOT_FOLDER = want_acc_root_folder

        tt = self.acc.acquireData()
        name = tt + '.h5'
        self._fname = os.path.join(want_acc_root_folder, name)
        print("filename %s " % self._fname)
    def testReadImageAndAnalysis(self):
        image_location = os.path.join(testDataRootDir(),
                                      'ima_for_req.fits')
        image = read_data.read_phasemap(image_location, ext=0)

        pscale = None
        step = 10000
        n_patches = None
        slope = req_check.test242(image, pscale)
        diff_piston = req_check.diffPiston(image)
        roc = req_check.test283(image, pscale, step)
        rem_31 = req_check.test243(image, 0.015, pscale, step, n_patches)
        rms_500 = req_check.test243(image, 0.1, pscale, step, n_patches)
        
Example #7
0
 def testIFFsAcquisition(self, mock, mockcmd, mockFilepath1, mockFilepath2):
     modalBaseTag = 'Hadamard3.fits'
     ampTag = 'ampTest3.fits'
     iff = IFFunctionsMaker(self.dm, self.interf)
     iff._interf.save_phasemap = self._skipSave
     iff._interf.acquire_phasemap = self._skipAcq
     n_push_pull = 1
     #inserire mock skip salvataggio dati
     mockFilepath2.return_value = os.path.join(testDataRootDir(), 'base',
                                               'M4Data', 'OPTData',
                                               'ModalAmplitude')
     mockFilepath1.return_value = os.path.join(testDataRootDir(), 'base',
                                               'M4Data', 'OPTData',
                                               'ModalBase')
     tt = iff.acq_IFFunctions(n_push_pull,
                              ampTag,
                              modalBaseTag,
                              shuffle=False,
                              template=None)
     tt2 = iff.acq_IFFunctions(n_push_pull,
                               ampTag,
                               modalBaseTag,
                               shuffle=True,
                               template=np.array([1, -1, 1]))
Example #8
0
    def testForDataAcquisition(self, mock_final_fold_name,
                               mock_start_fold_name, zmq_mock):
        want_acc_root_folder = os.path.join(testDataRootDir(), 'base',
                                            'M4Data', 'OPTData',
                                            'AccelerometersData')
        mock_final_fold_name.ACC_ROOT_FOLDER = want_acc_root_folder
        mock_start_fold_name.accelerometers_data_folder = want_acc_root_folder
        print(mock_start_fold_name.accelerometers_data_folder)

        acc = ZmqAccelerometers()
        #name = acc.acquireData()

        tt = '20210519_160814.h5'
        acc = AccelerometersData()
        start = os.path.join(mock_start_fold_name.accelerometers_data_folder,
                             tt)
        final_destination = os.path.join(mock_final_fold_name.ACC_ROOT_FOLDER,
                                         tt)
Example #9
0
 def testReadData(self):
     ic = read_data.InterferometerConverter()
     file_path = os.path.join(testDataRootDir(), 'img_0046.h5')
     ima = ic.from4D(file_path)
     file_path = os.path.join(testDataRootDir(), '0.4D')
     ima2 = ic.fromNew4D(file_path)
Example #10
0
 def testCreationWhitFakePathInYaml(self):
     ott, interf = create_ott(
         os.path.join(testDataRootDir(), 'base', 'Configurations',
                      'testConf2.yaml'))