Skip to content

Commit

Permalink
#421 space-time weights file in DID incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed May 6, 2016
1 parent 78c3877 commit b6f7b36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ShapeOperations/GalWeight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ bool GalWeight::SaveDIDWeights(Project* project, int num_obs, std::vector<wxInt6

for (int cp=gal[orig_id].Size(); --cp >= 0;) {
int n_id = gal[orig_id][cp];
out << n_id + offset;
out << n_id + offset + 1; // n_id starts from 0, so add 1
if (cp > 0) out << " ";
}
out << endl;
Expand Down
2 changes: 1 addition & 1 deletion ShapeOperations/GwtWeight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bool GwtWeight::SaveDIDWeights(Project* project, int num_obs, std::vector<wxInt6
for (long nbr=0; nbr<gwt[orig_id].Size(); ++nbr) {
const GwtNeighbor& current = gwt[orig_id].elt(nbr);

int n_id = current.nbx + offset;
int n_id = current.nbx + offset + 1; // current.nbx starts from 0, so add 1

out << newids[i] << ' ' << n_id << ' ' << setprecision(9) << setw(18) << current.weight << endl;
}
Expand Down
10 changes: 5 additions & 5 deletions ShapeOperations/WeightUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ GalElement* WeightUtils::ReadGal(const wxString& fname,
msg << "range of 1 through " << num_obs << ".";
} else {
msg << " encountered which does not exist in field \"";
msg << key_field << " of the Table.";
msg << key_field << "\" of the Table.";
}
LOG_MSG(msg);
wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR);
Expand Down Expand Up @@ -288,15 +288,15 @@ GalElement* WeightUtils::ReadGal(const wxString& fname,
if (it == id_map.end()) {
wxString msg = "On line ";
msg << line_cnt << " of weights file, observation id ";
msg << obs;
msg << neigh;
if (use_rec_order) {
msg << " encountered which is out of allowed ";
msg << "observation ";
msg << "range of 1 through " << num_obs << ".";
} else {
msg << " encountered which does not exist ";
msg << "in field \"" << key_field;
msg << " of the Table.";
msg << "\" of the Table.";
}
LOG_MSG(msg);
wxMessageDialog dlg(NULL, msg, "Error",
Expand Down Expand Up @@ -521,7 +521,7 @@ GalElement* WeightUtils::ReadGwtAsGal(const wxString& fname,
msg << "range of 1 through " << num_obs << ".";
} else {
msg << " encountered which does not exist in field \"";
msg << key_field << " of the Table.";
msg << key_field << "\" of the Table.";
}
LOG_MSG(msg);
wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR);
Expand Down Expand Up @@ -728,7 +728,7 @@ GwtElement* WeightUtils::ReadGwt(const wxString& fname,
msg << "range of 1 through " << num_obs << ".";
} else {
msg << " encountered which does not exist in field \"";
msg << key_field << " of the Table.";
msg << key_field << "\" of the Table.";
}
LOG_MSG(msg);
wxMessageDialog dlg(NULL, msg, "Error", wxOK | wxICON_ERROR);
Expand Down

0 comments on commit b6f7b36

Please sign in to comment.