Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
This repository was archived by the owner on Sep 15, 2026. It is now read-only.

Problem with ShakeGrid subdivide method on edges #138

Description

@kallstadt-usgs

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions