Example #1
0
	def PyExec(self):
		run_f2py_compatibility_test()
		
		self.log().information('Jump input')
		inType = self.getPropertyValue('InputType')
		prefix = self.getPropertyValue('Instrument')
		ana = self.getPropertyValue('Analyser')
		prog = self.getPropertyValue('QLprogram')
		jump = self.getPropertyValue('Fit')
		fw = self.getPropertyValue('Width')
		sam = self.getPropertyValue('SamNumber')

		sname = prefix+sam+'_'+ana+'_'+prog
		cropOp = self.getProperty('CropQ')
		if cropOp:
			qmin = self.getPropertyValue('Qmin')
			qmax = self.getPropertyValue('Qmax')
			qrange = [qmin, qmax]
		else:
			qrange = [0.0, 5.0]
		verbOp = self.getProperty('Verbose')
		plotOp = self.getProperty('Plot')
		saveOp = self.getProperty('Save')

		workdir = config['defaultsave.directory']
		if inType == 'File':
			path = os.path.join(workdir, sname+'_Parameters.nxs')					# path name for nxs file
			LoadNexusProcessed(Filename=path, OutputWorkspace=sname+'_Parameters')
			message = 'Input from File : '+path
		else:
			message = 'Input from Workspace : '+sname
		if verbOp:
			logger.notice(message)
		Main.JumpRun(sname,jump,prog,fw,cropOp,qrange,verbOp,plotOp,saveOp)
Example #2
0
    def PyExec(self):
        from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform

        if is_supported_f2py_platform():
            import IndirectBayes as Main

        run_f2py_compatibility_test()

        self.log().information('Quest input')
        inType = self.getPropertyValue('InputType')
        prefix = self.getPropertyValue('Instrument')
        ana = self.getPropertyValue('Analyser')
        sam = self.getPropertyValue('SamNumber')
        rinType = self.getPropertyValue('ResInputType')
        res = self.getPropertyValue('ResNumber')
        elastic = self.getProperty('ElasticOption').value
        bgd = self.getPropertyValue('BackgroundOption')
        emin = self.getPropertyValue('EnergyMin')
        emax = self.getPropertyValue('EnergyMax')
        nbin = self.getPropertyValue('SamBinning')
        nbins = [nbin, 1]
        nbet = self.getProperty('NumberBeta').value
        nsig = self.getProperty('NumberSigma').value
        nbs = [nbet, nsig]

        sname = prefix+sam+'_'+ana + '_red'
        rname = prefix+res+'_'+ana + '_res'
        erange = [float(emin), float(emax)]
        if elastic:
            o_el = 1
        else:
            o_el = 0
        fitOp = [o_el, bgd, 0, 0]
        loopOp = self.getProperty('Sequence').value
        verbOp = self.getProperty('Verbose').value
        plotOp = self.getPropertyValue('Plot')
        saveOp = self.getProperty('Save').value

        workdir = config['defaultsave.directory']
        if inType == 'File':
            spath = os.path.join(workdir, sname+'.nxs')        # path name for sample nxs file
            LoadNexusProcessed(Filename=spath, OutputWorkspace=sname)
            Smessage = 'Sample from File : '+spath
        else:
            Smessage = 'Sample from Workspace : '+sname

        if rinType == 'File':
            rpath = os.path.join(workdir, rname+'.nxs')        # path name for res nxs file
            LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
            Rmessage = 'Resolution from File : '+rpath
        else:
            Rmessage = 'Resolution from Workspace : '+rname

        if verbOp:
            logger.notice(Smessage)
            logger.notice(Rmessage)
        Main.QuestRun(sname,rname,nbs,erange,nbins,fitOp,loopOp,plotOp,saveOp)
