[Shake-dev] ShakeMap bug fixes

Peter Lombard lombard at seismo.berkeley.edu
Fri Feb 13 19:11:48 GMT 2009


Kuo-Wan,

I have found a bug in the ShakeMap program db2xml. This program is used to
query a CISN-style database to extract ground motion data and generate a
db_dig.xml file in an event input directory. Until recently this code was
probably used only at Caltech; as CISN software is being adopted by other
regional networks, db2xml will see more use.

The bug is that a regular expression so search a unit string for velocity
units like "cms" also matches the acceleration string "cmss". The result is
that psa values are being transformed incorrectly.

While I was at it, I cleaned up the code formatting and added a few
comments. Attached is the new db2xml.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db2xml
Type: application/octet-stream
Size: 14129 bytes
Desc: not available
Url : http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20090213/81f999ea/attachment-0004.obj 
-------------- next part --------------

I also found some problems in two perl modules in perl/lib/Shake. Both
Event.pm and Source.pm did not handle leapseconds correctly. The CISN-style
database has provision for leapseconds, so ShakeMap needs to handle them
properly. Attached are the two modified codes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Event.pm
Type: application/octet-stream
Size: 4658 bytes
Desc: not available
Url : http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20090213/81f999ea/attachment-0005.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Source.pm
Type: application/octet-stream
Size: 11516 bytes
Desc: not available
Url : http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20090213/81f999ea/attachment-0006.obj 
-------------- next part --------------

Finally, I modified retrieve to print out the time that it starts and
finishes. This is useful for diagnosing delays in ShakeMap.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: retrieve
Type: application/octet-stream
Size: 5575 bytes
Desc: not available
Url : http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20090213/81f999ea/attachment-0007.obj 
-------------- next part --------------


Hopefully these changes will make their way into any upcoming ShakeMap
release.

Pete


More information about the Shake-dev mailing list