示例#1
0
def test_make_derived_geographic_crs(tmp_path):
    conversion = RotatedLatitudeLongitudeConversion(o_lat_p=0, o_lon_p=0)
    dgc = DerivedGeographicCRS(base_crs=GeographicCRS(), conversion=conversion)
    assert dgc.name == "undefined"
    assert dgc.type_name == "Derived Geographic 2D CRS"
    assert dgc.coordinate_operation == conversion
    assert dgc.is_derived
    assert_can_pickle(dgc, tmp_path)
示例#2
0
def test_rotated_latitude_longitude_operation():
    aeaop = RotatedLatitudeLongitudeConversion(
        grid_north_pole_latitude=1,
        grid_north_pole_longitude=2,
        north_pole_grid_longitude=3,
    )
    assert aeaop.name == "unknown"
    assert aeaop.method_name == "PROJ ob_tran o_proj=longlat"
    assert _to_dict(aeaop) == {"o_lat_p": 1.0, "o_lon_p": 2.0, "lon_0": 3.0}
示例#3
0
def _rotated_latitude_longitude(cf_params):
    """
    http://cfconventions.org/cf-conventions/cf-conventions.html#_rotated_pole
    """
    return RotatedLatitudeLongitudeConversion(
        o_lat_p=cf_params["grid_north_pole_latitude"],
        o_lon_p=cf_params["grid_north_pole_longitude"],
        lon_0=cf_params.get("north_pole_grid_longitude", 0.0),
    )
def _rotated_latitude_longitude(cf_params):
    """
    http://cfconventions.org/cf-conventions/cf-conventions.html#_rotated_pole
    """
    return RotatedLatitudeLongitudeConversion(
        o_lat_p=cf_params["grid_north_pole_latitude"],
        o_lon_p=cf_params["grid_north_pole_longitude"],
        # https://github.com/pyproj4/pyproj/issues/927
        lon_0=cf_params.get("north_pole_grid_longitude", 0.0) + 180,
    )
def test_rotated_latitude_longitude_operation__defaults():
    aeaop = RotatedLatitudeLongitudeConversion(o_lat_p=1, o_lon_p=2)
    assert aeaop.name == "unknown"
    assert aeaop.method_name == "PROJ ob_tran o_proj=longlat"
    assert _to_dict(aeaop) == {"o_lat_p": 1.0, "o_lon_p": 2.0, "lon_0": 0.0}