import_section#

import_section(path, file_name, var, lon_min, lon_max, lat_min, lat_max, M, depth_interval)[source]#

Import a vertical section from a file. Supports all kinds of sections: along latitude, longitude, or diagonal line. This function serves as the main controller.

Parameters:
  • path (str) – Path to the file. This path should contain the grid.nc as well.

  • file_name (str) – Name of the file.

  • var (str) – Name of the variable.

  • lon_min (float) – Limits of the line. If lon_min = lon_max, it is treated as a line along longitude, and vice versa.

  • lon_max (float) – Limits of the line. If lon_min = lon_max, it is treated as a line along longitude, and vice versa.

  • lat_min (float) – Limits of the line. If lon_min = lon_max, it is treated as a line along longitude, and vice versa.

  • lat_max (float) – Limits of the line. If lon_min = lon_max, it is treated as a line along longitude, and vice versa.

  • M (int) – Number of points in the section following its direction from A to B.

  • depth_interval (float) – Interval of Z.

Returns:

  • new_depth (ndarray of shape (K, M)) – Shared regular depth grid replicated across columns.

  • data_out (ndarray of shape (K, M)) – Interpolated data on new_depth.