wrf.xy_to_ll_proj¶
- wrf.xy_to_ll_proj(x, y, meta=True, squeeze=True, map_proj=None, truelat1=None, truelat2=None, stand_lon=None, ref_lat=None, ref_lon=None, pole_lat=None, pole_lon=None, known_x=None, known_y=None, dx=None, dy=None, latinc=None, loninc=None)¶
Return the latitude and longitude for the specified x,y coordinates.
The x and y arguments can be a single value or a sequence of values. This version of the xy_to_ll routine allows users to manually specify map projection parameters.
The leftmost dimension of the returned array represents two different quantities:
return_val[0,…] will contain the latitude values.
return_val[1,…] will contain the longitude values.
- Parameters:
x (
float
or sequence) – A single x-coordinate or a sequence of x-coordinate values to be converted.y (
float
or sequence) – A single y-coordinate or a sequence of y-coordinate values to be converted.squeeze (
bool
, optional) – Set to False to prevent dimensions with a size of 1 from being automatically removed from the shape of the output. Default is True.meta (
bool
, optional) – Set to False to disable metadata and returnnumpy.ndarray
instead ofxarray.DataArray
. Default is True.map_proj (
int
) – Model projection [1=Lambert Conformal, 2=Polar Stereographic, 3=Mercator, 6=Lat-Lon]. Required.truelat1 (
float
) – Latitude of true scale 1. Required for map_proj = 1, 2, 3 (defaults to 0 otherwise).truelat2 (
float
) – Latitude of true scale 2. Optional for map_proj = 1 (defaults to 0 otherwise).stand_lon (
float
) – Standard longitude. Required for map_proj = 1, 2, 6 (defaults to 0 otherwise).ref_lat (
float
) – A reference latitude. Required.ref_lon (
float
) – A reference longitude. Required.known_x (
float
) – The known x-coordinate associated with ref_lon. Required.known_y (
float
) – The known y-coordinate associated with ref_lat. Required.pole_lat (
float
) – Pole latitude. Required for map_proj = 6 (use 90 for no rotation).pole_lon (
float
) – Pole longitude. Required for map_proj = 6 (use 0 for no rotation).dx (
float
) – The x spacing in meters at the true latitude. Required for all map projections.dy (
float
) – Required for map_proj = 6 (defaults to 0 otherwise).latinc (
float
) –Optional for map_proj = 6. Default is:
latinc = (dy*360.0)/2.0/Constants.PI/Constants.WRF_EARTH_RADIUS
loninc (
float
) –Optional for map_proj = 6. Default is:
loninc = (dx*360.0)/2.0/Constants.PI/Constants.WRF_EARTH_RADIUS
- Returns:
The latitude and longitude values whose leftmost dimension is 2 (0=latitude, 1=longitude). If xarray is enabled and the meta parameter is True, then the result will be a
xarray.DataArray
object. Otherwise, the result will be anumpy.ndarray
object with no metadata.- Return type: