compass.landice.mesh.add_grid_imask_from_dst_scrip_hull
- compass.landice.mesh.add_grid_imask_from_dst_scrip_hull(source_scrip, dest_scrip, masked_source_scrip, domain, buffer_m=50000.0, source_crs='EPSG:4326', mesh_crs=None, hull_path=None, logger=None)[source]
Create a new source SCRIP file with grid_imask set to 1 only for cells that fall within the boundary (plus buffer) of the destination SCRIP footprint. This dramatically reduces the work ESMF_RegridWeightGen must do when the source dataset is much larger than the destination mesh.
- Parameters:
source_scrip (str) – Input source SCRIP file
dest_scrip (str) – Destination SCRIP file used by ESMF_RegridWeightGen. Ignored if hull_path is provided.
masked_source_scrip (str) – Output source SCRIP file with updated grid_imask
domain (str) – Projection domain. Recognised convenience keys: ‘greenland’, ‘gis-gimp’, ‘antarctica’, ‘ais-bedmap2’. Any other value requires mesh_crs to be supplied explicitly.
buffer_m (float, optional) – Approximate outward hull expansion in meters. Ignored if hull_path is provided.
source_crs (str, optional) – CRS of lon/lat variables in SCRIP files (default ‘EPSG:4326’)
mesh_crs (str, optional) – Proj4/EPSG string for planar coordinates. Derived from domain if None.
hull_path (matplotlib.path.Path or None, optional) – Pre-built buffered concave boundary of the destination mesh footprint, as returned by
compass.landice.mesh.build_dst_scrip_hull(). When provided, dest_scrip is not read and the boundary is not recomputed, which is useful when masking multiple source datasets against the same destination mesh.logger (logging.Logger, optional) – Logger for status messages; falls back to print if None.