pyacs.lib.utils.make_grid

Grid generation utilities.

pyacs.lib.utils.make_grid.make_grid(min_lon, max_lon, min_lat, max_lat, nx=None, ny=None, step_x=None, step_y=None, outfile=None, format='psvelo', comment='')[source]

Generate a regular grid and optionally write it to a text file.

Parameters:
  • min_lon (float) – Minimum longitude (decimal degrees).

  • max_lon (float) – Maximum longitude (decimal degrees).

  • min_lat (float) – Minimum latitude (decimal degrees).

  • max_lat (float) – Maximum latitude (decimal degrees).

  • nx (int, optional) – Number of points along longitude. If provided, ny defaults to nx.

  • ny (int, optional) – Number of points along latitude.

  • step_x (float, optional) – Longitude step (alternative to nx).

  • step_y (float, optional) – Latitude step; defaults to step_x if not provided.

  • outfile (str, optional) – Output file path. If None, no file is written.

  • format (str, optional) – None for lon,lat only; ‘psvelo’ for psvelo-style rows. Default is ‘psvelo’.

  • comment (str, optional) – Comment for the output file. Default is ‘’.

Returns:

2D array of shape (n_points, 2) with lon, lat columns.

Return type:

numpy.ndarray