/**
   * This methods makes the GCIM results in a string for output to either console or external window
   */
  public String getGcimResultsString() {

    for (int i = 0; i < numIMi; i++) {

      HashMap<TectonicRegionType, ScalarIMR> imriMap = imiAttenRels.get(i);
      ScalarIMR firstIMRiFromMap = TRTUtils.getFirstIMR(imriMap);

      GcimResultsString += "----------------------" + "\n";
      // Get the IM name for printing
      if (firstIMRiFromMap.getIntensityMeasure().getName() == SA_Param.NAME) {
        GcimResultsString +=
            "Results for SA period: "
                + ((SA_Param) firstIMRiFromMap.getIntensityMeasure()).getPeriodParam().getValue()
                + "\n";
      } else if (firstIMRiFromMap.getIntensityMeasure().getName() == SA_InterpolatedParam.NAME) {
        GcimResultsString +=
            "Results for SA Interpolated period: "
                + ((SA_InterpolatedParam) firstIMRiFromMap.getIntensityMeasure())
                    .getPeriodInterpolatedParam()
                    .getValue()
                + "\n";
      } else {
        GcimResultsString +=
            "Results for " + firstIMRiFromMap.getIntensityMeasure().getName() + "\n";
      }
      for (int j = 0; j < zApprox.length; j++) {
        GcimResultsString += imiArray[j][i] + "\t" + cdfIMi_IMjArray[j][i] + "\n";
      }
      GcimResultsString += "----------------------" + "\n";
      GcimResultsString += "\n";
    }
    return GcimResultsString;
  }
 private static void setSAPeriodInIMR(ScalarIMR imr, double period) {
   ((Parameter<Double>) imr.getIntensityMeasure())
       .getIndependentParameter(PeriodParam.NAME)
       .setValue(new Double(period));
 }