/[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 4119 by gross, Fri Dec 14 07:21:14 2012 UTC revision 4120 by gross, Tue Dec 18 04:49:37 2012 UTC
# Line 58  class DomainBuilder(object): Line 58  class DomainBuilder(object):
58          self.setPadding()          self.setPadding()
59          self.setVerticalExtents()          self.setVerticalExtents()
60          self.__background_magnetic_field = None          self.__background_magnetic_field = None
61            self.fixDensityBelow()
62            self.fixSusceptibilityBelow()
63    
64      def addSource(self, source):      def addSource(self, source):
65          """          """
# Line 156  class DomainBuilder(object): Line 158  class DomainBuilder(object):
158      Returns a list of magnetic surveys, see `` getSurveys`` for details      Returns a list of magnetic surveys, see `` getSurveys`` for details
159      """      """
160      return self.getSurveys(DataSource.MAGNETIC)      return self.getSurveys(DataSource.MAGNETIC)
161        def fixDensityBelow(self,depth=None):
162            """
163            defines the depth below which density anomaly is set to zero.
164            """
165            self.__fix_density_below=depth
166            
167        def fixSusceptibilityBelow(self,depth=None):
168            """
169            defines the depth below which density anomaly is set to zero.
170            """
171            self.__fix_susceptibility_below=depth
172    
173            
174                    
175      def getSurveys(self, datatype):      def getSurveys(self, datatype):
176          """          """
# Line 190  class DomainBuilder(object): Line 205  class DomainBuilder(object):
205              return np.array([-B[1],  -B[2],  -B[0]])              return np.array([-B[1],  -B[2],  -B[0]])
206    
207      def getSetDensityMask(self):      def getSetDensityMask(self):
208          x=self.getDomain().getX()          z=self.getDomain().getX()[self._dim-1]
209          return wherePositive(x[self._dim-1]) +whereZero(x[self._dim-1]-inf(x[self._dim-1]))          m = whereNonNegative(z)
210          # \        + whereZero(x[0]-inf(x[0]))+ whereZero(x[0]-sup(x[0]))          if self.__fix_density_below:
211           m += whereNonPositive(z+self.__fix_density_below)
212            
213            return m
214            
215      def getSetSusceptibilityMask(self):      def getSetSusceptibilityMask(self):
216          return wherePositive(self.getDomain().getX()[self._dim-1])          z=self.getDomain().getX()[self._dim-1]
217            m = whereNonNegative(z)
218            if self.__fix_susceptibility_below:
219           m += whereNonPositive(z+self.__fix_susceptibility_below)
220            return m
221    
222    
223      def getDomain(self):      def getDomain(self):
224          """          """

Legend:
Removed from v.4119  
changed lines
  Added in v.4120

  ViewVC Help
Powered by ViewVC 1.1.26