-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ch_ephem): CHIME ephemeris refactored from ch_util. #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To pull out one major question I had from the description that I'd like opinions on:
|
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Jul 25, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument rotation: `ch_ephem` has also taken on the rotation data that was in `tools` (where it's been re-imported from `ch_ephem`). Not sure this is ideal. Please comment on the `ch_ephem` PR if you can provide an opinion on this. Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these is the unused `ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ljgray
approved these changes
Jul 25, 2024
I don't mind moving the rotation data here, personally. |
885a8fb
to
5247b97
Compare
I've added |
ljgray
approved these changes
Jul 27, 2024
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Jul 27, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Jul 27, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Jul 27, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
7514d20
to
d704f6b
Compare
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Jul 31, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
1f8b5f7
to
7694836
Compare
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`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Aug 1, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Aug 1, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Aug 1, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Aug 1, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
ketiltrout
added a commit
to chime-experiment/ch_util
that referenced
this pull request
Aug 1, 2024
This re-imports stuff moved to `ch_ephem`. It both re-imports everything that was moved back into `ch_util.ephemeris` for backwards compatibility, but also removes references to `ch_util.epheremis` from the code, using the newly-exported versions of things directly. This PR requires both: * radiocosmology/caput#271 * chime-experiment/ch_ephem#1 Catalogs: All the catalogs have been moved to `ch_ephem`, which provides a standard interface to them via `ch_ephem.catalogs.load`. To make this change, `fluxcat.FluxCatalog.load` has been broken into two pieces. The new `fluxcat.FluxCatalog.load_dict` imports a catalog from an already-parsed JSON dict (which is what `ch_ephem` provides). The original `fluxcat.FluxCatalog.load` works as it used to, but tail-calls `load_dict` to do most of the importing. Position data: Position data (lat, lon, alt) is now obtained by fetching the parameter out of the `caput.time.Observer` objects provided by `ch_ephem`. The constants in `ch_util.ephemeris` are populated by doing this. Instrument geormetry: `ch_ephem` has also taken on the geometry data (rotation, roll, offset) that was in `tools` (where it's been re-imported from `ch_ephem`). Private objects deleted: I've also deleted a number of private objects which are no longer being used (i.e. objects whose names start with a leading underscore). Notable among these are the geometry constants from `ch_util.tools` and the unused`ch_util.tools._LAT_LON` which had position data for various instruments which differed from the position data provided by `ch_util.ephemeris`. Also removed are the long-deprectated `ch_util.ephemeris._get_chime` and `ch_util.ephemeris.transit_RA`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extracts a lot of
ch_util.ephemeris
into a separate package.General changes:
caput.time.Observer
methods: feat(time): Solar/lunar ephemerides radiocosmology/caput#271Observer
object, now useNone
as a default, and load thechime
observer during execution if necessary. (This is to avoid unnecessarily importingch_ephem.observers
.)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 toch_ephem
. The other catalogues could stay inch_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 bych_util.ephemeris
, but for the most part, they have to be fetched via name from theget()
function. The exception to this is thechime
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 instrumentObserver
objects can be added toch_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 incaput
. This rotation is needed bych_ephem.coord.peak_ra
. If we don't want to do this to theseObservers
, one other options would be to keeppeak_ra
inch_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 basech_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
. Likeobservers
, this submodule reads data from disk at import time, so is not automatically imported into the basech_ephem
object.Time:
Time utilities, largely unchanged from what was in
ch_util.ephemeris
.