/[escript]/trunk/downunder/py_src/domainbuilder.py
ViewVC logotype

Diff of /trunk/downunder/py_src/domainbuilder.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4114 by caltinay, Thu Dec 13 06:38:11 2012 UTC revision 4115 by gross, Fri Dec 14 04:48:48 2012 UTC
# Line 144  class DomainBuilder(object): Line 144  class DomainBuilder(object):
144              if pad_y < 0:              if pad_y < 0:
145                  raise ValueError("setElementPadding: Arguments must be non-negative")                  raise ValueError("setElementPadding: Arguments must be non-negative")
146          self._padding = [pad_x,pad_y], 'e'          self._padding = [pad_x,pad_y], 'e'
147            
148      def getGravitySurveys(self):      def getGravitySurveys(self):
149        """
150        Returns a list of gravity surveys, see `` getSurveys`` for details
151        """
152        return self.getSurveys(DataSource.GRAVITY)
153        
154        def getMagneticSurveys(self):
155        """
156        Returns a list of magnetic surveys, see `` getSurveys`` for details
157        """
158        return self.getSurveys(DataSource.MAGNETIC)
159            
160        def getSurveys(self, datatype):
161          """          """
162          Returns a list of `Data` objects for all gravity surveys available to          Returns a list of `Data` objects for all gravity surveys available to
163          this domain builder.          this domain builder.
# Line 155  class DomainBuilder(object): Line 167  class DomainBuilder(object):
167          """          """
168          if len(self._gravity_surveys)==0:          if len(self._gravity_surveys)==0:
169              for src in self._sources:              for src in self._sources:
170                  if src.getDataType()==DataSource.GRAVITY:                  if src.getDataType()==datatype:
171                      survey=src.getSurveyData(self.getDomain(), self._dom_origin, self._dom_NE, self._spacing)                      survey=src.getSurveyData(self.getDomain(), self._dom_origin, self._dom_NE, self._spacing)
172                      self._gravity_surveys.append(survey)                      self._gravity_surveys.append(survey)
173          return self._gravity_surveys          return self._gravity_surveys
174    
175      def getMagneticSurveys(self):      def setBackgroundMagneticFluxDensity(self, B):
         """  
         Returns a list of `Data` objects for all magnetic surveys available to  
         this domain builder.  
   
         :return: List of magnetic surveys which are tuples (anomaly,error).  
         :rtype: ``list``  
         """  
         if len(self._magnetic_surveys)==0:  
             for src in self._sources:  
                 if src.getDataType()==DataSource.MAGNETIC:  
                     survey=src.getSurveyData(self.getDomain(), self._dom_origin, self._dom_NE, self._spacing)  
                     self._magnetic_surveys.append(survey)  
         return self._magnetic_surveys  
   
     def setBackgroundMagneticField(self, B):  
176          """          """
177          sets the back ground magnetic field B=(B_r,B_theta, B_phi)          sets the back ground magnetic flux density B=(B_r,B_theta, B_phi)
178          """          """
179          self.__background_magnetic_field=B          self.__background_magnetic_field=B
180    
181      def getBackgroundMagneticField(self):      def getBackgroundMagneticFluxDensity(self):
182          """          """
183          returns the back ground magnetic field.          returns the back ground magnetic flux density.
184          """          """
185          B = self.__background_magnetic_field          B = self.__background_magnetic_field
186          # this is for Cartesian (FIXME ?)          # this is for Cartesian (FIXME ?)
# Line 194  class DomainBuilder(object): Line 191  class DomainBuilder(object):
191    
192      def getSetDensityMask(self):      def getSetDensityMask(self):
193          x=self.getDomain().getX()          x=self.getDomain().getX()
194          return wherePositive(x[self._dim-1])+whereZero(x[self._dim-1]-inf(x[self._dim-1]))          return wherePositive(x[self._dim-1]) #+whereZero(x[self._dim-1]-inf(x[self._dim-1]))
195          # \        + whereZero(x[0]-inf(x[0]))+ whereZero(x[0]-sup(x[0]))          # \        + whereZero(x[0]-inf(x[0]))+ whereZero(x[0]-sup(x[0]))
196    
197      def getSetSusceptibilityMask(self):      def getSetSusceptibilityMask(self):

Legend:
Removed from v.4114  
changed lines
  Added in v.4115

  ViewVC Help
Powered by ViewVC 1.1.26