Beispiel #1
0
    def print_algorithms(self):
        algorithms = Config().get('algorithms.single') + Config().get(
            'algorithms.double')

        Calibration().load()

        device_classes = Nvidia().get_nvidia_device_classes()

        for device_class in device_classes:
            data = {}

            for algorithm in algorithms:
                data[algorithm] = {}

                for miner_name in Config().get('miners'):
                    miner = eval('%s()' % (miner_name.title()))

                    if algorithm in miner.supported_algorithms():
                        data[algorithm][miner_name] = Calibration(
                        ).get_miner_hashrate_for_algorithm_on_device(
                            miner_name, algorithm, device_class)
                    else:
                        data[algorithm][miner_name] = "-"

            self.display_device_algorithm_table(device_class, data)

        print "\nnote: - means not supported\n"
Beispiel #2
0
    def get_current_payrate(self):
        hashrates = Calibration().get_hashrates(self)

        return Pools().get_payrate(self, hashrates, self.algos[0]['pool'],
                                   self.algos[0]['miner'],
                                   self.algos[0]['algo'],
                                   self.algos[0]['region'])
Beispiel #3
0
def calibrate(alpha, flags, nooutliers=False):
    ll.info(__name__)
    images = glob.glob(
        f'/Users/torres/OneDrive/UNB/2020-08 Visão Computacional/'
        f'Trabalho 1/Calibration{res.cam}/*.jpg')

    images = sorted(images)

    calib = Calibration(delay=10,
                        sample_size=10,
                        cbcols=8,
                        cbrows=6,
                        alpha=alpha,
                        nooutliers=nooutliers)

    ll.info('Made calib object')

    ll.debug(f'Reading {len(images)} images…')
    for filename in images:
        img = cv2.imread(filename, cv2.IMREAD_UNCHANGED)
        calib.add_sample(img, filename)

    params = calib.calculate_camera_params(flags=flags)

    if not params:
        ll.error('Erro ao calibrar.')

    ll.info(f'Writing camera params to file {res.file}')
    filenames = '\n'.join(images)
    comment = (f"With files:\n{filenames}\n" f'Camera: {res.cam}')
    params.write_to_file(res.file, comment)

    return params
Beispiel #4
0
def visualization(labels, pointcloud, img, test, calib_info, rotation=None):
    img_shape = [1242, 375]
    mesh = o3d.geometry.TriangleMesh.create_coordinate_frame(size=10)
    calib = Calibration(calib_info)
    pts_rect = calib.lidar_to_rect(pointcloud[:, 0:3])
    fov_flag = get_fov_flag(pts_rect, img_shape, calib)
    points, _ = calib.lidar_to_img(pointcloud[fov_flag][:, :3])
    # print(points.shape)
    pcd = get_pcd(pointcloud[fov_flag][:, :3])
    bboxes, meshes = get_bboxes(labels, calib, rotation)
    # o3d.visualization.draw_geometries(bboxes+pcd+[]+[],width=960,height=640,point_show_normal=False)

    vis = o3d.visualization.Visualizer()
    vis.create_window(width=1023, height=1023, left=5, top=5)
    vis.get_render_option().background_color = np.array([0., 0., 0.])
    vis.get_render_option().show_coordinate_frame = False
    vis.get_render_option().point_size = 2
    from testo3d import get_strong
    bboxes = get_strong(bboxes)
    ctr = vis.get_view_control()
    param = o3d.io.read_pinhole_camera_parameters('1130.json')
    ctr.convert_from_pinhole_camera_parameters(param)
    # ctr.set_zoom(0.8)
    for t in bboxes + pcd:
        vis.add_geometry(t)
    vis.run()
    param = vis.get_view_control().convert_to_pinhole_camera_parameters()
    o3d.io.write_pinhole_camera_parameters('1130.json', param)
    vis.capture_screen_image('/home/zzj/Desktop/test.png', True)
    bboxes = get_2Dlabels(labels)
    draw_2Dlabels(bboxes, img, points)
    exit()
