vararg_alias("repscan") #setup tools to create metadata in Nexus files from gdascripts.metadata.metadata_commands import setTitle, meta_add, meta_ll, meta_ls, meta_rm alias("setTitle") alias("meta_add") alias("meta_ll") alias("meta_ls") alias("meta_rm") from gda.data.scan.datawriter import NexusDataWriter LocalProperties.set(NexusDataWriter.GDA_NEXUS_METADATAPROVIDER_NAME,"metashop") #create time scannables from gdascripts.pd.time_pds import waittimeClass2, showtimeClass, showincrementaltimeClass, actualTimeClass waittime=waittimeClass2('waittime') showtime=showtimeClass('showtime') inctime=showincrementaltimeClass('inctime') actualTime=actualTimeClass("actualTime") #=================================================== #Raspberry Pi Specific Objects #=================================================== #RPi Communication Interface #rpiComms.initaliseCommunicator("127.23.31.56") #enter the Pi's IP address, 127.0.0.1 (localhost) should work #PiCamera Interface picamera = rpiCameraScannable.rpiCameraScannable("picamera") #Turntable turntable = rpiTurntable.rpiTurntable("turntable")
alias("caget") from gda.scan.RepeatScan import create_repscan, repscan vararg_alias("repscan") #setup tools to create metadata in Nexus files from gdascripts.metadata.metadata_commands import setTitle, meta_add, meta_ll, meta_ls, meta_rm alias("setTitle") alias("meta_add") alias("meta_ll") alias("meta_ls") alias("meta_rm") from gda.data.scan.datawriter import NexusDataWriter LocalProperties.set(NexusDataWriter.GDA_NEXUS_METADATAPROVIDER_NAME,"metashop") #create time scannables from gdascripts.pd.time_pds import waittimeClass2, showtimeClass, showincrementaltimeClass, actualTimeClass waittime=waittimeClass2('waittime') showtime=showtimeClass('showtime') inctime=showincrementaltimeClass('inctime') actualTime=actualTimeClass("actualTime") #run user editable startup script if isLive(): run("localStationUser.py") except: exceptionType, exception, traceback = sys.exc_info() handle_messages.log(None, "Error in localStation", exceptionType, exception, traceback, False)
print "Initialization Started"; from uk.ac.gda.server.exafs.scan import EnergyScan from gda.configuration.properties import LocalProperties from gda.data.scan.datawriter import NexusDataWriter LocalProperties.set(NexusDataWriter.GDA_NEXUS_METADATAPROVIDER_NAME,"metashop") xas = energyScan xanes = xas vararg_alias("xas") vararg_alias("xanes") # To make scans return to the start after being run # Should be for commissioning only. scansReturnToOriginalPositions = 0 from gdascripts.pd.time_pds import showtimeClass showtime = showtimeClass("showtime") showtime.setLevel(4) # so it is operated before anything else in a scan print "Initialization Complete";
# the subdirectory parts def setSubdirectory(dirname): '''create a new sub-directory for data collection that follows''' Finder.find("GDAMetadata").setMetadataValue("subdirectory", dirname) try: os.mkdir(pwd()) except: pass print ### Create time Scannables print "Creating time scannables" from timerelated import clock, t, dt, w #@UnusedImport showtime = showtimeClass('Showtime') inctime = showincrementaltimeClass('inctime') waittime = waittimeClass2('Waittime') atime = actualTimeClass('atime') ### Pipeline def configureScanPipeline(length=None, simultaneousPoints=None): lengthProp = LocalProperties.GDA_SCAN_MULTITHREADED_SCANDATA_POINT_PIPElINE_LENGTH simultaneousProp = LocalProperties.GDA_SCAN_MULTITHREADED_SCANDATA_POINT_PIPElINE_POINTS_TO_COMPUTE_SIMULTANEOUSELY def show(): print "ScanDataPoint pipeline:" print " " + lengthProp + " = " + LocalProperties.get( lengthProp, '4') # duplicated in ScannableCommands print " " + simultaneousProp + " = " + LocalProperties.get(
print "Initialization Started" from uk.ac.gda.server.exafs.scan import EnergyScan from gda.configuration.properties import LocalProperties from gda.data.scan.datawriter import NexusDataWriter LocalProperties.set(NexusDataWriter.GDA_NEXUS_METADATAPROVIDER_NAME, "metashop") xas = energyScan xanes = xas vararg_alias("xas") vararg_alias("xanes") # To make scans return to the start after being run # Should be for commissioning only. scansReturnToOriginalPositions = 0 from gdascripts.pd.time_pds import showtimeClass showtime = showtimeClass("showtime") showtime.setLevel(4) # so it is operated before anything else in a scan print "Initialization Complete"
from gdascripts.pd.dummy_pds import DummyPD from gdascripts.pd.dummy_pds import MultiInputExtraFieldsDummyPD from gdascripts.pd.dummy_pds import ZeroInputExtraFieldsDummyPD from gdascripts.pd.time_pds import showtimeClass from gdascripts.pd.time_pds import showincrementaltimeClass from gdascripts.pd.time_pds import waittimeClass print "Creating dummy devices x,y and z" x=DummyPD("x") y=DummyPD("y") z=DummyPD("z") print "Creating timer devices t, dt, and w" t = showtimeClass("t") # cannot also be driven. dt= showincrementaltimeClass("dt") w = waittimeClass("w") print "Creating multi input/extra field device, mi, me and mie" mi=MultiInputExtraFieldsDummyPD('mi',['i1','i2'],[]) me=MultiInputExtraFieldsDummyPD('me',[],['e1','e2']) mie=MultiInputExtraFieldsDummyPD('mie',['i1'],['e2','e3']) print "Createing zero input/extra field device, zie" zie=ZeroInputExtraFieldsDummyPD('zie')