Repository navigation
OpenXISF 0.5.0
OpenXISF 0.5.0 reads the astrometric solutions of images, as the XISF specification defines them, and converts image coordinates to celestial coordinates and back with them. Before 1.0, minor versions may change the API.
Astrometric solutions
- Reading a solution (
<openxisf/astrometry.h>).astrometric_solutionreads the solution of an image from its properties, theAstrometricSolutionnamespace of spec §11.5.3.7, in its three layers: the projection, with its reference point and linear transformation; the projective transformations; and the distortion models, surface splines of the six basis functions of the specification with Global, Local and Fallback terms. Each layer is checked for its required properties and their dimensions.status()says whether a layer is available or why not (a missing property, an inconsistent one, an unknown identifier, a lower layer that is not available), andproblem()explains it. A solution of another major revision is not read at all, and unknown properties of a supported revision are ignored, as the versioning rules of the specification ask. - Converting coordinates.
image_to_celestial()andcelestial_to_image()go through the highest available layer, or a chosen one: the seven projections of the specification (Gnomonic, Stereographic, zenithal equal-area, Orthographic, Plate Carrée, Mercator and Hammer-Aitoff), the spherical rotation of Annex A with its default native coordinates, the projective transformations and the residuals of the distortion models. Each direction uses the transformation that the solution stores, never a numerical inversion, in double precision. A point beyond the domain of a projection has no coordinates.projection()gives the first layer with the defaults of the specification applied. - Writing. The writer keeps the properties of a solution as they are given. A solution describes the image it was computed for: an application that crops, resamples or otherwise changes the geometry of an image removes it with
remove_astrometric_solution(), as the specification requires. - An
astrometric_solutionis immutable, and any number of threads can use it at once; its copies share their data.read_infoprints the solution of each image, with the coordinates of its centre.
OpenXISF agrees within 3e-12 pixels with the coordinates that PixInsight 1.9.5 computes for its own solutions, where the specification expects implementations to agree within 1e-6 pixels, and within 1e-11 pixels with WCSLIB for linear solutions of every projection. Samples written by PixInsight with its coordinates, and WCSLIB's coordinates, are part of the tests.
Compatibility
- The new header is included by
<openxisf/openxisf.h>. The rest of the API is unchanged. - The properties of a solution of another major revision have types of their own: the reader no longer warns that their types differ from those of revision 1, and the writer no longer refuses them. Within revision 1, both check the types as before.
Not yet
Signed units. Distortion models are evaluated one point at a time, visiting every term of the model.
Building and testing
The library builds with CMake 3.25 or newer and installs a CMake package (find_package(openxisf CONFIG REQUIRED)) and a pkg-config file. Its dependencies are pugixml, zlib, LZ4 and Zstandard; oneTBB and OpenSSL are optional. See the README for the presets and options.
The tests of this release pass in CI on Linux (GCC 14 and Clang 18 with libstdc++ and libc++, x64 and arm64, with AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer, clang-tidy and fuzzing, and builds with oneTBB and OpenSSL), on Windows (MSVC x64 and arm64, clang-cl, MSYS2 UCRT64 and CLANG64) and on macOS (AppleClang, arm64 and x64), and the vcpkg port builds on all three.
The API documentation is attached as openxisf-0.5.0-docs.tar.gz.