wrf.ll_to_xy_proj¶
-
wrf.
ll_to_xy_proj
(latitude, longitude, meta=True, squeeze=True, as_int=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 x, y coordinates for a specified latitude and longitude.
The latitude and longitude arguments can be a single value or a sequence of values. This version of the ll_to_xy routine allows users to manually specify projection parameters.
The leftmost dimension of the returned array represents two different quantities:
- return_val[0,…] will contain the X (west_east) values.
- return_val[1,…] will contain the Y (south_north) values.
Parameters: - latitude (
float
or sequence) – A single latitude or a sequence of latitude values to be converted. - longitude (
float
or sequence) – A single longitude or a sequence of latitude 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. - as_int (
bool
) – Set to False to return the x,y values asfloat
, otherwise they will be returned asint
. 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 x,y coordinate value(s) whose leftmost dimension is 2 (0=X, 1=Y). 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: