Skip to content

Commit

Permalink
Use ParameterText for Kalman Filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Aug 24, 2015
1 parent 57418ec commit e42ddc0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ gridpp
gridpp_debug
gridpp_train
gridpp_train_debug
gridpp_kf
gridpp_kf_debug
*.nc
gmon.out
tags
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(BUILDDIR_D)/%.E : src/%.cpp $(INCS)
gridpp: $(OBJ_O) $(DRVOBJ_O) makefile
$(CC) $(CFLAGS_O) $(LFLAGS) $(OBJ_O) $(DRVOBJ_O) $(LIBS_O) -o $@

kalmanFilter: $(OBJ_O) $(KFOBJ_O) makefile
gridpp_kf: $(OBJ_O) $(KFOBJ_O) makefile
$(CC) $(CFLAGS_O) $(LFLAGS) $(OBJ_O) $(KFOBJ_O) $(LIBS_O) -o $@

gridpp_train: $(OBJ_O) $(TRAINOBJ_O) makefile
Expand All @@ -78,7 +78,7 @@ gridpp_train: $(OBJ_O) $(TRAINOBJ_O) makefile
gridpp_debug: $(OBJ_D) $(DRVOBJ_D) makefile gtest
$(CC) $(CFLAGS_D) $(LFLAGS) $(OBJ_D) $(DRVOBJ_D) $(LIBS_D) -o $@

kalmanFilter_debug: $(OBJ_D) $(KFOBJ_D) makefile gtest
gridpp_kf_debug: $(OBJ_D) $(KFOBJ_D) makefile gtest
$(CC) $(CFLAGS_D) $(LFLAGS) $(OBJ_D) $(KFOBJ_D) $(LIBS_D) -o $@

gridpp_train_debug: $(OBJ_D) $(TRAINOBJ_D) makefile gtest
Expand Down
8 changes: 4 additions & 4 deletions src/Driver/Kf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ int main(int argc, const char *argv[]) {
options.getValue("output", outputFilename);

KalmanFilter kf(Variable::T, 0.1);
ParameterFileSpatial dataFile = ParameterFileSpatial(dataFilename);
ParameterFileSpatial currFile = ParameterFileSpatial(currentFilename);
ParameterFileSpatial newFile = ParameterFileSpatial(newFilename);
ParameterFileSpatial outputFile = ParameterFileSpatial(outputFilename);
ParameterFileText dataFile(Options("file=" + dataFilename + " spatial=1"));
ParameterFileText currFile(Options("file=" + currentFilename + " spatial=1"));
ParameterFileText newFile(Options("file=" + newFilename + " spatial=1"));
ParameterFileText outputFile(Options("file=" + outputFilename + " spatial=1"));

std::vector<int> times = Util::combine(dataFile.getTimes(), currFile.getTimes());
std::vector<Location> locations = Util::combine(dataFile.getLocations(), currFile.getLocations());
Expand Down
1 change: 1 addition & 0 deletions src/ParameterFile/Netcdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ std::string ParameterFileNetcdf::description() {
ss << Util::formatDescription("-p netcdf", "Parameters stored in a Netcdf file. File must have contain: dimensions time, lat (or y), lon (or x), coeff; variables with dims: time[time], latitude[lat,lon], longitude[lat,lon], coefficients[time,lat,lon,coeff]. The number of parameters in a set must be constant and equals the size of the 'coeff' dimension.") << std::endl;
ss << Util::formatDescription(" dimName=coefficient", "What is the name of the dimension representing different coefficients?") << std::endl;
ss << Util::formatDescription(" varName=coeff", "What is the name of the variable containing the coefficients?") << std::endl;
ss << Util::formatDescription(" file=required", "Filename of file.") << std::endl;
return ss.str();
}

0 comments on commit e42ddc0

Please sign in to comment.