Skip to content

Commit

Permalink
Refs #10254 add WISH to MaskBTP instruments
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Oct 5, 2014
1 parent 8de3533 commit 1b0ac10
Showing 1 changed file with 15 additions and 9 deletions.
Expand Up @@ -24,8 +24,8 @@ def summary(self):

def PyInit(self):
self.declareProperty(mantid.api.WorkspaceProperty("Workspace", "",direction=mantid.kernel.Direction.InOut, optional = mantid.api.PropertyMode.Optional), "Input workspace (optional)")
allowedInstrumentList=mantid.kernel.StringListValidator(["","ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","TOPAZ"])
self.declareProperty("Instrument","",validator=allowedInstrumentList,doc="One of the following instruments: ARCS, CNCS, CORELLI, HYSPEC, NOMAD, POWGEN, SNAP, SEQUOIA, TOPAZ")
allowedInstrumentList=mantid.kernel.StringListValidator(["","ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","TOPAZ","WISH"])
self.declareProperty("Instrument","",validator=allowedInstrumentList,doc="One of the following instruments: ARCS, CNCS, CORELLI, HYSPEC, NOMAD, POWGEN, SNAP, SEQUOIA, TOPAZ, WISH")
self.declareProperty("Bank","",doc="Bank(s) to be masked. If empty, will apply to all banks")
self.declareProperty("Tube","",doc="Tube(s) to be masked. If empty, will apply to all tubes")
self.declareProperty("Pixel","",doc="Pixel(s) to be masked. If empty, will apply to all pixels")
Expand All @@ -47,13 +47,13 @@ def PyExec(self):
self.instrument = ws.getInstrument()
self.instname = self.instrument.getName()

instrumentList=["ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","TOPAZ"]
self.bankmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":1,"SEQUOIA":38,"SNAP":1,"TOPAZ":10}
self.bankmax={"ARCS":115,"CNCS":50,"CORELLI":91,"HYSPEC":20,"NOMAD":99,"POWGEN":300,"SEQUOIA":150,"SNAP":18,"TOPAZ":59}
tubemin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"TOPAZ":0}
tubemax={"ARCS":8,"CNCS":8,"CORELLI":16,"HYSPEC":8,"NOMAD":8,"POWGEN":153,"SEQUOIA":8,"SNAP":255,"TOPAZ":255}
pixmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"TOPAZ":0}
pixmax={"ARCS":128,"CNCS":128,"CORELLI":256,"HYSPEC":128,"NOMAD":128,"POWGEN":6,"SEQUOIA":128,"SNAP":255,"TOPAZ":255}
instrumentList=["ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","TOPAZ","WISH"]
self.bankmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":1,"SEQUOIA":38,"SNAP":1,"TOPAZ":10,"WISH":1}
self.bankmax={"ARCS":115,"CNCS":50,"CORELLI":91,"HYSPEC":20,"NOMAD":99,"POWGEN":300,"SEQUOIA":150,"SNAP":18,"TOPAZ":59,"WISH":5}
tubemin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"TOPAZ":0,"WISH":1}
tubemax={"ARCS":8,"CNCS":8,"CORELLI":16,"HYSPEC":8,"NOMAD":8,"POWGEN":153,"SEQUOIA":8,"SNAP":255,"TOPAZ":255,"WISH":152}
pixmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"TOPAZ":0,"WISH":1}
pixmax={"ARCS":128,"CNCS":128,"CORELLI":256,"HYSPEC":128,"NOMAD":128,"POWGEN":6,"SEQUOIA":128,"SNAP":255,"TOPAZ":255,"WISH":512}

try:
instrumentList.index(self.instname)
Expand Down Expand Up @@ -173,6 +173,12 @@ def _getEightPackHandle(self,banknum):
return self.instrument.getComponentByName("bank"+str(banknum))[0]
else:
raise ValueError("Out of range index for "+str(self.instname)+" instrument bank numbers")
elif self.instname=="WISH":
if (self.bankmin[self.instname]<=banknum<= self.bankmax[self.instname]):
print "panel"+"%02d" % banknum
return self.instrument.getComponentByName("panel"+"%02d" % banknum)[0]
else:
raise ValueError("Out of range index for "+str(self.instname)+" instrument bank numbers")
else:
if (self.bankmin[self.instname]<=banknum<= self.bankmax[self.instname]):
return self.instrument.getComponentByName("bank"+str(banknum))
Expand Down

0 comments on commit 1b0ac10

Please sign in to comment.