Reference

pysofa is a functional programming tool. This means it is a collection of independent functions and, apart from input and output values which are python objects, it does not provide object-oriented machinery. There are plans to build an OOP version using SOFA routines, but it is yet unclear if these will be included as part of pysofa or of another module which will make use of pysofa.

Function names in pysofa are almost directly mapped to those of the SOFA library, with two slight modifications:

  • the iau prefix is removed to conform with the SOFA license
  • names are all lowercased, to conform with PEP 8

thus, for example, the SOFA routine iauEra00 is accessible via pysofa.era00.

All functions in this module are accessible under the pysofa namespace, but, for the sake of convenience, the complete list of functions has been divided into three separate pages, with functions grouped by scope:

The documentation of pysofa is quite terse and merely consist of a brief summary and a list of expected input/output types and values. Users are urged to refer to the official SOFA manual for detailed explanations on this routines, especially to get references for the algorithms used. Each documented function in pysofa refers to the relevant page of the official manual.pdf file distributed with SOFA. Note that these page numbers match those of the latest release of SOFA and should be adapted when using older version of the manual.

Apart from the functions directly underlied by SOFA listed in the next pages, pysofa provides the following ones:

pysofa.get_sofa_version()

Return a tuple containing the three components of the SOFA library release wich has been loaded, in the form (year, month, day).

In case the release number hasn’t been resolved (None, None, None) is returned. This should never occur and shall be signaled as a bug.

Note

this only deals with major release numbers and does not account for revised versions of SOFA.

pysofa.has_function(funcname)
Helper function that returns True if this particular release of SOFA provides the function funcname, and False otherwise. This is only the case with function names that are legal SOFA function names, wich means that calling has_function with a funcname that isn’t known by any version of SOFA will raise AttributeError.

Indices and tables

Table Of Contents

Previous topic

Welcome to pysofa’s documentation page !

Next topic

Date time functions

This Page