pynetdesign.modelling.io.global2local#
- pynetdesign.modelling.io.global2local(latY, lonX, refLat=None, refLon=None)[source]#
Converts global latitude and longitude coordinates to Cartesian coordinates under a simple spherical Earth approximation.
- Parameters:
- latY
numpy.ndarray An array of latitude coordinates in degrees.
- lonX
numpy.ndarray An array of longitude coordinates in degrees.
- refLat
float, optional The reference latitude for the local coordinate system. If not provided, the average of the input latitude coordinates will be used.
- refLon
float, optional The reference longitude for the local coordinate system. If not provided, the average of the input longitude coordinates will be used.
- latY
- Returns:
Examples
>>> latY = np.array([37.7749, 34.0522, 40.7128]) >>> lonX = np.array([-122.4194, -118.2437, -74.0060]) >>> x_local_coords, y_local_coords, refLat, refLon = global2local(latY, lonX)