Example #1
0
    def Save(self):
        OutFile = self.SolsFileOut
        if not ".npz" in OutFile: OutFile += ".npz"

        log.print("  Saving interpolated solution file as: %s" % OutFile)
        self.DicoOut["Sols"] = self.SolsOut
        self.DicoOut["Sols"]["G"][:] = self.GOut[:]
        try:
            np.savez(OutFile, **(self.DicoOut))
        except:
            log.print("There was an exception while using savez")
            log.print("  you should set the environment variable TMPDIR")
            log.print("  to a directory where there is enough space")

        NpShared.DelAll("%s" % IdSharedMem)
Example #2
0
    def Save(self):
        OutFile = self.OutSolsName
        if not ".npz" in OutFile: OutFile += ".npz"

        #self.SpacialSmoothTEC()

        if "TEC" in self.InterpMode:
            # OutFileTEC="%s.TEC_CPhase.npz"%OutFile
            # log.print("  Saving TEC/CPhase solution file as: %s"%OutFileTEC)
            # np.savez(OutFileTEC,
            #          TEC=self.TECArray,
            #          CPhase=self.CPhaseArray)
            self.DicoFile["SolsTEC"] = self.TECArray
            self.DicoFile["SolsCPhase"] = self.CPhaseArray

        log.print("  Saving interpolated solution file as: %s" % OutFile)
        self.DicoFile["SmoothMode"] = self.InterpMode
        self.DicoFile["SolsOrig"] = copy.deepcopy(self.DicoFile["Sols"])
        self.DicoFile["SolsOrig"]["G"][:] = self.DicoFile["Sols"]["G"][:]
        self.DicoFile["Sols"]["G"][:] = self.GOut[:]
        np.savez(OutFile, **(self.DicoFile))

        # import PlotSolsIm
        # G=self.DicoFile["Sols"]["G"].view(np.recarray)
        # iAnt,iDir=10,0
        # import pylab
        # pylab.clf()
        # A=self.GOut[:,:,iAnt,iDir,0,0]
        # B=G[:,:,iAnt,iDir,0,0]
        # Gs=np.load(OutFile)["Sols"]["G"].view(np.recarray)
        # C=Gs[:,:,iAnt,iDir,0,0]
        # pylab.subplot(1,3,1)
        # pylab.imshow(np.abs(A).T,interpolation="nearest",aspect="auto")
        # pylab.subplot(1,3,2)
        # pylab.imshow(np.abs(B).T,interpolation="nearest",aspect="auto")
        # pylab.subplot(1,3,3)
        # pylab.imshow(np.abs(C).T,interpolation="nearest",aspect="auto")
        # pylab.draw()
        # pylab.show()
        # PlotSolsIm.Plot([self.DicoFile["Sols"].view(np.recarray)])

        NpShared.DelAll("%s" % IdSharedMem)