Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyzlj committed Nov 4, 2016
1 parent 3bbca2a commit 27d024d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Binary file not shown.
Binary file added dist/PyGeoC-0.1.0.tar.gz
Binary file not shown.
Binary file removed dist/PyGeoC-0.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run_tests(self):
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1',
version='0.1.0',

description='Python for GeoComputation',
long_description=long_description,
Expand Down
14 changes: 7 additions & 7 deletions test/StatisticsByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ def StatisticsByMask(simf, obsf, maskf):
E2 = 0.
for row in range(rows):
for col in range(cols):
if not FloatEqual(maskdata[row][col], nodata):
tmpx, tmpy = maskr.GetCentralCoors(row, col)
if not maskdata[row][col] == nodata:
tmpx, tmpy = maskr.GetCentralCoors(row + 1, col + 1)
simV = simr.GetValueByXY(tmpx, tmpy)
obsV = obsr.GetValueByXY(tmpx, tmpy)
if simV is not None and obsV is not None and \
not FloatEqual(simV, simNodata) and not FloatEqual(obsV, obsNodata):
not simV == simNodata and not obsV == obsNodata:
n += 1
E += (simV - obsV)
E2 += (simV - obsV) * (simV - obsV)
# print n, E, E2
print n, E, E2
ME = E / n
RMSE = math.sqrt(E2 / n)
return ME, RMSE
if __name__ == "__main__":
MaskRasterFile = r'C:\z_data_m\ArtificialDEM\MASK.tif'
SimulateRasterFile = r'C:\z_data_m\ArtificialDEM\SaddleSCA.asc'
TheoryRasterFile = r'C:\z_data_m\ArtificialDEM\SCATh.tif'
MaskRasterFile = r'C:\Users\ZhuLJ\Desktop\ME_RMSE_testdata\region.tif'
SimulateRasterFile = r'C:\Users\ZhuLJ\Desktop\ME_RMSE_testdata\result.tif'
TheoryRasterFile = r'C:\Users\ZhuLJ\Desktop\ME_RMSE_testdata\theoSCA_1m.asc'
ME, RMSE = StatisticsByMask(SimulateRasterFile, TheoryRasterFile, MaskRasterFile)
print "ME: %f, RMSE: %f" % (ME, RMSE)

0 comments on commit 27d024d

Please sign in to comment.