[Shake-dev] developing new GMPE module for ShakeMap v3.5

Georgia Cua georgia.cua at sed.ethz.ch
Thu Dec 16 12:25:00 UTC 2010


Hi Vince,

Thanks for the hint. 

I replaced the subroutine siteCorrectList in my new module with what you attached (I'm not sure whether that was what you were suggesting), and have a different error now

shake at phantom:~/opt/shakemap/bin$ ./shake -event newtest
grind: Predictive map: no data in '/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../data/newtest/input'
grind: Using fixed boundary 5.6 45.6 10.8 47.8
grind: 47.8:45.6:10.8:5.6
grind:

arg <lats> must be an array ref at /rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../perl/lib/Shake/GMPE/SwissNGA.pm line 309
shake: Error in grind: 65280

(originally, the error had to do with <lons>, now it is <lats>)

Do you have a GMPE module that uses Rjb and HAZUS for site corrections? Maybe I could use that as my starting template instead? (Of the modules included in the distribution, only MA2005.pm seemed to use HAZUS, and it does not use Rjb.) 

Thanks,
Georgia



On Dec 15, 2010, at 4:43 PM, Vince Quitoriano wrote:

> 
> I've run into this problem before when using the site correction function
> in HazusPGV.pm instead of rolling my own. In HazusPGV.pm, the
> functions siteCorrectList and siteCorrectGrid will throw an exception when
> they get no points, so you need to catch that possibility before you call
> them from within your own module. If you look at the other GMPEs that
> use HAZUS, they all say something like:
> 
> sub siteCorrectList {
>  my ($self, $type, $direction, $amps, $lons, $lats, $vels, $outdir,
>      $gmtbin, $verbose) = @_;
>  return [] if (!defined $amps or @$amps <= 0); #### Avoid exception
> 
> #-------------------------------------------------------------------------
>  # Call the HazusPGV module to do the site corrections
> #-------------------------------------------------------------------------
>  return $self->{hazus}->siteCorrectList(@_);
> }
> 
> Hope that helps,
> --
> Vince Quitoriano (vinceq at usgs.gov)
> USGS Did You Feel It?	http://earthquake.usgs.gov/earthquakes/dyfi
> USGS ShakeMaps:		http://earthquake.usgs.gov/earthquakes/shakemap
> 
> On 12/15/10 5:57 AM, Georgia Cua wrote:
>> Dear Bruce,
>> 
>> I'm trying to code a new GMPE module for our ShakeMap v3.5 installation
>> in Switzerland. It has the functional form of Cua and Heaton
>> (unpublished) constrained with Swiss weak motion data and NGA strong
>> motion data, and should be valid in the magnitude range 2 <= M <= 8.
>> 
>> I have written the new module (SwissNGA.pm) based on Small.pm (because
>> it uses Rjb as a distance measure) and MA2005.pm (because it does not
>> have a GMPE-spefic site amplification approach, and should thus use the
>> Hazus module).
>> 
>> Essentially the new module is Small.pm with a few lines/subroutines
>> replaced with portions of MA2005.pm (from Constructor, and subroutines
>> siteCorrectGrd, siteCorrectList), and of course, changing the
>> calculation of the regression equation.
>> 
>> In theory, should this result in a working module, or is the basic
>> approach flawed?
>> 
>> I have installed the new module and tried running it on a scenario event
>> (just event information, no PGM observations), resulting in the
>> following error
>> 
>> shake at phantom:~/opt/shakemap/bin$ ./shake -event newtest -verbose
>> shake: Running:
>> '/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../bin/grind -event
>> newtest -qtm -lonspan 5.5 -boundcheck -xml -lonspan 5.5 -psa'
>> grind: Predictive map: no data in
>> '/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../data/newtest/input'
>> grind: Using fixed boundary 5.6 45.6 10.8 47.8
>> grind: 47.8:45.6:10.8:5.6
>> grind:
>> 
>> arg <lons> must be an array ref at
>> /rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../perl/lib/Shake/GMPE/SwissNGA.pm
>> line 306
>> shake: Error in grind: 65280
>> 
>> Is the approach of basing the new module primarily on Small.pm (with
>> portions from MA2005.pm) a valid approach, or are there some subtleties
>> that I am completely bulldozing over? Do you have any more detailed
>> documentation/instructions for writing new modules?
>> 
>> Sorry if this is not the type of question to be sending to the developer
>> list!
>> 
>> Thanks,
>> Georgia
>> 
>> PS. the new module SwissNGA.pm is attached
>> 
>> 
>> 
>> _______________________________________________
>> Shake-dev mailing list
>> Shake-dev at geohazards.usgs.gov
>> https://geohazards.usgs.gov/mailman/listinfo/shake-dev
> _______________________________________________
> Shake-dev mailing list
> Shake-dev at geohazards.usgs.gov
> https://geohazards.usgs.gov/mailman/listinfo/shake-dev



-----------------------------
Dr. Georgia Cua
Swiss Seismological Service
Institute of Geophysics
ETH Zurich, NO H61
Sonneggstr 5
CH-8092 Zurich
Switzerland

Tel:  +41-44-633-7574   
Fax: +41-44-633-1065   

georgia.cua at sed.ethz.ch
-----------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20101216/aef72bdc/attachment.html>


More information about the Shake-dev mailing list