Example #1
0
  public static void writeTimeSeriesData(Config config, CsvData csv, HecDss dssFile, String file)
      throws Exception {
    TimeSeriesContainer ts = new TimeSeriesContainer();

    ts.fullName = config.path;
    ts.fileName = file;

    ts.times = new int[csv.data.size()];
    for (int i = 0; i < csv.data.size(); i++) {
      ts.times[i] = calcTime(csv.data.get(i).name, i == 0 ? true : false);
    }
    ts.startTime = ts.times[0];
    ts.endTime = ts.times[ts.times.length - 1];

    ts.values = csv.columns[0];
    ts.numberValues = ts.values.length;

    if (config.getParameter() != null) {
      ts.parameter = config.getParameter(); // partE;
    }
    if (config.getLocation() != null) {
      ts.location = config.getLocation(); // partE;
    }

    ts.type = config.getXtype();
    ts.units = config.getUnits();

    dssFile.put(ts);
  }
Example #2
0
  public static void writePairedData(Config config, CsvData data, HecDss dssFile) throws Exception {

    PairedDataContainer pdc = new PairedDataContainer();

    if (config.label != null) {
      pdc.labels = new String[] {"", config.label};
    }
    if (config.date != null) {
      pdc.date = config.date;
    }

    if (config.location != null) {
      pdc.location = config.location;
    }

    if (config.xunits != null) {
      pdc.xunits = config.xunits;
    }

    if (config.xtype != null) {
      pdc.xtype = pdc.xtype;
    }

    if (config.xparameter != null) {
      pdc.xparameter = pdc.xparameter;
    }

    pdc.xOrdinate = config.xOrdinate;

    if (config.yunits != null) {
      pdc.yunits = config.yunits;
    }

    if (config.ytype != null) {
      pdc.ytype = config.ytype;
    }

    if (config.yparameter != null) {
      pdc.yparameter = config.yparameter;
    }

    pdc.yOrdinate = config.yOrdinate;

    pdc.fullName = config.path;

    pdc.xOrdinates = data.firstColumn;
    pdc.yOrdinates = data.columns;

    pdc.numberCurves = config.numberCurves;
    pdc.numberOrdinates = pdc.xOrdinates.length;

    dssFile.put(pdc);
  }