src/pys5p/s5p_xarray.py
def __get_data(dset, data_sel: tuple, field: str):
    """
    Return data of the HDF5 dataset

    Parameters
    ----------
    dset :  h5py.Dataset
       h5py dataset from which the data is read
    data_sel :  numpy slice
       A numpy slice generated for example numpy.s_
       Default read while array
    field : str
       Name of field in compound dataset or None

    Returns
    -------
    Numpy array

    Notes
    -----
    Read floats always as doubles
    """
    if data_sel is None:
        data_sel = ()

    if np.issubdtype(dset.dtype, np.floating):
        data = dset.astype(float)[data_sel]
        data[data == float.fromhex('0x1.ep+122')] = np.nan
        return data

    if field is None:
        return dset[data_sel]

    data = dset.fields(field)[data_sel]
    if np.issubdtype(data.dtype, np.floating):
        data = data.astype(float)
        data[data == float.fromhex('0x1.ep+122')] = np.nan
    return data

    Return data of the HDF5 dataset

    Parameters
    ----------
    dset :  h5py.Dataset
       h5py dataset from which the data is read
    data_sel :  numpy slice
       A numpy slice generated for example numpy.s_
       Default read while array
    field : str
       Name of field in compound dataset or None

    Returns
    -------
    Numpy array

    Notes
    -----
    Read floats always as doubles
    
Return data of the HDF5 dataset
Parameters

dset :  h5py.Dataset
h5py dataset from which the data is read
data_sel :  numpy slice
A numpy slice generated for example numpy.s_
Default read while array
field : str
Name of field in compound dataset or None

Returns

Numpy array

Notes

Read floats always as doubles
Return data of the HDF5 dataset Parameters dset : h5py . Dataset h5py dataset from which the data is read data_sel : numpy slice A numpy slice generated for example numpy . s_ Default read while array field : str Name of field in compound dataset or None Returns Numpy array Notes Read floats always as doubles
def __get_data(dset, data_sel: tuple, field: str):
    if data_sel is None:
        data_sel = ()
    if np.issubdtype(dset.dtype, np.floating):
        data = dset.astype(float)[data_sel]
        data[data == float.fromhex('0x1.ep+122')] = np.nan
        return data
    if field is None:
        return dset[data_sel]
    data = dset.fields(field)[data_sel]
    if np.issubdtype(data.dtype, np.floating):
        data = data.astype(float)
        data[data == float.fromhex('0x1.ep+122')] = np.nan
    return data
def __get_data ( dset , data_sel : tuple , field : str ) : if data_sel is None : data_sel = ( ) if np . issubdtype ( dset . dtype , np . floating ) : data = dset . astype ( float ) [ data_sel ] data [ data == float . fromhex ( '0x1.ep+122' ) ] = np . nan return data if field is None : return dset [ data_sel ] data = dset . fields ( field ) [ data_sel ] if np . issubdtype ( data . dtype , np . floating ) : data = data . astype ( float ) data [ data == float . fromhex ( '0x1.ep+122' ) ] = np . nan return data
Return data of the HDF5 dataset
Parameters
Return data of the HDF5 dataset Parameters
"""
    Return data of the HDF5 dataset

    Parameters
    ----------
    dset :  h5py.Dataset
       h5py dataset from which the data is read
    data_sel :  numpy slice
       A numpy slice generated for example numpy.s_
       Default read while array
    field : str
       Name of field in compound dataset or None

    Returns
    -------
    Numpy array

    Notes
    -----
    Read floats always as doubles
    """
dset
data_sel
tuple
field
str