Exemplo n.º 1
0
    def get_user_value_changes(self, detnum):
        """Goes through individual settings and asks the user if things are
        correct

        Parameters
        ----------
        detnum : int
            The detector number this detector is stored as
        """
        self.print_self(detnum)
        if inp.get_yes_no("Change Digitizer Setup", default_value=False):
            brd = inp.get_int("New Board Number")
            chan = inp.get_int("New Channel Number")
            self.digi_pair = (brd, chan)
        if inp.get_yes_no("Change MPOD Setup", default_value=False):
            brd = inp.get_int("New Board Number")
            chan = inp.get_int("New Channel Number")
            self.mpod_pair = (brd, chan)
        if inp.get_yes_no("Change Det. Position Offsets", default_value=False):
            xoff = inp.get_float("New X Offset")
            yoff = inp.get_float("New Y Offset")
            zoff = inp.get_float("New Z Offset")
            self.pos_offset = (xoff, yoff, zoff)
        if inp.get_yes_no("Change Detector Type", default_value=False):
            print "Known Types are: NaI, LS, CeBr3, HeMod, HeUnmod"
            new_type = inp.get_str("New Detector Type")
            self.det_type = new_type
        if inp.get_yes_no("Change Projection Thresholds", default_value=False):
            en_thresh = inp.get_float("New Energy Threshold for PSD Proj")
            psd_thresh = inp.get_float("New PSD Threshold for Energy Proj")
            self.thresh_pair = (int(en_thresh), psd_thresh)
Exemplo n.º 2
0
 def get_removed_dets(self):
     """Asks the user which detectors to remove"""
     ans = True
     while ans:
         self.print_array_setup()
         val = inp.get_int("Detector Number to Remove")
         if val in self.det_dict:
             del self.det_dict[val]
         else:
             print "Detector number not in array setup!"
         ans = inp.get_yes_no("Remove Another Detector",
                              default_value=False)
Exemplo n.º 3
0
 def get_added_dets(self):
     """Asks the user to define new detectors"""
     ans = True
     while ans:
         self.print_array_setup()
         val = inp.get_int("New Detector Number")
         if val in self.det_dict:
             print "Detector number already exists!"
         else:
             new_det = DetectorSetup.build_new_det(val)
             self.det_dict[val] = new_det
         ans = inp.get_yes_no("Add Another Detector", default_value=False)
Exemplo n.º 4
0
 def get_modded_dets(self):
     """Asks the user to modify existing detectors"""
     ans = True
     while ans:
         self.print_array_setup()
         val = inp.get_int("Detector to modify")
         if val in self.det_dict:
             self.det_dict[val].get_user_value_changes(val)
         else:
             print "Detector does not exist"
         ans = inp.get_yes_no("Modify Another Detector",
                              default_value=False)
Exemplo n.º 5
0
    def build_new_det(detnum):
        """Static method to make a new detector from user input

        Parameters
        ----------
        detnum : int
            The detector number this detector is stored as

        Returns
        -------
        det_setup : DetectorSetup
            A newly initialized detector setup
        """
        is_good = 'n'
        while is_good in ['n', 'N']:
            brd = inp.get_int("New Digitizer Board Number")
            chan = inp.get_int("New Digitizer Channel Number")
            temp = [(brd, chan)]
            brd = inp.get_int("New MPOD Board Number")
            chan = inp.get_int("New MPOD Channel Number")
            temp.append((brd, chan))
            xoff = inp.get_float("New X Offset")
            yoff = inp.get_float("New Y Offset")
            zoff = inp.get_float("New Z Offset")
            temp.append((xoff, yoff, zoff))
            print "Known Detector Types are: NaI, LS, CeBr3, HeMod, HeUnmod"
            new_type = inp.get_str("New Detector Type")
            temp.append(new_type)
            out_str = "New Energy Threshold for PSD Proj"
            en_thresh = inp.get_float(out_str)
            out_str = "New PSD Threshold for Energy Proj"
            psd_thresh = inp.get_float(out_str)
            temp.append((int(en_thresh), psd_thresh))
            det_setup = DetectorSetup((temp[0], temp[1]), temp[2], temp[3],
                                      temp[4])
            det_setup.print_self(detnum)
            if inp.get_yes_no("Is this correct", default_value=True):
                return det_setup