-
Notifications
You must be signed in to change notification settings - Fork 17
Issue 1211 - Implements 3D receiver IO and IO tests for receivers #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments.
specfem::utilities::is_close(this->x, other.x) && | ||
specfem::utilities::is_close(this->z, other.z) && | ||
specfem::utilities::is_close(this->angle, other.angle); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can 2 receivers have same station and network name but have different locations/angle? Should this be a assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really only used for checking the read-in stations in the unit tests, I'm not sure whether there is a different use case. If you just want to check whether receivers share the same station name or just the same location, the approach should be slightly different maybe implementing a new a method like same_code(other)
or same_location(other)
We could implement a function that weeds out potential duplicates, or throws an error if a vector of receivers contains two receivers of the same angle and location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I am wondering we should throw a runtime error if stations have same name but different location/angle. It's more to do with symantics of operator==. For example, what would be the expected behavior when someone uses the function outside of test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, understood! Yes i agree.
bool specfem::receivers::receiver<specfem::dimension::type::dim3>::operator==( | ||
const receiver &other) const { | ||
return (this->network_name == other.network_name) && | ||
(this->station_name == other.station_name) && | ||
specfem::utilities::is_close(this->x, other.x) && | ||
specfem::utilities::is_close(this->y, other.y) && | ||
specfem::utilities::is_close(this->z, other.z); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as 2D
Description
This PR
io/sources
tests to include source file and yaml node reading.read_receivers
->read_2d_receivers
read_3d_receivers
STATIONS
file reading and yaml node reading for receiversIssue Number
Closes #1211
Checklist
Please make sure to check developer documentation on specfem docs.