def send_off(self, frame):
    if ((not (self.wiring_map is None)) and (self.bolo_props is None)):
        self.bolo_props = calibration.BolometerPropertiesMap()
        n_chans = 0
        squids = {}
        for k in self.wiring_map.keys():
            wm = self.wiring_map[k]
            c = (wm.channel + 1)
            if (c > n_chans):
                n_chans = c
            sq = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot, (wm.module + 1))
            squids[sq] = 1
        n_squids = len(squids.keys())
        sq_layout = make_square_block(n_squids)
        ch_layout = make_square_block(n_chans)
        sq_x_sep = (ch_layout[0] + 1)
        sq_y_sep = (ch_layout[1] + 1)
        ch_x_sep = 1
        ch_y_sep = 1
        for (i, sq) in enumerate(sorted(squids.keys())):
            x = (i % sq_layout[0])
            y = (i // sq_layout[0])
            squids[sq] = (((1.2 * x) * ch_layout[0]), ((1.2 * y) * ch_layout[1]))
        for k in self.wiring_map.keys():
            wm = self.wiring_map[k]
            sq_id = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot, (wm.module + 1))
            w_id = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot)
            sql = squids[sq_id]
            x = (sql[0] + ((wm.channel % ch_layout[0]) * ch_x_sep))
            y = (sql[1] + ((wm.channel // ch_layout[0]) * ch_y_sep))
            bp = calibration.BolometerProperties()
            bp.physical_name = k
            bp.band = 0
            bp.pol_angle = 0
            bp.pol_efficiency = 0
            bp.wafer_id = w_id
            bp.squid_id = sq_id
            bp.x_offset = float(x)
            bp.y_offset = float(y)
            self.bolo_props[k] = bp
        out_frame = core.G3Frame(core.G3FrameType.Calibration)
        out_frame['BolometerProperties'] = self.bolo_props
        out_frame['DfMuxTransferFunction'] = self.default_tf
        return [out_frame, frame]
    else:
        return frame
def send_off(self, frame):
    if ((not (self.wiring_map is None)) and (self.bolo_props is None)):
        self.bolo_props = calibration.BolometerPropertiesMap()
        n_chans = 0
        squids = {}
        for k in self.wiring_map.keys():
            wm = self.wiring_map[k]
            c = (wm.channel + 1)
            if (c > n_chans):
                n_chans = c
            sq = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot, (wm.module + 1))
            squids[sq] = 1
        n_squids = len(squids.keys())
        sq_layout = make_square_block(n_squids)
        ch_layout = make_square_block(n_chans)
        sq_x_sep = (ch_layout[0] + 1)
        sq_y_sep = (ch_layout[1] + 1)
        ch_x_sep = 1
        ch_y_sep = 1
        for (i, sq) in enumerate(sorted(squids.keys())):
            x = (i % sq_layout[0])
            y = (i // sq_layout[0])
            squids[sq] = (((1.2 * x) * ch_layout[0]), ((1.2 * y) * ch_layout[1]))
        for k in self.wiring_map.keys():
            wm = self.wiring_map[k]
            sq_id = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot, (wm.module + 1))
            w_id = get_physical_id(wm.board_serial, wm.crate_serial, wm.board_slot)
            sql = squids[sq_id]
            x = (sql[0] + ((wm.channel % ch_layout[0]) * ch_x_sep))
            y = (sql[1] + ((wm.channel // ch_layout[0]) * ch_y_sep))
            bp = calibration.BolometerProperties()
            bp.physical_name = k
            bp.band = 0
            bp.pol_angle = 0
            bp.pol_efficiency = 0
            bp.wafer_id = w_id
            bp.squid_id = sq_id
            bp.x_offset = float(x)
            bp.y_offset = float(y)
            self.bolo_props[k] = bp
        out_frame = core.G3Frame(core.G3FrameType.Calibration)
        out_frame['BolometerProperties'] = self.bolo_props
        out_frame['DfMuxTransferFunction'] = self.default_tf
        return [out_frame, frame]
    else:
        return frame