Skip to content

Commit

Permalink
A bugger - messy issue. See issue #171
Browse files Browse the repository at this point in the history
  • Loading branch information
uniomni committed Oct 28, 2011
1 parent a470012 commit 3d96c7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
16 changes: 11 additions & 5 deletions impact/plugins/earthquake/allen_fatality_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ def run(layers,
population = layers[1]

# Scale resampled population density

current_res = population.get_resolution()[0]
native_res = float(population.get_keywords()['resolution'])
keywords = population.get_keywords()
if 'resolution' in keywords:
# Clunky - see issue #171
native_res = float(keywords['resolution'])

#print 'current res', current_res
#print 'native res', native_res
#print 'current res', current_res
#print 'native res', native_res

scaling = (current_res / native_res) ** 2
#print 'scaling', scaling
scaling = (current_res / native_res) ** 2
#print 'scaling', scaling
else:
scaling = 1

# Extract data
H = intensity.get_data(nan=0)
Expand Down
16 changes: 10 additions & 6 deletions impact/plugins/flood/HKV_flood_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ def run(layers):
# Scale resampled population density
# FIXME (Ole) - TODO
current_res = population.get_resolution()[0]
native_res = float(population.get_keywords()['resolution'])
keywords = population.get_keywords()
if 'resolution' in keywords:
# Clunky - see issue #171
native_res = float(keywords['resolution'])

#print 'current res', current_res
#print 'native res', native_res

scaling = (current_res / native_res) ** 2
#print 'scaling', scaling
#print 'current res', current_res
#print 'native res', native_res

scaling = (current_res / native_res) ** 2
#print 'scaling', scaling
else:
scaling = 1

# Extract data as numeric arrays
D = inundation.get_data(nan=0.0) # Depth
Expand Down

0 comments on commit 3d96c7c

Please sign in to comment.