Example #3
0
    def PyExec(self):
        run_f2py_compatibility_test()

        self.log().information("Quest input")
        inType = self.getPropertyValue("InputType")
        prefix = self.getPropertyValue("Instrument")
        ana = self.getPropertyValue("Analyser")
        sam = self.getPropertyValue("SamNumber")
        rinType = self.getPropertyValue("ResInputType")
        res = self.getPropertyValue("ResNumber")
        elastic = self.getProperty("ElasticOption")
        bgd = self.getPropertyValue("BackgroundOption")
        emin = self.getPropertyValue("EnergyMin")
        emax = self.getPropertyValue("EnergyMax")
        nbin = self.getPropertyValue("SamBinning")
        nbins = [nbin, 1]
        nbet = self.getPropertyValue("NumberBeta")
        nsig = self.getPropertyValue("NumberSigma")
        nbs = [nbet, nsig]

        sname = prefix + sam + "_" + ana + "_red"
        rname = prefix + res + "_" + ana + "_res"
        erange = [float(emin), float(emax)]
        if elastic:
            o_el = 1
        else:
            o_el = 0
        if bgd == "Sloping":
            o_bgd = 2
        if bgd == "Flat":
            o_bgd = 1
        if bgd == "Zero":
            o_bgd = 0
        fitOp = [o_el, o_bgd, 0, 0]
        loopOp = self.getProperty("Sequence")
        verbOp = self.getProperty("Verbose")
        plotOp = self.getPropertyValue("Plot")
        saveOp = self.getProperty("Save")

        workdir = config["defaultsave.directory"]
        if inType == "File":
            spath = os.path.join(workdir, sname + ".nxs")  # path name for sample nxs file
            LoadNexusProcessed(Filename=spath, OutputWorkspace=sname)
            Smessage = "Sample from File : " + spath
        else:
            Smessage = "Sample from Workspace : " + sname
        if rinType == "File":
            rpath = os.path.join(workdir, rname + ".nxs")  # path name for res nxs file
            LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
            Rmessage = "Resolution from File : " + rpath
        else:
            Rmessage = "Resolution from Workspace : " + rname
        if verbOp:
            logger.notice(Smessage)
            logger.notice(Rmessage)
        Main.QuestRun(sname, rname, nbs, erange, nbins, fitOp, loopOp, verbOp, plotOp, saveOp)
Example #4
0
	def PyExec(self):
                from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform

                if is_supported_f2py_platform():
                        import IndirectMuscat as Main

		run_f2py_compatibility_test()

		self.log().information('Muscat input')
		prefix = self.getPropertyValue('Instrument')
		ana = self.getPropertyValue('Analyser')
		geom = self.getPropertyValue('Geom')
		disp = self.getPropertyValue('Dispersion')
		sam = self.getPropertyValue('SamNumber')
		sname = prefix+sam+'_'+ana

		NRUN1 = self.getPropertyValue('NR1')
		NRUN2 = self.getPropertyValue('NR2')
		NMST = self.getPropertyValue('Nms')
		JRAND = 12345
		MRAND = 67890
		neut = [int(NRUN1), int(NRUN2), int(JRAND), int(MRAND), int(NMST)]

		HEIGHT = 3.0
		alfa = self.getPropertyValue('DetAngle')
		THICK = self.getPropertyValue('Thick')
		WIDTH = self.getPropertyValue('Width')
		HEIGHT = self.getPropertyValue('Height')
		if geom == 'Flat':
			beam = [float(THICK), float(WIDTH), float(HEIGHT), float(alfa)]
		if geom == 'Cyl':
			beam = [float(THICK), float(WIDTH), float(HEIGHT), 0.0]        #beam = [WIDTH, WIDTH2, HEIGHT, 0.0]
		dens = self.getPropertyValue('Density')
		sigb = self.getPropertyValue('SigScat')
		siga = self.getPropertyValue('SigAbs')
		sigss=sigb
		temp = self.getPropertyValue('Temperature')
		sam = [float(temp), float(dens), float(siga), float(sigb)]

		NQ = self.getPropertyValue('NQ')
		dQ = self.getPropertyValue('dQ')
		Nw = self.getPropertyValue('NW')
		dw = self.getPropertyValue('dW')           #in microeV
		grid = [int(NQ), float(dQ), int(Nw), float(dw)]
		c1 = self.getPropertyValue('Coeff1')
		c2 = self.getPropertyValue('Coeff2')
		c3 = self.getPropertyValue('Coeff3')
		c4 = self.getPropertyValue('Coeff4')
		c5 = self.getPropertyValue('Coeff5')
		coeff = [float(c1), float(c2), float(c3), float(c4), float(c5)]
		kr1 = 1

		verbOp = self.getProperty('Verbose').value
		plotOp = self.getPropertyValue('Plot')
		saveOp = self.getProperty('Save').value
		Main.MuscatFuncStart(sname,geom,neut,beam,sam,grid,disp,coeff,kr1,verbOp,plotOp,saveOp)
