示例#1
0
  public void makeFiles(DateTime begin, double duration, String nsclSelectString, String mask) {
    cwbServer.query(begin, duration, nsclSelectString);
    if (cwbServer.hasNext()) {
      do {
        SacTimeSeries sac =
            makeTimeSeries(cwbServer.getNext(), begin, duration, this.fill, this.gaps, this.trim);
        if (sac != null) {
          if (this.event != null) {
            SacHeaders.setEventHeader(sac, this.event);
            if (this.picks) {
              if (this.synthetic == null) {
                SacHeaders.setPhasePicks(sac, this.event);
              } else {
                SacHeaders.setPhasePicks(sac, this.event, this.extendedPhases, this.synthetic);
              }
            } else {
              if (this.synthetic != null) {
                SacHeaders.setPhasePicks(sac, this.extendedPhases, this.synthetic);
              }
            }
          } else {
            if (this.customEvent != null) {
              SacHeaders.setEventHeader(
                  sac,
                  this.customEvent.getEventTime(),
                  this.customEvent.getEventLat(),
                  this.customEvent.getEventLon(),
                  this.customEvent.getEventDepth(),
                  this.customEvent.getEventMag(),
                  this.customEvent.getEventMagType().magNum(),
                  this.customEvent.getEventType().eventTypeNum());
            }
            if (this.synthetic != null) {
              SacHeaders.setPhasePicks(sac, this.extendedPhases, this.synthetic);
            }
          }

          outputFile(sac, begin, mask, this.pzunit);
        } else {
          // TODO logger message about null data
        }
      } while (cwbServer.hasNext());
    } else {
      logger.info(
          String.format(
              "No matching data for \"%s\", at begin time %s, duration %.2fs, on %s:%d",
              nsclSelectString,
              begin.toString("YYYY/MM/dd HH:mm:ss"),
              duration,
              cwbServer.getHost(),
              cwbServer.getPort()));
    }
  }