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 (
floator sequence) – A single x-coordinate or a sequence of x-coordinate values to be converted. - y (
floator 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.ndarrayinstead ofxarray.DataArray. Default is True. - as_int (
bool) – Set to True to return the x,y values asint, otherwise they will be returned asfloat. - map_proj (
int) – Model projection [1=Lambert Conformal, 2=Polar Stereographic, 3=Mercator, 6=Lat-Lon]. Required. - truelat1 (
float) – True latitude 1. Required for map_proj = 1, 2, 3 (defaults to 0 otherwise). - truelat2 (
float) – True latitude 2. Optional for map_proj = 1 (defaults to 0 otherwise). - stand_lon (
float) – Standard longitude. Required. - 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. Optional for map_proj = 6 (defaults to 90 otherwise). - pole_lon (
float) – Pole longitude. Optional for map_proj = 6 (defaults to 0 otherwise). - dx (
float) – The x spacing in meters at the true latitude. Required for map_proj = 1, 2, 3 (defaults to 0 otherwise). - dy (
float) – Required for map_proj = 1, 2, 3 (defaults to 0 otherwise). - latinc (
float) –Required for map_proj = 6. Defined as:
latinc = (dy*360.0)/2.0/Constants.PI/Constants.WRF_EARTH_RADIUS
- loninc (
float) –Required for map_proj = 6. Defined as:
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.DataArrayobject. Otherwise, the result will be anumpy.ndarrayobject with no metadata.Return type: