hypso.georeference.georef

Submodules

Package Contents

Classes

GoogleMapsLayers

Google Maps Layers Class

GoogleMapDownloader

A class which generates high resolution google maps images given a longitude, latitude and zoom level

Functions

gen_resample_grid(grid_res_x, grid_res_y, ...)

Generate resample grid to the bbox coordinate limits

gen_resample_grid_bbox_min(grid_res_x, grid_res_y, ...)

Generate resample grid bbox minimum

get_julian_day_number(date_time)

Get Julian Day Number from Date Time

get_greenwich_mean_sidereal_time_seconds(date_time)

Gets Greenwich mean sidereal time in seconds

minimum_bounding_rectangle(points)

Find the smallest bounding rectangle for a set of points. Rval is a 4x2 matrix of bounding box corner coordinates

mat_from_quat(quat)

Matrix from Quaternion

rotate_axis_angle(vec, axis, angle)

Rotates vector vec around axis axis by angle angle Both vec, axis, and vec_rot are column vectors. axis is a

ecef_to_lat_lon_alt(pos)

Input pos has to be Nx3, and units in meters

eci_to_lat_loneci_alt(pos)

ECI to latitude and longitude and altitude

eci_lon_to_ecef_lon(datetime_utc, lon, time_offset)

ECI to longitude to ECEF Longitude conversion

eci_to_lat_lon_alt(pos, times, time_offset)

ECI to Lat/Lon Altitude

pos_ecef_to_lat_lon_alt(pos)

Coverts POS ECEF to latitude and longitude and altitude

lat_lon_alt_to_ecef(lla)

Converts latitude and longitude ALT to ECEF

ellipsoid_line_intersection(point, direction)

Calculates the ellipsodie and line intersection

pixel_to_latlon(px_x, px_y, tl_x, tl_y, zoom_level)

Pixel to Lat Lon

main()

Main entry point

Attributes

R_eq

f

e_2

R_pl

hypso.georeference.georef.gen_resample_grid(grid_res_x, grid_res_y, bbox_coord_limits)

Generate resample grid to the bbox coordinate limits

Parameters:
  • grid_res_x

  • grid_res_y

  • bbox_coord_limits – is expected to be a list or tuple with 4 elements as follows: [xmin, xmax, ymin, ymax]

Returns:

Return type:

Tuple[numpy.ndarray, list]

hypso.georeference.georef.gen_resample_grid_bbox_min(grid_res_x, grid_res_y, bbox_minimal)

Generate resample grid bbox minimum

Parameters:
  • grid_res_x

  • grid_res_y

  • bbox_minimal

    shall have has shape [4,2] and consists of four points describing the corner of the minimal bounding box.

    The width of the box is taken as the distance between point [0,:] and [3,:].

    The height of the box is taken as the distance between point [2,:] and [3,:].

    The x direction is taken as the direction going from point [3,:] to point [0,:].

    The y direction is taken as the direction going from point [3,:] to point [2,:].

Returns:

Return type:

Tuple[numpy.ndarray, list]

hypso.georeference.georef.get_julian_day_number(date_time)

Get Julian Day Number from Date Time

Parameters:

date_time – Date Time

Returns:

Julian day as float

Return type:

float

hypso.georeference.georef.get_greenwich_mean_sidereal_time_seconds(date_time)

Gets Greenwich mean sidereal time in seconds

Parameters:

date_time

Returns:

seconds since last midnight of a sidereal day

Return type:

float

hypso.georeference.georef.minimum_bounding_rectangle(points)

Find the smallest bounding rectangle for a set of points. Rval is a 4x2 matrix of bounding box corner coordinates

Parameters:

points – nx2 matrix of coordinates

Returns:

a set of points representing the corners of the bounding box.

Return type:

numpy.ndarray

hypso.georeference.georef.mat_from_quat(quat)

Matrix from Quaternion

Parameters:

quat – must be a four element list of numbers or 4 element nump array

Return type:

numpy.ndarray

