/** * This creates the lists of mags and non-zero rates (above minMag). * * @param magFreqDist */ private void setAll(HypoMagFreqDistAtLoc hypoMagFreqDistAtLoc) { // make list of non-zero rates and mags (if mag >= minMag) mags = new ArrayList(); rates = new ArrayList(); rakes = new ArrayList(); dips = new ArrayList(); IncrementalMagFreqDist[] magFreqDists = hypoMagFreqDistAtLoc.getMagFreqDistList(); FocalMechanism[] focalMechanisms = hypoMagFreqDistAtLoc.getFocalMechanismList(); for (int i = 0; i < magFreqDists.length; i++) { FocalMechanism focalMech = focalMechanisms[i]; IncrementalMagFreqDist magFreqDist = magFreqDists[i]; for (int m = 0; m < magFreqDist.getNum(); m++) { if (magFreqDist.getY(m) > 0 && magFreqDist.getX(m) >= minMag) { mags.add(new Double(magFreqDist.getX(m))); rates.add(new Double(magFreqDist.getY(m))); rakes.add(new Double(focalMech.getRake())); dips.add(new Double(focalMech.getDip())); } } } }
/** * This constructor takes a HypoMagFreqDistAtLoc object, depth as a function of mag * (aveRupTopVersusMag), and a default depth (defaultHypoDepth). The depth of each point source is * set according to the mag using the aveRupTopVersusMag function; if mag is below the minimum x * value of this function, then defaultHypoDepth is applied. Note that the depth value in * HypoMagFreqDistAtLoc.getLocation() is ignored here (that location is cloned here and the depth * is overwritten). This sets the source as Poissonian */ public PointEqkSource( HypoMagFreqDistAtLoc hypoMagFreqDistAtLoc, ArbitrarilyDiscretizedFunc aveRupTopVersusMag, double defaultHypoDepth, double duration, double minMag) { this.aveRupTopVersusMag = aveRupTopVersusMag; this.defaultHypoDepth = defaultHypoDepth; this.duration = duration; this.minMag = minMag; this.isPoissonian = true; this.location = hypoMagFreqDistAtLoc.getLocation().clone(); this.setAll(hypoMagFreqDistAtLoc); this.variableDepthRakeAndDip = true; probEqkRupture = new ProbEqkRupture(); }