Ignore:
Timestamp:
Mar 29, 2013, 5:55:09 PM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON planetoplot_v2. Added options to pp.py. Added help to pp.py. Set warnings in case files cannot be written. Set warnings for bounds too tight. Corrected one possible bug when several plots in a row.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py

    r917 r920  
    172172    # print status
    173173    def printstatus(self):
    174         print "**** Done step: " + self.status
     174        if self.filename == "THIS_IS_A_CLONE":
     175            pass
     176        else:
     177            print "**** Done step: " + self.status
    175178
    176179    #####################################################
     
    216219               setattr(the_clone,k,v)
    217220        the_clone.verbose = False
     221        the_clone.filename = "THIS_IS_A_CLONE" # trick to avoid additional outputs
    218222        the_clone.define()
    219223        for i in range(self.nfin):
     
    511515        self.printstatus()
    512516        # check if things were done OK before
    513         if self.status != "defined": print "!! ERROR !! Please use .define() to define your pp object."
     517        if self.status != "defined": print "!! ERROR !! Please use .define() to define your pp object." ; exit()
    514518        ## first get fields
    515519        ## ... only what is needed is extracted from the files
     
    777781        if (self.n == self.howmanyplots):
    778782            ppplot.save(mode=self.out,filename=self.filename,folder=self.folder,custom=customplot)
     783            mpl.close()
    779784        # SAVE A PICKLE FILE WITH THE self.p ARRAY OF OBJECTS
    780785        if self.verbose: print "**** Saving session in "+self.filename + ".ppobj"
    781786        savfile = self.folder + "/" + self.filename + ".ppobj"
    782         filehandler = open(savfile, 'w')
    783         pickle.dump(self.p, filehandler)
     787        try:
     788            filehandler = open(savfile, 'w')
     789            pickle.dump(self.p, filehandler)
     790        except IOError:
     791            print "!! WARNING !! Saved object file not written. Probably do not have permission to write here."
    784792
    785793    ###########################################################
     
    884892            except:
    885893                try: self.p[iii].lstyle = opt.lstyle[0]
     894                except: pass
     895            ###
     896            try: self.p[iii].color = opt.color[iii]
     897            except: 
     898                try: self.p[iii].color = opt.color[0]
     899                except: pass
     900            ###
     901            try: self.p[iii].marker = opt.marker[iii]
     902            except: 
     903                try: self.p[iii].marker = opt.marker[0]
    886904                except: pass
    887905            ###
Note: See TracChangeset for help on using the changeset viewer.