Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ get_proj_parameters()

static std::string pism::get_proj_parameters ( const File input_file,
const std::string &  mapping_variable_name 
)
static

Get PROJ parameters from the grid mapping variable mapping_variable_name in input_file or from global attributes.

Return the string containing PROJ parameters.

Tries

  • reading the "crs_wkt" attribute of the grid mapping variable (CF conventions)
  • reading the "proj_params" attribute of the grid mapping variable (convention used by CDO)

If failed to discover PROJ parameters, tries global attributes "proj" and "proj4", in this order (PISM's old convention).

Definition at line 278 of file projection.cc.

References contains_epsg(), parse_epsg(), printf(), and pism::File::read_text_attribute().

Referenced by pism::MappingInfo::FromFile().