def filterStack(self, stackname, minx=600, maxx=1600, miny=82, maxy=150):
		runnum = apStack.getNumStacksFromSession(self.sessionname)
		filtstackname = "meanfilt%d-%s"%(runnum+1, self.timestamp)

		stackid = apStack.getStackIdFromRunName(stackname, self.sessionname)
		if not stackid:
			apDisplay.printError("Failed to find stack %s for session %s"%(stackname, self.sessionname))


		script = os.path.join(self.appiondir, "bin", "stackFilter.py ")
#		params = ((" --runname=%s --projectid=%d --old-stack-id=%d --minx=%d --maxx=%d --miny=%d --maxy=%d --description='%s'")
#			%(filtstackname, self.params['projectid'], stackid, 
#			600, 1000, 82, 105, 
#			'filtering junk with test suite application'))
		params = ((" --runname=%s --projectid=%d --old-stack-id=%d --minx=%d --maxx=%d --miny=%d --maxy=%d --description='%s'")
			%(filtstackname, self.params['projectid'], stackid, 
			minx, maxx, miny, maxy, 
			'filtering junk with test suite application'))
		
		# Add appion flags 
		if self.params['commit'] is True:
			params += " --commit "
		else:
			params += " --no-commit "

		self.runCommand(script+" "+params)

		stackid = apStack.getStackIdFromSubStackName(filtstackname, self.sessionname)
		if not stackid:
			apDisplay.printError("Failed to create stack %s for session %s during stackFilter test."%(filtstackname, self.sessionname))

		return filtstackname
	def maxLike(self, substackname, lowpass=10, highpass=2000, numref=3, bin=2, maxiter=12):
		runnum = apAlignment.getNumAlignRunsFromSession(self.sessionname)
		maxlikename = "maxlike%d-%s"%(runnum+1, self.timestamp)

		stackid = apStack.getStackIdFromSubStackName(substackname, self.sessionname)
		if not stackid:
			apDisplay.printError("Failed to find stack %s for session %s during maxLikeAlignment test."%(substackname, self.sessionname))
		

		print (self.params['projectid'], stackid, 10, 2000, 3, 1, 12, 'max like with test suite application')
		

		script = os.path.join(self.appiondir, "bin", "maxlikeAlignment.py")
		params = (" --runname=%s --projectid=%d --stack=%d --lowpass=%d --highpass=%d --num-ref=%d --bin=%d --savemem --converge=slow --mirror --fast --fast-mode=narrow --max-iter=%d --description='%s'"
			%(maxlikename, self.params['projectid'], stackid, lowpass, highpass, numref, bin, maxiter, 
			'max like with test suite application'))
		
		# Add appion flags 
		if self.params['commit'] is True:
			params += " --commit "
		else:
			params += " --no-commit "

		self.runCommand(script+" "+params)

		return maxlikename
    def maxLike(self, substackname):
        runnum = apAlignment.getNumAlignRunsFromSession(self.sessionname)
        maxlikename = "maxlike%d-%s" % (runnum + 1, self.timestamp)

        stackid = apStack.getStackIdFromSubStackName(substackname, self.sessionname)

        print (self.params["projectid"], stackid, 10, 2000, 3, 1, 12, "max like with test suite application")

        script = os.path.join(self.appiondir, "bin", "maxlikeAlignment.py")
        params = (
            " --runname=%s --projectid=%d --stack=%d --lowpass=%d --highpass=%d --num-ref=%d --bin=%d --savemem --converge=slow --mirror --fast --fast-mode=narrow --max-iter=%d --description='%s'"
            % (
                maxlikename,
                self.params["projectid"],
                stackid,
                10,
                2000,
                3,
                2,
                12,
                "max like with test suite application",
            )
        )
        if self.params["commit"] is True:
            params += " --commit "
        else:
            params += " --no-commit "
        self.runCommand(script + " " + params)

        return maxlikename
	def maxLike(self, substackname):
		runnum = apAlignment.getNumAlignRunsFromSession(self.sessionname)
		maxlikename = "maxlike%d-%s"%(runnum+1, self.timestamp)

		stackid = apStack.getStackIdFromSubStackName(substackname, self.sessionname)

		print (self.params['projectid'], stackid, 10, 2000, 3, 1, 12, 'max like with test suite application')

		script = os.path.join(self.appiondir, "bin", "maxlikeAlignment.py")
		params = (" --runname=%s --projectid=%d --stack=%d --lowpass=%d --highpass=%d --num-ref=%d --bin=%d --savemem --converge=slow --mirror --fast --fast-mode=narrow --max-iter=%d --description='%s'"
			%(maxlikename, self.params['projectid'], stackid, 10, 2000, 3, 2, 12, 
			'max like with test suite application'))
		if self.params['commit'] is True:
			params += " --commit "
		else:
			params += " --no-commit "
		self.runCommand(script+" "+params)

		return maxlikename