Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Discussion: Structure of parameters #1092

Closed
DominicOram opened this issue Jan 22, 2024 · 2 comments
Closed

Discussion: Structure of parameters #1092

DominicOram opened this issue Jan 22, 2024 · 2 comments
Assignees

Comments

@DominicOram
Copy link
Collaborator

As a developer I would like it to be easier to manage the internal and external parameters for plans. At the moment there are a number of issues with them such as:

  • There is a large amount of boilerplate
  • We're providing many parameters the plans might not need

Acceptance Criteria

  • We collectively write down the pros/cons of how we're managing this
  • We have a meeting to discuss
  • In the meeting a new architecture is created and documented
  • New tickets are made for implementation
@DominicOram
Copy link
Collaborator Author

  • We want the conversion between parameter types to be explicit, not based on magic string key interpretation
    Pseudo code:
class DiffractionExperiment(Model):
    visit: str
	file_name: str
	exposure_time_s: float
	comment: str = ""
	detector_distance_mm: float = None	

    def detector_params() -> DetectorParams:
	   abstract()
	
	def ispyb_params() -> IspybParams: #Soon to remove
	   abstract()

class ThingWithScan(Model):
	def scan_points() -> ScanSpec: 
	   abstract()

class CommonGrid(DiffractionExperiment):
	grid_width_um = GRID_SCAN_WIDTH
	exposure_time_s: float = GRID_SCAN_EXPOSURE_TIME
	use_roi_mode: bool = GRID_SCAN_USE_ROI
	transmission_frac: float = 1
	   
class GridScanWithEdgeDetect(CommonGrid):
	demand_energy_ev: float = None
	omega_start: float = None

class GridScan(CommonGrid, ThingWithScan):
	demand_energy_ev: float = None
	omega_start_deg: float = None
	x_step_size_um: float = APERTURE_SIZE
	y_step_size_um: float = APERTURE_SIZE
	z_step_size_um: float = APERTURE_SIZE
	
	x_steps: int
	y_steps: int
	z_steps: int
	
	x_start_um: float
	y1_start_um: float
	y2_start_um: float
	z1_start_um: float
	z2_start_um: float

    def FGS_params() -> FGSParams:
	    ...

class PinTipCentreThenXrayCentre(CommonGrid, DiffractionExperiment):
    omega_start_deg: float = None
	tip_offset_um: float = 0
	
class RotationScan(DiffractionExperiment, ThingWithScan):
    rotation_axis: Enum = "omega"
	omega_start_deg: float = None
	rotation_angle_deg: float
	rotation_increment_deg: float
	rotation_direction: Enum
	x_start_um: float = None
	y_start_um: float = None
	z_start_um: float = None
	transmission_frac : float
	
class RobotLoadThenCentre(CommonGrid, DiffractionExperiment):
	demand_energy_ev: float = None
	sample_puck: int
	sample_pin: int
	omega_start_deg:float = None
	

# Doesn't yet exist but will look something like this
class DoOneUDC(DiffractionExperiment, CommonGrid):
	""" Diffraction data is for grids at start"""
	demand_energy_ev: float = None
	rotation_exposure_s: float
	rotation_axis: Enum = "omega"
	rotation_angle_deg: float
	rotation_increment_deg: float
	rotation_direction: Enum
	sample_id: int # Will be used to work out puck/pin

@dperl-dls
Copy link
Collaborator

Now we have agreed on a model, new tracking issue for implementing changes: #1275

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants