Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ch_ephem): CHIME ephemeris refactored from ch_util.
Extracts a lot of `ch_util.ephemeris` into a separate package. General changes: * Solar and lunar ephemeris functions have been converted into `caput.time.Observer` methods: radiocosmology/caput#271 * Other functions that take a `Observer` object, now use `None` as a default, and load the `chime` observer during execution if necessary. More comments on specific submodules follow. Catalogs: This contains all the `ch_util/catalogs` plus a function (`ch_ephem.catalogs.load`) to read them and return the parsed JSON. The standard source catalogues loaded by the `sources` submodule need to move to `ch_ephem`. The other catalogues could stay in `ch_util`, but it seems simpler to me to keep them all in the same place and provide a uniform interface to them. Coord: Co-ordinate transforms etc. These are essentially unchanged from their versions in `ch_util.ephemeris`. Observers: Re-creates all the `caput.time.Observers` which used to be created by `ch_util.ephemeris`, but for the most part, they have to be fetched via name from the `get()` function. The exception to this is the `chime` Observer, which can be directly imported, since it's the one usually needed. Position data for the observers is now in a YAML data file `instruments.yaml` which is parsed at import time. New instrument `Observer` objects can be added to `ch_ephem` just by adding information for it to the YAML file. Also note that `Observers` returned by this submodule have an extra attribute, `rotation`, inserted into their `__dict__`, which is not in `caput`. This rotation is needed by `ch_ephem.coord.peak_ra`. If we don't want to do this to these `Observers`, one other options would be to keep `peak_ra` in `ch_util` (moving it to, say, `ch_util.tools`), and then there's no need for rotation information in this module. Like `sources`, this submodule reads data from disk at import time, so is not automatically imported into the base `ch_ephem` object. Pointing: Just Galt telescope pointing routines, unchanged from `ch_util.ephemeris`. These are another candidate we could consider putting somewhere else in ch_util, if we don't want them here. Sources: Loads the standard source catalogs, and provides the calibrator objects `CasA`, `CygA`, `TauA`, `VirA`. Like `observers`, this submodule reads data from disk at import time, so is not automatically imported into the base `ch_ephem` object. Time: Time utilities, largely unchanged from what was in `ch_util.ephemeris`.
- Loading branch information