groops-devs / groops

A software toolkit for gravity field recovery and GNSS processing
GNU General Public License v3.0
178 stars 106 forks source link

Question about function "GriddedData::isValid()" in file "girddedData.cpp" #238

Closed MrSoul8715 closed 7 months ago

MrSoul8715 commented 7 months ago

Hi, I've meet some problem when reading code "GriddedData::isValid()" in file "girddedData.cpp". In this function, the test "values.at(idx).size() != points.size()" seems to be wrong. Can someone explain why thest two values need to be equal? The correct test seems to be "values.size() != points.size()". Thanks for reading.

akvas commented 7 months ago

Hi @MrSoul8715,

values is a nested vector< vector<Double> > (https://github.com/groops-devs/groops/blob/e96877132ebb5380845222e635499cc400020522/source/base/griddedData.h#L34), where the first index (values.at(firstIdx)) refers to the quantity (e.g., station displacements, water storage anomalies, ...) and the second index (values.at(firstIdx).at(secondIdx)) refers to the value of the quantity for the point points.at(secondIdx).

Hope this helps!

Cheers, Andreas

MrSoul8715 commented 7 months ago

Thanks for your reply! Now, I understand those codes better.