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

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

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

revision 4047 by gross, Tue Oct 30 09:10:07 2012 UTC revision 4049 by caltinay, Wed Oct 31 00:50:50 2012 UTC
# Line 445  class NetCDFDataSource(DataSource): Line 445  class NetCDFDataSource(DataSource):
445                         alt_of_data=0.):                         alt_of_data=0.):
446          """          """
447          :param gravfile: file with gravity data in netcdf format          :param gravfile: file with gravity data in netcdf format
448          :type gravfile: ```str```          :type gravfile: ``str``
449          :param magfile: file with magnetic datafile in netcdf format          :param magfile: file with magnetic datafile in netcdf format
450          :type magfile: ```str```          :type magfile: ``str``
451          :param topofile: file with topography data in netcdf format          :param topofile: file with topography data in netcdf format
452          :type topofile: ```str```          :type topofile: ``str``
453          :param depth: depth below surface filled with rock          :param depth: depth below surface filled with rock
454          :type depth: ```float```          :type depth: ``float``
455          :param air_layer: height above surface filled with air. It is assumed that that density correction is zero          :param air_layer: height above surface filled with air. It is
456                         in this region.                            assumed that that density correction is zero
457          :type air_layer: ```float```                            in this region.
458            :type air_layer: ``float``
459          :param vertical_cells: number of vertical cells          :param vertical_cells: number of vertical cells
460          type vertical_cells: ```int```          :type vertical_cells: ``int``
461          :param alt_of_data: altitude of measurements above ground in meter          :param alt_of_data: altitude of measurements above ground in meters
462          :type alt_of_data: ```float```          :type alt_of_data: ``float``
463          """          """
464          super(NetCDFDataSource,self).__init__()          super(NetCDFDataSource,self).__init__()
465          self.__topofile=topofile          self.__topofile=topofile
466          self.__gravfile=gravfile          self.__gravfile=gravfile
467          self.__magfile=magfile          self.__magfile=magfile
468          self.__determineExtents((-depth,air_layer,n))          self.__determineExtents((-depth,air_layer,vertical_cells))
469          self.__altOfData=alt_of_data          self.__altOfData=alt_of_data
470    
471      def __determineExtents(self, ve):      def __determineExtents(self, ve):
# Line 614  class ERSDataSource(DataSource): Line 615  class ERSDataSource(DataSource):
615      Note that this class only accepts a very specific type of ER Mapper data      Note that this class only accepts a very specific type of ER Mapper data
616      input and will raise an exception if other data is found.      input and will raise an exception if other data is found.
617      """      """
618      def __init__(self, headerfile, datafile=None, vertical_extents=(-40000,10000,25), alt_of_data=0.):      def __init__(self, headerfile, datafile=None, depth=40000.,
619                     air_layer=10000., vertical_cells=25, alt_of_data=0.):
620          """          """
621          headerfile - usually ends in .ers          :param headerfile: ER Mapper header file (usually ends in .ers)
622          datafile - usually has the same name as the headerfile without '.ers'          :type headerfile: ``str``
623            :param datafile: ER Mapper binary data file name. If not supplied the
624                             name of the header file without '.ers' is assumed
625            :type datafile: ``str``
626            :param depth: depth below surface filled with rock
627            :type depth: ``float``
628            :param air_layer: height above surface filled with air. It is
629                              assumed that that density correction is zero
630                              in this region.
631            :type air_layer: ``float``
632            :param vertical_cells: number of vertical cells
633            :type vertical_cells: ``int``
634            :param alt_of_data: altitude of measurements above ground in meters
635            :type alt_of_data: ``float``
636          """          """
637          super(ERSDataSource,self).__init__()          super(ERSDataSource,self).__init__()
638          self.__headerfile=headerfile          self.__headerfile=headerfile
# Line 625  class ERSDataSource(DataSource): Line 640  class ERSDataSource(DataSource):
640              self.__datafile=headerfile[:-4]              self.__datafile=headerfile[:-4]
641          else:          else:
642              self.__datafile=datafile              self.__datafile=datafile
643          self.__readHeader(vertical_extents)          self.__readHeader((-depth, air_layer, vertical_cells))
644          self.__altOfData=alt_of_data          self.__altOfData=alt_of_data
645    
646      def __readHeader(self, ve):      def __readHeader(self, ve):

Legend:
Removed from v.4047  
changed lines
  Added in v.4049

  ViewVC Help
Powered by ViewVC 1.1.26