Beispiel #5
0
    def get_mean_calib():
        # calibration with mean values of all kitti calibration files
        calib = Calibration()
        calib.P = np.array([[719.787081, 0., 608.463003, 44.9538775],
                            [0., 719.787081, 174.545111, 0.1066855],
                            [0., 0., 1., 3.0106472e-03]])
        calib.V2C = np.array([[
            7.49916597e-03, -9.99971248e-01, -8.65110297e-04, -6.71807577e-03
        ], [1.18652889e-02, 9.54520517e-04, -9.99910318e-01, -7.33152811e-02],
                              [
                                  9.99882833e-01, 7.49141178e-03,
                                  1.18719929e-02, -2.78557062e-01
                              ]])
        calib.R0 = np.array([[0.99992475, 0.00975976, -0.00734152],
                             [-0.0097913, 0.99994262, -0.00430371],
                             [0.00729911, 0.0043753, 0.99996319]])

        calib.c_u = calib.P[0, 2]
        calib.c_v = calib.P[1, 2]
        calib.f_u = calib.P[0, 0]
        calib.f_v = calib.P[1, 1]
        calib.b_x = calib.P[0, 3] / (-calib.f_u)  # relative
        calib.b_y = calib.P[1, 3] / (-calib.f_v)

        return calib
def dot_product_calibration_set(ideals, measured, *args, **kwargs):
    '''
    This function is used for calculating calibration uncertainty due
    to un-biased, non-systematic errors.

    It creates an ensemble of calibration instances. the set  of
    measurement lists used in the ensemble is the python 'zip' of measured
    and ideal lists. it is equivalent to making a calibration for each
    connection instance of a measurement.

    This requires the same number of repeat elements for

    takes:
            ideals: list of ideal Networks
            measured: list of measured Networks
            *args,**kwargs: passed to Calibration initializer

    returns:
            cal_ensemble: a list of Calibration instances.
    '''
    # this is a way to sort the measured list by alphabetically ordering
    # of the Network element names
    measured_range = range(len(measured))
    name_list = [k.name for k in measured]
    sorted_index = sorted(measured_range, key=lambda k: name_list[k])
    measured = [measured[k] for k in sorted_index]

    measured_iterable = \
            [[ measure for measure in measured \
                    if ideal.name in measure.name] for ideal in ideals]
    m_array = array(measured_iterable)

    return [Calibration(ideals = ideals, measured = list(m_array[:,k]),\
            *args, **kwargs)\
            for k in range(m_array.shape[1])]
def binomial_coefficient_calibration_set(ideals, measured, n, *args, **kwargs):
    '''
    Produces a ensemble of calibration instances based on choosing
    sub-sets of the ideal/measurement lists from an overdetermined
    calibration. This concept is described in 'De-embeding and
    Un-terminating' by Penfield and Baurer.

    so, if the calibration ideals and measured lists have length 'm'
    then the resultant ensemble of calibrations is 'm choose n' long.


    takes:
            ideals: list of ideal Networks
            measured: list of measured Networks
            n: length of ideal/measured lists to pass to calibrations
                    (must be < len(ideals) )
            *args,**kwargs: passed to Calibration initializer

    returns:
            cal_ensemble: a list of Calibration instances.



    '''
    if n >= len(ideals):
        raise ValueError('n must be larger than # of standards')

    ideal_subsets = \
            [ ideal_subset for ideal_subset in combinations(ideals,n)]
    measured_subsets = \
            [ measured_subset for measured_subset in combinations(measured,n)]

    return  [Calibration(ideals = list(k[0]), measured=list(k[1]),\
            *args, **kwargs) for k in zip(ideal_subsets, measured_subsets)]
Beispiel #8
0
    def load(self, hdf5_file):
        """Load the data from the given hdf5 file and the sqlite3 database."""
        # Load the calibration object associated with this data.
        self.calib = Calibration(self.detector, _date_from_shot(self.shot))

        # Load the raw data.
        data_name = 'data_{0}'.format(self.detector.sn)
        self.y = hdf5_file.get(data_name).value

        # Read data from the database.
        query = 'SELECT shot, aperture, filter, port, dt, t0, timestamp '
        query += 'FROM xRayData WHERE shot=? AND detector=?'

        row = dbutil.fetchall(const.DB_XRAY_PATH, query,
                              (self.shot, int(self.detector.sn)))[0]

        self.shot = row[0]
        self.aperture = row[1]
        self.filter = row[2]
        self.port = row[3]
        self.dt = row[4]
        self.t0 = row[5]
        self.timestamp = row[6]

        if self.aperture is not None:
            self.aperture = mp.XRayAperture.get(self.aperture)
        if self.filter is not None:
            self.filter = mp.XRayFilter.get(self.filter)
        if self.port is not None:
            self.port = mp.Port.get(self.port)
Beispiel #9
0
    def sighup_handler(self, x, y):
        Log().add('info', 'SIGHUP caught, reloading config and benchmark data')

        Config().reload()
        Calibration().load()
        Miners().reload_config()

        for device in Nvidia().get_nvidia_devices():
            if not self.device_in_list(device):
                device.update()

                if device.state == 'active':
                    device.log(
                        'info',
                        'currently running algorithm %s with %s [profile=%s] [region=%s]'
                        % (device.algos[0]['algo'], device.algos[0]['miner'],
                           device.profile, device.algos[0]['region']))
                elif device.state == 'calibrating':
                    device.log(
                        'info',
                        'calibration in progress with algorithm %s using %s [region=%s]'
                        % (device.algos[0]['algo'], device.algos[0]['miner'],
                           device.algos[0]['region']))

                self.devices.append(device)

        for device in self.devices:
            if device.state == 'active':
                device.apply_profile()

        Log().add('info', 'reload complete')
Beispiel #10
0
def main():
    debug_mode = rospy.get_param(NODE_NAME + "/debug", DEFAULT_DEBUG_MODE)
    if debug_mode:
        log_level = rospy.DEBUG
        rospy.loginfo(
            "[{0}] Launching calibration node in debug mode".format(NODE_NAME))
    else:
        log_level = rospy.INFO

    rospy.init_node(NODE_NAME, anonymous=True, log_level=log_level)
    update_rate = rospy.get_param('~update_rate', DEFAULT_UPDATE_RATE)
    playback = rospy.get_param('/' + 'px150' + '/' + 'playback',
                               DEFAULT_PLAYBACK)

    # state_machine_input = StateMachineInput(NODE_NAME)
    calibration = Calibration(NODE_NAME, playback=playback)
    calibration_state_machine = CalibrationStateMachine(
        calibration, update_rate, NODE_NAME)
    rospy.loginfo(
        '[{0}] Calibration state machine successfully generated'.format(
            NODE_NAME))

    rospy.core.add_preshutdown_hook(
        lambda reason: calibration_state_machine.request_shutdown())

    calibration_state_machine.run()
Beispiel #11
0
    def get_power_limit_for_algorithm(self, miner_name, algorithm):
        calibrated = Calibration().get('%s.%s.%s' %
                                       (self.dclass, miner_name, algorithm))

        if calibrated:
            return calibrated['power_limit']

        return None
Beispiel #12
0
 def start_calibration(self):
     if self._calibrating or self._tracking:
         return None
     if self._tracker is not None:
         calib = Calibration(self._q)
         calib.run(self._tracker, self._on_calib_done)
         self._calibrating = True
         return calib
Beispiel #13
0
    def __init__(self):
        super().__init__()

        self.calibration = Calibration()
        self.eye_tracker = EyeTracker()
        self.vector = None
        self.left_eye = None
        self.right_eye = None
Beispiel #14
0
    def work(self, input_items, output_items):
        inp = input_items[0]

        for i in range(len(inp)):
            data = []
            for x in inp[i]:
                data.append(x & 0xFF)
                data.append(x >> 8)

            frame = Frame(data, self.frame_prev)
            if not frame:
                print "no frame" + str(frame)
                continue
            if not frame.is_broken():
                self.frame_prev = frame

            self.conf = frame.get(SF_TYPE_CONFIG)
            if self.conf is not None:
                frame_num = self.conf.frame_num
                node_id = self.conf.id
                calibration_num = self.conf.calibration_num
                de = DataEvent(
                    [EVENT_CONFIG, frame_num, node_id, calibration_num])
                wx.PostEvent(self.panel, de)
                del de
            else:
                frame_num = 'N/A'

            self.meas = frame.get(SF_TYPE_MEASUREMENTS)
            if self.meas is not None and self.conf is not None:
                temp = self.meas.temp
                hum = self.meas.hum_down
                pres = self.meas.pressure
                de = DataEvent(
                    [EVENT_MEASSURE, self.conf.frame_num, temp, hum, pres])
                wx.PostEvent(self.panel, de)
                del de

            #self._dump_frame(frame, frame_num)
            #self._dump_eval(frame)
            if not self.calibrated and self.conf is not None:
                self.calibrated = self.calib.addFragment(
                    self.conf.calibration_num, self.conf.calibration_data)
                if self.calibrated:
                    print("calibration complete at frame %s" % frame_num)
                    calib_data = self.calib.data()
                    self.calib = Calibration(calib_data)

                    de = DataEvent([EVENT_CALIBRATED])
                    wx.PostEvent(self.panel, de)
                    del de

            print("frame: %s %s" % (
                frame_num,
                not frame.is_broken(),
            ))

        return len(inp)
Beispiel #15
0
 def calibrate(self, the_number):
     is_equal = the_number == self.comparator
     if is_equal:
         message = self.equal_message.format(the_number)
     elif the_number > self.comparator:
         message = self.high_message.format(the_number)
     else:
         message = self.low_message.format(the_number)
     return Calibration(is_equal, message)
Beispiel #16
0
 def __init__(self, label):
     QtCore.QObject.__init__(self)
     self.label = ord(label.upper()) - 64
     self.controller = Leap.Controller()
     self.calibration = Calibration(self.controller)
     self.status = None
     self.status_bar = None
     self.status_mutex = False
     self.stop_thread_flag = False
     self.stop_thread_mutex = False
Beispiel #17
0
    def mbtc_per_day(self):
        if self.state in ['active', 'calibrating']:
            hashrates = Calibration().get_hashrates(self)

            return Pools().get_payrate(self, hashrates, self.algos[0]['pool'],
                                       self.algos[0]['miner'],
                                       self.algos[0]['algo'],
                                       self.algos[0]['region'])

        return 0
    def __init__(self):
        self.frame = None
        self.eye_left = None
        self.eye_right = None
        self.calibration = Calibration()

        self._face_detector = dlib.get_frontal_face_detector()

        cwd = os.path.abspath(os.path.dirname(__file__))
        model_path = os.path.abspath(os.path.join(cwd, "prathikeyedata.dat"))
        self._predictor = dlib.shape_predictor(model_path)
Beispiel #19
0
def calibrate():
    images = glob.glob(
        f'/Users/torres/OneDrive/UNB/2020-08 Visão Computacional/'
        f'Trabalho 1/Calibration{cam}/*.jpg')

    calib = Calibration(delay=10, sample_size=10, cbcols=8, cbrows=6, alpha=1)

    for filename in images:
        img = cv2.imread(filename, cv2.IMREAD_UNCHANGED)
        calib.add_sample(img)

    return calib
    def __init__(self):
        self.frame = None
        self.eye_left = None
        self.eye_right = None
        self.calibration = Calibration()

        # _face_detector is used to detect faces
        self._face_detector = dlib.get_frontal_face_detector()

        # _predictor is used to get facial landmarks of a given face
        model_path = "shape_predictor_68_face_landmarks.dat"
        self._predictor = dlib.shape_predictor(model_path)
Beispiel #21
0
    def __init__(self):
        self.frame = None
        self.eye_left = None
        self.eye_right = None
        self.calibration = Calibration()

        # _face_detector is used to detect faces
        self._face_detector = dlib.get_frontal_face_detector()

        # _predictor is used to get facial landmarks of a given face
        cwd = os.path.abspath(os.path.dirname(__file__))
        model_path = os.path.abspath(os.path.join(cwd, "trained_models/shape_predictor_68_face_landmarks.dat"))
        self._predictor = dlib.shape_predictor(model_path)
Beispiel #22
0
	def work(self, input_items, output_items):
		inp = input_items[0]

		for i in range(len(inp)):
			data = []
			for x in inp[i]:
				data.append(x&0xFF)
				data.append(x>>8)

			frame = Frame(data, self.frame_prev)
			if not frame:
				print "no frame" + str(frame)
				continue
			if not frame.is_broken():
				self.frame_prev = frame

			self.conf = frame.get(SF_TYPE_CONFIG)
			if self.conf is not None:
				frame_num = self.conf.frame_num
				node_id   = self.conf.id
				calibration_num = self.conf.calibration_num

				self.node_id.setText(str(node_id))
				self.frame_num.setText(str(frame_num))
			else:
				frame_num = 0

			self.meas = frame.get(SF_TYPE_MEASUREMENTS)
			if self.meas is not None and self.conf is not None:
				temp = self.meas.temp
				hum  = self.meas.hum_down
				pres = self.meas.pressure

				self.plot.update_figure(frame_num, temp, hum, pres)

			if not self.calibrated and self.conf is not None:
				self.calibrated = self.calib.addFragment(self.conf.calibration_num, self.conf.calibration_data)
				if self.calibrated:
					print("calibration complete at frame %s" % frame_num)
					calib_data = self.calib.data()
					self.calib = Calibration(calib_data)

					self.calibrated_label.setText("calibrated")
					self.calibrated_label.setStyleSheet("color: green")

			print("frame: %s %s" % (frame_num, not frame.is_broken(), ))


		return len(inp)
