.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\grp1_RME_gettingstarted\plot_e00_creating_RMEMeas_objects.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_grp1_RME_gettingstarted_plot_e00_creating_RMEMeas_objects.py: RMEMeas Objects =============== This is a basic example demonstrating how to create and use RMEMeas objects. In this example we go over different ways to initialize one from scratch, how to create linear uncertainty mechanisms, and how to create probability distributions for Monte Carlo analysis. Indexing and interpolating are also briefly discussed. .. GENERATED FROM PYTHON SOURCE LINES 14-22 Initializing from a Nominal Data Set ------------------------------------ The easiest - and most versatile - way to make a RMEMeas object from scratch is to use the :func:`rmellipse.uobjects.RMEMeas.from_nom` function, then add the uncertainty mechanisms and Monte Carlo data. With this function you just provide a nominal data set and a name for your object. The name is used when saving to formats like xml and hdf5. .. GENERATED FROM PYTHON SOURCE LINES 22-35 .. code-block:: Python from rmellipse.uobjects import RMEMeas import xarray as xr import numpy as np nom = xr.DataArray( [[1, 2, 3], [4, 5, 6]], dims=('d1', 'd2'), coords={'d1': [0.1, 0.2], 'd2': ['a', 'b', 'c']}, ) meas = RMEMeas.from_nom(name='myval', nom=nom) print(meas.nom) .. rst-class:: sphx-glr-script-out .. code-block:: none Size: 48B array([[1, 2, 3], [4, 5, 6]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[0.01, 0.01, 0.01], [0.01, 0.01, 0.01]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[inf, inf, inf], [inf, inf, inf]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[1.01, 2.01, 3.01], [4.01, 5.01, 6.01]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[0.98040036, 1.98040036, 2.98040036], [3.98040036, 4.98040036, 5.98040036]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[1.01959964, 2.01959964, 3.01959964], [4.01959964, 5.01959964, 6.01959964]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[0.02906974, 0.02906974, 0.02906974], [0.02906974, 0.02906974, 0.02906974]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[1.01, 2.01, 3.01], [4.01, 5.01, 6.01]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 8B array(1.) Coordinates: d1 float64 8B 0.1 d2 Size: 8B array(1.) Coordinates: d1 float64 8B 0.1 d2 Size: 8B array(1.) Coordinates: d1 float64 8B 0.1 d2 Size: 8B array(1.) Coordinates: d1 float64 8B 0.1 d2 Size: 48B array([[0.01, 0.01, 0.01], [0.01, 0.01, 0.01]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[1.02065929, 2.02065929, 3.02065929], [4.02065929, 5.02065929, 6.02065929]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[1., 2., 3.], [4., 5., 6.]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[0., 0., 0.], [0., 0., 0.]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 48B array([[0., 0., 0.], [0., 0., 0.]]) Coordinates: * d1 (d1) float64 16B 0.1 0.2 * d2 (d2) Size: 72B array([[1.75, 2.75, 3.75], [2.5 , 3.5 , 4.5 ], [3.25, 4.25, 5.25]]) Coordinates: * d2 (d2) ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_e00_creating_RMEMeas_objects.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_e00_creating_RMEMeas_objects.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_