@@ -166,7 +166,7 @@ |
|
// optional flags |
Utils.passOptQuotedParam(agesParam, parameter(), flags); |
- |
+ |
// optional flags |
Utils.passOptQuotedParam(agesParam, parameter(), outputs); |
|
@@ -203,9 +203,9 @@ |
ObjFunc of = cosu().getObjFunc(name); |
|
double[] obsData = Utils.getData(data[0], |
- dataFolder, cal_start, cal_end); |
+ dataFolder, cal_start, cal_end, 0); |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end); |
+ double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end, 0); |
double result = of.eval(obsData, simData, parameter().getDouble("missing", -9999d)); |
result = Double.isNaN(result) ? -999.0 : result; |
|
@@ -215,9 +215,9 @@ |
ObjFunc of = cosu().getObjFunc(name); |
|
double[] obsData = Utils.getData(data[0], |
- dataFolder, cal_start, cal_end); |
+ dataFolder, cal_start, cal_end, 0); |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end); |
+ double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end, 0); |
double result = of.eval(obsData, simData, parameter().getDouble("missing", -9999d)); |
result = Double.isNaN(result) ? -999.0 : result; |
|
@@ -159,9 +159,9 @@ |
// } |
|
double[] obsData = Utils.getData(data[0], |
- dataFolder, cal_start, cal_end); |
+ dataFolder, cal_start, cal_end, 0); |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end); |
+ double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end, 0); |
double result = of.eval(obsData, simData, parameter().getDouble("missing", -9999d)); |
result = Double.isNaN(result) ? -999.0 : result; |
|
@@ -133,9 +133,9 @@ |
ObjFunc of = cosu().getObjFunc(name); |
|
double[] obsData = Utils.getData(data[0], |
- dataFolder, cal_start, cal_end); |
+ dataFolder, cal_start, cal_end, 10); |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end); |
+ double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end, 10); |
double result = of.eval(obsData, simData, parameter().getDouble("missing", -9999d)); |
result = Double.isNaN(result) ? -999.0 : result; |
|
@@ -133,9 +133,9 @@ |
ObjFunc of = cosu().getObjFunc(name); |
|
double[] obsData = Utils.getData(data[0], |
- dataFolder, cal_start, cal_end); |
+ dataFolder, cal_start, cal_end, 0); |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end); |
+ double[] simData = Utils.getData(data[1], workspace().getDir(), cal_start, cal_end, 0); |
double result = of.eval(obsData, simData, parameter().getDouble("missing", -9999d)); |
result = Double.isNaN(result) ? -999.0 : result; |
|
@@ -622,11 +622,12 @@ |
* @param workspace |
* @param start |
* @param end |
+ * @param timestep |
* @return |
* @throws IOException |
*/ |
public static double[] getData(String d, File workspace, |
- String start, String end) throws IOException { |
+ String start, String end, int timestep) throws IOException { |
if (d == null) { |
throw new IllegalArgumentException("Missing data property: " + d); |
} |
@@ -635,16 +636,17 @@ |
throw new IllegalArgumentException("invalid: " + d + " expected:: <file>/<table>/<column>"); |
} |
|
-// System.out.println(Arrays.toString(parts)); |
+// System.out.println(Arrays.toString(parts)); |
CSTable t = DataIO.table(new File(workspace, parts[FILE]), parts[TABLE]); |
|
Date startDate = Conversions.convert(start, Date.class); |
Date endDate = Conversions.convert(end, Date.class); |
|
-// System.out.println(startDate); |
-// System.out.println(endDate); |
+// System.out.println(startDate); |
+// System.out.println(endDate); |
double[] vals = DataIO.getColumnDoubleValuesInterval(startDate, endDate, t, |
- parts[COLUMN], DataIO.DAILY); |
+ parts[COLUMN], timestep); |
+// System.out.println(" --> "+ vals.length); |
|
return vals; |
} |
@@ -660,7 +662,7 @@ |
public static void main(String[] args) throws IOException { |
// small test |
//double[] d = getData("obs_data02_14.csv/obs/orun[1]", new File("/tmp"), "2002-01-18", "2002-02-18"); |
- double[] d = getData("orun.csv/observed/orun[1]", new File("/tmp/csip/bin/ages/data/EAGLE"), "2008-01-18", "2008-02-18"); |
+ double[] d = getData("orun.csv/observed/orun[1]", new File("/tmp/csip/bin/ages/data/EAGLE"), "2008-01-18", "2008-02-18", DataIO.DAILY); |
System.out.println(Arrays.toString(d)); |
// d(); |
} |