BPMF.ploting_utils

BPMF.plotting_utils.add_scale_bar(ax, x_start, y_start, distance, source_crs, orientation='longitudinal', **kwargs)[source]
Parameters:
  • ax (GeoAxes instance) – The axis on which we want to add a scale bar.

  • x_start (float) – The x coordinate of the left end of the scale bar, given in the axis coordinate system, i.e. from 0 to 1.

  • y_start (float) – The y coordinate of the left end of the scale bar, given in the axis coordinate system, i.e. from 0 to 1.

  • distance (float) – The distance covered by the scale bar, in km.

  • source_crs (cartopy.crs) – The coordinate system in which the data are written.

  • orientation (string, default to 'longitudinal') – Either ‘longitudinal’ or ‘latitudinal’. Determine the orientation of the scale bar.

BPMF.plotting_utils.initialize_map(map_longitudes, map_latitudes, map_axis=None, seismic_stations=None, text_size=14, markersize=10, topography_file=None, path_topo='', faults=None, right_labels=False, left_labels=True, bottom_labels=True, top_labels=False, **kwargs)[source]

Initialize map instance with Cartopy.

BPMF.plotting_utils.plot_catalog(tids=None, db_path_T=None, db_path_M=None, catalog=None, ax=None, remove_multiples=True, scat_kwargs={}, cmap=None, db_path='')[source]
BPMF.plotting_utils.plot_detection_matrix(X, datetimes=None, stack=None, title=None, ax=None, show=True, **kwargs)[source]
BPMF.plotting_utils.plot_template(idx, db_path_T='template_db_2/', db_path='', n_stations=10, stations=None, mv_view=True, show=True)[source]
BPMF.plotting_utils.uncertainty_ellipse(hmax_uncertainty_km, hmin_uncertainty_km, hmax_azimuth_deg, longitude_center, latitude_center, num_points=100)[source]

Compute a set of longitude and latitude points that describe the uncertainty ellipse in the horizontal plane.

Parameters:
  • hmax_uncertainty_km (float) – The length of the major axis of the uncertainty ellipse in kilometers.

  • hmin_uncertainty_km (float) – The length of the minor axis of the uncertainty ellipse in kilometers.

  • hmax_azimuth_deg (float) – The azimuth angle of the major axis of the uncertainty ellipse in degrees.

  • longitude_center (float) – The longitude coordinate of the center point of the ellipse.

  • latitude_center (float) – The latitude coordinate of the center point of the ellipse.

  • num_points (int, optional) – The number of points used to describe the ellipse, default is 100.

Returns:

  • longitude_ellipse (numpy.ndarray) – The longitude coordinates of the points that make up the uncertainty ellipse.

  • latitude_ellipse (numpy.ndarray) – The latitude coordinates of the points that make up the uncertainty ellipse.

BPMF.plotting_utils.vertical_uncertainty_ellipse(cov_mat, longitude_center, latitude_center, depth_center, horizontal_direction='longitude', num_points=100)[source]

Compute a set of longitude and latitude points that describe the uncertainty ellipse in the vertical plane.

Parameters:
  • cov_mat (numpy.ndarray) – The (3x3) covariance matrix returned by Event.relocate(method=’NLLoc’).

  • longitude_center (float) – The longitude coordinate of the center point of the ellipse.

  • latitude_center (float) – The latitude coordinate of the center point of the ellipse.

  • depth_center (float) – The depth, in km, of the center point of the ellipse.

  • horizontal_direction (str, optional) – Either ‘longitude’ or ‘latitude’. Define the x-coordinate of the plane.

  • num_points (int, optional) – The number of points used to describe the ellipse, default is 100.

Returns:

  • longitude_ellipse (numpy.ndarray) – The longitude coordinates of the points that make up the uncertainty ellipse.

  • latitude_ellipse (numpy.ndarray) – The latitude coordinates of the points that make up the uncertainty ellipse.

  • depth_ellipse (numpy.ndarray) – The depth, in km, of the points that make up the uncertainty ellipse.