Beispiel #23
0
    def scan_devices(self):
        self.devices = Nvidia().get_nvidia_devices()

        Calibration().load()

        if len(self.devices) < 1:
            Log().add('fatal', "no nvidia GPUs found")

        Log().add("info", "found %d nvidia GPUs" % (len(self.devices)))

        Calibration().check_calibrated_algorithms(self.devices)

        Log().add('info', 'retrieving state from miner backends')

        Miners().poll()

        for device in self.devices:
            device.update()

            if device.state == 'active':
                device.log(
                    'info',
                    'currently running algorithm %s with %s [profile=%s] [region=%s]'
                    % (device.algos[0]['algo'], device.algos[0]['miner'],
                       device.profile, device.algos[0]['region']))
                device.apply_profile()
            elif device.state == 'calibrating':
                device.log(
                    'info',
                    'calibration in progress with algorithm %s using %s [region=%s]'
                    % (device.algos[0]['algo'], device.algos[0]['miner'],
                       device.algos[0]['region']))

            device.period_start = self.startup_time
            device.grubtime = device.period_start + (
                60 * random.randrange(15, 1424))
Beispiel #24
0
    def __init__(self, con, loop=None):
        """:param web.rest.base.Connection con: the base http connection"""
        self.conn = con
        conf = Config()
        self.ws = None
        self.cal = Calibration()
        self.url = conf.get_rest_base() + "/warning"
        self.ws_url = conf.get_ws_base() + "/warn"
        self.configs = []
        if loop is not None:
            self.loop = loop
        else:
            self.loop = asyncio.new_event_loop()

        self.__current = {}
Beispiel #25
0
 def calibration_init(self):
     global b
     b.__del__()
     self.root.destroy()
     self.root.quit()
     self.calibration = Calibration(is_polish)
     f = open(resource_path(r'.\img\settings.json'))
     settings = json.load(f)
     f.close()
     b = BlinkDetector(is_polish)
     b.detector = detector
     b.predictor = predictor
     b.calibration_value = settings['wsk']
     b.diagonal_value = settings['dgn']
     second_window()
Beispiel #26
0
def dot_product(ideals, measured_sets, *args, **kwargs):
    '''
    '''
    for measured_set in measured_sets:
        if len(measured_set) != len(measured_sets[0]):
            raise(IndexError('all measured NetworkSets must have same length for dot product combinatoric function'))

    cal_list = []
    for k in range(len(measured_sets[0])):
        measured = [measured_set[k] for measured_set in measured_sets]
        cal_list.append(
            Calibration(ideals=ideals, measured= measured,
            *args,**kwargs)
            )
        
    return cal_list
    def loop(self):
        self._test_write_header()
        calib = CalibrationCollector()
        frame_prev = None
        while True:
            data = self._src.get_frame()
            if not data:
                return
            frame = Frame(data, frame_prev)
            if not frame:
                continue
            if not frame.is_broken():
                frame_prev = frame
            conf = frame.get(SF_TYPE_CONFIG)
            if conf is not None:
                frame_num = conf.frame_num
            else:
                frame_num = 'N/A'
            self._dump_frame(frame, frame_num)
            self._dump_eval(frame)
            if conf is not None:
                if calib.addFragment(conf.callibration_num, conf.callibration_data):
                    break
            print("frame: %s %s" % (frame_num, not frame.is_broken(), ))

        print("calibration complete at frame %s" % frame_num)
        calib_data = calib.data()
        calib = Calibration(calib_data)
        self._dump_calibration(calib, calib_data)

        while True:
            data = self._src.get_frame()
            if not data:
                break
            frame = Frame(data, frame_prev)
            if not frame:
                continue
            if not frame.is_broken():
                frame_prev = frame
            conf = frame.get(SF_TYPE_CONFIG)
            if conf is not None:
                frame_num = conf.frame_num
            else:
                frame_num = 'N/A'
            self._dump_frame(frame, frame_num)
            self._dump_eval(frame, calib)
            print("frame: %s %s" % (frame_num, not frame.is_broken(), ))
Beispiel #28
0
    def __init__(self):
        """Creates the main UI dialog box and sets up the sections in the desired layout."""
        QDialog.__init__(self)
        self.font_type = "Courier"
        self.font_size = 10
        font = QFont(self.font_type, self.font_size)
        font.setFixedPitch(True)
        QApplication.setFont(font, "QPlainTextEdit")
        self.ts_start = datetime.datetime.now()
        self.ui_flags = FLAGS
        self.dlg = uic.loadUi("dep.ui", self)

        has_pickled_project = self.unpickle_project()

        self.verbose = FLAGS.verbose
        self.s3_ignore_fullsize_color = FLAGS.s3_ignore_fullsize_color
        self.s3_sample_frame = FLAGS.s3_sample_frame
        self.project_root = FLAGS.project_root
        self.path_project = config.DOCKER_INPUT_ROOT

        self.configure_farm()
        self.full_size = self.dlg.frameSize()

        verify_data.set_default_top_level_paths(self)

        if not has_pickled_project:
            verify_data.verify(self)

        dep_util.set_full_size_widths(self)

        self.calibrate = Calibration(self)
        self.background = Background(self)
        self.depth = DepthEstimation(self)
        self.export = Export(self)
        self.sections = [
            self.calibrate, self.background, self.depth, self.export
        ]

        global sections
        sections = self.sections

        self.setup_sections_layout()
        self.setup_sections_signals()
        self.setup_project()
        self.setup_clock()

        self.dlg.show()
Beispiel #29
0
    def can_run(self):
        if self.ignored():
            if Config().get('debug'):
                self.log('debug', 'device is ignored - not starting worker')
            return False

        if self.calibrating():
            if Config().get('debug'):
                self.log('debug',
                         'device is calibrating - not starting worker')
            return False

        if not Calibration().get_hashrates(self):
            if Config().get('debug'):
                self.log(
                    'debug',
                    'device has no calibration data - not starting worker')
            return False

        if self.pin:
            if 'idle' in self.pin.keys() or 'calibration' in self.pin.keys():
                if Config().get('debug'):
                    self.log(
                        'debug',
                        'device is pinned to calibration or idle - not starting worker'
                    )
                return False

            return True

        if not self.best_pool:
            self.log('warning', 'unable to use - no best pool')
            return False

        if not self.best_miner:
            self.log('warning', 'unable to use - no best miner')
            return False

        if not self.best_algo:
            self.log('warning', 'unable to use - no best algorithm')
            return False

        if self.best_miner == 'nicehash' and not self.best_region:
            self.log('warning', 'unable to use - no best region')
            return False

        return True
def cartesian_product_calibration_set(ideals, measured, *args, **kwargs):
    '''
    This function is used for calculating calibration uncertainty due
    to un-biased, non-systematic errors.

    It creates an ensemble of calibration instances. the set  of
    measurement lists used in the ensemble is the Cartesian Product
    of all instances of each measured standard.

    The idea is that if you have multiple measurements of each standard,
    then the multiple calibrations can be made by generating all possible
    combinations of measurements.  This produces a conceptually simple,
    but computationally expensive way to estimate calibration uncertainty.



    takes:
            ideals: list of ideal Networks
            measured: list of measured Networks
            *args,**kwargs: passed to Calibration initializer

    returns:
            cal_ensemble: a list of Calibration instances.


    you can use the output to estimate uncertainty by calibrating a DUT
    with all calibrations, and then running statistics on the resultant
    set of Networks. for example

    import skrf as rf
    # define you lists of ideals and measured networks
    cal_ensemble = \
            rf.cartesian_product_calibration_ensemble( ideals, measured)
    dut = rf.Network('dut.s1p')
    network_ensemble = [cal.apply_cal(dut) for cal in cal_ensemble]
    rf.plot_uncertainty_mag(network_ensemble)
    [network.plot_s_smith() for network in network_ensemble]
    '''
    measured_iterable = \
            [[ measure for measure in measured \
                    if ideal.name in measure.name] for ideal in ideals]
    measured_product = product(*measured_iterable)

    return [Calibration(ideals =ideals, measured = list(product_element),\
            *args, **kwargs)\
            for product_element in measured_product]