Source code for iCalibrationDB.detector_instances.dssc

from ..detectors import (DetectorInstance, DetectorModule,
                         DetectorSpec, DetectorTypes)


class _DSSC(DetectorSpec):
    detector_type = DetectorTypes.DSSC

    DSSC_MiniSDDV1_F2_001 = DetectorModule(uuid=40001)
    DSSC_MiniSDDV1_F2_002 = DetectorModule(uuid=40002)
    DSSC_MiniSDDV1_F2_003 = DetectorModule(uuid=40003)
    DSSC_MiniSDDV1_F2_004 = DetectorModule(uuid=40004)

    DSSC_MiniSDDV1_F2_005 = DetectorModule(uuid=40005)
    DSSC_MiniSDDV1_F2_006 = DetectorModule(uuid=40006)
    DSSC_MiniSDDV1_F2_007 = DetectorModule(uuid=40007)
    DSSC_MiniSDDV1_F2_008 = DetectorModule(uuid=40008)

    DSSC_MiniSDDV1_F2_009 = DetectorModule(uuid=40009)
    DSSC_MiniSDDV1_F2_010 = DetectorModule(uuid=40010)
    DSSC_MiniSDDV1_F2_011 = DetectorModule(uuid=40011)
    DSSC_MiniSDDV1_F2_012 = DetectorModule(uuid=40012)

    DSSC_MiniSDDV1_F2_013 = DetectorModule(uuid=40013)
    DSSC_MiniSDDV1_F2_014 = DetectorModule(uuid=40014)
    DSSC_MiniSDDV1_F2_015 = DetectorModule(uuid=40015)
    DSSC_MiniSDDV1_F2_016 = DetectorModule(uuid=40016)


[docs]class DSSCInstance(DetectorInstance): def _repr_html_(self): b1 = 'bgcolor="#7ee878" width="250px" height="50px" style="border: 1px solid black;"' b2 = 'bgcolor="#ddd042" width="250px" height="50px" style="border: 1px solid black;"' b3 = 'bgcolor="#42aedd" width="250px" height="50px" style="border: 1px solid black;"' b4 = 'bgcolor="#dd4242" width="250px" height="50px" style="border: 1px solid black;"' view = """ <h2> Detector: {det}, Detector UUID: {duuid:03d}, Modules: {nmods} </h2> <table width="500px" height="500px" padding=0 style="border: 1px solid black; border-collapse: collapse;"> <tr> <td {b4}>{Q4M1}</td><td rowspan=4>&nbsp;</td><td {b1}>{Q1M1}</td> </tr> <tr> <td {b4}>{Q4M2}</td> </td><td {b1}>{Q1M2}</td> </tr> <tr> <td {b4}>{Q4M3}</td> </td><td {b1}>{Q1M3}</td> </tr> <tr> <td {b4}>{Q4M4}</td> </td><td {b1}>{Q1M4}</td> </tr> <tr colspan=3 height="12px"> </tr> <tr> <td {b3}>{Q3M1}</td><td rowspan=4>&nbsp;</td><td {b2}>{Q2M1}</td> </tr> <tr> <td {b3}>{Q3M2}</td> </td><td {b2}>{Q2M2}</td> </tr> <tr> <td {b3}>{Q3M3}</td> </td><td {b2}>{Q2M3}</td> </tr> <tr> <td {b3}>{Q3M4}</td> </td><td {b2}>{Q2M4}</td> </tr> </table> """ rdr = view.format(det=self.__class__.__name__.replace("_", ""), duuid=self.detector_uuid, nmods=16, Q1M1=self.Q1M1, Q1M2=self.Q1M2, Q1M3=self.Q1M3, Q1M4=self.Q1M4, Q2M1=self.Q2M1, Q2M2=self.Q2M2, Q2M3=self.Q2M3, Q2M4=self.Q2M4, Q3M1=self.Q3M1, Q3M2=self.Q3M2, Q3M3=self.Q3M3, Q3M4=self.Q3M4, Q4M1=self.Q4M1, Q4M2=self.Q4M2, Q4M3=self.Q4M3, Q4M4=self.Q4M4, b1=b1, b2=b2, b3=b3, b4=b4 ) return rdr
class _DSSC1M1(DSSCInstance): parent = _DSSC detector_uuid = 4 Q1M1 = _DSSC.DSSC_MiniSDDV1_F2_004 Q1M2 = _DSSC.DSSC_MiniSDDV1_F2_003 Q1M3 = _DSSC.DSSC_MiniSDDV1_F2_002 Q1M4 = _DSSC.DSSC_MiniSDDV1_F2_001 Q2M1 = _DSSC.DSSC_MiniSDDV1_F2_008 Q2M2 = _DSSC.DSSC_MiniSDDV1_F2_007 Q2M3 = _DSSC.DSSC_MiniSDDV1_F2_006 Q2M4 = _DSSC.DSSC_MiniSDDV1_F2_005 Q3M1 = _DSSC.DSSC_MiniSDDV1_F2_009 Q3M2 = _DSSC.DSSC_MiniSDDV1_F2_010 Q3M3 = _DSSC.DSSC_MiniSDDV1_F2_011 Q3M4 = _DSSC.DSSC_MiniSDDV1_F2_012 Q4M1 = _DSSC.DSSC_MiniSDDV1_F2_013 Q4M2 = _DSSC.DSSC_MiniSDDV1_F2_014 Q4M3 = _DSSC.DSSC_MiniSDDV1_F2_015 Q4M4 = _DSSC.DSSC_MiniSDDV1_F2_016