src/coecms/um/um2oasis.py
def um_endgame_scrip_grids(frac_t):
    """
    Create SCRIP descriptions of the UM ENDGAME t, u and v grids from the land fraction

    Args:
        frac_t (xarray.DataArray): UM land fractions on the theta grid

    Returns:
        dict mapping UM grid names to SCRIP descriptions of that grid
    """
    mask_t = xarray.where(frac_t < 1.0, 0, 1).astype('i4')

    dlat = (mask_t.lat[1] - mask_t.lat[0]).data
    dlon = (mask_t.lon[1] - mask_t.lon[0]).data
    lat_v = np.clip(np.append(mask_t.lat - dlat/2, mask_t.lat[-1] + dlat/2), -90, 90)
    lon_u = mask_t.lon - dlon/2

    mask_v = xarray.DataArray(np.zeros((lat_v.size, mask_t.lon.size), dtype='i4'), coords=[('lat', lat_v), ('lon', mask_t.lon)])
    mask_u = xarray.DataArray(np.zeros((mask_t.lat.size, lon_u.size), dtype='i4'), coords=[('lat', mask_t.lat), ('lon', lon_u)])

    ds_t = latlon_scrip_grid(mask_t)
    ds_v = latlon_scrip_grid(mask_v)
    ds_u = latlon_scrip_grid(mask_u)

    ds_t['grid_area'] = ds_t.grid_area

    return {'um_t': ds_t, 'um_u': ds_u, 'um_v': ds_v}

    Create SCRIP descriptions of the UM ENDGAME t, u and v grids from the land fraction

    Args:
        frac_t (xarray.DataArray): UM land fractions on the theta grid

    Returns:
        dict mapping UM grid names to SCRIP descriptions of that grid
    
Create SCRIP descriptions of the UM ENDGAME t, u and v grids from the land fraction
Create SCRIP descriptions of the UM ENDGAME t u and v grids from the land fraction
def um_endgame_scrip_grids(frac_t):
    mask_t = xarray.where(frac_t < 1.0, 0, 1).astype('i4')
    dlat = (mask_t.lat[1] - mask_t.lat[0]).data
    dlon = (mask_t.lon[1] - mask_t.lon[0]).data
    lat_v = np.clip(np.append(mask_t.lat - dlat/2, mask_t.lat[-1] + dlat/2), -90, 90)
    lon_u = mask_t.lon - dlon/2
    mask_v = xarray.DataArray(np.zeros((lat_v.size, mask_t.lon.size), dtype='i4'), coords=[('lat', lat_v), ('lon', mask_t.lon)])
    mask_u = xarray.DataArray(np.zeros((mask_t.lat.size, lon_u.size), dtype='i4'), coords=[('lat', mask_t.lat), ('lon', lon_u)])
    ds_t = latlon_scrip_grid(mask_t)
    ds_v = latlon_scrip_grid(mask_v)
    ds_u = latlon_scrip_grid(mask_u)
    ds_t['grid_area'] = ds_t.grid_area
    return {'um_t': ds_t, 'um_u': ds_u, 'um_v': ds_v}
def um_endgame_scrip_grids ( frac_t ) : mask_t = xarray . where ( frac_t < 1.0 , 0 , 1 ) . astype ( 'i4' ) dlat = ( mask_t . lat [ 1 ] - mask_t . lat [ 0 ] ) . data dlon = ( mask_t . lon [ 1 ] - mask_t . lon [ 0 ] ) . data lat_v = np . clip ( np . append ( mask_t . lat - dlat / 2 , mask_t . lat [ - 1 ] + dlat / 2 ) , - 90 , 90 ) lon_u = mask_t . lon - dlon / 2 mask_v = xarray . DataArray ( np . zeros ( ( lat_v . size , mask_t . lon . size ) , dtype = 'i4' ) , coords = [ ( 'lat' , lat_v ) , ( 'lon' , mask_t . lon ) ] ) mask_u = xarray . DataArray ( np . zeros ( ( mask_t . lat . size , lon_u . size ) , dtype = 'i4' ) , coords = [ ( 'lat' , mask_t . lat ) , ( 'lon' , lon_u ) ] ) ds_t = latlon_scrip_grid ( mask_t ) ds_v = latlon_scrip_grid ( mask_v ) ds_u = latlon_scrip_grid ( mask_u ) ds_t [ 'grid_area' ] = ds_t . grid_area return { 'um_t' : ds_t , 'um_u' : ds_u , 'um_v' : ds_v }
Create SCRIP descriptions of the UM ENDGAME t, u and v grids from the land fraction
Create SCRIP descriptions of the UM ENDGAME t u and v grids from the land fraction
"""
    Create SCRIP descriptions of the UM ENDGAME t, u and v grids from the land fraction

    Args:
        frac_t (xarray.DataArray): UM land fractions on the theta grid

    Returns:
        dict mapping UM grid names to SCRIP descriptions of that grid
    """
dict mapping UM grid names to SCRIP descriptions of that grid
dict mapping UM grid names to SCRIP descriptions of that grid
frac_t
UM land fractions on the theta grid
UM land fractions on the theta grid