예제 #1
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_datafile(self):
     datafile = QtGui.QFileDialog.getOpenFileName()
     self.data_file.setText(datafile)
     datafile = str(datafile)
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.data_file_hdf5.setText(path or "")
예제 #2
0
파일: input_view.py 프로젝트: kif/dahu
 def detector_changed(self):
     """
     Called by the UI when the combo-box value is changed
     """
     logger.debug("detector_changed")
     detector = str(self.detector.currentText()).lower()
     inst = pyFAI.detectors.detector_factory(detector)
     if inst.force_pixel:
         self.pixel1.setText(str(inst.pixel1))
         self.pixel2.setText(str(inst.pixel2))
         self.detectorfile.setText("")
     elif self.detectorfile.text():
         detectorfile = str(self.detectorfile.text()).strip()
         if op.isfile(detectorfile):
             if is_hdf5(detectorfile):
                 det = pyFAI.detectors.detector_factory(detectorfile)
                 self.pixel1.setText(str(det.pixel1))
                 self.pixel2.setText(str(det.pixel2))
                 self.detector.setCurrentIndex(
                     self.all_detectors.index("nexusdetector"))
             else:
                 try:
                     spline = pyFAI.spline.Spline(detectorfile)
                 except Exception as error:
                     logger.error("failed %s on %s" % (error, detectorfile))
                 else:
                     self.pixel1.setText(str(spline.pixelSize[1] * 1e-6))
                     self.pixel2.setText(str(spline.pixelSize[0] * 1e-6))
                     self.detector.setCurrentIndex(
                         self.all_detectors.index("frelon"))
         else:
             logger.warning("No such detector file %s" % detectorfile)
예제 #3
0
파일: input_view.py 프로젝트: kif/dahu
 def select_datafile(self):
     datafile = QtGui.QFileDialog.getOpenFileName()
     self.data_file.setText(datafile)
     datafile = str(datafile)
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.data_file_hdf5.setText(path or "")
예제 #4
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def detector_changed(self):
     """
     Called by the UI when the combo-box value is changed
     """
     logger.debug("detector_changed")
     detector = str(self.detector.currentText()).lower()
     inst = pyFAI.detectors.detector_factory(detector)
     if inst.force_pixel:
         self.pixel1.setText(str(inst.pixel1))
         self.pixel2.setText(str(inst.pixel2))
         self.detectorfile.setText("")
     elif self.detectorfile.text():
         detectorfile = str(self.detectorfile.text()).strip()
         if op.isfile(detectorfile):
             if is_hdf5(detectorfile):
                 det = pyFAI.detectors.detector_factory(detectorfile)
                 self.pixel1.setText(str(det.pixel1))
                 self.pixel2.setText(str(det.pixel2))
                 self.detector.setCurrentIndex(self.all_detectors.index("nexusdetector"))
             else:
                 try:
                     spline = pyFAI.spline.Spline(detectorfile)
                 except Exception as error:
                     logger.error("failed %s on %s" % (error, detectorfile))
                 else:
                     self.pixel1.setText(str(spline.pixelSize[1] * 1e-6))
                     self.pixel2.setText(str(spline.pixelSize[0] * 1e-6))
                     self.detector.setCurrentIndex(self.all_detectors.index("frelon"))
         else:
             logger.warning("No such detector file %s" % detectorfile)
예제 #5
0
파일: test_io.py 프로젝트: deschila/pyFAI
    def test_new_detector(self):
        fname = os.path.join(self.tmpdir, "nxs.h5")
        nxs = io.Nexus(fname, "r+")
        nxs.new_detector()
        nxs.close()

        self.assert_(io.is_hdf5(fname), "nexus file is an HDF5")
예제 #6
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_maskfile(self):
     logger.debug("select_maskfile")
     maskfile = str(QtGui.QFileDialog.getOpenFileName())
     if maskfile:
         self.mask_file.setText(maskfile or "")
         self.do_mask.setChecked(True)
         if is_hdf5(maskfile):
             path = HDF5Dialog.getPath(maskfile)
             self.mask_file_hdf5.setText(path or "")
예제 #7
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_darkcurrent(self):
     logger.debug("select_darkcurrent")
     darkcurrent = str(QtGui.QFileDialog.getOpenFileName())
     if darkcurrent:
         self.dark_current.setText(str_(darkcurrent))
         self.do_dark.setChecked(True)
         if is_hdf5(darkcurrent):
             path = HDF5Dialog.getPath(darkcurrent)
             self.dark_current_hdf5.setText(path or "")
예제 #8
0
파일: input_view.py 프로젝트: kif/dahu
 def select_flatfield(self):
     logger.debug("select_flatfield")
     flatfield = str(QtGui.QFileDialog.getOpenFileName())
     if flatfield:
         self.flat_field.setText(str_(flatfield))
         self.do_flat.setChecked(True)
         if is_hdf5(flatfield):
             path = HDF5Dialog.getPath(flatfield)
             self.flat_field_hdf5.setText(path or "")
예제 #9
0
파일: input_view.py 프로젝트: kif/dahu
 def select_darkcurrent(self):
     logger.debug("select_darkcurrent")
     darkcurrent = str(QtGui.QFileDialog.getOpenFileName())
     if darkcurrent:
         self.dark_current.setText(str_(darkcurrent))
         self.do_dark.setChecked(True)
         if is_hdf5(darkcurrent):
             path = HDF5Dialog.getPath(darkcurrent)
             self.dark_current_hdf5.setText(path or "")
