Sign up. Implementation of "Astronomical Algorithms" by Jean Meeus. Go Branch: master New pull request. Find File. Download ZIP. Sign in Sign up. Launching GitHub Desktop Go back. Launching Xcode Launching Visual Studio Latest commit bfbd9ac May 10, Meeus Selected algorithms from the book "Astronomical Algorithms" by Jean Meeus, following the second edition, copyright , with corrections as of August 10, Repository organization The branch "master" has the current version.
Package organization Package meeus is a documentation-only package. See meeus package documentation for a chapter title cross-reference. Install package software with go get Technically, go get github. The tests also require the sexagesimal package, so use the -t option to prompt go get to find it as a test dependency: go get -t github.
Tests With all eight VSOP87 files dowloaded as described above, and with an environment variable set to their location, then from the meeus directory go test. To run all tests except for those requiring planet positions computed from the VSOP87 files, use go test -tags nopp. You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. May 10, These windows are currently implemented using wxPython and provide a scrollable text window for output messages, a text box for user input when requested, an "abort" button, and a button to save the text contents to a log file, as well as an indication of the current status. There is one task window for every task executed. The "Close" button is "Abort" while the task is executing. ObitTalk uses the swig utility to provide python callable bindings to the upper-level Obit classes.
These also provide access to data, especially the data descriptors "headers" to help control processing. This provides python-level access to such functionality as "make an image from this data set" or "convolve this image with that Gaussian," allowing flexible prototyping using extant classes in a relatively efficient way because python is only used for high-level control with the bulk of the computation is done in C.
Extensive use is made of the python doc string facility to provide help using python help. In addition, task-level documentation is contained in the AIPS. HLP files and the Obit. TDF files and can be displayed as well. ObitView is an interactive image display written in C and using Motif and the Obit libraries for data access. Once an image is loaded into the display, GUI controls allows the user to modify the display e. Functions include displaying pixel values and coordinates, marking selected positions in an image, blinking between image pairs, and displaying a 3D image as a "movie.
ObitView can also function as a standalone image browser. There is extensive online user documentation available from the help menu. See the electronic edition of the PASP for a color version of this figure.
- African American Journalists: Autobiography as Memoir and Manifesto.
- Astronomical Algorithms - Jean Meeus - Google книги!
- Considerations in Contact Lens Use Under Adverse Conditions: Proceedings of a Symposium?
- Astronomical Algorithms by Jean Meeus - AbeBooks!
- How Cities Reshape the Evolutionary Path of Urban Wildlife.
Currently the detailed applications developed in Obit are for radio astronomy, but the infrastructure should be more widely applicable. In particular, the support of astronomical images is relatively general and includes multidimensional images, blanked pixels, WCS projective geometries, and a number of generic image operations such as pixel arithmetic, FFTs, convolutions, and resampling from one projective geometry onto another.
The interface to tables is also fairly flexible. Astronomical applications involving images or tables that do not need additional C language routines for efficiency could use the distributed Obit package with the addition of python modules for the particular applications. For applications for which the current package is insufficient either because of missing functionality or the need for more efficient implementation in C, additional packages are possible. One such package is the single dish on-the-fly imaging package called ObitSD.
Many operations on data in the form of images or tables can be implemented with only the addition of python modules. If the existing classes are adequate, but the python interface is too inefficient, and a task is adequate, then new tasks could be written in which all operations are executed in C. There is a template task provided to demonstrate the use of the various interfaces.
The Obit class derivation scheme allows classes in additional packages to be derived from the Obit types defined in the basic package. If the predefined data types are inadequate e. If an implementation in python is desirable but a python-only implementation is too slow, then the critical operations need to be implemented in C.
These are best defined in an additional package. The ObitSD package illustrates how this is done. For example, consider the case of a python-based CCD package with an efficient cosmic-ray removal algorithm. The basic input and output data are well describable by images, so that no new data types are needed; although the cosmic ray removal routine needs to be in C for efficiency, other operations could be implemented in python. Image pixel arrays are kept in memory as ObitFArray multidimensional arrays of floats objects; a routine, RemoveCosmicRay, is needed to accept an ObitFArray and replace the values of pixels affected by a cosmic ray by the magic blanking value i.
These would be implemented in a directory myCCD and need the following components:. Obit is maintained by means of cvs, which allows distributed maintenance. Python or C additions to the basic Obit package could either be sent to the author's email address for inclusion, or the author of the software can be given write access to the repository. Additional packages can be maintained by cvs either on an NRAO server or on the author's server. The bulk of the Obit package is in the C language-class library.
The design and properties of this library are discussed in the following. There are certain properties of software, some desirable, some undesirable, that one would like to control.
Astronomical Algorithms by Jean Meeus
Many of them are driven by the use of C. While it is efficient and generally robust, ANSI C does not directly support many object-oriented features that are necessary for a moderate-scale software project. In addition, it is subject to some serious deficiencies, especially the sensitivity to bugs involving memory usage. These design objectives and the implementations in Obit are discussed in the following.
An object-oriented methodology is of great assistance in building software of even moderate complexity. However, efficiency and robustness of the software are also critical. The C language contains no intrinsic support for object-oriented programming, and so the necessary features need to be implemented by convention.
The Obit approach to enforcing these conventions is to try to make following them simple and not following them more difficult. For example, most classes have constructors but, as described below, no explicit destructors. This forces the use of reference counting to manage objects. Library functions have extensive input checking, which also help enforce adherence to the Obit conventions; these checks are compile-time options that may be turned off for fully debugged software. In the Obit implementation of classes, each object is a structure that contains at least a minimum number of members, a standard bit pattern establishing the following as an Obit object, a pointer to the object's class structure, a reference count, and an optional name.
Inheritance is then by means of the C preprocessor. This header file includes at the beginning the corresponding header file of the parent class. The inclusion of the class Def. The classes themselves have a similar construction. Each class has a global structure, mostly defining class function pointers. There is also a flag indicating if the class structure is initialized. On the first call to a constructor of the class, the class hierarchy is recursively initialized. This consists of setting function pointers, starting with the base Obit class.
A template class is provided to simplify the creation of new classes. This illustrates deriving class xxx from class xx using multiple header files. Because C has no syntax for calling an object function, this must be done explicitly in the call sequence. By convention, the object is the first argument of the function call. Calls can be done either directly to the function, if there is no ambiguity, or to the function pointer of the object's class, if polymorphism is potentially needed. One key aspect of a software package is robust object management. In part, this means allowing inheritance of classes to support polymorphism, the ability to use a derived and more specialized class in the same way as a more basic class.
Principal among these is memory usage; C is very flexible in its use of memory but is very unforgiving of bugs. Not deleting unused objects leads to memory leaks and eventually the program slows to a crawl and then dies; multiple deletions of objects leads to mysterious program crashes in places unrelated to the error. Because C does not understand the Obit inheritance scheme, calls to a class function pointer as opposed to directly calling the function must have objects cast to the class that first defined the function.
The called routine must then check that the object is of its own, or of a derived type. This is done by an IsA function in each class that first checks that the object is a valid Obit object and then that the object is of the same, or a derived, type as the class. With a few exceptions, Obit classes have constructors but do not have an explicit destructor. Instead, reference counting is used. When an object is created, its reference count is initialized to 1. Additional references are made using the class Ref function that increments the object's reference count and returns the pointer to the object.
Whenever a routine is finished with an object, the class Unref function is called that decrements the object's reference count and returns a NULL. The object pointer should be set to the return value of the Unref function to prevent future erroneous usages. If the reference count goes to zero, the object is destroyed by first unreferencing any member objects and then deallocating any other memory or resources allocated. Traditional data processing systems have each had their own proprietary data formats, and data in another format had to be translated before it could be used.
This seriously inhibits the interoperability between software packages. If different data formats adhere to a common data model, the translation can be performed on the fly between memory and external disk representations. It is very desirable to have the details of the external representation of a data set hidden from the application software, as this allows it to operate on multiple external forms. Data objects are derived from the ObitData class. Each ObitData object has an ObitIO member for which an object of the appropriate derived class is needed.
These ObitIO objects know how to read and write the external form of the data. Data objects are considered sequences of atoms pixel values, visibility records, etc. Applications then loop over these blocks with some combination of reading, processing, and writing. This "strip-mining" technique allows efficient processing of data sets of arbitrary size.
Because the ObitIO member takes care of translating to and from external forms, applications generally do not need to be aware of the source of the data. This allows simple conversion from one external form to another. One of the common sources of instability in software is the change in call sequence to a routine when control or result parameters change. Such changes frequently involve multiple layers of software used from many places.
It is highly desirable to bundle these parameters in ways that only the software required to set or access these parameters knows of their existence. The ObitInfoList container class allows depositing and accessing a relatively arbitrary set of labeled scalars or arrays of a range of data types.
Access to entries in an ObitInfoList can either consider absence an error or not; in the latter case a default action can be taken. Many complex Obit objects include an ObitInfoList member that is used to define data selection, processing control, or other parameters. This facility is widely used to pass such information to processing functions. Thus, parameters that may or may not be needed do not have to be explicitly given in a call sequence.
Modification of software involving the addition of new parameters only requires changes in the producers and users of the additional parameters. This is a very important feature of classes with a nontrivial inheritance structure for which derived classes may need very different sets of parameters. Obit tasks convert the input parameter file to an ObitInfoList for internal use.
Software should deal gracefully with occasions when things go wrong and the processing cannot be continued as originally planned. In addition, error handling frequently involves logged messages. If a higher level can deal with an error case, then messages leading to or resulting from the error condition may need to be suppressed. Logging messages and error handling is provided by the ObitErr class and any function that can detect errors or generate logging messages has an argument of this class.
Messages are accumulated on an ObitErr object until an explicit request to display them is made. If a routine detects an error that it cannot handle, it will write appropriate logging messages to the ObitErr, set its error flag, and return. The calling routine can then either deal with the problem, clear the flag and remove the associated error messages, or add traceback or other diagnostic information and return. If an unhandled error reaches the top level of an Obit task, the task terminates.
If an unhandled error reaches the python level of an ObitTalk or plain python script or interactive session, it is converted into a python exception. By default, ObitErr messages are written to stderr. However, this system uses the glib logging which allows defining application-specific logging handlers. Once packages grow beyond a certain size or involve multiple programmers, name-space control is critical to avoid conflicts.
For a given library to be callable from other packages, all of its globally visible symbols need to be unique. ANSI C provides few tools for controlling the name-space so this is done in the naming conventions. Public functions have names beginning with the name of the class or utility module to which they belong. The class hierarchy is generally indicated in the names of classes with the class name starting with that of the parent. A few exceptions occur, primarily in the names of the data classes which omit "Data.
Many of the astronomical instruments currently under construction or contemplation will produce so much data that single processor or single thread applications will be seriously inadequate. Efficient use of multiple cores, processors, and computers is an absolute necessity. Distributed processing is also a requirement for large data sets that will require spreading the processing load over nodes of a cluster. For extremely large data sets, it may be impractical to distribute the raw data, and the processing may need to be done close to the source of the data and remote from the user of the software.
There are two principle means of parallel processing in current computational hardware. One is the use of multiple processing threads using a shared address space. The other method is multiple, independent processes using independent address spaces. The first of these is applicable to multiprocessor, or multicore machines, the second to multiprocessor machines, supercomputers, clusters, or networks of independent computers.
The hooks for multithreaded use are implemented by means of the ObitThread class. This class is nominally a mutex with the basic functionality needed to control simple use of threads and is defined but not fully implemented. One major obstacle to full implementation of threading is that cfitsio used for all access to FITS files is not thread-safe. Many of the techniques used in astronomy allow the distribution of processing into multiple loosely coupled processing streams.
One example is the imaging of spectral channels; processing of individual channels is independent, and the coupling is the collection of the results into a single data cube. Thus, tight coupling of parallel processing streams multithreading is not an absolute requirement, but distribution of coarse grained processing units is. In Obit, this is handled at the ObitTalk level. ObitTalk uses its XML-RPC interface to allow distributing processing over nodes of a cluster, over a local area network, or remotely over a wide area network—in particular, the Internet. In practice, multiple independent processing streams of tasks or scripts implemented on a cluster have proved adequate to date for applications of Obit.
For maximum use of a generally usable software package, it should be portable to all platforms and environments in which it is useful. Portable in space means also portable in time and the lifetime of a portable software solution can greatly exceed that of one tailored to a specific environment. Portability, both in space and time, is an important design consideration. The glib library, which is designed to make moderate to large scale C software more portable, is widely used. For example, with few exceptions, data are typed using the glib definitions e. Third-party packages adopted also attempt a high level of portability.
For instance, the cfitsio package for access to FITS files largely hides the difference between the defined data formats of FITS big endian and that of the local host. Many data objects contain tables to store auxiliary information e. This allows a ready re generation of the table class after the definition has been made or modified. A number of third-party software packages are used to reduce the amount of development required directly in Obit. These are briefly described in the following. Much of the third-party software used in Obit has an Obit wrapper class to hide the actual implementation.
This allows the use of ifdef statements based on the results of the installation scripts to select the actual implementation. For "plug compatible" libraries like Motif and LessTif, the selection can be made in the configure stage of installation. To add a new alternate library that is not plug compatible, the installation scripts need to be modified to search for the additional library and the Obit wrapper class code modified for the conditional implementation of the alternate library.
The initial "Obit" is omitted from the class names. These steps are iterated until one of several possible convergence criteria is met. If the region imaged consists of a mosaic with multiple tiles, these are projected "flattened" onto a single image. The component restoration and flattening steps use functionality inherited from the ObitDConClean class. Special cases, such as the spatially variant calibration needed for ionospheric phase corrections or the polarization dependent pointing errors "beam squint" from the off-axis feeds of instruments like the VLA, can be accommodated using the polymorphic properties of specialized classes derived from the ObitUVImager and ObitSkyModel classes.
Astronomical Algorithms - Celestaire, Inc.
This structure can be extended to provide additional, specialized functionality. Detailed documentation of the Obit C language classes is done using the doxygen package. This software uses specially coded comments embedded in the software text files to generate documentation in both LaTeX and html forms. Doxygen does not understand the class structure used in Obit but its documentation display is sufficiently powerful to be useful nonetheless. There are two user-level interfaces to the Obit class libraries.
These are the compiled tasks and the high-level interface from python. Obit tasks are compiled programs linked against the Obit-class libraries.