Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cog/commands/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def calibrate(
phi,
geometry,
pathToImages,
format="RayonixMX340",
resolution=2.0,
spot_profile=(6, 4, 4),
inpfile="calibrate.inp",
Expand All @@ -27,6 +28,8 @@ def calibrate(
Experimental geometry from which to initialize refinement
pathToImages : str
Path to directory containing the MCCD images
format : string (optional)
Image format to use by Precognition
resolution : float
High-resolution limit in angstroms
spot_profile : tuple(length, width, sigma-cut)
Expand Down Expand Up @@ -60,7 +63,7 @@ def calibrate(
f"Input\n"
f" Crystal 0.05 0.05 0.05 0.05 0.05 0.05 free\n"
f" Distance 0.05 free\n"
f" Format RayonixMX340\n"
f" Format {format}\n"
f" Resolution {resolution} 100\n"
f" Wavelength 1.02 1.18\n"
f" Spot {spot_profile[0]} {spot_profile[1]} {spot_profile[2]}\n"
Expand Down
5 changes: 4 additions & 1 deletion cog/commands/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def index(
spacegroup=None,
distance=None,
center=None,
format="RayonixMX340",
phi=0.0,
resolution=2.0,
spot_profile=(6, 4, 4),
Expand All @@ -34,6 +35,8 @@ def index(
Detector distance in mm
center : tuple(center_x, center_y)
Coordinates of beam center in pixels
format : string (optional)
Image format to use by Precognition
phi : float
Phi angle of goniometer
resolution : float
Expand Down Expand Up @@ -79,7 +82,7 @@ def index(
f" Pixel 0.08854 0.08854\n"
f" Omega 0 0\n"
f" Goniometer 0 0 {phi}\n"
f" Format RayonixMX340\n"
f" Format {format}\n"
f"{matrixline}"
f" Image {image}\n"
f" Resolution {resolution:.2f} 100\n"
Expand Down
5 changes: 4 additions & 1 deletion cog/commands/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def refine(
phi,
geometry,
pathToImages,
format="RayonixMX340",
resolution=2.0,
spot_profile=(6, 4, 4),
inpfile="refine.inp",
Expand All @@ -28,6 +29,8 @@ def refine(
Experimental geometry from which to initialize refinement
pathToImages : str
Path to directory containing the MCCD images
format : string (optional)
Image format to use by Precognition
resolution : float
High-resolution limit in angstroms
spot_profile : tuple(length, width, sigma-cut)
Expand Down Expand Up @@ -61,7 +64,7 @@ def refine(
f"Input\n"
f" Crystal 0.05 0.05 0.05 0.05 0.05 0.05 free\n"
f" Distance 0.05 free\n"
f" Format RayonixMX340\n"
f" Format {format}\n"
f" Omega 0 0\n"
f" prompt off\n"
f" result off\n\n"
Expand Down
5 changes: 4 additions & 1 deletion cog/commands/softlimits.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def softlimits(
spacegroup=None,
distance=None,
center=None,
format="RayonixMX340",
resolution=2.0,
spot_profile=(10, 5, 2.0),
inpfile="limits.inp",
Expand All @@ -31,6 +32,8 @@ def softlimits(
Detector distance in mm
center : tuple(center_x, center_y)
Coordinates of beam center in pixels
format : string (optional)
Image format to use by Precognition
resolution : float
High-resolution limit in angstroms
spot_profile : tuple(length, width, sigma-cut)
Expand Down Expand Up @@ -62,7 +65,7 @@ def softlimits(
f" Pixel 0.0886 0.0886\n"
f" Omega 0 0\n"
f" Goniometer 0 0 0\n"
f" Format RayonixMX340\n"
f" Format {format}\n"
f" Image {image}\n"
f" Resolution {resolution:.2f} 100\n"
f" Wavelength 1.02 1.16\n"
Expand Down
19 changes: 16 additions & 3 deletions cog/core/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(
pixelSize=(0.08854, 0.08854),
cell=None,
spacegroup=None,
format="RayonixMX340",
):

# Initialize attributes
Expand All @@ -33,7 +34,7 @@ def __init__(
self.pixelSize = pixelSize
self.cell = cell
self.spacegroup = spacegroup

self.format = format
return

# -------------------------------------------------------------------#
Expand Down Expand Up @@ -144,6 +145,16 @@ def numImages(self):
"""
return len(self.images)

@property
def format(self):
"""Image format to use by Precognition"""
return self._format

@format.setter
def format(self, val):
self._format = val


# ----------------------------------------------------------------------#
# Methods

Expand Down Expand Up @@ -351,6 +362,7 @@ def softlimits(self, image, resolution=2.0, spot_profile=(10, 5, 2.0)):
self.spacegroup,
self.distance,
self.center,
self.format,
resolution,
spot_profile,
)
Expand Down Expand Up @@ -393,6 +405,7 @@ def index(
self.spacegroup,
self.distance,
self.center,
self.format,
phi,
resolution,
spot_profile,
Expand Down Expand Up @@ -435,7 +448,7 @@ def refine(
raise KeyError(f"{image} was not found in image DataFrame")

rmsd, numMatched, geom = refine(
image, phi, geometry, self.pathToImages, resolution, spot_profile
image, phi, geometry, self.pathToImages, self.format, resolution, spot_profile
)
self.images.loc[image, "geometry"] = geom
self.images.loc[image, "rmsd"] = rmsd
Expand Down Expand Up @@ -466,7 +479,7 @@ def calibrate(self, image, resolution=2.0, spot_profile=(6, 4, 4.0)):
raise KeyError(f"{image} was not found in image DataFrame")

rmsd, numMatched, geom = calibrate(
image, phi, geometry, self.pathToImages, resolution, spot_profile
image, phi, geometry, self.pathToImages, self.format, resolution, spot_profile
)
self.images.loc[image, "geometry"] = geom
self.images.loc[image, "rmsd"] = rmsd
Expand Down