/[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 3972 by caltinay, Wed Sep 19 03:08:39 2012 UTC revision 3980 by caltinay, Fri Sep 21 01:55:39 2012 UTC
# Line 610  class ERSDataSource(DataSource): Line 610  class ERSDataSource(DataSource):
610          try:          try:
611              maskval = float(md_dict['RasterInfo.NullCellValue'])              maskval = float(md_dict['RasterInfo.NullCellValue'])
612          except:          except:
613              raise RuntimeError("Could not determine NullCellValue")              maskval = 99999
614    
615          try:          try:
616              spacingX = float(md_dict['RasterInfo.CellInfo.Xdimension'])              spacingX = float(md_dict['RasterInfo.CellInfo.Xdimension'])
# Line 640  class ERSDataSource(DataSource): Line 640  class ERSDataSource(DataSource):
640                  wkt=ds.GetProjection()                  wkt=ds.GetProjection()
641              except:              except:
642                  wkt='GEOGCS["GEOCENTRIC DATUM of AUSTRALIA",DATUM["GDA94",SPHEROID["GRS80",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'                  wkt='GEOGCS["GEOCENTRIC DATUM of AUSTRALIA",DATUM["GDA94",SPHEROID["GRS80",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]'
643                  self.logger.warn('GDAL not available, assuming GDA94 data')                  self.logger.warn('GDAL not available or file read error, assuming GDA94 data')
644              originX_UTM,originY_UTM=LatLonToUTM(originX, originY, wkt)              originX_UTM,originY_UTM=LatLonToUTM(originX, originY, wkt)
645              op1X,op1Y=LatLonToUTM(originX+spacingX, originY+spacingY, wkt)              op1X,op1Y=LatLonToUTM(originX+spacingX, originY+spacingY, wkt)
646              # we are rounding to avoid interpolateOnDomain issues              # we are rounding to avoid interpolateOnDomain issues
# Line 680  class ERSDataSource(DataSource): Line 680  class ERSDataSource(DataSource):
680          nValues=self.__nPts[:2]+[1]          nValues=self.__nPts[:2]+[1]
681          first=self._dom_NE_pad[:2]+[self._dom_NE_pad[2]+int((self.__altOfData-self.__origin[2])/self.__delta[2])]          first=self._dom_NE_pad[:2]+[self._dom_NE_pad[2]+int((self.__altOfData-self.__origin[2])/self.__delta[2])]
682          g=ripleycpp._readBinaryGrid(self.__datafile, Function(self.getDomain()),          g=ripleycpp._readBinaryGrid(self.__datafile, Function(self.getDomain()),
683                  first, nValues, (), -1e8)                  first, nValues, (), self.__maskval)
684          sigma=whereNonNegative(g+1e7)          sigma=whereNonZero(g-self.__maskval)
685          g=g*1e-6          g=g*1e-6
686          sigma=sigma*2e-6          sigma=sigma*2e-6
687          return g*[0,0,1], sigma          return g*[0,0,1], sigma

Legend:
Removed from v.3972  
changed lines
  Added in v.3980

  ViewVC Help
Powered by ViewVC 1.1.26