Skip to content

Commit

Permalink
add warnings for BeamGrid depends on its beam solid angle.
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-takase committed Apr 23, 2024
1 parent 9171ad3 commit b940382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grasp2alm/beam_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __post_init__(self):

beam_solid_angle_rad = (np.cos(np.deg2rad(self.ys)) - np.cos(np.deg2rad(self.ye))) * (np.deg2rad(self.xe) - np.deg2rad(self.xs))
if not np.isclose(beam_solid_angle_rad, 2.0*np.pi) and not np.isclose(beam_solid_angle_rad, 4.0*np.pi):
warnings.warn("Warning: beam solid angle is not 2pi or 4pi because BeamGrid has xs={xs}, xe={xe}, ys={ys} and ye={ye}. The header should be checked.")
warnings.warn(f"Warning: beam solid angle is not 2pi or 4pi because BeamGrid has xs={self.xs}, xe={self.xe}, ys={self.ys} and ye={self.ye}. The header should be checked.")

line = fi.readline().split()
self.nx = int(line[0])
Expand Down

0 comments on commit b940382

Please sign in to comment.