예제 #10
0
파일: input_view.py 프로젝트: kif/dahu
 def select_maskfile(self):
     logger.debug("select_maskfile")
     maskfile = str(QtGui.QFileDialog.getOpenFileName())
     if maskfile:
         self.mask_file.setText(maskfile or "")
         self.do_mask.setChecked(True)
         if is_hdf5(maskfile):
             path = HDF5Dialog.getPath(maskfile)
             self.mask_file_hdf5.setText(path or "")
예제 #11
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_flatfield(self):
     logger.debug("select_flatfield")
     flatfield = str(QtGui.QFileDialog.getOpenFileName())
     if flatfield:
         self.flat_field.setText(str_(flatfield))
         self.do_flat.setChecked(True)
         if is_hdf5(flatfield):
             path = HDF5Dialog.getPath(flatfield)
             self.flat_field_hdf5.setText(path or "")
예제 #12
0
파일: test_io.py 프로젝트: silx-kit/pyFAI
    def test_new_detector(self):
        if io.h5py is None:
            logger.warning("H5py not present, skipping test_io.TestNexus")
            return
        fname = os.path.join(self.tmpdir, "nxs.h5")
        nxs = io.Nexus(fname, "a")
        nxs.new_detector()
        nxs.close()

        self.assertTrue(io.is_hdf5(fname), "nexus file is an HDF5")
예제 #13
0
파일: test_io.py 프로젝트: vallsv/pyFAI
    def test_new_detector(self):
        if io.h5py is None:
            logger.warning("H5py not present, skipping test_io.TestNexus")
            return
        fname = os.path.join(self.tmpdir, "nxs.h5")
        nxs = io.Nexus(fname, "r+")
        nxs.new_detector()
        nxs.close()

        self.assertTrue(io.is_hdf5(fname), "nexus file is an HDF5")
예제 #14
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_detectorfile(self):
     logger.debug("select_detectorfile")
     splinefile = str(QtGui.QFileDialog.getOpenFileName())
     if splinefile:
         self.detectorfile.setText(splinefile)
         if is_hdf5(splinefile):
             det = pyFAI.detectors.detector_factory(splinefile)
             self.pixel1.setText(str(det.pixel1))
             self.pixel2.setText(str(det.pixel2))
             self.detector.setCurrentIndex(self.all_detectors.index("nexusdetector"))
         else:
             try:
                 spline = pyFAI.spline.Spline(splinefile)
             except Exception as error:
                 logger.error("failed %s on %s" % (error, splinefile))
             else:
                 if spline.pixelSize:
                     self.pixel1.setText(str(spline.pixelSize[1] * 1e-6))
                     self.pixel2.setText(str(spline.pixelSize[0] * 1e-6))
                     self.detector.setCurrentIndex(self.all_detectors.index("frelon"))
예제 #15
0
파일: input_view.py 프로젝트: kif/dahu
 def select_detectorfile(self):
     logger.debug("select_detectorfile")
     splinefile = str(QtGui.QFileDialog.getOpenFileName())
     if splinefile:
         self.detectorfile.setText(splinefile)
         if is_hdf5(splinefile):
             det = pyFAI.detectors.detector_factory(splinefile)
             self.pixel1.setText(str(det.pixel1))
             self.pixel2.setText(str(det.pixel2))
             self.detector.setCurrentIndex(
                 self.all_detectors.index("nexusdetector"))
         else:
             try:
                 spline = pyFAI.spline.Spline(splinefile)
             except Exception as error:
                 logger.error("failed %s on %s" % (error, splinefile))
             else:
                 if spline.pixelSize:
                     self.pixel1.setText(str(spline.pixelSize[1] * 1e-6))
                     self.pixel2.setText(str(spline.pixelSize[0] * 1e-6))
                     self.detector.setCurrentIndex(
                         self.all_detectors.index("frelon"))
예제 #16
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_dark_hdf5(self):
     logger.debug("select_dark_hdf5")
     datafile = str(self.dark_current.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.dark_current_hdf5.setText(path or "")
예제 #17
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_flat_hdf5(self):
     logger.debug("select_flat_hdf5")
     datafile = str(self.flat_field.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.flat_field_hdf5.setText(path or "")
예제 #18
0
파일: input_view.py 프로젝트: kif/UPBL09a
 def select_mask_hdf5(self):
     logger.debug("select_mask_hdf5")
     datafile = str(self.mask_file.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.mask_file_hdf5.setText(path or "")
예제 #19
0
파일: input_view.py 프로젝트: kif/dahu
 def select_mask_hdf5(self):
     logger.debug("select_mask_hdf5")
     datafile = str(self.mask_file.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.mask_file_hdf5.setText(path or "")
예제 #20
0
파일: input_view.py 프로젝트: kif/dahu
 def select_flat_hdf5(self):
     logger.debug("select_flat_hdf5")
     datafile = str(self.flat_field.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.flat_field_hdf5.setText(path or "")
예제 #21
0
파일: input_view.py 프로젝트: kif/dahu
 def select_dark_hdf5(self):
     logger.debug("select_dark_hdf5")
     datafile = str(self.dark_current.text())
     if datafile and is_hdf5(datafile):
         path = HDF5Dialog.getPath(datafile)
         self.dark_current_hdf5.setText(path or "")