Merge branch 'RELEASE-3_1' into RELEASE-3_2
Conflicts: sics/site_ansto/instrument/bilby/config/chopper/sct_astrium_chopper.tcl sics/site_ansto/instrument/bilby/config/motors/shutters_sct.tcl sics/site_ansto/instrument/bilby/config/motors/tank_sct.tcl sics/site_ansto/instrument/bilby/util/sics_config.ini sics/site_ansto/instrument/config/environment/hiden_xcs_sct.tcl sics/site_ansto/instrument/config/environment/huber_pilot_sct.tcl sics/site_ansto/instrument/config/environment/isotech_ps_sct.tcl sics/site_ansto/instrument/config/environment/keithley_m2700_sct.tcl sics/site_ansto/instrument/config/environment/magneticField/oxford12tlv_sct.tcl sics/site_ansto/instrument/config/environment/magneticField/tsi_smc_sct.tcl sics/site_ansto/instrument/config/environment/nhq_200_sct.tcl sics/site_ansto/instrument/config/environment/omron_hldc_sct.tcl sics/site_ansto/instrument/config/environment/protekmm_sct.tcl sics/site_ansto/instrument/config/environment/temperature/eurotherm_m2000_sct.tcl sics/site_ansto/instrument/config/environment/temperature/julabo_lh45_gen_sct.tcl sics/site_ansto/instrument/config/environment/temperature/lakeshore_218_sct.tcl sics/site_ansto/instrument/config/environment/temperature/ls336_sct.tcl sics/site_ansto/instrument/config/environment/temperature/ls340_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_base_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_level_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_pres_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_scpi_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_temp_sct.tcl sics/site_ansto/instrument/config/environment/temperature/mercury_valve_sct.tcl sics/site_ansto/instrument/config/environment/temperature/nprvasm2_sct.tcl sics/site_ansto/instrument/config/environment/temperature/pfeiffer_hg_sct.tcl sics/site_ansto/instrument/config/environment/temperature/watlow_mpm_sct.tcl sics/site_ansto/instrument/config/environment/temperature/watlow_mrm_sct.tcl sics/site_ansto/instrument/config/environment/temperature/watlow_mst4_sct.tcl sics/site_ansto/instrument/config/environment/temperature/west_6100.sct sics/site_ansto/instrument/config/source/reactor_status_sct.tcl sics/site_ansto/instrument/hrpd/echidna_configuration.tcl sics/site_ansto/instrument/sans/quokka_configuration.tcl sics/site_ansto/instrument/tas/config/motors/motor_configuration.tcl sics/site_ansto/instrument/util/gen_sct.py sics/site_ansto/instrument/util/motor_utility.tcl
This commit is contained in:
@@ -7,3 +7,4 @@ config
|
||||
util
|
||||
hostport_config.tcl
|
||||
hostport_config_test.tcl
|
||||
sics_simulation.tcl
|
||||
|
||||
96
site_ansto/instrument/sans/config/commands/growfile.tcl
Normal file
96
site_ansto/instrument/sans/config/commands/growfile.tcl
Normal file
@@ -0,0 +1,96 @@
|
||||
# \file Implements 'dsc actime interval' command.
|
||||
set GROWFILE_STATE "DISABLED"
|
||||
set growfileSaveIndex 0
|
||||
|
||||
|
||||
proc doGrowFile {} {
|
||||
global GROWFILE_STATE
|
||||
global growfileSaveIndex
|
||||
|
||||
# Reset the GROWFILE_STATE variable in case some naughty user sets it directly
|
||||
set GROWFILE_STATE "ENABLED"
|
||||
set HMSTATE [SplitReply [hmm configure daq]]
|
||||
set FSTATE [SplitReply [file_status]]
|
||||
# broadcast CALLED: [info level 0], HMSTATE = $HMSTATE, FSTATE = $FSTATE
|
||||
if { $FSTATE != "UNKNOWN" && $FSTATE != "OPEN" && $HMSTATE == "Started"} {
|
||||
# broadcast growfile $growfileSaveIndex
|
||||
save $growfileSaveIndex "growfile"
|
||||
incr growfileSaveIndex
|
||||
} else {
|
||||
if {$growfileSaveIndex == 0} {
|
||||
broadcast ERROR: GROWFILE HMSTATE = $HMSTATE, FSTATE = $FSTATE. The histmem must be running and you must create a newfile before calling "growfile"
|
||||
} else {
|
||||
broadcast STOP GROWFILE Acquisition finished. HMSTATE = $HMSTATE, FSTATE = $FSTATE.
|
||||
save $growfileSaveIndex "growfile"
|
||||
newfile clear
|
||||
broadcast Saved [hval /experiment/file_name]
|
||||
}
|
||||
set growfileSaveIndex 0
|
||||
sicspoll del doGrowFile
|
||||
set GROWFILE_STATE "DISABLED"
|
||||
hsetprop /instrument/detector/hmm mutable true
|
||||
}
|
||||
}
|
||||
publish doGrowFile user
|
||||
|
||||
|
||||
proc growfile { {interval 300} } {
|
||||
global GROWFILE_STATE
|
||||
global growfileSaveIndex
|
||||
|
||||
set GROWFILE_STATE "DISABLED"
|
||||
set growfileSaveIndex 0
|
||||
|
||||
set as_error 0
|
||||
|
||||
set myrights [set_rights manager]
|
||||
if {$myrights == -1} {
|
||||
return -code error "ERROR: You are not authorized for this operation"
|
||||
}
|
||||
set interval [string tolower $interval]
|
||||
if {$interval == "check" || $interval == "status"} {
|
||||
if { $GROWFILE_STATE == "ENABLED" } {
|
||||
return "GROWFILE $GROWFILE_STATE [sicspoll intervall doGrowFile]"
|
||||
} else {
|
||||
return "GROWFILE $GROWFILE_STATE"
|
||||
}
|
||||
} elseif {[string is integer $interval]} {
|
||||
if {$interval <= 0} {
|
||||
if { $GROWFILE_STATE == "ENABLED" } {
|
||||
sicspoll del doGrowFile
|
||||
set GROWFILE_STATE "DISABLED"
|
||||
}
|
||||
} else {
|
||||
if {$GROWFILE_STATE == "DISABLED"} {
|
||||
sicspoll add doGrowFile script $interval doGrowFile
|
||||
# sicspoll listen # WARNING:When the listening client exits it leaves SICSPOLL task with a corrupt connection object.
|
||||
set GROWFILE_STATE "ENABLED"
|
||||
} else {
|
||||
sicspoll intervall doGrowFile $interval
|
||||
}
|
||||
}
|
||||
} else {
|
||||
set as_error 1
|
||||
}
|
||||
|
||||
set_rights $myrights
|
||||
|
||||
if {$as_error} {
|
||||
return -code error "ERROR: Invalid argument in '[info level 0]', should be an integer or 'check'"
|
||||
}
|
||||
}
|
||||
publish growfile user
|
||||
|
||||
# \brief Run histogram for the specified time and save XY binned data at the given interval.
|
||||
# \param actime Acquisition time in seconds.
|
||||
# \param saveint Save interval in seconds.
|
||||
proc dsc {actime saveint} {
|
||||
hsetprop /instrument/detector/hmm mutable false
|
||||
newfile HISTOGRAM_XY
|
||||
histmem mode time
|
||||
histmem preset $actime
|
||||
histmem start
|
||||
growfile $saveint
|
||||
}
|
||||
|
||||
publish dsc user
|
||||
@@ -26,35 +26,35 @@ fileeval $cfPath(parameters)/parameters.tcl
|
||||
fileeval $cfPath(plc)/plc.tcl
|
||||
fileeval $cfPath(optics)/optics.tcl
|
||||
fileeval $cfPath(counter)/counter.tcl
|
||||
fileeval $cfPath(environment)/agilent_33220A_sct.tcl
|
||||
fileeval $cfPath(environment)/hiden_xcs_sct.tcl
|
||||
fileeval $cfPath(environment)/huber_pilot_sct.tcl
|
||||
fileeval $cfPath(environment)/isotech_ps_sct.tcl
|
||||
fileeval $cfPath(environment)/sct_agilent_33220A.tcl
|
||||
fileeval $cfPath(environment)/sct_hiden_xcs.tcl
|
||||
fileeval $cfPath(environment)/sct_huber_pilot.tcl
|
||||
fileeval $cfPath(environment)/sct_isotech_ps.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_eurotherm_2000.tcl
|
||||
fileeval $cfPath(environment)/temperature/eurotherm_m2000_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_eurotherm_m2000.tcl
|
||||
fileeval $cfPath(environment)/sct_keithley_2700.tcl
|
||||
fileeval $cfPath(environment)/keithley_m2700_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/lakeshore_218_sct.tcl
|
||||
fileeval $cfPath(environment)/sct_keithley_m2700.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_218.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_336.tcl
|
||||
fileeval $cfPath(environment)/temperature/ls336_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_ls336.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_340.tcl
|
||||
fileeval $cfPath(environment)/temperature/ls340_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_ls340.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_370.tcl
|
||||
fileeval $cfPath(environment)/temperature/lakeshore_m370_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/mercury_scpi_sct.tcl
|
||||
fileeval $cfPath(environment)/nhq_200_sct.tcl
|
||||
fileeval $cfPath(environment)/omron_hldc_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/pfeiffer_hg_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_lakeshore_m370.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_mercury_scpi.tcl
|
||||
fileeval $cfPath(environment)/sct_nhq_200.tcl
|
||||
fileeval $cfPath(environment)/sct_omron_hldc.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_pfeiffer_hg.tcl
|
||||
fileeval $cfPath(environment)/sct_protek_common.tcl
|
||||
fileeval $cfPath(environment)/protekmm_sct.tcl
|
||||
fileeval $cfPath(environment)/sct_protekmm.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_rvasm2.tcl
|
||||
fileeval $cfPath(environment)/temperature/nprvasm2_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_nprvasm2.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_pm.tcl
|
||||
fileeval $cfPath(environment)/temperature/watlow_mpm_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_mpm.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_rm.tcl
|
||||
fileeval $cfPath(environment)/temperature/watlow_mrm_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_mrm.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_st4.tcl
|
||||
fileeval $cfPath(environment)/temperature/watlow_mst4_sct.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_watlow_mst4.tcl
|
||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||
fileeval $cfPath(nexus)/nxscripts.tcl
|
||||
fileeval $cfPath(hmm)/detector.tcl
|
||||
@@ -63,7 +63,7 @@ fileeval $cfPath(commands)/commands.tcl
|
||||
fileeval $cfPath(anticollider)/anticollider.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_julabo_lh45.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_qlink.tcl
|
||||
fileeval $cfPath(environment)/magneticField/tsi_smc_sct.tcl
|
||||
fileeval $cfPath(environment)/magneticField/sct_tsi_smc.tcl
|
||||
fileeval $cfPath(environment)/temperature/sct_oxford_itc.tcl
|
||||
fileeval $cfPath(environment)/magneticField/oxford_labview.tcl
|
||||
fileeval $cfPath(environment)/magneticField/sct_bruker_BEC1.tcl
|
||||
@@ -73,6 +73,7 @@ fileeval $cfPath(environment)/sct_antonparr_MCR500.tcl
|
||||
fileeval $cfPath(beamline)/spin_flipper.tcl
|
||||
fileeval $cfPath(commands)/pulser.tcl
|
||||
fileeval $cfPath(commands)/hvcommands.tcl
|
||||
fileeval $cfPath(commands)/growfile.tcl
|
||||
|
||||
source gumxml.tcl
|
||||
|
||||
|
||||
23
site_ansto/instrument/sans/sics_simulation.tcl
Normal file
23
site_ansto/instrument/sans/sics_simulation.tcl
Normal file
@@ -0,0 +1,23 @@
|
||||
# Simulation flags, possible values = true or false
|
||||
# true: The simulated driver will be used.
|
||||
# false: The real driver will be used.
|
||||
# icsval column = settings when running on the Instrument Control Server (ie SICS_SIMULATION not defined)
|
||||
# fakedev column = settings for test platforms (ie SICS_SIMULATION=fakedev)
|
||||
foreach {simflag icsval fakedev} {
|
||||
opal_simulation true true
|
||||
detector_simulation false true
|
||||
hmm_simulation false true
|
||||
environment_simulation false false
|
||||
counter_simulation false true
|
||||
motor_simulation false false
|
||||
chopper_simulation false true
|
||||
velsel_simulation false true
|
||||
plc_simulation false true
|
||||
rfgen_simulation false true
|
||||
goniometer_simulation false true
|
||||
magnetic_simulation false true
|
||||
} {
|
||||
dict set SIMFLAG_VAL $simflag ICSVAL $icsval
|
||||
dict set SIMFLAG_VAL $simflag FAKEDEV $fakedev
|
||||
VarMake $simflag Text internal
|
||||
}
|
||||
94
site_ansto/instrument/sans/util/dsc.py
Executable file
94
site_ansto/instrument/sans/util/dsc.py
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python
|
||||
# vim: ft=python ts=8 sts=4 sw=4 expandtab autoindent smartindent
|
||||
""" Find the trigger time for Differenctial Scanning Calorimetry data in nx.hdf files. """
|
||||
|
||||
import sys
|
||||
import os
|
||||
import h5py
|
||||
import argparse
|
||||
import time
|
||||
from collections import defaultdict
|
||||
|
||||
class SkipFile(BaseException):
|
||||
"""This exception should be raised to skip processing a file"""
|
||||
pass
|
||||
|
||||
PARSER = argparse.ArgumentParser(
|
||||
description = """Report the time offset for the start of the DSC profile relative to the start time of the histogram data.
|
||||
This program can process multiple hdf files by specifying the path to the first file and the number of files to process.
|
||||
You can also speficy a list of 'file_path numfile' pairs.""",
|
||||
usage='dsc file_path numfile {file_path numfile}'
|
||||
)
|
||||
PARSER.add_argument('files', nargs='+', help = 'List of "file_path numfile" pairs')
|
||||
ARGS = PARSER.parse_args()
|
||||
|
||||
FAILS = defaultdict(list)
|
||||
for startfile, num in zip(ARGS.files[0::2], ARGS.files[1::2]):
|
||||
numfiles = int(num)
|
||||
hfdir = os.path.dirname(startfile)
|
||||
hfbase = os.path.basename(startfile)
|
||||
idx = hfbase.find('.')
|
||||
startFID = hfbase[:idx]
|
||||
ext = hfbase[idx:]
|
||||
idnum = int(startFID[3:])
|
||||
inst_abname = hfbase[:3]
|
||||
|
||||
hfval = {}
|
||||
print
|
||||
for i in range(numfiles):
|
||||
try:
|
||||
currid = idnum + i
|
||||
fileID = inst_abname + '%07d' % currid
|
||||
if (hfdir == ''):
|
||||
nxfile = fileID + ext
|
||||
else:
|
||||
nxfile = hfdir + '/' + fileID + ext
|
||||
|
||||
try:
|
||||
hf = h5py.File(nxfile, 'r')
|
||||
except:
|
||||
FAILS['badfile'].append(nxfile)
|
||||
continue
|
||||
|
||||
if (hfbase.startswith('QKK')):
|
||||
rootpath = fileID + '/'
|
||||
else:
|
||||
rootpath = 'entry1/'
|
||||
|
||||
for dpath in ['time_stamp', 'instrument/detector/start_time', 'sample/dsc_val']:
|
||||
dscpath = rootpath + dpath
|
||||
if dscpath in hf:
|
||||
hfval[dpath] = hf[dscpath][:]
|
||||
else:
|
||||
FAILS['badpath:{0}'.format(dpath)].append(nxfile)
|
||||
hf.close()
|
||||
raise SkipFile
|
||||
|
||||
print fileID
|
||||
datiter = {}
|
||||
dat_hasnext = 0
|
||||
time_tuple = time.strptime(hf[rootpath + 'start_time'][0], '%Y-%m-%d %H:%M:%S')
|
||||
hfval['time_stamp'] += time.mktime(time_tuple)
|
||||
hfval['time_stamp'] -= hfval['instrument/detector/start_time']
|
||||
dsc0 = hfval['sample/dsc_val'][0]
|
||||
no_transition = True
|
||||
for i in range(1, len(hfval['sample/dsc_val'][1:])):
|
||||
dsc1 = hfval['sample/dsc_val'][i]
|
||||
if abs(dsc1 - dsc0) > 1.9:
|
||||
no_transition = False
|
||||
msg = 'dsc_val transition from {dsc0} to {dsc1} volts at {time} seconds from detector start time, array index = {index}'
|
||||
print msg.format(dsc0=dsc0, dsc1=dsc1, time=hfval['time_stamp'][i], index=i)
|
||||
dsc0 = dsc1
|
||||
|
||||
if no_transition:
|
||||
print 'dsc_val no transition'
|
||||
|
||||
print
|
||||
hf.close()
|
||||
except SkipFile:
|
||||
continue
|
||||
|
||||
for k in FAILS.keys():
|
||||
if (len(FAILS[k])):
|
||||
print >> sys.stderr, 'Skipped following files. Reason = ', k
|
||||
print >> sys.stderr, FAILS[k]
|
||||
@@ -4,6 +4,9 @@ enabled = False
|
||||
[12Tmagnet_setup]
|
||||
cascade = B1:12tmagnet_oxford,sample_stage:Oxford_12tmagnet_sample_insert,T1:mercury_scpi_01
|
||||
enabled = False
|
||||
[20_position_pulser]
|
||||
cascade = T1:julabo_lh45,Function_Generator:agilent_33220A,High_Voltage:protek_02,sample_stage:20_pos_sample_stage
|
||||
enabled = False
|
||||
[20_position_setup]
|
||||
cascade = T1:julabo_lh45,sample_stage:20_pos_sample_stage
|
||||
enabled = False
|
||||
@@ -70,6 +73,13 @@ id = 2
|
||||
implementation = none
|
||||
name = curr2
|
||||
optype = multimeter
|
||||
[Power Supply]
|
||||
datype = V
|
||||
enabled = False
|
||||
id = 1
|
||||
implementation = none
|
||||
name = isops
|
||||
optype = power_supply
|
||||
[Rheometry]
|
||||
enabled = False
|
||||
implementation = none
|
||||
@@ -155,11 +165,19 @@ optype = motion_axis
|
||||
desc = "Load the ten position sample changer configuration"
|
||||
imptype = motion_axis
|
||||
|
||||
[11tmagnet_oxford]
|
||||
desc = "11/10 Tesla Oxford Magnet"
|
||||
driver = "oxford_labview"
|
||||
imptype = magnetic_field
|
||||
interval = 5
|
||||
ip = 10.157.205.44
|
||||
port = 55001
|
||||
|
||||
[12tmagnet_oxford]
|
||||
asyncqueue = sct
|
||||
desc = "12 Tesla Oxford Magnet"
|
||||
driver = "oxford_labview"
|
||||
imptype = magnetic_field
|
||||
interval = 5
|
||||
ip = 10.157.205.3
|
||||
port = 55001
|
||||
|
||||
@@ -217,6 +235,13 @@ ip = 10.157.205.13
|
||||
port = 4444
|
||||
type = B
|
||||
|
||||
[isotech_ps]
|
||||
desc = "Isotech Power Supply:Baud=2400,Data=8,Stop=1,Parity=None,Flow=None"
|
||||
driver = "isotech_ps"
|
||||
imptype = power_supply
|
||||
ip = 137.157.202.79
|
||||
port = 4001
|
||||
|
||||
[julabo_lh45]
|
||||
ctrl_sensor = "bath"
|
||||
desc = "Julabo temperature controller"
|
||||
@@ -315,6 +340,16 @@ terminator = \r\n
|
||||
tol1 = 1.0
|
||||
tol2 = 1.0
|
||||
|
||||
[ls340_09]
|
||||
desc = "Lakeshore 340 temperature controller"
|
||||
driver = "ls340"
|
||||
imptype = temperature
|
||||
ip = 137.157.202.79
|
||||
port = 4002
|
||||
terminator = \r\n
|
||||
tol1 = 1.0
|
||||
tol2 = 1.0
|
||||
|
||||
[ls340_11]
|
||||
desc = "Lakeshore 340 temperature controller"
|
||||
driver = "ls340"
|
||||
|
||||
Reference in New Issue
Block a user