Example #5
0
	def PyExec(self):
		run_f2py_compatibility_test()
		
		self.log().information('ILLines input')
		inType = self.getPropertyValue('InputType')
		instr = self.getPropertyValue('Instrument')
		prog = self.getPropertyValue('Program')
		sam = self.getPropertyValue('SamNumber')
		rinType = self.getPropertyValue('ResInputType')
		rtype = self.getPropertyValue('ResType')
		res = self.getPropertyValue('ResNumber')
		elastic = self.getProperty('ElasticOption')
		bgd = self.getPropertyValue('BackgroundOption')
		width = self.getProperty('FixWidth')
		wfile = self.getPropertyValue('WidthFile')
		resnorm = self.getProperty('ResNorm')
		resn = self.getPropertyValue('ResNormNumber')
		emin = self.getPropertyValue('EnergyMin')
		emax = self.getPropertyValue('EnergyMax')
		nbin = self.getPropertyValue('SamBinning')
		nrbin = self.getPropertyValue('ResBinning')
		nbins = [nbin, nrbin]

		sname = instr+'_'+sam
		rname = instr+'_'+res
		rsname = instr+resn
		erange = [emin, emax]
		if elastic:
			o_el = 1
		else:
			o_el = 0
		if bgd == 'Sloping':
			o_bgd = 2
		if bgd == 'Flat':
			o_bgd = 1
		if bgd == 'Zero':
			o_bgd = 0
		if width:
			o_w1 = 1
		else:
			o_w1 = 0
		if resnorm:
			o_res = 1
		else:
			o_res = 0
		fitOp = [o_el, o_bgd, o_w1, o_res]
		verbOp = self.getProperty('Verbose')
		plotOp = self.getPropertyValue('Plot')
		saveOp = self.getProperty('Save')
		Main.QLStart(prog,inType,sname,rinType,rname,rtype,rsname,erange,nbins,fitOp,wfile,verbOp,plotOp,saveOp)
Example #6
0
	def PyExec(self):
                from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform
                
                if is_supported_f2py_platform():
                        import IndirectMuscat as Main
		run_f2py_compatibility_test()

		self.log().information('Muscat input')
		prefix = self.getPropertyValue('Instrument')
		ana = self.getPropertyValue('Analyser')
		geom = self.getPropertyValue('Geom')
		sam = self.getPropertyValue('SamNumber')
		sqwi = self.getPropertyValue('SqwInput')
		sname = prefix+sam+'_'+ana
		sqw = prefix+sqwi+'_'+ana

		NRUN1 = self.getPropertyValue('NR1')
		NRUN2 = self.getPropertyValue('NR2')
		NMST = self.getPropertyValue('Nms')
		JRAND = 12345
		MRAND = 67890
		neut = [int(NRUN1), int(NRUN2), int(JRAND), int(MRAND), int(NMST)]

		HEIGHT = 3.0
		alfa = self.getPropertyValue('DetAngle')
		THICK = self.getPropertyValue('Thick')
		WIDTH = self.getPropertyValue('Width')
		HEIGHT = self.getPropertyValue('Height')
		if geom == 'Flat':
			beam = [float(THICK), float(WIDTH), float(HEIGHT), float(alfa)]
		if geom == 'Cyl':
			beam = [float(THICK), float(WIDTH), float(HEIGHT), 0.0]        #beam = [WIDTH, WIDTH2, HEIGHT, 0.0]
		dens = self.getPropertyValue('Density')
		sigb = self.getPropertyValue('SigScat')
		siga = self.getPropertyValue('SigAbs')
		temp = self.getPropertyValue('Temperature')
		sam = [float(temp), float(dens), float(siga), float(sigb)]

		kr1 = 1
		verbOp = self.getProperty('Verbose').value
		plotOp = self.getPropertyValue('Plot')
		saveOp = self.getProperty('Save').value
		Main.MuscatDataStart(sname,geom,neut,beam,sam,sqw,kr1,verbOp,plotOp,saveOp)
