[Shake-dev] Print grind

Bruce Worden cbworden at gmail.com
Thu Oct 18 15:59:48 UTC 2012


Hi Jordi,

To print the station code of the intensities as they are flagged, edit the program 'grind' and go to around line 2906 (this may vary somewhat depending on what revision of ShakeMap you are running -- if you have trouble locating the relevant lines, search for 'sub flag_stations_by_ipe' and scroll down a few lines). You should see something that looks like this:

  for($i = 0; $i < $n; $i++) {
    if (defined $obs->[$i] and $obs->[$i] !~ /NaN/i) {
      #---------------------------------------------------------------------
      # Beyond the GMPE's fitted range, we want to toss large data points
      # but not necessarily small ones
      #---------------------------------------------------------------------
      $d = $obs->[$i] - $ests->[$i];
      $mi_sd = $misda->[$i] * $outlier_level;
      if ($d > $mi_sd or ($d < -$mi_sd and $dists->[$i] < $bias_max_range)) {
        $sta = $stahp->{$cc->[$i]};
        $flagged{$sta->code}{intensity} = 1;
        $obs->[$i] = 'NaN';
        $nflagged++;
      }
    }
  }

Add a line something like this:

  for($i = 0; $i < $n; $i++) {
    if (defined $obs->[$i] and $obs->[$i] !~ /NaN/i) {
      #---------------------------------------------------------------------
      # Beyond the GMPE's fitted range, we want to toss large data points
      # but not necessarily small ones
      #---------------------------------------------------------------------
      $d = $obs->[$i] - $ests->[$i];
      $mi_sd = $misda->[$i] * $outlier_level;
      if ($d > $mi_sd or ($d < -$mi_sd and $dists->[$i] < $bias_max_range)) {
        $sta = $stahp->{$cc->[$i]};
        $flagged{$sta->code}{intensity} = 1;
printf "Flagging station '%s'\n", $sta->code;
        $obs->[$i] = 'NaN';
        $nflagged++;
      }
    }

That will print a line like:

Flagging station 'JZM'

Each time a station is flagged. Modify the printf line as you see fit.

Bruce

On Oct 18, 2012, at 5:56 AM, Roviró Pou, Jordi wrote:

> Hello,
> I need some help to know how can I do to show the flagged stations in every iteration, only for IPE, in the grind module.
> I try to use the Print option into the grind.pm code, but it’s so difficult for me (I've never worked with perl language.)
> My idea is to know which stations are flagged in each iteration to understand how it works the bias methodology.
>  
> The –verbose option explains to me:
>  
> Using IPE::Isard2008 for IPE
> Intensity Bias=-0.08
> 24 stations flagged out this iteration
> Intensity Bias=-0.05
> 0 stations flagged out this iteration
> Uncertainty computation skipped (no Intensity > 6.0)
>  
> I want to know which stations are.
> Thank you very much!
>  
>  
> 
> <image002.jpg>
> Jordi Roviró i Pou
> Unitat de Risc Sísmic
> Institut Geològic de Catalunya
> 
> Balmes, 209-211 | E-08006 Barcelona | Tel. 34 93 553 84 30 (2418)
> jroviro at igc.cat | www.igc.cat
>  
> _______________________________________________
> Shake-dev mailing list
> Shake-dev at geohazards.usgs.gov
> https://geohazards.usgs.gov/mailman/listinfo/shake-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20121018/06607f30/attachment-0001.html>


More information about the Shake-dev mailing list