gridit v3.2.3¶
Mercurial revision 5770:c90c3015e72d | 2026-05-22
Description¶
gridit is a tool that converts unstructured data to structured grids. It processes input files (e.g., finite element or mesh-based data) and generates structured output in various formats such as ASCII, NetCDF, or BMG.
Usage¶
gridit input [OPTIONS] file
Options¶
Option |
Description |
|---|---|
|
Display help and exit. |
|
Define grid mapping using the format |
|
Number of iterations for growing unmasked pixels. |
|
Discretization pair for NetCDF input atlas. |
|
NetCDF input atlas file name convention. See Notes for details. |
|
Grid file followed by an empty-terminated list of up to 3 gridded variable names for |
|
Notebook file containing grid or projection definitions. |
|
Mesh file (required). |
|
Zone name or global resolution. |
|
Output root name. Default: |
|
Input format. Default: |
Examples¶
Basic Conversion (ASCII Output)¶
Convert an unstructured .s2r file to ASCII format:
gridit input.s2r -f ascii -m mesh_file.nc
Convert to NetCDF with Custom Output Name¶
Convert an unstructured .s2r file to NetCDF format with a custom output name:
gridit input.s2r -f netcdf -o output_root -m mesh_file.nc
Specify Grid Span and Resolution¶
Convert an input file with a custom grid span and resolution:
gridit input.s2r -xmin 0 -xmax 10 -ymin 0 -ymax 10 -dx 0.1 -dy 0.1 -m mesh_file.nc
Use a Predefined Zone¶
Convert an input file using a predefined zone:
gridit input.s2r -z "global_1deg" -m mesh_file.nc
Apply Persistence for Unmasked Pixels¶
Convert an input file with persistence applied to unmasked pixels:
gridit input.s2r --persistence 5 -m mesh_file.nc
Custom Mapping¶
Convert an input file with a custom mapping:
gridit input.s2r --mapping "[0:0.5:10; 0:0.5:10]" -m mesh_file.nc
Convert Vector Data (V2R to NetCDF)¶
Convert a vector .v2r file to NetCDF format:
gridit input.v2r -f netcdf -m mesh_file.nc -g grid_file.nc u v
Use a Notebook File¶
Convert an input file using a notebook file for grid definitions:
gridit input.s2r -n notebook_file.txt -m mesh_file.nc
Environment Variables¶
gridit does not explicitly rely on environment variables for its core functionality. However, if used in conjunction with other tools or scripts, standard environment variables (e.g., PATH, LD_LIBRARY_PATH) may apply.
Notes¶
Input Files:
Supported input formats:
.s2r,.s2c,.v2r,.v2c.The
-m(mesh file) option is required for all conversions.
Output Formats:
Supported output formats:
ascii,netcdf,grd,bmg.If the output format is
netcdf, the-discretisationoption may be required for proper handling of the input atlas.
Grid and Mesh:
The
-goption requires a grid file followed by up to 3 variable names (e.g., fore,u, andvcomponents in vector data).The
--mappingoption allows flexible grid definitions. Ensure the syntax is correct (e.g.,[lonmin:dlon:lonmax; latmin:dlat:latmax]).
Resolution Units:
Units for
-dxand-dycan be specified as:d: Degreesm: Minutes': Arcminutess: Seconds": Arcseconds
Example:
-dx 30'(30 arcminutes) or-dy 0.5d(0.5 degrees).
Persistence:
The
--persistenceoption is useful for filling gaps in unmasked regions by iteratively growing unmasked pixels.
Zone and Global Resolution:
The
-zoption can specify a predefined zone (e.g.,global_1deg) or a global resolution.
See Also¶
Quoddy Finite Element Model (for
.s2r,.s2c,.v2r,.v2cformats)