RasterGridRequest: Clean-up unused methods
This commit is contained in:
@@ -6,11 +6,6 @@ from pydantic import Field, AfterValidator, BaseModel
|
||||
from aaredaqlib.coordinate import Coordinate, positive_coords, SmargonCoordinate
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
|
||||
|
||||
def normalize_angle(angle_deg: float) -> float:
|
||||
normalized_angle = math.fmod(angle_deg + 180, 360) - 180.0
|
||||
return normalized_angle
|
||||
|
||||
class RasterGridRequest(BaseModel):
|
||||
dtz: float | None = None
|
||||
transmission: float | None = None
|
||||
@@ -39,24 +34,6 @@ class RasterGridRequest(BaseModel):
|
||||
def start_pxl(self, geom: SampleGeometryModel) -> Coordinate:
|
||||
return geom.smargon_to_beamline(self.smargon.sh_mm)
|
||||
|
||||
def point_sample_belongs_to_grid(
|
||||
self, geom: SampleGeometryModel, i: Coordinate
|
||||
) -> bool:
|
||||
point = i - geom.smargon_to_beamline(self.smargon.sh_mm)
|
||||
return (0 <= point.x < self.n_x * self.grid_size_mm.x) and (
|
||||
0 <= point.y < self.n_y * self.grid_size_mm.y
|
||||
)
|
||||
|
||||
def grid_visible(self, geom: SampleGeometryModel) -> bool:
|
||||
if (
|
||||
abs(normalize_angle(self.omega_deg - geom.omega_deg)) < 1.0
|
||||
and abs(self.smargon.phi_deg - geom.smargon.phi_deg) < 1.0
|
||||
and abs(self.smargon.chi_deg - geom.smargon.chi_deg) < 1.0
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class CompletedRasterGrid(BaseModel):
|
||||
request: RasterGridRequest
|
||||
bkg_estimate: List[float]
|
||||
|
||||
Reference in New Issue
Block a user