Example #7
0
  def PyExec(self):
    from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform

    if is_supported_f2py_platform():
            import IndirectBayes as Main

    run_f2py_compatibility_test()
    
    self.log().information('ResNorm input')
    inType = self.getPropertyValue('InputType')
    prefix = self.getPropertyValue('Instrument')
    ana = self.getPropertyValue('Analyser')
    van = self.getPropertyValue('VanNumber')
    rinType = self.getPropertyValue('ResInputType')
    res = self.getPropertyValue('ResNumber')
    emin = self.getPropertyValue('EnergyMin')
    emax = self.getPropertyValue('EnergyMax')
    nbin = self.getPropertyValue('VanBinning')

    vname = prefix+van+'_'+ana+ '_red'
    rname = prefix+res+'_'+ana+ '_res'
    erange = [float(emin), float(emax)]
    verbOp = self.getProperty('Verbose').value
    plotOp = self.getPropertyValue('Plot')
    saveOp = self.getProperty('Save').value

    workdir = config['defaultsave.directory']
    if inType == 'File':
      vpath = os.path.join(workdir, vname+'.nxs')              # path name for van nxs file
      LoadNexusProcessed(Filename=vpath, OutputWorkspace=vname)
      Vmessage = 'Vanadium from File : '+vpath
    else:
      Vmessage = 'Vanadium from Workspace : '+vname
    if rinType == 'File':
      rpath = os.path.join(workdir, rname+'.nxs')                # path name for res nxs file
      LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
      Rmessage = 'Resolution from File : '+rpath
    else:
      Rmessage = 'Resolution from Workspace : '+rname
    if verbOp:
      logger.notice(Vmessage)
      logger.notice(Rmessage)
    Main.ResNormRun(vname,rname,erange,nbin,verbOp,plotOp,saveOp)
Example #8
0
    def PyExec(self):
        from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform

        if is_supported_f2py_platform():
            import IndirectBayes as Main

        run_f2py_compatibility_test()

        self.log().information("ResNorm input")
        inType = self.getPropertyValue("InputType")
        prefix = self.getPropertyValue("Instrument")
        ana = self.getPropertyValue("Analyser")
        van = self.getPropertyValue("VanNumber")
        rinType = self.getPropertyValue("ResInputType")
        res = self.getPropertyValue("ResNumber")
        emin = self.getPropertyValue("EnergyMin")
        emax = self.getPropertyValue("EnergyMax")
        nbin = self.getPropertyValue("VanBinning")

        vname = prefix + van + "_" + ana + "_red"
        rname = prefix + res + "_" + ana + "_res"
        erange = [float(emin), float(emax)]
        plotOp = self.getPropertyValue("Plot")
        saveOp = self.getProperty("Save").value

        workdir = config["defaultsave.directory"]
        if inType == "File":
            vpath = os.path.join(workdir, vname + ".nxs")  # path name for van nxs file
            LoadNexusProcessed(Filename=vpath, OutputWorkspace=vname)
            Vmessage = "Vanadium from File : " + vpath
        else:
            Vmessage = "Vanadium from Workspace : " + vname
        if rinType == "File":
            rpath = os.path.join(workdir, rname + ".nxs")  # path name for res nxs file
            LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
            Rmessage = "Resolution from File : " + rpath
        else:
            Rmessage = "Resolution from Workspace : " + rname
        logger.information(Vmessage)
        logger.information(Rmessage)
        Main.ResNormRun(vname, rname, erange, nbin, plotOp, saveOp)
Example #9
0
	def PyExec(self):
		run_f2py_compatibility_test()
		
		self.log().information('QLines input')
		inType = self.getPropertyValue('InputType')
		prefix = self.getPropertyValue('Instrument')
		ana = self.getPropertyValue('Analyser')
		prog = self.getPropertyValue('Program')
		sam = self.getPropertyValue('SamNumber')
		rinType = self.getPropertyValue('ResInputType')
		rtype = self.getPropertyValue('ResType')
		res = self.getPropertyValue('ResNumber')
		elastic = self.getProperty('ElasticOption')
		bgd = self.getPropertyValue('BackgroundOption')
		width = self.getProperty('FixWidth')
		wfile = self.getPropertyValue('WidthFile')
		resnorm = self.getProperty('ResNorm')
		resn = self.getPropertyValue('ResNormNumber')
		emin = self.getPropertyValue('EnergyMin')
		emax = self.getPropertyValue('EnergyMax')
		nbin = self.getPropertyValue('SamBinning')
		nrbin = self.getPropertyValue('ResBinning')
		nbins = [nbin, nrbin]

		if rtype == 'Res':
			rext = 'res'
		if rtype == 'Data':
			rext = 'red'
		sname = prefix+sam+'_'+ana + '_red'
		rname = prefix+res+'_'+ana + '_' + rext
		rsname = prefix+resn+'_'+ana + '_ResNorm_Paras'
		erange = [float(emin), float(emax)]
		if elastic:
			o_el = 1
		else:
			o_el = 0
		if bgd == 'Sloping':
			o_bgd = 2
		if bgd == 'Flat':
			o_bgd = 1
		if bgd == 'Zero':
			o_bgd = 0
		if width:
			o_w1 = 1
		else:
			o_w1 = 0
		if resnorm:
			o_res = 1
		else:
			o_res = 0
		fitOp = [o_el, o_bgd, o_w1, o_res]
		loopOp = self.getProperty('Sequence')
		verbOp = self.getProperty('Verbose')
		plotOp = self.getPropertyValue('Plot')
		saveOp = self.getProperty('Save')

		workdir = config['defaultsave.directory']
		if inType == 'File':
			spath = os.path.join(workdir, sname+'.nxs')		# path name for sample nxs file
			LoadNexusProcessed(Filename=spath, OutputWorkspace=sname)
			Smessage = 'Sample from File : '+spath
		else:
			Smessage = 'Sample from Workspace : '+sname
		if rinType == 'File':
			rpath = os.path.join(workdir, rname+'.nxs')		# path name for res nxs file
			LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
			Rmessage = 'Resolution from File : '+rpath
		else:
			Rmessage = 'Resolution from Workspace : '+rname
		if verbOp:
			logger.notice(Smessage)
			logger.notice(Rmessage)
		if fitOp[3] == 1:
			path = os.path.join(workdir, rsname+'.nxs')	# path name for resnnrm nxs file
			LoadNexusProcessed(Filename=path, OutputWorkspace='ResNorm')
		Main.QLRun(prog,sname,rname,rsname,erange,nbins,fitOp,wfile,loopOp,verbOp,plotOp,saveOp)
