<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Vince,<div><br></div><div>Thanks for the hint.&nbsp;</div><div><br></div><div>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</div><div><br></div><div>shake@phantom:~/opt/shakemap/bin$ ./shake -event newtest<br>grind: Predictive map: no data in '/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../data/newtest/input'<br>grind: Using fixed boundary 5.6 45.6 10.8 47.8<br>grind: 47.8:45.6:10.8:5.6<br>grind:<br><br>arg &lt;lats&gt; must be an array ref at /rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../perl/lib/Shake/GMPE/SwissNGA.pm line 309<br>shake: Error in grind: 65280<br></div><div><br></div><div>(originally, the error had to do with &lt;lons&gt;, now it is &lt;lats&gt;)</div><div><br></div><div>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.)&nbsp;</div><div><br></div><div>Thanks,</div><div>Georgia</div><div><br></div><div><br></div><div><br><div><div>On Dec 15, 2010, at 4:43 PM, Vince Quitoriano wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>I've run into this problem before when using the site correction function<br>in HazusPGV.pm instead of rolling my own. In HazusPGV.pm, the<br>functions siteCorrectList and siteCorrectGrid will throw an exception when<br>they get no points, so you need to catch that possibility before you call<br>them from within your own module. If you look at the other GMPEs that<br>use HAZUS, they all say something like:<br><br>sub siteCorrectList {<br> &nbsp;my ($self, $type, $direction, $amps, $lons, $lats, $vels, $outdir,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$gmtbin, $verbose) = @_;<br> &nbsp;return [] if (!defined $amps or @$amps &lt;= 0); #### Avoid exception<br><br>#-------------------------------------------------------------------------<br> &nbsp;# Call the HazusPGV module to do the site corrections<br>#-------------------------------------------------------------------------<br> &nbsp;return $self-&gt;{hazus}-&gt;siteCorrectList(@_);<br>}<br><br>Hope that helps,<br>--<br>Vince Quitoriano (<a href="mailto:vinceq@usgs.gov">vinceq@usgs.gov</a>)<br>USGS Did You Feel It?<span class="Apple-tab-span" style="white-space:pre">        </span><a href="http://earthquake.usgs.gov/earthquakes/dyfi">http://earthquake.usgs.gov/earthquakes/dyfi</a><br>USGS ShakeMaps:<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>http://earthquake.usgs.gov/earthquakes/shakemap<br><br>On 12/15/10 5:57 AM, Georgia Cua wrote:<br><blockquote type="cite">Dear Bruce,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm trying to code a new GMPE module for our ShakeMap v3.5 installation<br></blockquote><blockquote type="cite">in Switzerland. It has the functional form of Cua and Heaton<br></blockquote><blockquote type="cite">(unpublished) constrained with Swiss weak motion data and NGA strong<br></blockquote><blockquote type="cite">motion data, and should be valid in the magnitude range 2 &lt;= M &lt;= 8.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I have written the new module (SwissNGA.pm) based on Small.pm (because<br></blockquote><blockquote type="cite">it uses Rjb as a distance measure) and MA2005.pm (because it does not<br></blockquote><blockquote type="cite">have a GMPE-spefic site amplification approach, and should thus use the<br></blockquote><blockquote type="cite">Hazus module).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Essentially the new module is Small.pm with a few lines/subroutines<br></blockquote><blockquote type="cite">replaced with portions of MA2005.pm (from Constructor, and subroutines<br></blockquote><blockquote type="cite">siteCorrectGrd, siteCorrectList), and of course, changing the<br></blockquote><blockquote type="cite">calculation of the regression equation.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">In theory, should this result in a working module, or is the basic<br></blockquote><blockquote type="cite">approach flawed?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I have installed the new module and tried running it on a scenario event<br></blockquote><blockquote type="cite">(just event information, no PGM observations), resulting in the<br></blockquote><blockquote type="cite">following error<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">shake@phantom:~/opt/shakemap/bin$ ./shake -event newtest -verbose<br></blockquote><blockquote type="cite">shake: Running:<br></blockquote><blockquote type="cite">'/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../bin/grind -event<br></blockquote><blockquote type="cite">newtest -qtm -lonspan 5.5 -boundcheck -xml -lonspan 5.5 -psa'<br></blockquote><blockquote type="cite">grind: Predictive map: no data in<br></blockquote><blockquote type="cite">'/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../data/newtest/input'<br></blockquote><blockquote type="cite">grind: Using fixed boundary 5.6 45.6 10.8 47.8<br></blockquote><blockquote type="cite">grind: 47.8:45.6:10.8:5.6<br></blockquote><blockquote type="cite">grind:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">arg &lt;lons&gt; must be an array ref at<br></blockquote><blockquote type="cite">/rdsk/projects/shake/opt/shakemap-3.5-vanilla/bin/../perl/lib/Shake/GMPE/SwissNGA.pm<br></blockquote><blockquote type="cite">line 306<br></blockquote><blockquote type="cite">shake: Error in grind: 65280<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is the approach of basing the new module primarily on Small.pm (with<br></blockquote><blockquote type="cite">portions from MA2005.pm) a valid approach, or are there some subtleties<br></blockquote><blockquote type="cite">that I am completely bulldozing over? Do you have any more detailed<br></blockquote><blockquote type="cite">documentation/instructions for writing new modules?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Sorry if this is not the type of question to be sending to the developer<br></blockquote><blockquote type="cite">list!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks,<br></blockquote><blockquote type="cite">Georgia<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">PS. the new module SwissNGA.pm is attached<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">Shake-dev mailing list<br></blockquote><blockquote type="cite">Shake-dev@geohazards.usgs.gov<br></blockquote><blockquote type="cite">https://geohazards.usgs.gov/mailman/listinfo/shake-dev<br></blockquote>_______________________________________________<br>Shake-dev mailing list<br>Shake-dev@geohazards.usgs.gov<br>https://geohazards.usgs.gov/mailman/listinfo/shake-dev<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><br class="Apple-interchange-newline"><br class="khtml-block-placeholder"></div><div>-----------------------------</div><div>Dr. Georgia Cua</div><div>Swiss Seismological Service</div><div>Institute of Geophysics</div><div>ETH Zurich, NO H61</div><div>Sonneggstr 5</div><div>CH-8092 Zurich</div><div>Switzerland</div><div><br class="khtml-block-placeholder"></div><div>Tel:&nbsp; +41-44-633-7574&nbsp; &nbsp;</div><div>Fax: +41-44-633-1065&nbsp; &nbsp;</div><div><br class="khtml-block-placeholder"></div><div><a href="mailto:georgia.cua@sed.ethz.ch">georgia.cua@sed.ethz.ch</a></div><div>-----------------------------</div><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>