Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with ShakeGrid subdivide method on edges #138

Open
kallstadt-usgs opened this issue Dec 30, 2019 · 0 comments
Open

Problem with ShakeGrid subdivide method on edges #138

kallstadt-usgs opened this issue Dec 30, 2019 · 0 comments

Comments

@kallstadt-usgs
Copy link
Member

kallstadt-usgs commented Dec 30, 2019

from mapio.geodict import GeoDict
from mapio.shake import ShakeGrid
import matplotlib.pyplot as plt

shakefile = 'grid.xml' # Use 1906 San Francisco shakemap here

gdict = GeoDict({'xmin': -122.88698976549115,
'xmax': -122.2389795319979,
'ymin': 37.49798642716523,
'ymax': 38.065041960700796,
'dx': 9.315845794900122e-05,
'dy': 9.315845794900046e-05,
'ny': 6088,
'nx': 6957})

##% Load in ShakeMap
shakemap = ShakeGrid.load(shakefile, adjust='res')

##% Then subdivide to match smaller geodict
PGA = shakemap.getLayer('pga').subdivide(gdict).getData().astype(float)

'''
This leaves edges with values much lower than they should be (but not nodata)
causing problems on the edges in later calculations for ground failure
'''
plt.imshow(PGA)
plt.show()
Screen Shot 2019-12-30 at 1 28 17 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant