pyremap.descriptor.LatLon2DGridDescriptor.read

classmethod LatLon2DGridDescriptor.read(filename=None, ds=None, lat_var_name='lat', lon_var_name='lon', mesh_name=None, regional=None)[source]

Read the lat-lon grid from a file with the given lat/lon var names.

Grid-cell corners come from the CF bounds of the latitude and longitude variables if they are available and neighboring cells share vertices. Otherwise, corners are interpolated and extrapolated from the cell centers.

Parameters:
  • filename (str, optional) – The path of the file containing the lat-lon grid (if ds is not supplied directly)

  • ds (xarray.Dataset, optional) – The path of the file containing the lat-lon grid (if supplied, filename will be ignored)

  • lat_var_name (str, optional) – The name of the latitude variable in the grid file

  • lon_var_name (str, optional) – The name of the longitude variable in the grid file

  • mesh_name (str or None, optional) – The name of the mesh or grid, used to give mapping files unique names

  • regional (bool or None, optional) – Whether this is a regional or global grid. A 2D grid cannot be classified automatically, so None is treated as regional (the default). Pass regional=False for global grids with 2D lat/lon.