Changeset 1192 for trunk/UTIL


Ignore:
Timestamp:
Feb 28, 2014, 2:59:54 PM (11 years ago)
Author:
aslmd
Message:

PLANETOPLOT. added getfd method to obtain fields+coordinates.

Location:
trunk/UTIL/PYTHON/planetoplot_v2
Files:
1 added
1 edited

Legend:

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

    r1178 r1192  
    214214        self.f = None
    215215        self.l = None
     216        self.x = None
     217        self.y = None
     218        self.z = None
     219        self.t = None
    216220        ## what could be defined by the user
    217221        self.file = file
     
    678682        self.f = [ [] for iii in range(self.nrequest) ]
    679683        self.l = [ [] for iii in range(self.nrequest) ]
     684        self.x = [ [] for iii in range(self.nrequest) ]
     685        self.y = [ [] for iii in range(self.nrequest) ]
     686        self.z = [ [] for iii in range(self.nrequest) ]
     687        self.t = [ [] for iii in range(self.nrequest) ]
    680688        count = 0
    681689        ## first get fields
     
    694702              # save fields in self.f for the user
    695703              self.f[count] = obj.field
     704              self.x[count] = obj.field_x
     705              self.y[count] = obj.field_y
     706              self.z[count] = obj.field_z
     707              self.t[count] = obj.field_t
    696708              # save a legend in self.l for the user
    697709              self.l[count] = "_"
     
    706718              count = count + 1
    707719        ## make it simple: self.f is simply the data array if self.nrequest=1
    708         if self.nrequest == 1: self.f = self.f[0]
     720        if self.nrequest == 1:
     721            self.f = self.f[0]
     722            self.x = self.x[0]
     723            self.y = self.y[0]
     724            self.z = self.z[0]
     725            self.t = self.t[0]
    709726        # change status
    710727        self.status = "retrieved"
     
    730747
    731748    ############################################################
     749    # getfd: a shortcut method for the define + retrieve chain #
     750    #       ... in which the output is self.f,x,y,z,t          #
     751    #       ... and the ppclass is kept quiet                  #
     752    ############################################################
     753    def getfd(self):
     754        self.quiet = True
     755        self.get()
     756        return self.f,self.x,self.y,self.z,self.t
     757
     758    ############################################################
    732759    # getfl: a shortcut method for the define + retrieve chain #
    733760    #       ... in which the output is self.f, self.l          #
    734     #       ... and the ppclass is kept quiet                 #
     761    #       ... and the ppclass is kept quiet                  #
    735762    ############################################################
    736763    def getfl(self):
Note: See TracChangeset for help on using the changeset viewer.