For my first mapping I wrote UnitNormMap, a map outputs unit vector and norm relative to a specified center. This can then be used with a 1-dimensional PolyMap to make a radial polynomial map, which can be used to model optical distortion.
I modified a copy of astShiftMap. This required creating the actual .c and .h files, and then updating the following files based on searching for ShiftMap and shiftmap:
- Ast.c (the python interface)
The changes are trivial in globals.c, globals.h, loader.c, and setup.py but the others require some care.
Additional changes are needed to support FORTRAN. The manual might also want an update, though it is possible that the reference section is automatically generated.
Furthermore, I modified a fork of PyAST, which contains a distribution of AST, but not its unit tests. PyAST has its own tests, but leaves most of the testing of mappings to AST. I added extensive testing for the new mapping in python, but did not attempt to add C tests.
The changes are here: https://github.com/r-owen/starlink-pyast.git on branch unitnormmap. The new map is being considered for inclusion in AST.