Example #10
0
	def PyExec(self):
                from IndirectImport import run_f2py_compatibility_test, is_supported_f2py_platform

                if is_supported_f2py_platform():
                        import IndirectBayes as Main

		run_f2py_compatibility_test()
		
		self.log().information('QLines input')
		inType = self.getPropertyValue('InputType')
		prefix = self.getPropertyValue('Instrument')
		ana = self.getPropertyValue('Analyser')
		prog = self.getPropertyValue('Program')
		sam = self.getPropertyValue('SamNumber')
		rinType = self.getPropertyValue('ResInputType')
		rtype = self.getPropertyValue('ResType')
		res = self.getPropertyValue('ResNumber')
		elastic = self.getProperty('ElasticOption').value
		bgd = self.getPropertyValue('BackgroundOption')
		width = self.getProperty('FixWidth').value
		wfile = self.getPropertyValue('WidthFile')
		rsnormType = self.getPropertyValue('ResNormInputType')
		resnorm = self.getProperty('ResNorm').value
		resn = self.getPropertyValue('ResNormNumber')
		emin = self.getPropertyValue('EnergyMin')
		emax = self.getPropertyValue('EnergyMax')
		nbin = self.getPropertyValue('SamBinning')
		nrbin = self.getPropertyValue('ResBinning')
		nbins = [nbin, nrbin]

		if rtype == 'Res':
			rext = 'res'
		if rtype == 'Data':
			rext = 'red'
		sname = prefix+sam+'_'+ana + '_red'
		rname = prefix+res+'_'+ana + '_' + rext
		rsname = prefix+resn+'_'+ana + '_ResNorm_Paras'
		erange = [float(emin), float(emax)]

		fitOp = [elastic, bgd, width, resnorm]
		loopOp = self.getProperty('Sequence').value
		verbOp = self.getProperty('Verbose').value
		plotOp = self.getPropertyValue('Plot')
		saveOp = self.getProperty('Save').value

		workdir = config['defaultsave.directory']
		if inType == 'File':
			spath = os.path.join(workdir, sname+'.nxs')		# path name for sample nxs file
			LoadNexusProcessed(Filename=spath, OutputWorkspace=sname)
			Smessage = 'Sample from File : '+spath
		else:
			Smessage = 'Sample from Workspace : '+sname
		if rinType == 'File':
			rpath = os.path.join(workdir, rname+'.nxs')		# path name for res nxs file
			LoadNexusProcessed(Filename=rpath, OutputWorkspace=rname)
			Rmessage = 'Resolution from File : '+rpath
		else:
			Rmessage = 'Resolution from Workspace : '+rname

		if resnorm:
			if rsnormType == 'File':
				rpath = os.path.join(workdir, rsname+'.nxs')		# path name for res nxs file
				LoadNexusProcessed(Filename=rpath, OutputWorkspace=rsname)
				Rmessage = 'ResNorm from File : '+rpath
			else:
				Rmessage = 'ResNorm from Workspace : '+rsname

		if verbOp:
			logger.notice(Smessage)
			logger.notice(Rmessage)

		rsname = rsname[:-6]

		Main.QLRun(prog,sname,rname,rsname,erange,nbins,fitOp,wfile,loopOp,verbOp,plotOp,saveOp)