pyremap.descriptor.LatLonGridDescriptor.read

classmethod LatLonGridDescriptor.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 describe contiguous cells. 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 and longitude variables in the grid file

  • lon_var_name (str, optional) – The name of the latitude and longitude variables 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. If None, this will be determined automatically by checking the limits of the corner latitude and longitude to see if they cover the globe.