How to use the omas.omas_ds.ODX function in omas

To help you get started, we’ve selected a few omas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gafusion / omas / omas / omas_ds.py View on Github external
def load_omas_dx(filename, consistency_check=True):
    """
    Load ODX from xarray dataset

    :param filename: filename or file descriptor to load from

    :param consistency_check: verify that data is consistent with IMAS schema

    :return: OMAS data xarray
    """
    import xarray
    DS = xarray.open_dataset(filename)
    DS.load()
    DS.close()
    return ODX(DS)
github gafusion / omas / omas / omas_ds.py View on Github external
def load_omas_ds(filename, consistency_check=True):
    """
    Load ODS from xarray dataset

    :param filename: filename or file descriptor to load from

    :param consistency_check: verify that data is consistent with IMAS schema

    :return: OMAS data set
    """
    import xarray
    DS = xarray.open_dataset(filename)
    DS.load()
    DS.close()
    odx = ODX(DS)
    ods = odx_2_ods(odx, consistency_check=consistency_check)
    return ods
github gafusion / omas / omas / omas_ds.py View on Github external
def through_omas_dx(odx, method=['function', 'class_method'][1]):
    """
    Test save and load OMAS data xarray via xarray file format

    :param ods: OMAS data xarray

    :return: OMAS data xarray
    """
    filename = omas_testdir(__file__) + '/test.dx'
    if method == 'function':
        save_omas_dx(odx, filename)
        odx1 = load_omas_dx(filename)
    else:
        odx.save(filename)
        odx1 = ODX().load(filename)
    return odx1
github gafusion / omas / omas / omas_ds.py View on Github external
def ods_2_odx(ods):
    '''
    Map ODS to an ODX

    :param ods: OMAS data set

    :return: OMAS data xarray
    '''
    return ODX(ods.dataset())