Example #1
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        # Set the detector in idle
        #self.set_trigger_mode('Internal', 1)

        # set TomoScan xml files
        self.epics_pvs['CamNDAttributesFile'].put(
            'TomoScanDetectorAttributes.xml')
        self.epics_pvs['FPXMLFileName'].put('TomoScanLayout.xml')
        macro = 'DET=' + self.pv_prefixes[
            'Camera'] + ',' + 'TS=' + self.epics_pvs['Testing'].__dict__[
                'pvname'].replace('Testing', '', 1)
        self.control_pvs['CamNDAttributesMacros'].put(macro)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable overw writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')

        # Lens change functionality
        prefix = self.pv_prefixes['MctOptics']
        self.epics_pvs['LensSelect'] = PV(prefix + 'LensSelect')
        # # ref to pixel size
        # self.epics_pvs['MCTPixelSize'] = PV(prefix+'PixelSize')
        # #
        # self.epics_pvs['PixelSize'].put(self.epics_pvs['MCTPixelSize'])

        log.setup_custom_logger("./tomoscan.log")
Example #2
0
    def __init__(self, pv_files, macros):
        log.setup_custom_logger(lfname=Path.home().joinpath(
            'logs', 'TomoScan_7BM.log'),
                                stream_to_console=True)
        super().__init__(pv_files, macros)

        # set TomoScan xml files
        self.epics_pvs['CamNDAttributesFile'].put(
            'TomoScanDetectorAttributes.xml')
        self.epics_pvs['FPXMLFileName'].put('TomoScanLayout.xml')
        macro = 'DET=' + self.pv_prefixes[
            'Camera'] + ',' + 'TC=' + self.epics_pvs['Testing'].__dict__[
                'pvname'].replace('Testing', '', 1)
        self.control_pvs['CamNDAttributesMacros'].put(macro)

        # Set the detector running in FreeRun mode
        self.set_trigger_mode('FreeRun', 1)

        # Set data directory
        file_path = Path(self.epics_pvs['DetectorTopDir'].get(as_string=True))
        #file_path = file_path.joinpath(self.epics_pvs['ExperimentYearMonth'].get(as_string=True))
        file_path = file_path.joinpath(
            self.epics_pvs['ExperimentYearMonth'].get(as_string=True) + '-' +
            self.epics_pvs['UserLastName'].get(as_string=True) + '-' +
            self.epics_pvs['ProposalNumber'].get(as_string=True))
        self.epics_pvs['FilePath'].put(str(file_path), wait=True)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Enable over-writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')
Example #3
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)

        # set TomoScan xml files
        self.epics_pvs['CamNDAttributesFile'].put(
            'TomoScanDetectorAttributes.xml')
        self.epics_pvs['FPXMLFileName'].put('TomoScanLayout.xml')
        macro = 'DET=' + self.pv_prefixes[
            'Camera'] + ',' + 'TS=' + self.epics_pvs['Testing'].__dict__[
                'pvname'].replace('Testing', '', 1)
        self.control_pvs['CamNDAttributesMacros'].put(macro)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable over writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')

        log.setup_custom_logger("./tomoscan.log")

        # try to read username/password for pdu and webcam

        access_fname = os.path.join(str(pathlib.Path.home()), 'access.json')
        with open(access_fname, 'r') as fp:
            self.access_dic = json.load(fp)
Example #4
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        # Set the detector running in FreeRun mode
        # self.set_trigger_mode('FreeRun', 1)
        # self.epics_pvs['CamAcquire'].put('Acquire') ###
        # self.wait_pv(self.epics_pvs['CamAcquire'], 1) ###

        # set TomoScan xml files
        self.epics_pvs['CamNDAttributesFile'].put(
            'TomoScanDetectorAttributes.xml')
        self.epics_pvs['FPXMLFileName'].put('TomoScanLayout.xml')
        macro = 'DET=' + self.pv_prefixes[
            'Camera'] + ',' + 'TS=' + self.epics_pvs['Testing'].__dict__[
                'pvname'].replace('Testing', '', 1)
        self.control_pvs['CamNDAttributesMacros'].put(macro)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable over writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')
        self.epics_pvs['StartEnergyChange'].put(0, wait=True)
        # energy scan
        self.epics_pvs['StartEnergyChange'].add_callback(self.pv_callback_step)

        log.setup_custom_logger("./tomoscan.log")
Example #5
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        
        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable overw writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')
        
        log.setup_custom_logger("./tomoscan.log")
Example #6
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        # Set the detector running in FreeRun mode
        # self.set_trigger_mode('FreeRun', 1)
        # self.epics_pvs['CamAcquire'].put('Acquire') ###
        # self.wait_pv(self.epics_pvs['CamAcquire'], 1) ###

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable over writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')

        log.setup_custom_logger("./tomoscan.log")
Example #7
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        
        # set TomoScan xml files
        self.epics_pvs['CamNDAttributesFile'].put('TomoScanDetectorAttributes.xml')
        self.epics_pvs['FPXMLFileName'].put('TomoScanLayout.xml')
        macro = 'DET=' + self.pv_prefixes['Camera'] + ',' + 'TS=' + self.epics_pvs['Testing'].__dict__['pvname'].replace('Testing', '', 1)
        self.control_pvs['CamNDAttributesMacros'].put(macro)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable overw writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')
        
        log.setup_custom_logger("./tomoscan.log")
Example #8
0
    def __init__(self, pv_files, macros):
        super().__init__(pv_files, macros)
        # Set the detector in idle
        self.set_trigger_mode('Internal', 1)
        
        # Set data directory
        file_path = self.epics_pvs['DetectorTopDir'].get(as_string=True) + self.epics_pvs['ExperimentYearMonth'].get(as_string=True) + os.path.sep + self.epics_pvs['UserLastName'].get(as_string=True) + os.path.sep
        self.epics_pvs['FilePath'].put(file_path, wait=True)

        # Enable auto-increment on file writer
        self.epics_pvs['FPAutoIncrement'].put('Yes')

        # Set standard file template on file writer
        self.epics_pvs['FPFileTemplate'].put("%s%s_%3.3d.h5", wait=True)

        # Disable overw writing warning
        self.epics_pvs['OverwriteWarning'].put('Yes')
        
        self.stream_init()

        log.setup_custom_logger("./tomoscan.log")