Exemple #1
0
    def read(self, target, database=None):

        if (target[:18] == 'FissionProductENDL'):
            ZAs = target[18:]
        else:
            Z, A, suffix, ZA = endl2.gndNameToEndlZ_A_Suffix(target)
            ZAs = endlmisc.strZASuffix(1000 * Z + A, suffix)
        return (self.readZA(ZAs, database=database))
Exemple #2
0
    def ZA(self, ZA, suffix=""):
        """Returns a reference to the endlZA matching ZA in self.  ZA is passed to endlmisc.intZA 
        and its return value to used for matching ZAs. If ZA has not been instantiated then None is returned."""

        sZA = endlmisc.strZASuffix(ZA, suffix)
        for z in self.zas:
            if (z.sZA == sZA): return z
        return None
Exemple #3
0
    def unreadZA(self, ZA, suffix=""):
        """Removes self's reference to ZA, but does not delete ZA's directory from self's work 
        directory (i.e., if process( ) is called this ZA will be processed). Also see removeZA."""

        sZA = endlmisc.strZASuffix(ZA, suffix)
        for i in range(len(self.zas)):
            if (self.zas[i].sZA == sZA):
                del self.zas[i]
                return
        endlmisc.printWarning("Warning in endlProject.unreadZA: za = " + sZA +
                              " not in project")
Exemple #4
0
    def removeZA(self, ZA, suffix=""):
        """Removes self's reference to ZA and deletes ZA's directory from self's work 
        directory (i.e., if process( ) is called this ZA will not be processed).  Also see unreadZA."""

        sZA = endlmisc.strZASuffix(ZA, suffix)
        for i in range(len(self.zas)):
            if (self.zas[i].sZA == sZA):
                if (self.zas[i].workDir != None):
                    os.system("rm -rf " + self.zas[i].workDir)
                del self.zas[i]
                return
        endlmisc.printWarning(
            "Warning in endlProject.removeZA: za = %s not in project" % sZA)
Exemple #5
0
    def addZA(self, ZA, suffix=""):
        """Adds a new empty endlZA class to self and returns a reference to it.  Also see readZA."""

        sZA = endlmisc.strZASuffix(ZA, suffix)
        for z in self.zas:
            if (z.sZA == sZA):
                raise Exception(
                    "\nError in endlProject.addZA: za = %s already present in this endlProject"
                    % sZA)
        z = endlZA.endlZA(ZA,
                          self.yi,
                          database=None,
                          workDir=self.workDir,
                          suffix=suffix,
                          readOnly=self.readOnly,
                          bdflsFile=self.bdflsFile)
        self.zas.append(z)
        return z
Exemple #6
0
    def readZA(self, ZA, database=None, suffix=""):
        """Reads in ZA from database, creating a new endlZA in self.  If database = None, the database from self is used. Also see addZA."""

        sZA = endlmisc.strZASuffix(ZA, suffix)
        for z in self.zas:
            if (z.sZA == sZA):
                endlmisc.printWarning(
                    "za = %s already present in this endlProject" % sZA)
                return z
        if (database == None): database = self.database
        z = endlZA.endlZA(ZA,
                          self.yi,
                          database=database,
                          workDir=self.workDir,
                          suffix=suffix,
                          readOnly=self.readOnly,
                          bdflsFile=self.bdflsFile)
        self.zas.append(z)
        return z
Exemple #7
0
    def __contains__(self, target):
        """Returns True if target is in self database, otherwise returns False."""

        strZA = endlmisc.strZASuffix(target)
        return (strZA in self.ZAList())