Git Product home page Git Product logo

Comments (1)

ckhroulev avatar ckhroulev commented on June 2, 2024 1

Here's an idea: we could use the NetCDF format for this, very much like we do to store PISM's configuration parameters.

PISM's source code would contain a pism_epsg.cdl file like this:

netcdf pism_epsg {
variables:
	int epsg_3413 ;
		epsg_3413:latitude_of_projection_origin = 90. ;
		epsg_3413:scale_factor_at_projection_origin = 1. ;
		epsg_3413:straight_vertical_longitude_from_pole = -45. ;
		epsg_3413:standard_parallel = 70. ;
		epsg_3413:false_northing = 0. ;
		epsg_3413:grid_mapping_name = "polar_stereographic" ;
		epsg_3413:false_easting = 0. ;
	int epsg_3031 ;
		epsg_3031:latitude_of_projection_origin = -90. ;
		epsg_3031:scale_factor_at_projection_origin = 1. ;
		epsg_3031:straight_vertical_longitude_from_pole = 0. ;
		epsg_3031:standard_parallel = -71. ;
		epsg_3031:false_northing = 0. ;
		epsg_3031:grid_mapping_name = "polar_stereographic" ;
		epsg_3031:false_easting = 0. ;
	int epsg_3057 ;
		epsg_3057:grid_mapping_name = "lambert_conformal_conic" ;
		epsg_3057:longitude_of_central_meridian = -19. ;
		epsg_3057:false_easting = 500000. ;
		epsg_3057:false_northing = 500000. ;
		epsg_3057:latitude_of_projection_origin = 65. ;
		epsg_3057:standard_parallel = 64.25, 65.75 ;
		epsg_3057:long_name = "CRS definition" ;
		epsg_3057:longitude_of_prime_meridian = 0. ;
		epsg_3057:semi_major_axis = 6378137. ;
		epsg_3057:inverse_flattening = 298.257222101 ;
	int epsg_5936 ;
		epsg_5936:latitude_of_projection_origin = 90. ;
		epsg_5936:scale_factor_at_projection_origin = 1. ;
		epsg_5936:straight_vertical_longitude_from_pole = -150. ;
		epsg_5936:standard_parallel = 90. ;
		epsg_5936:false_northing = 2000000. ;
		epsg_5936:grid_mapping_name = "polar_stereographic" ;
		epsg_5936:false_easting = 2000000. ;
	int epsg_26710 ;
		epsg_26710:longitude_of_central_meridian = -123. ;
		epsg_26710:false_easting = 500000. ;
		epsg_26710:false_northing = 0. ;
		epsg_26710:grid_mapping_name = "transverse_mercator" ;
		epsg_26710:inverse_flattening = 294.978698213898 ;
		epsg_26710:latitude_of_projection_origin = 0. ;
		epsg_26710:scale_factor_at_central_meridian = 0.9996 ;
		epsg_26710:semi_major_axis = 6378206.4 ;
		epsg_26710:unit = "metre" ;
}

that would be converted into a .nc file by the build system. During initialization PISM would read this file and iterate over all the variables to extract the map from EPSG codes to CF variable attributes. Then this map can be used to fill PISM's output files with appropriate CF-conformant metadata based on the EPSG code found in the input file.

Users would be able to create custom pism_epsg.nc file by editing the .cdl file and running ncgen. They would then be able to tell PISM to use this file by setting a command-line option.

Note that this is not needed to be able to generate lon and lat fields and their _bounds: we just need the EPSG code for that.

from pism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.