:return:a 3x3 numpy array containing the rotation matrix

hypso.georeference.georef.rotate_axis_angle(vec, axis, angle)

Rotates vector vec around axis axis by angle angle Both vec, axis, and vec_rot are column vectors. axis is a unit vector, angle is in radians

Parameters:
  • vec

  • axis

  • angle

Returns:

Return type:

numpy.ndarray

hypso.georeference.georef.R_eq = 6378137.0
hypso.georeference.georef.f
hypso.georeference.georef.e_2
hypso.georeference.georef.R_pl = 6356752.0
hypso.georeference.georef.ecef_to_lat_lon_alt(pos)

Input pos has to be Nx3, and units in meters

Parameters:

pos

Returns:

lat lon (with respect to ECI axes) and altitude in degrees and meters

Return type:

numpy.ndarray

hypso.georeference.georef.eci_to_lat_loneci_alt(pos)

ECI to latitude and longitude and altitude

Parameters:

pos

Returns:

Return type:

numpy.ndarray

hypso.georeference.georef.eci_lon_to_ecef_lon(datetime_utc, lon, time_offset)

ECI to longitude to ECEF Longitude conversion :param datetime_utc: :param lon: :param time_offset:

Returns:

Return type:

float

hypso.georeference.georef.eci_to_lat_lon_alt(pos, times, time_offset)

ECI to Lat/Lon Altitude

Parameters:
  • pos – needs to be Nx3

  • times – needs to be N

  • time_offset – is a float. is an additional time offset to adjust georeferencing

Returns:

Numpy array with pseudo latitude and longitude and altitude

Return type:

numpy.ndarray

hypso.georeference.georef.pos_ecef_to_lat_lon_alt(pos)

Coverts POS ECEF to latitude and longitude and altitude :param pos: :return:

Return type:

numpy.ndarray

hypso.georeference.georef.lat_lon_alt_to_ecef(lla)

Converts latitude and longitude ALT to ECEF :param lla: :return:

Return type:

numpy.ndarray

hypso.georeference.georef.ellipsoid_line_intersection(point, direction)

Calculates the ellipsodie and line intersection

Parameters:
  • point

  • direction

Returns:

Return type:

Tuple[float, float]

hypso.georeference.georef.pixel_to_latlon(px_x, px_y, tl_x, tl_y, zoom_level)

Pixel to Lat Lon

Parameters:
  • px_x – Pixel coordinates of google maps image (can be float)

  • px_y – Pixel coordinates of google maps image (can be float)

  • tl_x – tile indices of top left (noth-western) corner (must be int)

  • tl_y – tile indices of top left (noth-western) corner (must be int)

  • zoom_level – zoom level of the image (also must be int)

Returns:

lat,lon

Return type:

Tuple[float, float]

class hypso.georeference.georef.GoogleMapsLayers

Google Maps Layers Class

ROADMAP = 'v'
TERRAIN = 'p'
ALTERED_ROADMAP = 'r'
SATELLITE = 's'
TERRAIN_ONLY = 't'
HYBRID = 'y'
class hypso.georeference.georef.GoogleMapDownloader(lat, lng, zoom=12, layer=GoogleMapsLayers.SATELLITE)

A class which generates high resolution google maps images given a longitude, latitude and zoom level

latlon_to_tileXY()

Generates an X,Y tile coordinate based on the latitude, longitude and zoom level

Returns:

An X,Y tile coordinate

Return type:

Tuple[float, float]

generateImage(**kwargs)

Generates an image by stitching a number of google map tiles together.

Parameters:

kwargs – center_tile_x: The center tile x coordinate center_tile_y: The center tile y coordinate tile_count_x: The number of tiles wide the image should be tile_count_y: The number of tiles high the image should be

Returns:

A high-resolution Goole Map image, and the tile coordinates of the top left tile in the image.

Return type:

Tuple[PIL.Image.Image, tuple]

hypso.georeference.georef.main()

Main entry point

Returns:

Return type:

None