hypso.plot.map

Module Contents

Functions

axis_extent(lat, lon)

Calculate the axis extent of the capture using the latitude and longitude arrays

image_extent(inproj_value, lat, lon)

Calculate the image extent of the capture using the latitude and longitude arrays to plot capture on a map.

tick_log_formatter(y, pos)

Matplotlib Image tick formatter

get_cartopy_axis(satellite_obj, dpi_input)

Get cartopy axis adjusted to the projection of the Hypso capture focused on the map area defined by the latitude

point_rgb_map(satellite_obj[, plotTitle, dpi_input, ...])

Function to add points to overlay on the RGB Map of the Hypso image

show_rgb_map(satellite_obj[, plotTitle, dpi_input])

Show RGB overlay of the Hypso image on a map.

plot_array_overlay(satellite_obj, plot_array[, ...])

Plot a 2D array overlayed on a RGB Hypso Capture on a Map.

auto_adjust_img(img)

Automatically adjust the image contracts using histogram equalization.

get_rgb(sat_obj[, R_wl, G_wl, B_wl])

Write an RGB Image from specified Bands. Optional parameters are

check_projection_geotiff(satobj)

Check and generate the projection metadata from GeoTiff. Generates GeoTiff if none is found.

write_rgb_to_png(sat_obj, path_to_save)

Write the RGB image to a .png file

Attributes

PLOTZOOM

hypso.plot.map.PLOTZOOM = 1.0
hypso.plot.map.axis_extent(lat, lon)

Calculate the axis extent of the capture using the latitude and longitude arrays

Parameters:
  • lat (numpy.ndarray) – 2D array of latitudes

  • lon (numpy.ndarray) – 2D array of longitudes

Returns:

List with the [lon_min, lon_max, lat_min, lat_max]

Return type:

List[float]

hypso.plot.map.image_extent(inproj_value, lat, lon)

Calculate the image extent of the capture using the latitude and longitude arrays to plot capture on a map.

Parameters:
  • inproj_value (osgeo.osr.SpatialReference) – Spatial reference projection value

  • lat (numpy.ndarray) – 2D array of latitudes

  • lon (numpy.ndarray) – 2D array of longitudes

Returns:

Returns two values, the image extent of the capture transformed into an EPSG projection and the projection into a cartopy projection

Return type:

Tuple[tuple, cartopy._epsg._EPSGProjection]

hypso.plot.map.tick_log_formatter(y, pos)

Matplotlib Image tick formatter

Parameters:
  • pos – Axis position

  • y – Y-axis object

Returns:

Formatted axis to log format

hypso.plot.map.get_cartopy_axis(satellite_obj, dpi_input)

Get cartopy axis adjusted to the projection of the Hypso capture focused on the map area defined by the latitude and longitude arrays.

Parameters:
  • satellite_obj – Hypso satellite object

  • dpi_input (int) – DPI Resolution for the plot

Returns:

Matplotlib axes object adjusted to the Hypso image, the image extent tuple, the project RPSG and the latitude and longitude array.

Return type:

Tuple[matplotlib.axes.Axes, tuple[float, float, float, float], cartopy._epsg._EPSGProjection, numpy.ndarray, numpy.ndarray]

hypso.plot.map.point_rgb_map(satellite_obj, plotTitle='RGB Image', dpi_input=450, patch_dict=None, r_plot=0.007, path_to_save=None)

Function to add points to overlay on the RGB Map of the Hypso image

Parameters:
  • satellite_obj – Hypso satellite object

  • plotTitle – Title for the plot

  • dpi_input – Resolution in DPI´s. Default 450.

  • patch_dict – Dictionary containing the location and color of the points to plot {"Point 1":{"lat":60.7776, "lon":11.0895, "color":"red"}, "Point 2":{"lat":60.5, "lon":10.4, "color":"orange"}}

  • r_plot – Radius of the plotted points. Default: 0.007.

  • path_to_save – Absolute Path to save the plot image.

Returns:

No return.

Return type:

None

hypso.plot.map.show_rgb_map(satellite_obj, plotTitle='RGB Image', dpi_input=450)

Show RGB overlay of the Hypso image on a map.

Parameters:
  • satellite_obj – Hypso satellite object

  • plotTitle – Title for the plot

  • dpi_input – Resolution in DPI´s. Default 450.

Returns:

No return.

Return type:

None

hypso.plot.map.plot_array_overlay(satellite_obj, plot_array, plotTitle='2D Array', cbar_title=' Chlorophyll Concentration [mg m^-3]', dpi_input=450, min_value=0.01, max_value=100)

Plot a 2D array overlayed on a RGB Hypso Capture on a Map.

Parameters:
  • satellite_obj – Hypso satellite object

  • plot_array – 2D array to plot. Should be of the same size of the Hypso capture Lat/Lon arrays

  • plotTitle – Tile for the plot

  • cbar_title – Tile for the colorbar

  • dpi_input – Resolution in DPI´s. Default 450.

  • min_value – Minimum value for the Colorbar

  • max_value – Maximum value for the Colorbar

Returns:

No return.

Return type:

None

hypso.plot.map.auto_adjust_img(img)

Automatically adjust the image contracts using histogram equalization.

Parameters:

img (numpy.ndarray) – Image to adjust as a numpy array.

Returns:

Adjusted image as a numpy array.

Return type:

numpy.ndarray

hypso.plot.map.get_rgb(sat_obj, R_wl=650, G_wl=550, B_wl=450)

Write an RGB Image from specified Bands. Optional parameters are

Parameters:
  • R_wl – The wavelength for the red channel. Defaults to 650.

  • G_wl – The wavelength for the green channel. Defaults to 550.

  • B_wl – The wavelength for the blue channel. Defaults to 450.

  • sat_obj – Hypso satellite object

Returns:

PIL Image object

Return type:

numpy.ndarray

hypso.plot.map.check_projection_geotiff(satobj)

Check and generate the projection metadata from GeoTiff. Generates GeoTiff if none is found.

Parameters:

satobj – Hypso satellite object

Returns:

Return type:

None

hypso.plot.map.write_rgb_to_png(sat_obj, path_to_save)

Write the RGB image to a .png file

Parameters:
  • sat_obj – Hypso Satellite object

  • path_to_save (str) – Path to save the .png image. Should include the file extension.

Returns:

No return.

Return type:

None