Align Einstein Telescope geometry with LAL#894
Align Einstein Telescope geometry with LAL#894milanwils wants to merge 4 commits intobilby-dev:mainfrom
Conversation
ColmTalbot
left a comment
There was a problem hiding this comment.
This is a nice change, I think we'll need to think a little about the best way to do this. I've suggested waiting a while to get this in as I don't think it is urgent, the labelling of ET2/ET3 doesn't really matter, and we can make the changes more satisfyingly if we break things.
| * 180 | ||
| / np.pi | ||
| ) | ||
| unit_vector_x = self[ii].geometry.unit_vector_along_arm("x") |
There was a problem hiding this comment.
I know this is not the change for the current code, but given that this is clearly better thought out than the current method, can the logic for updating the geometry be moved into a standalone function (with a nice docstring)?
There was a problem hiding this comment.
Perhaps we could add setters to the InterferometerGeometry class for x, y and vertex? For the lat, long, elevation, tilt and azimuth these setters are separate but it does not seem sensible to me that someone can change only one Cartesian coordinate.
All the update logic could then be moved into the geometry class and only the calculation of the new corner points (which is triangle specific) remains in the 'TriangularInterferometer` class.
My main concern with this is approach is that one would need to be careful to update the vertex position before changing the unit vector. Otherwise the calculation of tilt and azimuth is wrong. This could be avoided by making the unit vectors the "base information" and deriving the tilt and azimuth from it.
This also raises the question of whether the constructor should be adapted to allow users to define the detector directly from Cartesian parameters. I guess you could argue that this is actually the only way you should be able to set these parameters as interferometers are constant.
| yarm_azimuth, | ||
| xarm_tilt=0.0, | ||
| yarm_tilt=0.0, | ||
| clockwise=True, |
There was a problem hiding this comment.
I would personally vote for just making a breaking change here (and waiting for a major release) to avoid adding a new parameter that doesn't really mean anything (the set of three Interferometers are just a permutation of each other with the different directions).
There was a problem hiding this comment.
Fine by me, if people really want they can still override the detector names
| return np.array([x_comp, y_comp, z_comp]) | ||
|
|
||
|
|
||
| def get_vertex_position_ellipsoid(x_comp, y_comp, z_comp): |
There was a problem hiding this comment.
I feel like this function should take and recieve the fame type, either (float, float, float) -> (float, float, float) or array -> array. I don't really mind which, but it would be good to be consistent.
I now see that the same thing happens in get_vertex_position_geocentric. sigh, I'm not sure if it is worth changing the other function.
We could change the other function to something like
def get_vertex_position_geocentric(position, _longitude=None, _elevation=None):
if longitude is not None and not isarray(position):
WARN("... syntax changed in Bilby 3.0.0 ...")
position = np.array([position, _longitude, _elevation])
...This would need a wider set of eyes/opinions.
There was a problem hiding this comment.
I went through the exact same thought process when writing the function. This seems like a good compromise.
Problem
As mentioned in #713, the current geometry of the ET is not in line with its definition in LAL.
Proposed Solution
ET.interferometerfile toclockwise=Falseso that the default is consistent with LAL. If this is undesired for backwards compatibility, it could be set toclockwise=True.Additional information
. Only if both get accepted do the configurations become identical.
There is also a small error in the LAL config, see LAL PR