Skip to content

Commit

Permalink
Modified Azimuth angle Geodetic class to reflect that accept 0 to 360…
Browse files Browse the repository at this point in the history
… longitude as input, and corrected documentation.
  • Loading branch information
mjtueros committed Oct 17, 2024
1 parent 9798b1e commit 1feb809
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion grand/geo/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ class Geodetic(GeodeticRepresentation):
Longitude: Angle east and west of the Prime Meridian. The Prime Meridian
is a north-south line that passes through Greenwich, UK.
+ve to the east of the Prime Meridian, -ve to the west.
Range: -180 deg to +180 deg.
Range: 0 deg to 360 deg positive or negative.
Note that coordinate transformation is possible for +ve 0 to 360 deg.
So negative values are changed to positive by adding 360.
Height: Also called altitude or elevation, this represents the height above
the Earth ellipsoid, measured in meters. The Earth ellipsoid is a
mathematical surface defined by a semi-major axis and a semi-minor axis.
Expand Down Expand Up @@ -702,6 +704,10 @@ def __init__(

if isinstance(latitude, (Number, np.ndarray)):
# use setter to replace placeholder coordinates values with the real values.
# RK: +ve 0 to 360 were only accepted for coordinate transformation.
# Now both +ve and -ve values are accepted for longitudes.
longitude = 360+longitude if longitude<0 else longitude

self.latitude = latitude
self.longitude = longitude
self.height = height
Expand Down
2 changes: 2 additions & 0 deletions grand/sim/detector/process_ant.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ def compute_voltage(
# frame is shower frame. self.frame is antenna frame.
logger.debug(f"pos {self.pos}")
if (not np.all(np.isfinite(self.pos))) or (not np.all(np.isfinite(frame))): # which one
print("pos",self.pos)
print("frame",frame)
raise MissingFrameError("missing antenna or shower frame")

# Compute the voltage. input fft_leff and field are in shower frame.
Expand Down
2 changes: 2 additions & 0 deletions grand/sim/efield2voltage.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ def compute_voc_du(self, du_idx):

# ----- antenna responses -----
# compute_voltage() --> return Voltage(t=t, V=volt_t)
print("here frame",self.evt_shower.frame)

self.voc[du_idx, 0] = self.ant_leff_sn.compute_voltage(
self.evt_shower.maximum, efield_idx, self.evt_shower.frame
).V
Expand Down

0 comments on commit 1feb809

Please sign in to comment.