def _calc_spatial_lat_lon_grid(datasets):
    ''''''
    lat_min, lat_max, lon_min, lon_max = datasets[0].spatial_boundaries()

    lats = datasets[0].lats
    lons = datasets[0].lons
    # These explicit float casts are needed to ensure that the type of the
    # lat/lon steps are not numpy values. PyYAML will choke on export if it
    # encounters a Numpy value.
    lat_step = float(abs(lats[1] - lats[0]))
    lon_step = float(abs(lons[1] - lons[0]))

    # We need to add an extra step value onto the end so when we generate a
    # range with these values we don't lose one that we're expecting.
    if lat_max != 90: lat_max += lat_step
    if lon_max != 180: lon_max += lon_step

    return ((lat_min, lat_max, lat_step), (lon_min, lon_max, lon_step))
dataset/ETHPy150Open apache/climate/ocw_config_runner/configuration_writer.py/_calc_spatial_lat_lon_grid/original