From d504d44458afb374e9b3f8c8e26263d3d32e4616 Mon Sep 17 00:00:00 2001 From: Dar Dahlen Date: Mon, 26 Aug 2024 13:12:27 -0700 Subject: [PATCH] Change name to Kete (#104) * Change name to Kete * Logo * doc typos --- .github/workflows/test-lint.yml | 8 +- CHANGELOG.md | 24 +++--- Cargo.toml | 10 +-- MANIFEST.in | 2 +- README.md | 34 +++++---- docs/{data => _static}/favicon.png | Bin docs/_static/kete.svg | 25 ++++++ docs/api/cache.rst | 4 +- docs/api/constants.rst | 2 +- docs/api/conversion.rst | 2 +- docs/api/flux.rst | 4 +- docs/api/fov.rst | 2 +- docs/api/interface.rst | 8 +- docs/api/observatory.rst | 6 +- docs/api/population.rst | 2 +- docs/api/propagation.rst | 2 +- docs/api/spice.rst | 2 +- docs/api/time.rst | 2 +- docs/api/vector.rst | 4 +- docs/code_structure.rst | 20 ++--- docs/conf.py | 11 +-- docs/data/selected.txt | 0 docs/index.rst | 10 +-- docs/installation.rst | 4 +- docs/tutorials/background.rst | 12 +-- docs/tutorials/background_plots.py | 9 +-- docs/tutorials/kona.rst | 36 ++++----- docs/tutorials/neatm.rst | 12 +-- docs/tutorials/neatm_plots.py | 12 +-- docs/tutorials/propagation.rst | 4 +- docs/tutorials/propagation_plots.py | 28 +++---- docs/tutorials/wise.rst | 24 +++--- pyproject.toml | 24 +++--- src/examples/README.rst | 2 +- src/examples/galactic_center.py | 26 +++---- src/examples/getting_started.py | 72 +++++++++--------- src/examples/on_sky.py | 20 ++--- src/examples/plot_close_approach.py | 24 +++--- src/examples/plot_close_encounter.py | 18 ++--- src/examples/plot_comet.py | 48 ++++++------ src/examples/plot_elevation.py | 26 +++---- src/examples/plot_flux_vs_wavelength.py | 10 +-- src/examples/plot_light_curve.py | 24 +++--- src/examples/plot_mpc_state.py | 14 ++-- src/examples/plot_observability.py | 30 ++++---- src/examples/plot_phases.py | 16 ++-- src/examples/plot_thermal_model.py | 14 ++-- src/examples/plot_trojans.py | 12 +-- src/examples/plot_uncertainty.py | 24 +++--- src/examples/solar_spectrum.py | 10 +-- src/{neospy => kete}/__init__.py | 0 src/{neospy => kete}/cache.py | 51 ++----------- src/{neospy => kete}/constants.py | 0 src/{neospy => kete}/conversion.py | 0 src/{neospy => kete}/covariance.py | 4 +- src/{neospy => kete}/deprecation.py | 4 +- src/{neospy => kete}/flux.py | 0 src/{neospy => kete}/fov.py | 0 src/{neospy => kete}/horizons.py | 10 +-- src/{neospy => kete}/irsa.py | 10 +-- src/{neospy => kete}/mpc.py | 70 ++++++++--------- src/{neospy => kete}/neos.py | 0 src/{neospy => kete}/population.py | 4 +- src/{neospy => kete}/power_law.py | 0 src/{neospy => kete}/propagation.py | 0 src/{neospy => kete}/rust/covariance.rs | 4 +- src/{neospy => kete}/rust/elements.rs | 8 +- src/{neospy => kete}/rust/fitting.rs | 2 +- src/{neospy => kete}/rust/flux/common.rs | 6 +- src/{neospy => kete}/rust/flux/mod.rs | 0 src/{neospy => kete}/rust/flux/models.rs | 66 ++++++++-------- src/{neospy => kete}/rust/flux/reflected.rs | 6 +- src/{neospy => kete}/rust/fovs/checks.rs | 2 +- src/{neospy => kete}/rust/fovs/collection.rs | 12 +-- src/{neospy => kete}/rust/fovs/definitions.rs | 20 ++--- src/{neospy => kete}/rust/fovs/mod.rs | 0 src/{neospy => kete}/rust/frame.rs | 6 +- src/{neospy => kete}/rust/horizons.rs | 4 +- src/{neospy => kete}/rust/kepler.rs | 6 +- src/{neospy => kete}/rust/lib.rs | 6 +- src/{neospy => kete}/rust/nongrav.rs | 8 +- src/{neospy => kete}/rust/propagation.rs | 12 +-- src/{neospy => kete}/rust/simult_states.rs | 8 +- src/{neospy => kete}/rust/spice/daf.rs | 2 +- src/{neospy => kete}/rust/spice/mod.rs | 2 +- src/{neospy => kete}/rust/spice/pck.rs | 8 +- src/{neospy => kete}/rust/spice/spk.rs | 2 +- src/{neospy => kete}/rust/spice/tle.rs | 0 src/{neospy => kete}/rust/state.rs | 6 +- src/{neospy => kete}/rust/state_transition.rs | 4 +- src/{neospy => kete}/rust/time.rs | 6 +- src/{neospy => kete}/rust/vector.rs | 6 +- src/{neospy => kete}/shape.py | 6 +- src/{neospy => kete}/spice.py | 26 +++---- src/{neospy => kete}/state_transition.py | 0 src/{neospy => kete}/time.py | 14 ++-- src/{neospy => kete}/vector.py | 0 src/{neospy => kete}/wise.py | 2 +- src/{neospy => kete}/ztf.py | 0 src/{neospy_core => kete_core}/Cargo.toml | 4 +- src/{neospy_core => kete_core}/README.md | 4 +- .../benches/propagation.rs | 4 +- .../benches/spice.rs | 6 +- .../benches/thermal.rs | 10 +-- .../data/20000001.bsp | Bin .../data/20000002.bsp | Bin .../data/20000004.bsp | Bin .../data/20000010.bsp | Bin .../data/20000704.bsp | Bin .../data/de440s.bsp | Bin .../data/earth_000101_240215_231123.bpc | Bin .../data/earth_200101_990825_predict.bpc | Bin .../data/leap_second.dat | 0 .../data/mpc_obs.tsv | 0 .../data/naif_ids.csv | 0 src/{neospy_core => kete_core}/data/readme.md | 2 +- src/{neospy_core => kete_core}/data/wise.bsp | Bin .../src/constants/gravity.rs | 0 .../src/constants/mod.rs | 0 .../src/constants/neos.rs | 0 .../src/constants/universal.rs | 0 .../src/constants/wise.rs | 0 .../src/elements.rs | 0 src/{neospy_core => kete_core}/src/errors.rs | 4 +- .../src/fitting/mod.rs | 0 .../src/fitting/newton.rs | 2 +- .../src/fitting/reduced_chi2.rs | 0 .../src/flux/comets.rs | 0 .../src/flux/common.rs | 0 .../src/flux/frm.rs | 0 .../src/flux/mod.rs | 0 .../src/flux/neatm.rs | 0 .../src/flux/reflected.rs | 0 .../src/flux/shapes.rs | 0 .../src/flux/sun.rs | 0 .../src/fov/fov_like.rs | 0 .../src/fov/generic.rs | 0 src/{neospy_core => kete_core}/src/fov/mod.rs | 0 .../src/fov/neos.rs | 0 .../src/fov/patches.rs | 0 .../src/fov/wise.rs | 0 src/{neospy_core => kete_core}/src/fov/ztf.rs | 0 .../src/frames/definitions.rs | 0 .../src/frames/mod.rs | 0 .../src/frames/wgs_84.rs | 0 src/{neospy_core => kete_core}/src/io/mod.rs | 0 .../src/io/obs_codes.rs | 0 .../src/io/serde_const_arr.rs | 0 src/{neospy_core => kete_core}/src/lib.rs | 4 +- .../src/propagation/acceleration.rs | 0 .../src/propagation/kepler.rs | 0 .../src/propagation/mod.rs | 0 .../src/propagation/nongrav.rs | 0 .../src/propagation/radau.rs | 0 .../src/propagation/runge_kutta.rs | 0 .../src/propagation/state_transition.rs | 0 .../src/simult_states.rs | 0 .../src/spice/binary.rs | 0 .../src/spice/daf.rs | 0 .../src/spice/interpolation.rs | 0 .../src/spice/mod.rs | 0 .../src/spice/naif_ids.rs | 0 .../src/spice/pck.rs | 0 .../src/spice/pck_segments.rs | 0 .../src/spice/spk.rs | 4 +- .../src/spice/spk_segments.rs | 0 src/{neospy_core => kete_core}/src/state.rs | 0 .../src/stats/ks_test.rs | 0 .../src/stats/mod.rs | 0 .../src/stats/quantile.rs | 0 .../src/time/leap_second.rs | 0 .../src/time/mod.rs | 0 .../src/time/scales.rs | 2 +- src/tests/flux/test_common.py | 4 +- src/tests/flux/test_model.py | 8 +- src/tests/test_conversion.py | 4 +- src/tests/test_horizons.py | 12 +-- src/tests/test_mpc.py | 2 +- src/tests/test_population.py | 2 +- src/tests/test_propagation.py | 4 +- src/tests/test_shape.py | 4 +- src/tests/test_spice.py | 6 +- src/tests/test_state.py | 2 +- src/tests/test_time.py | 2 +- src/tests/test_vector.py | 2 +- src/tests/test_wise.py | 2 +- 186 files changed, 616 insertions(+), 636 deletions(-) rename docs/{data => _static}/favicon.png (100%) create mode 100644 docs/_static/kete.svg delete mode 100644 docs/data/selected.txt rename src/{neospy => kete}/__init__.py (100%) rename src/{neospy => kete}/cache.py (73%) rename src/{neospy => kete}/constants.py (100%) rename src/{neospy => kete}/conversion.py (100%) rename src/{neospy => kete}/covariance.py (99%) rename src/{neospy => kete}/deprecation.py (93%) rename src/{neospy => kete}/flux.py (100%) rename src/{neospy => kete}/fov.py (100%) rename src/{neospy => kete}/horizons.py (98%) rename src/{neospy => kete}/irsa.py (97%) rename src/{neospy => kete}/mpc.py (93%) rename src/{neospy => kete}/neos.py (100%) rename src/{neospy => kete}/population.py (99%) rename src/{neospy => kete}/power_law.py (100%) rename src/{neospy => kete}/propagation.py (100%) rename src/{neospy => kete}/rust/covariance.rs (98%) rename src/{neospy => kete}/rust/elements.rs (96%) rename src/{neospy => kete}/rust/fitting.rs (91%) rename src/{neospy => kete}/rust/flux/common.rs (99%) rename src/{neospy => kete}/rust/flux/mod.rs (100%) rename src/{neospy => kete}/rust/flux/models.rs (90%) rename src/{neospy => kete}/rust/flux/reflected.rs (97%) rename src/{neospy => kete}/rust/fovs/checks.rs (98%) rename src/{neospy => kete}/rust/fovs/collection.rs (89%) rename src/{neospy => kete}/rust/fovs/definitions.rs (97%) rename src/{neospy => kete}/rust/fovs/mod.rs (100%) rename src/{neospy => kete}/rust/frame.rs (92%) rename src/{neospy => kete}/rust/horizons.rs (98%) rename src/{neospy => kete}/rust/kepler.rs (95%) rename src/{neospy => kete}/rust/lib.rs (95%) rename src/{neospy => kete}/rust/nongrav.rs (94%) rename src/{neospy => kete}/rust/propagation.rs (96%) rename src/{neospy => kete}/rust/simult_states.rs (96%) rename src/{neospy => kete}/rust/spice/daf.rs (91%) rename src/{neospy => kete}/rust/spice/mod.rs (90%) rename src/{neospy => kete}/rust/spice/pck.rs (92%) rename src/{neospy => kete}/rust/spice/spk.rs (98%) rename src/{neospy => kete}/rust/spice/tle.rs (100%) rename src/{neospy => kete}/rust/state.rs (96%) rename src/{neospy => kete}/rust/state_transition.rs (87%) rename src/{neospy => kete}/rust/time.rs (97%) rename src/{neospy => kete}/rust/vector.rs (98%) rename src/{neospy => kete}/shape.py (98%) rename src/{neospy => kete}/spice.py (93%) rename src/{neospy => kete}/state_transition.py (100%) rename src/{neospy => kete}/time.py (87%) rename src/{neospy => kete}/vector.py (100%) rename src/{neospy => kete}/wise.py (99%) rename src/{neospy => kete}/ztf.py (100%) rename src/{neospy_core => kete_core}/Cargo.toml (96%) rename src/{neospy_core => kete_core}/README.md (93%) rename src/{neospy_core => kete_core}/benches/propagation.rs (99%) rename src/{neospy_core => kete_core}/benches/spice.rs (87%) rename src/{neospy_core => kete_core}/benches/thermal.rs (89%) rename src/{neospy_core => kete_core}/data/20000001.bsp (100%) rename src/{neospy_core => kete_core}/data/20000002.bsp (100%) rename src/{neospy_core => kete_core}/data/20000004.bsp (100%) rename src/{neospy_core => kete_core}/data/20000010.bsp (100%) rename src/{neospy_core => kete_core}/data/20000704.bsp (100%) rename src/{neospy_core => kete_core}/data/de440s.bsp (100%) rename src/{neospy_core => kete_core}/data/earth_000101_240215_231123.bpc (100%) rename src/{neospy_core => kete_core}/data/earth_200101_990825_predict.bpc (100%) rename src/{neospy_core => kete_core}/data/leap_second.dat (100%) rename src/{neospy_core => kete_core}/data/mpc_obs.tsv (100%) rename src/{neospy_core => kete_core}/data/naif_ids.csv (100%) rename src/{neospy_core => kete_core}/data/readme.md (92%) rename src/{neospy_core => kete_core}/data/wise.bsp (100%) rename src/{neospy_core => kete_core}/src/constants/gravity.rs (100%) rename src/{neospy_core => kete_core}/src/constants/mod.rs (100%) rename src/{neospy_core => kete_core}/src/constants/neos.rs (100%) rename src/{neospy_core => kete_core}/src/constants/universal.rs (100%) rename src/{neospy_core => kete_core}/src/constants/wise.rs (100%) rename src/{neospy_core => kete_core}/src/elements.rs (100%) rename src/{neospy_core => kete_core}/src/errors.rs (98%) rename src/{neospy_core => kete_core}/src/fitting/mod.rs (100%) rename src/{neospy_core => kete_core}/src/fitting/newton.rs (97%) rename src/{neospy_core => kete_core}/src/fitting/reduced_chi2.rs (100%) rename src/{neospy_core => kete_core}/src/flux/comets.rs (100%) rename src/{neospy_core => kete_core}/src/flux/common.rs (100%) rename src/{neospy_core => kete_core}/src/flux/frm.rs (100%) rename src/{neospy_core => kete_core}/src/flux/mod.rs (100%) rename src/{neospy_core => kete_core}/src/flux/neatm.rs (100%) rename src/{neospy_core => kete_core}/src/flux/reflected.rs (100%) rename src/{neospy_core => kete_core}/src/flux/shapes.rs (100%) rename src/{neospy_core => kete_core}/src/flux/sun.rs (100%) rename src/{neospy_core => kete_core}/src/fov/fov_like.rs (100%) rename src/{neospy_core => kete_core}/src/fov/generic.rs (100%) rename src/{neospy_core => kete_core}/src/fov/mod.rs (100%) rename src/{neospy_core => kete_core}/src/fov/neos.rs (100%) rename src/{neospy_core => kete_core}/src/fov/patches.rs (100%) rename src/{neospy_core => kete_core}/src/fov/wise.rs (100%) rename src/{neospy_core => kete_core}/src/fov/ztf.rs (100%) rename src/{neospy_core => kete_core}/src/frames/definitions.rs (100%) rename src/{neospy_core => kete_core}/src/frames/mod.rs (100%) rename src/{neospy_core => kete_core}/src/frames/wgs_84.rs (100%) rename src/{neospy_core => kete_core}/src/io/mod.rs (100%) rename src/{neospy_core => kete_core}/src/io/obs_codes.rs (100%) rename src/{neospy_core => kete_core}/src/io/serde_const_arr.rs (100%) rename src/{neospy_core => kete_core}/src/lib.rs (97%) rename src/{neospy_core => kete_core}/src/propagation/acceleration.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/kepler.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/mod.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/nongrav.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/radau.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/runge_kutta.rs (100%) rename src/{neospy_core => kete_core}/src/propagation/state_transition.rs (100%) rename src/{neospy_core => kete_core}/src/simult_states.rs (100%) rename src/{neospy_core => kete_core}/src/spice/binary.rs (100%) rename src/{neospy_core => kete_core}/src/spice/daf.rs (100%) rename src/{neospy_core => kete_core}/src/spice/interpolation.rs (100%) rename src/{neospy_core => kete_core}/src/spice/mod.rs (100%) rename src/{neospy_core => kete_core}/src/spice/naif_ids.rs (100%) rename src/{neospy_core => kete_core}/src/spice/pck.rs (100%) rename src/{neospy_core => kete_core}/src/spice/pck_segments.rs (100%) rename src/{neospy_core => kete_core}/src/spice/spk.rs (99%) rename src/{neospy_core => kete_core}/src/spice/spk_segments.rs (100%) rename src/{neospy_core => kete_core}/src/state.rs (100%) rename src/{neospy_core => kete_core}/src/stats/ks_test.rs (100%) rename src/{neospy_core => kete_core}/src/stats/mod.rs (100%) rename src/{neospy_core => kete_core}/src/stats/quantile.rs (100%) rename src/{neospy_core => kete_core}/src/time/leap_second.rs (100%) rename src/{neospy_core => kete_core}/src/time/mod.rs (100%) rename src/{neospy_core => kete_core}/src/time/scales.rs (99%) diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index 1f21f05..4334571 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -10,7 +10,7 @@ on: branches: [ "main" ] env: - NEOSPY_CACHE_DIR: ${{ github.workspace }}/docs/data + kete_CACHE_DIR: ${{ github.workspace }}/docs/data concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -41,15 +41,15 @@ jobs: python3 -m black . --check - name: Lint with mypy run: | - python3 -m mypy src/neospy/ + python3 -m mypy src/kete/ # Build and run pytest - - name: Build neospy + - name: Build kete run: | python3 -m pip install '.[dev]' -v - name: Test with pytest run: | - python3 -m pytest --cov-report term-missing --cov=neospy + python3 -m pytest --cov-report term-missing --cov=kete # Build documentation and push artifact - name: Build Docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 239920a..5735fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for long term integrations, on the scale of less than a mega-year. -- Added clear deprecation tooling, which helps indicate how to update neospy when a +- Added clear deprecation tooling, which helps indicate how to update kete when a function's signature changes or is removed. - Added default plotting tools for fits files, which make decent scaling guesses for ZTF and WISE frames. This includes annotation and zooming functions. @@ -90,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moved the downloading of Horizons spice kernels from `SpiceKernel` to `horizons`. - Renamed all field of view checking functions to similar names: `fov_static_check`, `fov_state_check`, and `fov_spice_check`. These functions are exposed at the base - level of neospy. + level of kete. - Moved much of the python documentation into the rust wrappers, and removed the remaining empty python files. Part of the rewrite involved moving and renaming many functions. @@ -148,7 +148,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Added support for downloading ZTF full fields FOV information into the neospy cache. +- Added support for downloading ZTF full fields FOV information into the kete cache. - Added simple lookup for observatory ecliptic state using MPC observatory codes. - Added 'Tutorials' to the documentation, these are larger worked examples which do not build at the same time as the standard docs. They are designed to be examples which @@ -204,17 +204,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial Release -- Initial version release of NEOSpy! -- NEOSpy's primary goal is to enable simulations of NEOs, however it also supports any +- Initial version release of kete! +- kete's primary goal is to enable simulations of NEOs, however it also supports any asteroid or comet. Included are n-body orbit propagation tools, thermal and optical modeling, tools for computing what minor planets can be seen by an observer. Along with many helpful interfaces to web tools such as JPL Horizons or IPAC's IRSA. -[Unreleased]: https://github.com/IPAC-SW/neospy/tree/main -[0.2.5]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.5 -[0.2.4]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.4 -[0.2.3]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.3 -[0.2.2]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.2 -[0.2.1]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.1 -[0.2.0]: https://github.com/IPAC-SW/neospy/releases/tag/v0.2.0 +[Unreleased]: https://github.com/IPAC-SW/kete/tree/main +[0.2.5]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.5 +[0.2.4]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.4 +[0.2.3]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.3 +[0.2.2]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.2 +[0.2.1]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.1 +[0.2.0]: https://github.com/IPAC-SW/kete/releases/tag/v0.2.0 diff --git a/Cargo.toml b/Cargo.toml index 397ec9f..a8eeceb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "_core" -version = "0.2.5" +version = "0.2.6" edition = "2021" [dependencies] -neospy_core = { version = "*", path = "src/neospy_core", features=["pyo3"]} +kete_core = { version = "*", path = "src/kete_core", features=["pyo3"]} pyo3 = { version = "^0.22.1", features = ["extension-module"] } serde = { version = "^1.0.203", features = ["derive"] } nalgebra = {version = "^0.33.0"} @@ -20,12 +20,12 @@ bincode = {version = "2.0.0-rc.3", features=["derive", "serde"]} [lib] name = "_core" -path = "src/neospy/rust/lib.rs" +path = "src/kete/rust/lib.rs" crate-type = ["cdylib"] [workspace] -members = ["src/neospy_core"] -default-members = ["src/neospy_core"] +members = ["src/kete_core"] +default-members = ["src/kete_core"] [profile.release] opt-level = 3 \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 36126af..601a0ae 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include src/neospy/_core* \ No newline at end of file +include src/kete/_core* \ No newline at end of file diff --git a/README.md b/README.md index a67eb45..a8658a1 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,28 @@ -# NEOSpy +# Kete -![Github Actions](https://github.com/IPAC-SW/neospy/actions/workflows/test-lint.yml/badge.svg?branch=main) +![Github Actions](https://github.com/IPAC-SW/kete/actions/workflows/test-lint.yml/badge.svg?branch=main) -The repository for NEOSpy, the NEO Surveyor Simulation Software. +The repository for Kete, Solar System Survey Simulation Software. +'Kete' comes from ancient greek mythology, meaning sea monsters, and is the root word +for Cetaceans (Whales). ## Introduction -The NEOSpy tools are intended to enable the simulation of all-sky surveys of minor +The kete tools are intended to enable the simulation of all-sky surveys of minor planets. This includes multi-body physics orbital dynamics, thermal and optical modeling of the objects, as well as field of view and light delay corrections. These tools in conjunction with the Minor Planet Centers (MPC) database of known asteroids can be used to not only plan surveys but can also be used to predict what objects are visible for existing or past surveys. -The primary goal for NEOSpy is to enable a set of tools that can operate on the entire +The primary goal for kete is to enable a set of tools that can operate on the entire MPC catalog at once, without having to do queries on specific objects. It has been used to simulate over 10 years of survey time for the NEO Surveyor mission using 10 million main-belt and near-Earth asteroids. ## Installation -If NEOSpy is built from source, the rust compiler must be installed. Installation +If kete is built from source, the rust compiler must be installed. Installation instructions may be found here: https://www.rust-lang.org/learn/get-started @@ -43,7 +45,7 @@ pip install setuptools --upgrade ### Units and Reference Frame -NEOSpy uses the ICRF Reference frame as the base coordinate frame, with units of AU, +Kete uses the ICRF Reference frame as the base coordinate frame, with units of AU, with time in JD with Barycentric Dynamical Time (TDB) scaling. Internally this frame converted to an Ecliptic coordinate system which is defined by the Obliquity Angle definition used by JPL Horizons, which is the defined IAU76/80 model in the J2000 frame. @@ -53,15 +55,15 @@ definition used by JPL Horizons, which is the defined IAU76/80 model in the J200 Both JPL Horizons and the Minor Planet Center (MPC) use this coordinate frame, which is essentially equivalent to J2000 Ecliptic coordinates. Conversion tools are available in -NEOSpy which enable conversion to the Equatorial frame and to various flavors of time. +kete which enable conversion to the Equatorial frame and to various flavors of time. ### Cache directory -Many operations in NEOSpy result in downloading various files. These files are cached +Many operations in kete result in downloading various files. These files are cached automatically, the directory where this cache is stored may be set by setting the -environment variable `NEOSPY_CACHE_DIR`. The default directory is `~/.neospy/`. +environment variable `kete_CACHE_DIR`. The default directory is `~/.kete/`. ``` bash -export NEOSPY_CACHE_DIR="~/.neospy/" +export kete_CACHE_DIR="~/.kete/" ``` ### Development @@ -80,11 +82,11 @@ These can be installed with: pip install sphinx sphinx_gallery autodoc ``` After this has been installed, the documentation can be built by running inside the -neospy directory. +kete directory. ``` bash (cd docs && make html && open html/index.html&) ``` -Once this has completed running, open the file `neospy/docs/html/index.html` for access +Once this has completed running, open the file `kete/docs/html/index.html` for access to the HTML documentation. To clean the previous docs build: @@ -103,14 +105,14 @@ Running tests require that the `pytest` and `pytest-cov` packages be installed. Open a terminal in the base of this folder and run the following command: ``` bash -pytest --cov-report term-missing --cov=neospy +pytest --cov-report term-missing --cov=kete ``` Another coverage report type is HTML, this will generate a folder called `htmlcov` in the directory where the command was run, then you can open the `htmlcov/index.html` file. This is a user-friendly website representation of the code coverage. ``` bash -pytest --cov-report html --cov=neospy +pytest --cov-report html --cov=kete ``` ### Running Tutorials @@ -126,7 +128,7 @@ python utils.py ### Running Benchmarks -There are a test suite of micro-benchmarks in the rust backend of NEOSpy. These require +There are a test suite of micro-benchmarks in the rust backend of kete. These require `gnuplot` to be installed, and may be run using the following command: ``` bash diff --git a/docs/data/favicon.png b/docs/_static/favicon.png similarity index 100% rename from docs/data/favicon.png rename to docs/_static/favicon.png diff --git a/docs/_static/kete.svg b/docs/_static/kete.svg new file mode 100644 index 0000000..5abb62d --- /dev/null +++ b/docs/_static/kete.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/docs/api/cache.rst b/docs/api/cache.rst index 162031c..3e9bcc3 100644 --- a/docs/api/cache.rst +++ b/docs/api/cache.rst @@ -1,8 +1,8 @@ cache ===== -Tools to interact with NEOSpy's Cache folder. +Tools to interact with kete's Cache folder. -.. automodule:: neospy.cache +.. automodule:: kete.cache :members: :inherited-members: \ No newline at end of file diff --git a/docs/api/constants.rst b/docs/api/constants.rst index cfb1e7a..33ea4c9 100644 --- a/docs/api/constants.rst +++ b/docs/api/constants.rst @@ -1,6 +1,6 @@ constants ========= -.. automodule:: neospy.constants +.. automodule:: kete.constants :members: :inherited-members: \ No newline at end of file diff --git a/docs/api/conversion.rst b/docs/api/conversion.rst index 269205b..5c52645 100644 --- a/docs/api/conversion.rst +++ b/docs/api/conversion.rst @@ -1,6 +1,6 @@ conversion ========== -.. automodule:: neospy.conversion +.. automodule:: kete.conversion :members: :inherited-members: diff --git a/docs/api/flux.rst b/docs/api/flux.rst index 833d962..fc50ed0 100644 --- a/docs/api/flux.rst +++ b/docs/api/flux.rst @@ -1,7 +1,7 @@ flux ==== -.. automodule:: neospy.flux +.. automodule:: kete.flux :members: :inherited-members: @@ -9,6 +9,6 @@ flux shape ----- -.. automodule:: neospy.shape +.. automodule:: kete.shape :members: :inherited-members: diff --git a/docs/api/fov.rst b/docs/api/fov.rst index 1fcc2ee..9b6fff6 100644 --- a/docs/api/fov.rst +++ b/docs/api/fov.rst @@ -3,6 +3,6 @@ fov Field of View -.. automodule:: neospy.fov +.. automodule:: kete.fov :members: :inherited-members: \ No newline at end of file diff --git a/docs/api/interface.rst b/docs/api/interface.rst index 3b27a38..7a60b6a 100644 --- a/docs/api/interface.rst +++ b/docs/api/interface.rst @@ -3,25 +3,25 @@ interface Below are APIs to external organizations and web interfaces. These are provided primarily to make it easier to fetch data from these various sources for analysis with -NEOSpy. +kete. Minor Planet Center (MPC) ------------------------- -.. automodule:: neospy.mpc +.. automodule:: kete.mpc :members: :inherited-members: IPAC - IRSA ----------- -.. automodule:: neospy.irsa +.. automodule:: kete.irsa :members: :inherited-members: JPL Horizons ------------ -.. automodule:: neospy.horizons +.. automodule:: kete.horizons :members: :inherited-members: diff --git a/docs/api/observatory.rst b/docs/api/observatory.rst index 2f1f025..a2b5614 100644 --- a/docs/api/observatory.rst +++ b/docs/api/observatory.rst @@ -4,18 +4,18 @@ observatories NEOS ---- -.. automodule:: neospy.neos +.. automodule:: kete.neos :members: :inherited-members: WISE ---- -.. automodule:: neospy.wise +.. automodule:: kete.wise :members: :inherited-members: ZTF --- -.. automodule:: neospy.ztf +.. automodule:: kete.ztf :members: :inherited-members: diff --git a/docs/api/population.rst b/docs/api/population.rst index 78c3ce1..e331c68 100644 --- a/docs/api/population.rst +++ b/docs/api/population.rst @@ -1,7 +1,7 @@ population ========== -.. automodule:: neospy.population +.. automodule:: kete.population :members: :inherited-members: :no-undoc-members: diff --git a/docs/api/propagation.rst b/docs/api/propagation.rst index 2c8b9a0..95a44a7 100644 --- a/docs/api/propagation.rst +++ b/docs/api/propagation.rst @@ -1,6 +1,6 @@ propagation =========== -.. automodule:: neospy.propagation +.. automodule:: kete.propagation :members: :inherited-members: diff --git a/docs/api/spice.rst b/docs/api/spice.rst index b4e9a33..f041487 100644 --- a/docs/api/spice.rst +++ b/docs/api/spice.rst @@ -23,6 +23,6 @@ used for numerical integrations when the correct flags are set. PCK Files which enable coordinate transformations between Earths surface and the common inertial frames. -.. automodule:: neospy.spice +.. automodule:: kete.spice :members: :inherited-members: diff --git a/docs/api/time.rst b/docs/api/time.rst index 568db4c..e0e773d 100644 --- a/docs/api/time.rst +++ b/docs/api/time.rst @@ -1,7 +1,7 @@ Time ==== -.. automodule:: neospy.time +.. automodule:: kete.time :members: :inherited-members: diff --git a/docs/api/vector.rst b/docs/api/vector.rst index d09f93d..7beed10 100644 --- a/docs/api/vector.rst +++ b/docs/api/vector.rst @@ -1,10 +1,10 @@ vectors/states/frames ===================== -Units used throughout NEOSpy are distance in au, and time in Days TDB scaled. +Units used throughout kete are distance in au, and time in Days TDB scaled. Coordinate frames match the coordinate frames used by cSPICE. -.. automodule:: neospy.vector +.. automodule:: kete.vector :members: Vector :inherited-members: diff --git a/docs/code_structure.rst b/docs/code_structure.rst index 899d49d..2086987 100644 --- a/docs/code_structure.rst +++ b/docs/code_structure.rst @@ -1,9 +1,9 @@ Code Organization ================= -Goals of NEOSpy +Goals of kete --------------- -NEOSpy is a collection of tools for calculating the orbits and expected fluxes for minor +kete is a collection of tools for calculating the orbits and expected fluxes for minor planets specifically for the purpose of estimating which objects are visible in current, past, or future sky surveys. Specifically the goal is that these calculations may be performed on the full set of all known asteroids in a reasonable amount of time on a @@ -13,7 +13,7 @@ Propagation ~~~~~~~~~~~ There are a number of existing tools which enable the propagation of orbits for many millions or billions of years, but these typically are designed for a comparatively -small number of objects (perhaps 10-100 thousand), whereas NEOSpy's design intent is +small number of objects (perhaps 10-100 thousand), whereas kete's design intent is 10-100 million objects over the course of decades. The total compute approximately scales like:: @@ -37,7 +37,7 @@ decades at this point, and is often used to keep track of the ephemeris of plane satellites (both natural and artificial), asteroids, and comets. Essentially the motion of anything in the Solar System can be encoded in some flavor of SPICE kernel. The primary downside of using cSPICE is that there is no native support for multi-core cpu -queries (an artifact of the age of the code). NEOSpy has native multi-core support for +queries (an artifact of the age of the code). kete has native multi-core support for the majority of all commonly used SPICE kernels. @@ -57,13 +57,13 @@ Rust has a number of advantages over existing languages, it's performance is typ comparable to C++/C, however due to the structure of the language it is less prone to the most common type of errors to do with memory allocation and management. In addition to this, Rust has excellent native multi-core support, especially for embarrassingly -parallel problems such as the orbit propagation required for NEOSpy. +parallel problems such as the orbit propagation required for kete. -NEOSpy Core +kete Core ~~~~~~~~~~~ The Rust core of the library, which does the underlying orbit and flux calculations is written entirely without any reference to Python. This core part is available as -`neospy_core`, and programming can be done entirely within Rust for tools which do not +`kete_core`, and programming can be done entirely within Rust for tools which do not require the Python wrapper. This design was chosen so that systems tools which would benefit from orbit computation can be written without having to have Python installed. It is important to note that if performance is a concern, then removing the Python is an @@ -74,13 +74,13 @@ Core Python Wrapper The Rust library described above then has Python wrappers written over it, allowing users to call these compiled tools inside of Python. In order to do this, some boiler-plate code is required to glue these independent parts together. This is where -the `rust` folder inside of NEOSpy comes from. Inside of this folder there are rust +the `rust` folder inside of kete comes from. Inside of this folder there are rust files which are mostly a one-to-one mapping to their respective counterparts inside of -the `neospy_core`. Ideally there should be no 'business' logic contained within these +the `kete_core`. Ideally there should be no 'business' logic contained within these wrappers, and they should largely exist to provide convenient mappings from the Python concepts to the Rust internal organization. -NEOSpy Python +kete Python ~~~~~~~~~~~~~ The remaining part of the code which is strictly Python is mostly quality of life functions, plotting, and web query code. There is little to no mathematics or physics diff --git a/docs/conf.py b/docs/conf.py index d6d987d..68830f8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,15 +6,13 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "neospy" +project = "kete" copyright = "2024, Caltech IPAC" author = "Dar Dahlen" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -html_favicon = "data/favicon.png" - extensions = [ "sphinx.ext.autodoc", "sphinx.ext.napoleon", @@ -59,6 +57,9 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] +html_logo = "_static/kete.svg" +html_favicon = "_static/favicon.png" # -- Sphinx gallery settings -------------------------------------------------- @@ -73,10 +74,10 @@ # -- doctest settings ---------------------------------------------------------- doctest_global_setup = """ -import neospy +import kete import matplotlib.pyplot as plt import numpy as np -from neospy import * +from kete import * """ # -- Nitpick settings ---------------------------------------------------------- diff --git a/docs/data/selected.txt b/docs/data/selected.txt deleted file mode 100644 index e69de29..0000000 diff --git a/docs/index.rst b/docs/index.rst index 870c58c..df1e353 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ -NEO Surveyor Simulation Tools -============================= +Kete Solar System Survey Tools +============================== -NEOSpy is a collection of tools which enable the simulation of ground or spaced based +Kete is a collection of tools which enable the simulation of ground or spaced based surveys of minor planets. Included here are: - Orbit propagation code capable of accurately calculating the orbits for many @@ -18,9 +18,9 @@ Many of these tools are independent from one another, and can be combined in man to answer questions. There are a collection of worked examples below which demonstrate some of the capabilities. -It is recommended that the background reading section be covered before using NEOSpy, +It is recommended that the background reading section be covered before using kete, as it is very important to understand the coordinate frames and reference times used. -Conversions such as UTC <-> TDB time can result in over a minute of difference in the +Conversions such as UTC to TDB time can result in over a minute of difference in the position of minor planets, which for fast moving objects is long enough that they may move out of frame. diff --git a/docs/installation.rst b/docs/installation.rst index 1fdaebc..c905df8 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -1,7 +1,7 @@ Installation ============ -These instructions are the method to install NEOSpy from source, it assumes that you +These instructions are the method to install kete from source, it assumes that you have already downloaded a copy of the source code. Requirements @@ -24,5 +24,5 @@ command: .. code-block:: console - # cd /neospy/source/directory + # cd /kete/source/directory pip install . \ No newline at end of file diff --git a/docs/tutorials/background.rst b/docs/tutorials/background.rst index 4bef2d9..554bc00 100644 --- a/docs/tutorials/background.rst +++ b/docs/tutorials/background.rst @@ -5,10 +5,10 @@ Coordinate Frames ----------------- Coordinate frames define the X/Y/Z axis required to represent position and velocity. -In NEOSpy, coordinate frames only define the direction of the X/Y/Z axis, and not the +In kete, coordinate frames only define the direction of the X/Y/Z axis, and not the origin of the coordinate system. This is to say, these frames are only relative definitions, and the object from which they are relative to must also be kept track of. -Additionally, all coordinate frames within NEOSpy are treated as inertial, meaning there +Additionally, all coordinate frames within kete are treated as inertial, meaning there is no funny business regarding accelerating frames such as a rocket. .. image:: ../data/background_frames.png @@ -47,14 +47,14 @@ use deep sky reference points. The current modern standard is the ICRF reference were defined using measurements from the GAIA mission. Historically there are older reference sets, such as FK5, which perform the same function with less precision. -NEOSpy uses the Ecliptic Frame, at the J2000 Reference point, with units of AU and +kete uses the Ecliptic Frame, at the J2000 Reference point, with units of AU and AU/Day. These largely match the definitions used by JPL Horizons and the MPC. Time ---- Keeping track of time is a famously difficult problem. Unfortunately when observing solar system objects which are flying by the observer, getting the time correct turns -out to be extremely important. First, let's pick a unit of time to use, NEOSpy uses +out to be extremely important. First, let's pick a unit of time to use, kete uses Days. Trouble immediately arises as time is observer-dependent, observers on the ground experience a different rate of time than those outside of the solar system. This is typically called the time Scale, the time scale which the Minor Planet Center and JPL @@ -120,7 +120,7 @@ ones). Since it is not possible to predict the location of leap seconds, plannin dependent operations in the future have the added complexity that they may have an additional second added in after planning has occurred. -NEOSpy uses the TDB Scaling, with JD as the 0 point for timekeeping, however there is a +kete uses the TDB Scaling, with JD as the 0 point for timekeeping, however there is a `Time` object which enables conversion to and from several time-keeping system. Asteroid Names @@ -138,7 +138,7 @@ do not have Permanent ones. An additional confusion that occurs is that these Permanent and Provisional each have two ways of being written. Due to historical reasons, these designations had to be able -to be packed into a reduced-length text string. In NEOSpy, these two are referred to as +to be packed into a reduced-length text string. In kete, these two are referred to as Packed or Unpacked designations. There is a strict 1-to-1 mapping from the packed to the unpacked. diff --git a/docs/tutorials/background_plots.py b/docs/tutorials/background_plots.py index c0d61ff..8936b90 100644 --- a/docs/tutorials/background_plots.py +++ b/docs/tutorials/background_plots.py @@ -1,13 +1,12 @@ import numpy as np import matplotlib.pyplot as plt -import neospy +import kete lon_steps = np.linspace(0, 360, 1000) -equatorial = [neospy.Vector.from_ra_dec(step, 0) for step in lon_steps] -ecliptic = [neospy.Vector.from_lat_lon(0, step) for step in lon_steps] +equatorial = [kete.Vector.from_ra_dec(step, 0) for step in lon_steps] +ecliptic = [kete.Vector.from_lat_lon(0, step) for step in lon_steps] galactic = [ - neospy.Vector.from_el_az(0, step, 1, frame=neospy.Frames.Galactic) - for step in lon_steps + kete.Vector.from_el_az(0, step, 1, frame=kete.Frames.Galactic) for step in lon_steps ] vectors_frames = [equatorial, ecliptic, galactic] diff --git a/docs/tutorials/kona.rst b/docs/tutorials/kona.rst index df40825..3995357 100644 --- a/docs/tutorials/kona.rst +++ b/docs/tutorials/kona.rst @@ -11,7 +11,7 @@ First we do some setup, including importing many needed packages. .. code-block:: python - import neospy + import kete import matplotlib.pyplot as plt import numpy as np import datetime @@ -35,25 +35,25 @@ calculated from the corners of the frame. frame = fits.open("data/01772a127-w3-int-1b.fits.gz")[0] # Here we compute a State of the observer, this could also be constructed - # using spice kernels using neospy.spice.state - sc_pos = neospy.Vector([frame.header['SUN2SCX'], + # using spice kernels using kete.spice.state + sc_pos = kete.Vector([frame.header['SUN2SCX'], frame.header['SUN2SCY'], frame.header['SUN2SCZ']], - neospy.Frames.Equatorial) - sc_vel = neospy.Vector([frame.header['SCVELX'], + kete.Frames.Equatorial) + sc_vel = kete.Vector([frame.header['SCVELX'], frame.header['SCVELY'], frame.header['SCVELZ']], - neospy.Frames.Equatorial) + kete.Frames.Equatorial) # Load the time time = datetime.datetime.fromisoformat(frame.header['DATIME']) # add utc timezone to date time = time.replace(tzinfo=datetime.timezone.utc) # now it is correctly formatted, load it - time_jd = neospy.Time.from_iso(time.isoformat()).jd + time_jd = kete.Time.from_iso(time.isoformat()).jd # Now there is a final state of the observer - sc_state = neospy.State("WISE", time_jd, sc_pos, sc_vel) + sc_state = kete.State("WISE", time_jd, sc_pos, sc_vel) # Build the corner position of the FOV in RA/DEC, and build those into vectors @@ -66,17 +66,17 @@ calculated from the corners of the frame. dx, dy = frame_wcs.pixel_shape for x, y in zip([0, 0, dx, dx], [0, dy, dy, 0]): coord = frame_wcs.pixel_to_world(x, y).icrs - corners.append(neospy.Vector.from_ra_dec(coord.ra.deg, coord.dec.deg)) + corners.append(kete.Vector.from_ra_dec(coord.ra.deg, coord.dec.deg)) # Build a generic FOV from the corners and the state of the observer - fov = neospy.fov.RectangleFOV.from_corners(corners, sc_state) + fov = kete.fov.RectangleFOV.from_corners(corners, sc_state) MPC Orbit Data -------------- Next we must collect orbit information from the Minor Planet Center (MPC). -We will load all known objects from their database, convert them to a Neospy State, +We will load all known objects from their database, convert them to a kete State, and propagate those states to the epoch near the FITs file epoch we opened. @@ -89,13 +89,13 @@ and propagate those states to the epoch near the FITs file epoch we opened. .. code-block:: python # Load orbit data from the MPC - mpc_obs = neospy.mpc.fetch_known_orbit_data() + mpc_obs = kete.mpc.fetch_known_orbit_data() # Convert that data to State objects. - mpc_states = neospy.mpc.table_to_states(mpc_obs) + mpc_states = kete.mpc.table_to_states(mpc_obs) # It takes a while to propagate 1.5 million asteroids 14 years... - mpc_states = neospy.propagate_n_body(mpc_states, time_jd) + mpc_states = kete.propagate_n_body(mpc_states, time_jd) Geometry Checks @@ -108,7 +108,7 @@ one, and then immediately take the single result back out. .. code-block:: python - visible_obj = neospy.fov_state_check(mpc_states, [fov])[0] + visible_obj = kete.fov_state_check(mpc_states, [fov])[0] Results @@ -167,13 +167,13 @@ Note again this is only showing the first 20 of 181. .. code-block:: python plt.figure(dpi=300) - wcs = neospy.irsa.plot_fits_image(frame, cmap='grey') + wcs = kete.irsa.plot_fits_image(frame, cmap='grey') for state in list(visible_obj)[:n_show]: vec = (state.pos - visible_obj.fov.observer.pos).as_equatorial - neospy.irsa.annotate_plot(wcs, vec.ra, vec.dec, state.desig, px_gap=10, length=10) + kete.irsa.annotate_plot(wcs, vec.ra, vec.dec, state.desig, px_gap=10, length=10) plt.xlabel("RA") plt.ylabel("DEC") - plt.title(f"NEOWISE Frame on Ecliptic\n{neospy.Time(time_jd).iso}"); + plt.title(f"NEOWISE Frame on Ecliptic\n{kete.Time(time_jd).iso}"); plt.savefig("data/kona.png") plt.close() diff --git a/docs/tutorials/neatm.rst b/docs/tutorials/neatm.rst index 5153314..3d01b36 100644 --- a/docs/tutorials/neatm.rst +++ b/docs/tutorials/neatm.rst @@ -32,25 +32,25 @@ In the original description of NEATM, all visible flux from the asteroid is due black body thermal emission from the heated surface. However this neglects the fact that the Sun emits light in the IR as well. This Solar emission of IR is reflected from the surface, and for colder asteroids can contribute a significant fraction of the -total flux. NEOSpy automatically includes this reflected light flux alongside the +total flux. kete automatically includes this reflected light flux alongside the thermal emission. -Below is an example of how to compute NEATM using NEOSpy, showing the relative +Below is an example of how to compute NEATM using kete, showing the relative contribution of thermal and emitted fluxes. .. code-block:: python - import neospy + import kete import matplotlib.pyplot as plt import numpy as np # Using NEOS wavelengths - bands = neospy.neos.BANDS + bands = kete.neos.BANDS observer = [0, 1, 0] # Define the NEATM model parameters for an object - params = neospy.flux.NeatmParams( + params = kete.flux.NeatmParams( "Ceres", band_wavelength=bands, band_albedos=[0.1] * len(bands), @@ -60,7 +60,7 @@ contribution of thermal and emitted fluxes. ) # Define some observing geometry, this can be calculated using orbital - # propagation code in neospy. + # propagation code in kete. distances = np.linspace(0.1, 6, 1000) sun2obj_vecs = [[r, 0, 0] for r in distances] sun2obs_vecs = [observer] * len(sun2obj_vecs) diff --git a/docs/tutorials/neatm_plots.py b/docs/tutorials/neatm_plots.py index a7b97c5..3b435de 100644 --- a/docs/tutorials/neatm_plots.py +++ b/docs/tutorials/neatm_plots.py @@ -4,7 +4,7 @@ import matplotlib as mpl import matplotlib.cm as cm -import neospy +import kete # Compute the temperatures of each facet of an object and plot it in 3d # Set the physical parameters used for the simulation @@ -20,16 +20,16 @@ beaming = 1.4 # Define the geometry -geom = neospy.shape.TriangleEllipsoid(40) +geom = kete.shape.TriangleEllipsoid(40) obj2sun = np.array([1, 0, 0]) # Compute the temperature at the subsolar point on the object. -subsolar_temp = neospy.flux.sub_solar_temperature( +subsolar_temp = kete.flux.sub_solar_temperature( -obj2sun, vis_albedo, g_phase, emissivity, beaming ) # Compute the NEATM facet temperatures for the object -facet_temps = neospy.flux.neatm_facet_temps( +facet_temps = kete.flux.neatm_facet_temps( geom.normals, subsolar_temp, obj2sun, @@ -79,8 +79,8 @@ plt.figure(dpi=150, figsize=(6, 5)) ax = plt.subplot(111, projection="3d") -facet_flux = [neospy.flux.black_body_flux(t, wavelength) for t in facet_temps] -obs2obj = -neospy.Vector.from_lat_lon(ax.elev, ax.azim) +facet_flux = [kete.flux.black_body_flux(t, wavelength) for t in facet_temps] +obs2obj = -kete.Vector.from_lat_lon(ax.elev, ax.azim) facet_flux = np.array(facet_flux) / np.max(facet_flux) diff --git a/docs/tutorials/propagation.rst b/docs/tutorials/propagation.rst index ba6c7f8..d983a8f 100644 --- a/docs/tutorials/propagation.rst +++ b/docs/tutorials/propagation.rst @@ -3,7 +3,7 @@ Orbit Propagation Orbit propagation can be an immensely complicated topic, spanning from two-body Keplerian motion, to models of gravitational fields including thousands of terms. Being -able to pick the correct amount of precision required is difficult, and NEOSpy makes a +able to pick the correct amount of precision required is difficult, and kete makes a number of judicious choices which are reasonable for the vast majority of cases. What follows is a discussion of the pros-cons of various models of gravitational forces, @@ -93,7 +93,7 @@ for this is that it can be computationally expensive. If we wish to predict the of minor planets for NEOWISE frames as an example, which are captured every 10-15 seconds, it would be wildly inefficient. Over the course of a few minutes objects motion can be modeled as linear, over hours (even days) the two-body approximation is often -good enough. As a result of this, NEOSpy has tools for adaptively changing the +good enough. As a result of this, kete has tools for adaptively changing the approximation used in order to get good computational performance. The typical method is to use a full N-Body simulation to get the highest precision, then use that solution for the next day or so (adjustable) with two-body mechanics to query hundreds of times. diff --git a/docs/tutorials/propagation_plots.py b/docs/tutorials/propagation_plots.py index f5b1737..d7af44d 100644 --- a/docs/tutorials/propagation_plots.py +++ b/docs/tutorials/propagation_plots.py @@ -1,13 +1,13 @@ import numpy as np import matplotlib.pyplot as plt -import neospy +import kete -neospy.spice.kernel_reload(["./data/20000042.bsp"]) +kete.spice.kernel_reload(["./data/20000042.bsp"]) -jd_start = neospy.Time.from_ymd(1920, 1, 1).jd -jd_end = neospy.Time.from_ymd(2020, 1, 1).jd +jd_start = kete.Time.from_ymd(1920, 1, 1).jd +jd_end = kete.Time.from_ymd(2020, 1, 1).jd -state = neospy.spice.get_state("42", jd_end) +state = kete.spice.get_state("42", jd_end) jds = np.logspace(np.log10(jd_end), np.log10(jd_end - 10), 1000) jds = np.concatenate( @@ -21,23 +21,23 @@ error_2body = [] n_body_no_asteroids = [] n_body_ast = [] -state = neospy.spice.get_state("42", jd_end) +state = kete.spice.get_state("42", jd_end) for jd in jds: - jpl_pos = neospy.spice.get_state("42", jd).pos + jpl_pos = kete.spice.get_state("42", jd).pos line = state.pos + state.vel * (jd - state.jd) - error_line.append((jpl_pos - line).r * neospy.constants.AU_KM) + error_line.append((jpl_pos - line).r * kete.constants.AU_KM) - two_body = neospy.propagate_two_body([state], jd)[0].pos - error_2body.append((jpl_pos - two_body).r * neospy.constants.AU_KM) + two_body = kete.propagate_two_body([state], jd)[0].pos + error_2body.append((jpl_pos - two_body).r * kete.constants.AU_KM) - n_body_state = neospy.propagate_n_body([n_body_state], jd)[0] - n_body_no_asteroids.append((jpl_pos - n_body_state.pos).r * neospy.constants.AU_KM) + n_body_state = kete.propagate_n_body([n_body_state], jd)[0] + n_body_no_asteroids.append((jpl_pos - n_body_state.pos).r * kete.constants.AU_KM) - n_body_state_ast = neospy.propagate_n_body( + n_body_state_ast = kete.propagate_n_body( [n_body_state_ast], jd, include_asteroids=True )[0] - n_body_ast.append((jpl_pos - n_body_state_ast.pos).r * neospy.constants.AU_KM) + n_body_ast.append((jpl_pos - n_body_state_ast.pos).r * kete.constants.AU_KM) plt.figure(dpi=150) plt.plot(-(jds[0] - jds) / 365, error_2body, label="Two-Body Approximation") diff --git a/docs/tutorials/wise.rst b/docs/tutorials/wise.rst index 7492512..1e1be2e 100644 --- a/docs/tutorials/wise.rst +++ b/docs/tutorials/wise.rst @@ -10,18 +10,18 @@ This can be thought of as an extended version of the KONA tutorial. WISE Fields of View ------------------- -A field of view is a patch of sky as seen from an observer. NEOSpy supports downloading +A field of view is a patch of sky as seen from an observer. kete supports downloading these FOVs directly from IPACs IRSA data repository. .. code-block:: python - import neospy + import kete # During 2023 there were 2.369 million individual frames taken of both W1 and W2 # bands, totalling just shy of 5 million individual frames. # This may take some time to download from IRSA. - fovs = neospy.wise.fetch_WISE_fovs('Reactivation_2023') + fovs = kete.wise.fetch_WISE_fovs('Reactivation_2023') Minor Planet Center Data ------------------------ @@ -32,19 +32,19 @@ Now we have to download the orbit data of NEOs from the Minor Planet Center (MPC .. code-block:: python # This is the orbit table from the MPC, this is over 100Mb, which also may take a - # minute to download. Note that NEOSpy caches these files after the first download. + # minute to download. Note that kete caches these files after the first download. # Future queries will use the cached copy unless `force_download=True` is set. - orb_table = neospy.mpc.fetch_known_orbit_data() + orb_table = kete.mpc.fetch_known_orbit_data() # Now we can down select these to just NEOs: - is_neo = neospy.population.neo(orb_table['peri_dist'], orb_table['ecc']) + is_neo = kete.population.neo(orb_table['peri_dist'], orb_table['ecc']) subset = orb_table[is_neo] # select only the numbered asteroids subset = subset[[str(n).isdigit() for n in subset.desig]] # Convert that table of values into cartesian state vectors: - states = neospy.mpc.table_to_states(subset) + states = kete.mpc.table_to_states(subset) Propagation @@ -63,7 +63,7 @@ frame in the mission phase we have selected. # now we propagate the NEOs to that time, including the effects of the 5 largest # main belt asteroids to include more precision. This may take a few minutes. - states = neospy.propagate_n_body(states, jd, include_asteroids=True) + states = kete.propagate_n_body(states, jd, include_asteroids=True) Visibility Test --------------- @@ -86,18 +86,18 @@ observable to NEOWISE during this mission phase. # were seen, and it drops empty FOVs. # Compute observable objects. - visible = neospy.fov_state_check(states, fovs) + visible = kete.fov_state_check(states, fovs) .. note:: The outputs of this may be saved using the following: - ``neospy.SimultaneousStates.save_list(visible, "visible_wise_2023.bin")`` + ``kete.SimultaneousStates.save_list(visible, "visible_wise_2023.bin")`` The states may later be loaded using: - ``visible = neospy.SimultaneousStates.load_list("visible_wise_2023.bin")`` + ``visible = kete.SimultaneousStates.load_list("visible_wise_2023.bin")`` Computing Positions @@ -117,7 +117,7 @@ Here is a codeblock which prints the first `n_show=100` objects. for vis in visible[:n_show]: for state in vis: vec = (state.pos - vis.fov.observer.pos).as_equatorial - mjd = neospy.Time(vis.fov.observer.jd).mjd + mjd = kete.Time(vis.fov.observer.jd).mjd print((f"{state.desig:<15s},{mjd:<15.6f},{vec.ra_hms:<15s}," f"{vec.dec_dms:<15s},{vis.fov.scan_id}-{str(vis.fov.frame_num)}")) diff --git a/pyproject.toml b/pyproject.toml index d1d147a..5b24eff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "neospy" -version = "0.2.5" -description = "NEO Surveyor Simulation Tools" +name = "kete" +version = "0.2.6" +description = "Kete Asteroid Survey Tools" readme = "README.md" authors = [{name = "Dar Dahlen", email = "ddahlen@ipac.caltech.edu"}, {name = "Joe Masiero", email = "jmasiero@ipac.caltech.edu"}, @@ -19,7 +19,7 @@ dependencies = ["astropy>=5.3.4", ] [project.urls] -homepage = "https://github.com/IPAC-SW/neospy" +homepage = "https://github.com/IPAC-SW/kete" [build-system] requires = ["maturin>=1.0", @@ -29,7 +29,7 @@ build-backend = "maturin" [tool.maturin] python-source = "src" -module-name = "neospy._core" +module-name = "kete._core" [project.optional-dependencies] dev = ["black>=23.1.0", @@ -60,12 +60,12 @@ markers = [ # Options for the coverage report. [tool.coverage.run] -omit = ["*/neospy/mpc.py", - "*/neospy/irsa.py", - "*/neospy/wise.py", - "*/neospy/ztf.py", - "*/neospy/horizons.py", - "*/neospy/data/*", +omit = ["*/kete/mpc.py", + "*/kete/irsa.py", + "*/kete/wise.py", + "*/kete/ztf.py", + "*/kete/horizons.py", + "*/kete/data/*", "*/examples/*",] # See https://github.com/psf/black/blob/main/pyproject.toml for more details @@ -82,7 +82,7 @@ exclude = ''' ''' [tool.pylint.imports] -ignored-modules=["_core", "neospy._core"] +ignored-modules=["_core", "kete._core"] [tool.mypy] plugins = "numpy.typing.mypy_plugin" diff --git a/src/examples/README.rst b/src/examples/README.rst index b399f20..763801e 100644 --- a/src/examples/README.rst +++ b/src/examples/README.rst @@ -1,4 +1,4 @@ Examples ======== -A collection of examples which demonstrate different parts of the neospy. +A collection of examples which demonstrate different parts of the kete. diff --git a/src/examples/galactic_center.py b/src/examples/galactic_center.py index 5e07833..f11fc84 100644 --- a/src/examples/galactic_center.py +++ b/src/examples/galactic_center.py @@ -6,37 +6,37 @@ Plot the on sky distribution of all NEOs along with the galactic and ecliptic planes. """ -import neospy +import kete import matplotlib.pyplot as plt import numpy as np -jd_start = neospy.Time.from_ymd(2024, 3, 1).jd -jd_end = neospy.Time.from_ymd(2024, 4, 1).jd +jd_start = kete.Time.from_ymd(2024, 3, 1).jd +jd_end = kete.Time.from_ymd(2024, 4, 1).jd # Load all orbits from the MPC catalog -all_orbits = neospy.mpc.fetch_known_orbit_data() +all_orbits = kete.mpc.fetch_known_orbit_data() # Filter to just the neos -neos = all_orbits[neospy.population.neo(all_orbits.peri_dist, all_orbits.ecc)] +neos = all_orbits[kete.population.neo(all_orbits.peri_dist, all_orbits.ecc)] # convert the catalog to States -states = neospy.mpc.table_to_states(neos) +states = kete.mpc.table_to_states(neos) # propagate the states to the start date, this may take several seconds. # If this is NEOs, there will be several impacts of old small objects which hit # the Earth over the years. -states = neospy.propagate_n_body(states, jd_start) +states = kete.propagate_n_body(states, jd_start) -galactic_center = neospy.Vector.from_el_az( - 0, 0, 1, frame=neospy.Frames.Galactic +galactic_center = kete.Vector.from_el_az( + 0, 0, 1, frame=kete.Frames.Galactic ).as_equatorial dist_to_galactic_center = [] while states[0].jd < jd_end: - states = neospy.propagate_two_body(states, states[0].jd + 1) + states = kete.propagate_two_body(states, states[0].jd + 1) - earth = neospy.spice.get_state("Earth", states[0].jd) + earth = kete.spice.get_state("Earth", states[0].jd) earth_to_obj = [(s.pos - earth.pos) for s in states] dist_to_galactic_center.append( @@ -55,10 +55,10 @@ galactic_plane = [] ecliptic_plane = [] for angle in np.arange(181, 361 + 180, 3): - vec = neospy.Vector.from_el_az(0.0, angle, 1, neospy.Frames.Galactic).as_equatorial + vec = kete.Vector.from_el_az(0.0, angle, 1, kete.Frames.Galactic).as_equatorial galactic_plane.append([(vec.ra + 180) % 360 - 180, vec.dec]) - vec = neospy.Vector.from_lat_lon(0, angle).as_equatorial + vec = kete.Vector.from_lat_lon(0, angle).as_equatorial ecliptic_plane.append([(vec.ra + 180) % 360 - 180, vec.dec]) ra_decs = [ diff --git a/src/examples/getting_started.py b/src/examples/getting_started.py index 92b3613..ed7e8cc 100644 --- a/src/examples/getting_started.py +++ b/src/examples/getting_started.py @@ -2,7 +2,7 @@ Getting Started =============== -Neospy has a few foundational concepts which are important to understand. The most +kete has a few foundational concepts which are important to understand. The most important concepts are related to geometry: - Frames - Reference frame, such as Ecliptic, Equatorial, Galactic. @@ -18,7 +18,7 @@ # Basic Geometry # -------------- -import neospy +import kete import numpy as np import matplotlib.pyplot as plt @@ -26,14 +26,14 @@ # Recall that an object in circular orbit has a speed of sqrt(GM / r) where r is the # radius of the orbit. r = 1 -epoch = neospy.Time.j2000() -speed = np.sqrt(neospy.constants.SUN_GM / r) -pos = neospy.Vector([0, r, 0], frame=neospy.Frames.Equatorial) -vel = neospy.Vector([-speed, 0, 0], frame=neospy.Frames.Equatorial) +epoch = kete.Time.j2000() +speed = np.sqrt(kete.constants.SUN_GM / r) +pos = kete.Vector([0, r, 0], frame=kete.Frames.Equatorial) +vel = kete.Vector([-speed, 0, 0], frame=kete.Frames.Equatorial) # We now make a State, representing the full information for an object in orbit of the # sun. -state = neospy.State("Circular", epoch, pos, vel) +state = kete.State("Circular", epoch, pos, vel) state # %% @@ -45,12 +45,12 @@ # Creation of vectors also have a few convenient helper functions: # On sky position of the andromeda galaxy -ra = neospy.conversion.ra_hms_to_degrees("0 42 44") -dec = neospy.conversion.dec_dms_to_degrees("+41 16 9") -vec = neospy.Vector.from_ra_dec(ra, dec) +ra = kete.conversion.ra_hms_to_degrees("0 42 44") +dec = kete.conversion.dec_dms_to_degrees("+41 16 9") +vec = kete.Vector.from_ra_dec(ra, dec) # Change to galactic frame, and print the elevation and azimuth -vec = vec.change_frame(neospy.Frames.Galactic) +vec = vec.change_frame(kete.Frames.Galactic) vec.el, vec.az # %% @@ -69,26 +69,26 @@ # We have just seen an example of the first way, lets explore the other ways. # Grabbing the state of the Moon. -# Neospy includes spice kernels for all of the planets, the Moon, Pluto and 5 asteroids: +# kete includes spice kernels for all of the planets, the Moon, Pluto and 5 asteroids: # Ceres, Pallas, Vesta, Hygiea, Interamnia -jd = neospy.Time.from_ymd(2020, 1, 1).jd -moon = neospy.spice.get_state("Moon", jd) +jd = kete.Time.from_ymd(2020, 1, 1).jd +moon = kete.spice.get_state("Moon", jd) # Grabbing a state from JPL Horizons # Note that the epoch of this state is the epoch of fit from Horizons. -eros = neospy.HorizonsProperties.fetch("Eros").state +eros = kete.HorizonsProperties.fetch("Eros").state # Grabbing a state from the MPC # This is more expensive, as the MPC lookup involves downloading a full copy of the MPC # database. This database contains more than a million asteroids. This gets returned as # a pandas dataframe. -orb_file = neospy.mpc.fetch_known_orbit_data() +orb_file = kete.mpc.fetch_known_orbit_data() subset = orb_file[orb_file["name"] == "Eros"] # Note that in this case the tool converts all objects in the provided table into states # which means it will always return a list of states, so below we get a list containing # a single state. -states = neospy.mpc.table_to_states(subset) +states = kete.mpc.table_to_states(subset) states # %% @@ -96,7 +96,7 @@ # ------------- # # The state(s) which are constructed above usually do not have an epoch which is useful. -# Luckily, neospy has tools for propagating the states forward and backward in time to +# Luckily, kete has tools for propagating the states forward and backward in time to # whichever epoch is desired. There are 2 workhorse functions related to orbit # propagation: # @@ -116,17 +116,17 @@ # Lets grab the state of a few asteroids: names = ["Eros", "Bennu", "Ryugu"] -orb_file = neospy.mpc.fetch_known_orbit_data() +orb_file = kete.mpc.fetch_known_orbit_data() subset = orb_file[[name in names for name in orb_file["name"]]] # This now contains 3 states: -states = neospy.mpc.table_to_states(subset) +states = kete.mpc.table_to_states(subset) # Lets propagate these states to the current epoch -now = neospy.Time.now().jd +now = kete.Time.now().jd -states_now_exact = neospy.propagate_n_body(states, now) -states_now_kepler = neospy.propagate_two_body(states, now) +states_now_exact = kete.propagate_n_body(states, now) +states_now_kepler = kete.propagate_two_body(states, now) states_now_exact # %% @@ -140,13 +140,13 @@ # - Using an MPC Observatory code # - Using Earth based latitude/longitude and altitude as one would find on a map. -now = neospy.Time.now().jd +now = kete.Time.now().jd # lookup the observers position in the solar system from a given observatory code/name. -observer_a = neospy.spice.mpc_code_to_ecliptic("Palomar Mountain", now) +observer_a = kete.spice.mpc_code_to_ecliptic("Palomar Mountain", now) # lookup the observer position from an earth location, this is IPAC, at 100m altitude. -observer_b = neospy.spice.earth_pos_to_ecliptic(now, 33.133278, 241.87206, 0.1, "IPAC") +observer_b = kete.spice.earth_pos_to_ecliptic(now, 33.133278, 241.87206, 0.1, "IPAC") observer_b # %% @@ -154,17 +154,17 @@ # observer. There are many different possible FOVs, the conceptually simplest one is an # omni-directional field of view: -fov = neospy.OmniDirectionalFOV(observer_a) +fov = kete.OmniDirectionalFOV(observer_a) fov # %% # We can now compute the observed position of objects in this FOV: -state = neospy.HorizonsProperties.fetch("Eros").state +state = kete.HorizonsProperties.fetch("Eros").state # This accepts many states and many FOVs at once, it is the most efficient when all the # requested states and FOVs are provided at the same time. -visible = neospy.fov_state_check([state], [fov])[0] +visible = kete.fov_state_check([state], [fov])[0] visible # %% @@ -186,26 +186,26 @@ # Plotting Planets # ---------------- # -# Here is a basic example of using neospy to plot an orbit. +# Here is a basic example of using kete to plot an orbit. plt.figure(dpi=150) -jd = neospy.Time.now().jd +jd = kete.Time.now().jd plt.gca().set_aspect("equal", "box") # plot the planets orbits for i, planet in enumerate(["Mercury", "Venus", "Earth", "Mars", "Jupiter"]): - plan = neospy.spice.get_state(planet, jd) + plan = kete.spice.get_state(planet, jd) plt.scatter(plan.pos.x, plan.pos.y, color=f"C{i}", s=10) jds = np.linspace(jd - plan.elements.orbital_period, jd, 100) - pos = np.array([neospy.spice.get_state(planet, jd).pos for jd in jds]).T + pos = np.array([kete.spice.get_state(planet, jd).pos for jd in jds]).T plt.plot(pos[0], pos[1], color="black", alpha=0.2) # plot the orbit of eros, using 2 body mechanics to plot the previous orbit -eros = neospy.HorizonsProperties.fetch("Eros").state -eros = neospy.propagate_two_body([eros], jd)[0] +eros = kete.HorizonsProperties.fetch("Eros").state +eros = kete.propagate_two_body([eros], jd)[0] plt.scatter(eros.pos.x, eros.pos.y, c="black", s=10) jds = np.linspace(jd - eros.elements.orbital_period, jd, 100) -pos = np.array([neospy.propagate_two_body([eros], jd)[0].pos for jd in jds]).T +pos = np.array([kete.propagate_two_body([eros], jd)[0].pos for jd in jds]).T plt.plot(pos[0], pos[1], c="C0", alpha=0.2) plt.xlabel("Ecliptic X (au)") diff --git a/src/examples/on_sky.py b/src/examples/on_sky.py index a891092..6659d97 100644 --- a/src/examples/on_sky.py +++ b/src/examples/on_sky.py @@ -5,11 +5,11 @@ Given a set of orbital elements, compute the on-sky position of an object. """ -import neospy +import kete # %% Loading orbital elements # Define an object through cometary orbital elements: -elements = neospy.CometElements( +elements = kete.CometElements( desig="Ceres", epoch=2460200.5, eccentricity=0.0789, @@ -24,7 +24,7 @@ state = elements.state # States for objects may also be queried from JPL Horizons -# state = neospy.HorizonsProperties.fetch("Ceres").state +# state = kete.HorizonsProperties.fetch("Ceres").state print("State information from orbital elements:\n") print(state) @@ -34,18 +34,18 @@ # state.as_equatorial, state.as_ecliptic, state.as_galactic, state.as_fk4 # %% Pick an observing time: -# By default, neospy uses TDB scaled JD time, the Time object automatically handles +# By default, kete uses TDB scaled JD time, the Time object automatically handles # conversions to and from this scaling: -jd = neospy.Time.from_ymd(2024, 6, 1.5).jd +jd = kete.Time.from_ymd(2024, 6, 1.5).jd # Currently the state of the object above is not at this date # lets perform orbit propagation to bring it to this date: -state = neospy.propagate_n_body([state], jd)[0] +state = kete.propagate_n_body([state], jd)[0] # %% Observatory Information # Lets try to make an observation of ceres from the ground -obs_info = neospy.mpc.find_obs_code("Palomar Mountain") +obs_info = kete.mpc.find_obs_code("Palomar Mountain") # Location of palomar mountain in lat/lon/elevation print( @@ -56,7 +56,7 @@ print(obs_info) # Load the position of the observer in the solar system: -observer = neospy.spice.mpc_code_to_ecliptic("Palomar Mountain", jd) +observer = kete.spice.mpc_code_to_ecliptic("Palomar Mountain", jd) # %% Propagation and Orbit calculations @@ -71,7 +71,7 @@ # Note that in general the two-body approximation will result in incorrect # position calculations when propagation time exceeds a few days. # But its an excellent approximation over the minutes time scale. -light_delay_state = neospy.propagate_two_body([state], state.jd, observer.pos)[0] +light_delay_state = kete.propagate_two_body([state], state.jd, observer.pos)[0] print("\nThe light delayed position of the object vs the instantaneous:") print(light_delay_state.pos) @@ -84,7 +84,7 @@ # %% RA/Dec calculations -print(f"\nAt {neospy.Time(jd).iso} UTC from the {obs_info[-1]} observatory") +print(f"\nAt {kete.Time(jd).iso} UTC from the {obs_info[-1]} observatory") print( f"{state.desig} is visible at:\n" f"{observer_to_object.ra_hms} RA {observer_to_object.dec_dms} DEC" diff --git a/src/examples/plot_close_approach.py b/src/examples/plot_close_approach.py index 4a7f85d..41e194b 100644 --- a/src/examples/plot_close_approach.py +++ b/src/examples/plot_close_approach.py @@ -5,22 +5,22 @@ Plot the close approach of Apophis in 2029. """ -import neospy +import kete import matplotlib.pyplot as plt import numpy as np import matplotlib # load apophis from horizons -cur_state = neospy.HorizonsProperties.fetch("Apophis").state +cur_state = kete.HorizonsProperties.fetch("Apophis").state -jd_center = neospy.Time.from_ymd(2029, 4, 13.9066).jd +jd_center = kete.Time.from_ymd(2029, 4, 13.9066).jd jd_start = jd_center - 1.25 jd_end = jd_center + 1.25 steps = 1 / 24 / 20 # propagate the state up to the start date. -cur_state = neospy.propagate_n_body([cur_state], jd_start, include_asteroids=True)[0] +cur_state = kete.propagate_n_body([cur_state], jd_start, include_asteroids=True)[0] # Now we propagate the object, recording info as we go # this is not the most efficient way to do this, but for 1 object it is easy. @@ -32,7 +32,7 @@ time = [] while cur_state.jd < jd_end: # propagate the object, and include the massive main belt asteroids - cur_state = neospy.propagate_n_body( + cur_state = kete.propagate_n_body( [cur_state], cur_state.jd + steps, include_asteroids=True )[0] time.append((cur_state.jd - jd_center)) @@ -40,16 +40,16 @@ rel_earth_state = cur_state.change_center(399) pos.append([rel_earth_state.pos.x, rel_earth_state.pos.y]) # gets earths position and record the distances. - moon = neospy.spice.get_state("Moon", cur_state.jd, center=399).pos - dist_to_moon.append((moon - rel_earth_state.pos).r * neospy.constants.AU_KM) - dist_to_earth.append(rel_earth_state.pos.r * neospy.constants.AU_KM) + moon = kete.spice.get_state("Moon", cur_state.jd, center=399).pos + dist_to_moon.append((moon - rel_earth_state.pos).r * kete.constants.AU_KM) + dist_to_earth.append(rel_earth_state.pos.r * kete.constants.AU_KM) moon_pos.append([moon.x, moon.y]) cmap = matplotlib.colormaps["magma"] colors = [cmap(x / len(elements) * 0.8) for x in range(len(elements))] print("Closest approach is on:") -print(neospy.Time(jd_start + np.argmin(dist_to_earth) * steps).ymd) +print(kete.Time(jd_start + np.argmin(dist_to_earth) * steps).ymd) # Note that this is at 10 steps a day, so this is not an exact calculation print(f"At a distance of about {np.min(dist_to_earth):0.0f} km") @@ -59,11 +59,9 @@ # ------------------------------ plt.suptitle("Apophis Close Encounter") -plt.scatter( - *np.transpose(pos) * neospy.constants.AU_KM, s=0.5, label="Apophis", c=colors -) +plt.scatter(*np.transpose(pos) * kete.constants.AU_KM, s=0.5, label="Apophis", c=colors) plt.plot( - *np.transpose(moon_pos) * neospy.constants.AU_KM, c="blue", alpha=0.25, label="Moon" + *np.transpose(moon_pos) * kete.constants.AU_KM, c="blue", alpha=0.25, label="Moon" ) plt.gca().axis("equal") plt.scatter(0, 0, c="Green", label="Earth") diff --git a/src/examples/plot_close_encounter.py b/src/examples/plot_close_encounter.py index 95d559e..5567aab 100644 --- a/src/examples/plot_close_encounter.py +++ b/src/examples/plot_close_encounter.py @@ -6,7 +6,7 @@ between the specified dates. """ -import neospy +import kete import matplotlib.pyplot as plt import numpy as np @@ -15,9 +15,9 @@ # ^^^^^^ # # Select the object of interest, and the times to plot the trajectory -obj = neospy.HorizonsProperties.fetch("'Oumuamua") -jd_start = neospy.Time.from_ymd(2016, 1, 1).jd -jd_end = neospy.Time.from_ymd(2018, 1, 1).jd +obj = kete.HorizonsProperties.fetch("'Oumuamua") +jd_start = kete.Time.from_ymd(2016, 1, 1).jd +jd_end = kete.Time.from_ymd(2018, 1, 1).jd # Select the scale of the X/Y/Z axis zoom = 1.2 @@ -36,10 +36,10 @@ earth_r = [] last_state = obj.state for jd in jds: - last_state = neospy.propagate_two_body([last_state], jd)[0] + last_state = kete.propagate_two_body([last_state], jd)[0] obj_pos.append(last_state.pos) - earth_pos.append(neospy.spice.get_state("Earth", jd).pos) - earth_r.append(neospy.Vector(obj_pos[-1] - earth_pos[-1]).r) + earth_pos.append(kete.spice.get_state("Earth", jd).pos) + earth_r.append(kete.Vector(obj_pos[-1] - earth_pos[-1]).r) # Find the time where the closest encounter with the earth jd_center = jds[np.argmin(earth_r)] @@ -55,10 +55,10 @@ ax.plot(pos[0], pos[1], pos[2], alpha=0.5, color="black") ax.scatter(pos_center.x, pos_center.y, pos_center.z, s=5, color="black") for i, planet in enumerate(["Mercury", "Venus", "Earth", "Mars", "Jupiter"]): - states = [neospy.spice.get_state(planet, jd).pos for jd in jds] + states = [kete.spice.get_state(planet, jd).pos for jd in jds] pos = np.array(states).T ax.plot(pos[0], pos[1], pos[2], color=f"C{i}", alpha=0.5) - pos = neospy.spice.get_state(planet, jd_center).pos + pos = kete.spice.get_state(planet, jd_center).pos ax.scatter(pos.x, pos.y, pos.z, color=f"C{i}", s=5) ax.scatter(0, 0, 0, color="red") ax.set_xticks([-zoom, 0, zoom]) diff --git a/src/examples/plot_comet.py b/src/examples/plot_comet.py index e3c34bc..c5d13da 100644 --- a/src/examples/plot_comet.py +++ b/src/examples/plot_comet.py @@ -7,16 +7,16 @@ """ from astropy.wcs import WCS -import neospy +import kete import astropy import numpy as np -import neospy +import kete import matplotlib.pyplot as plt import numpy as np # This is comet NEOWISE as observed by ZTF -state = neospy.HorizonsProperties.fetch("C/2020 F3").state +state = kete.HorizonsProperties.fetch("C/2020 F3").state # Specific frame information for the ZTF frame where neowise was imaged. # See the tutorials for KONA and Precovery for more information on how to @@ -31,24 +31,24 @@ ) # Load the fits file for this ZTF frame. -frame = astropy.io.fits.open(neospy.ztf.fetch_ZTF_file(**frame_info))[0] +frame = astropy.io.fits.open(kete.ztf.fetch_ZTF_file(**frame_info))[0] # Grab frame information from this file -jd = neospy.Time(frame.header["OBSJD"], scaling="utc").jd +jd = kete.Time(frame.header["OBSJD"], scaling="utc").jd frame_wcs = WCS(frame.header) corners = [] dx, dy = frame_wcs.pixel_shape for x, y in zip([dx, dx, 0, 0], [0, dy, dy, 0]): coord = frame_wcs.pixel_to_world(x, y).icrs - corners.append(neospy.Vector.from_ra_dec(coord.ra.deg, coord.dec.deg)) -observer_loc = neospy.spice.mpc_code_to_ecliptic("ZTF", jd) + corners.append(kete.Vector.from_ra_dec(coord.ra.deg, coord.dec.deg)) +observer_loc = kete.spice.mpc_code_to_ecliptic("ZTF", jd) -# Build a neospy FOV for this frame -fov = neospy.ZtfCcdQuad(corners, observer_loc, maglimit=np.nan, fid=1, **frame_info) +# Build a kete FOV for this frame +fov = kete.ZtfCcdQuad(corners, observer_loc, maglimit=np.nan, fid=1, **frame_info) # Compute the observation information for the comet in this frame -vis = neospy.fov_state_check([state], [fov])[0] +vis = kete.fov_state_check([state], [fov])[0] def plot_vector(wcs, vec_a, vec_b, label, x=0.2, y=0.2, c="w", length=0.1, **kwargs): @@ -86,13 +86,11 @@ def plot_vectors(wcs, state, fov, x=0.2, y=0.2): - East vector, showing Equatorial East. """ - past_vec = ( - neospy.propagate_n_body([state], state.jd - 0.05)[0].pos - fov.observer.pos - ) + past_vec = kete.propagate_n_body([state], state.jd - 0.05)[0].pos - fov.observer.pos sun_vec = (state.pos * 1.001) - fov.observer.pos vec = (state.pos - fov.observer.pos).as_equatorial - north_vec = neospy.Vector.from_ra_dec(vec.ra, vec.dec + 0.01) - east_vec = neospy.Vector.from_ra_dec(vec.ra + 0.01, vec.dec) + north_vec = kete.Vector.from_ra_dec(vec.ra, vec.dec + 0.01) + east_vec = kete.Vector.from_ra_dec(vec.ra + 0.01, vec.dec) plot_vector(wcs, vec, past_vec, r"-$v$", x=x, y=y, c="r") plot_vector(wcs, vec, sun_vec, r"r$_\odot$", x=x, y=y, c=(0, 0.5, 1)) @@ -105,22 +103,22 @@ def plot_syndyne(wcs, state, fov, beta, back_days=90, day_step=1, **kwargs): Plot a single syndyne line for the provided beta value. """ # create a non-grav model for the dust which will be used for propagation/ - model = neospy.propagation.NonGravModel.new_dust(beta) + model = kete.propagation.NonGravModel.new_dust(beta) # working backward, calculate the position of the comet at each time step - dust_state = neospy.propagate_n_body([state], fov.observer.jd - back_days)[0] + dust_state = kete.propagate_n_body([state], fov.observer.jd - back_days)[0] dust_states = [] for jd in np.arange(dust_state.jd, fov.observer.jd, day_step): - dust_state = neospy.propagate_n_body([dust_state], jd)[0] + dust_state = kete.propagate_n_body([dust_state], jd)[0] dust_states.append(dust_state) # Now treat all of those points as though they are release dust, and # propagated to the current epoch. - cur_state = neospy.propagate_n_body( + cur_state = kete.propagate_n_body( dust_states, fov.observer.jd, non_gravs=[model] * len(dust_states) ) # apply a light delay correction - cur_state = neospy.propagate_two_body(cur_state, fov.observer.jd, fov.observer.pos) + cur_state = kete.propagate_two_body(cur_state, fov.observer.jd, fov.observer.pos) # Setup plotting pos = [(x.pos - fov.observer.pos).as_equatorial for x in cur_state] @@ -147,16 +145,16 @@ def plot_synchrone( betas = np.logspace(np.log10(beta_min), np.log10(beta_max), beta_steps)[::-1] # build non-grav models for each beta - models = [neospy.propagation.NonGravModel.new_dust(beta) for beta in betas] + models = [kete.propagation.NonGravModel.new_dust(beta) for beta in betas] # propagate the comet back to the release date - dust_state = neospy.propagate_n_body([state], fov.observer.jd + days_back)[0] + dust_state = kete.propagate_n_body([state], fov.observer.jd + days_back)[0] dust_states = [dust_state] * len(betas) # release dust and propagate foward to the current epoch. - cur_state = neospy.propagate_n_body(dust_states, fov.observer.jd, non_gravs=models) + cur_state = kete.propagate_n_body(dust_states, fov.observer.jd, non_gravs=models) # apply a light delay correction - cur_state = neospy.propagate_two_body(cur_state, fov.observer.jd, fov.observer.pos) + cur_state = kete.propagate_two_body(cur_state, fov.observer.jd, fov.observer.pos) # setup plotting pos = [(x.pos - fov.observer.pos).as_equatorial for x in cur_state] @@ -175,7 +173,7 @@ def plot_synchrone( # Plot the final results plt.figure(dpi=200) -wcs = neospy.ztf.plot_frame(vis.fov) +wcs = kete.ztf.plot_frame(vis.fov) plt.title("Comet NEOWISE - C/2020 F3\n") # plot syndynes diff --git a/src/examples/plot_elevation.py b/src/examples/plot_elevation.py index 679048d..bdda527 100644 --- a/src/examples/plot_elevation.py +++ b/src/examples/plot_elevation.py @@ -15,7 +15,7 @@ from labellines import labelLines -import neospy +import kete # %% @@ -37,15 +37,15 @@ # Calculating elevations over one night # ------------------------------------- -jd_start = neospy.Time.from_iso(start_time.isoformat()).jd +jd_start = kete.Time.from_iso(start_time.isoformat()).jd jd_end = jd_start + 1 # Fetch orbital elements from horizons states = [ - neospy.HorizonsProperties.fetch(str(name), update_name=True).state + kete.HorizonsProperties.fetch(str(name), update_name=True).state for name in object_names ] -states = neospy.propagate_n_body(states, jd_start) +states = kete.propagate_n_body(states, jd_start) # step through time in 1 minute increments @@ -59,18 +59,18 @@ for subrange in steps: # for each time step, calculate the elevation and sun elevation jd_step = jd_start + subrange - approx_state = neospy.propagate_two_body(states, jd_step) - sun2obs = neospy.spice.mpc_code_to_ecliptic(site, jd_step).pos - earth2obs = neospy.spice.mpc_code_to_ecliptic(site, jd_step, center="399").pos + approx_state = kete.propagate_two_body(states, jd_step) + sun2obs = kete.spice.mpc_code_to_ecliptic(site, jd_step).pos + earth2obs = kete.spice.mpc_code_to_ecliptic(site, jd_step, center="399").pos sun_elevation.append(90 - earth2obs.angle_between(-sun2obs)) - moon = neospy.spice.get_state("Moon", jd_step) - obs2obj = neospy.Vector(moon.pos - sun2obs) + moon = kete.spice.get_state("Moon", jd_step) + obs2obj = kete.Vector(moon.pos - sun2obs) moon_elevation.append(90 - earth2obs.angle_between(obs2obj)) cur_elev = [] for state in approx_state: - obs2obj = neospy.Vector(state.pos - sun2obs) + obs2obj = kete.Vector(state.pos - sun2obs) cur_elev.append(90 - earth2obs.angle_between(obs2obj)) elevation.append(cur_elev) @@ -98,9 +98,9 @@ elevation = elevation[:, sort_idx] object_names = np.array(object_names)[sort_idx] -dates_utc = [neospy.Time(t + jd_start).to_datetime() for t in steps] +dates_utc = [kete.Time(t + jd_start).to_datetime() for t in steps] dates = [t.astimezone(timezone) for t in dates_utc] -moon_frac = neospy.spice.moon_illumination_frac(jd_start) +moon_frac = kete.spice.moon_illumination_frac(jd_start) # Find the time closest to midnight midnight = dates[np.argmax([d.hour + d.minute for d in dates])] @@ -177,7 +177,7 @@ ax2 = plt.twinx() ax2.set_ylim(ymin, ymax) elev_ticks = np.arange(10, 91, 10) -airmass = [f"{x:0.3g}" for x in neospy.conversion.compute_airmass(90 - elev_ticks)] +airmass = [f"{x:0.3g}" for x in kete.conversion.compute_airmass(90 - elev_ticks)] ax2.set_yticks(elev_ticks, airmass) plt.ylabel("Airmass") diff --git a/src/examples/plot_flux_vs_wavelength.py b/src/examples/plot_flux_vs_wavelength.py index 33f6db2..97f987a 100644 --- a/src/examples/plot_flux_vs_wavelength.py +++ b/src/examples/plot_flux_vs_wavelength.py @@ -10,7 +10,7 @@ import numpy as np import matplotlib.pyplot as plt -import neospy +import kete def flux_per_wavelength( @@ -44,16 +44,16 @@ def flux_per_wavelength( """ # Calculate the geometry, the observer is placed 1 AU from the sun. - sun2sc = neospy.Vector([1.0, 0, 0]) + sun2sc = kete.Vector([1.0, 0, 0]) alpha = np.pi - phase - solar_elong peri_dist = sun2sc.r / np.sin(phase) * np.sin(solar_elong) - sun2obj = neospy.Vector([np.cos(alpha) * peri_dist, np.sin(alpha) * peri_dist, 0]) + sun2obj = kete.Vector([np.cos(alpha) * peri_dist, np.sin(alpha) * peri_dist, 0]) fluxes = [] for wave in wavelength: - flux = neospy.flux.neatm_flux( + flux = kete.flux.neatm_flux( sun2obj, sun2sc, v_albedo=v_albedo, @@ -63,7 +63,7 @@ def flux_per_wavelength( wavelength=wave, emissivity=0.9, ) - refl_flux = neospy.flux.hg_apparent_flux( + refl_flux = kete.flux.hg_apparent_flux( sun2obj, sun2sc, g_param=0.15, diff --git a/src/examples/plot_light_curve.py b/src/examples/plot_light_curve.py index 8e94a5b..d580d07 100644 --- a/src/examples/plot_light_curve.py +++ b/src/examples/plot_light_curve.py @@ -5,13 +5,13 @@ This is an example plot of a light curve using NEATM. """ -import neospy +import kete import numpy as np import matplotlib.pyplot as plt # Using ceres as a source for a state vector -state = neospy.spice.get_state("ceres", 2460000.5) +state = kete.spice.get_state("ceres", 2460000.5) # Various input values albedo = 0.1 @@ -28,19 +28,19 @@ dts = np.linspace(0, 10, 30) # Construct an object which is twice the radius in they y axis. -geom = neospy.shape.TriangleEllipsoid(30, x_scale=1, y_scale=2, z_scale=1) -normals = [neospy.Vector(norm) for norm in geom.normals] +geom = kete.shape.TriangleEllipsoid(30, x_scale=1, y_scale=2, z_scale=1) +normals = [kete.Vector(norm) for norm in geom.normals] # Pick an axis of rotation -axis_of_rotation = neospy.Vector.from_lat_lon(90, 0) +axis_of_rotation = kete.Vector.from_lat_lon(90, 0) jd = state.jd fluxes = [] for dt in dts: # Find the observer and object positions some time in the future. - earth_pos = neospy.spice.get_state("Earth", jd + dt).pos - final_pos = neospy.propagate_two_body([state], jd + dt, earth_pos)[0].pos + earth_pos = kete.spice.get_state("Earth", jd + dt).pos + final_pos = kete.propagate_two_body([state], jd + dt, earth_pos)[0].pos obj2obs = final_pos - earth_pos @@ -52,13 +52,11 @@ ] ) - ss_temp = neospy.flux.sub_solar_temperature( - -obj2obs, albedo, G, emissivity, beaming - ) - temps = neospy.flux.neatm_facet_temps(new_normals, ss_temp, obj2obs) - facet_fluxes = [neospy.flux.black_body_flux(t, wavelength) for t in temps] + ss_temp = kete.flux.sub_solar_temperature(-obj2obs, albedo, G, emissivity, beaming) + temps = kete.flux.neatm_facet_temps(new_normals, ss_temp, obj2obs) + facet_fluxes = [kete.flux.black_body_flux(t, wavelength) for t in temps] facet_fluxes = np.array(facet_fluxes) * geom.areas - flux = neospy.flux.lambertian_flux( + flux = kete.flux.lambertian_flux( facet_fluxes, geom.normals, -obj2obs, diameter, emissivity ) fluxes.append(flux) diff --git a/src/examples/plot_mpc_state.py b/src/examples/plot_mpc_state.py index c069581..7df62be 100644 --- a/src/examples/plot_mpc_state.py +++ b/src/examples/plot_mpc_state.py @@ -7,7 +7,7 @@ This plots all of the Hildas from the MPC, along with the last 90 days of their orbit. """ -import neospy +import kete import matplotlib.pyplot as plt import numpy as np @@ -15,19 +15,19 @@ zoom = 4.0 # Fetch all known asteroid orbits -orb = neospy.mpc.fetch_known_orbit_data() +orb = kete.mpc.fetch_known_orbit_data() # Subset to the Hildas orb = orb[orb["group_name"] == "Hilda"] # convert the table of data to State objects -states = neospy.mpc.table_to_states(orb) +states = kete.mpc.table_to_states(orb) # Every object in the MPC orbit file has its own epoch of fit. # This means that some objects epochs may be months or years away from # others. In order to bring all of these objects to the same epoch, the # function below will propagate the states to the first state's epoch. -states = neospy.propagate_two_body(states, states[0].jd) +states = kete.propagate_two_body(states, states[0].jd) # Grab the positions from this subset pos = np.array([p.pos for p in states]) @@ -41,16 +41,16 @@ # Plot the planets for 1 orbit each for i, planet in enumerate(["Mercury", "Venus", "Earth", "Mars", "Jupiter"]): jd = states[0].jd - plan = neospy.spice.get_state(planet, jd) + plan = kete.spice.get_state(planet, jd) ax.scatter(plan.pos.x, plan.pos.y, color=f"C{i}", s=10) jds = np.linspace(jd - plan.elements.orbital_period, jd, 100) - pos = np.array([neospy.spice.get_state(planet, jd).pos for jd in jds]).T + pos = np.array([kete.spice.get_state(planet, jd).pos for jd in jds]).T ax.plot(pos[0], pos[1], pos[2], color="black", alpha=0.2) for state in states: jd = states[0].jd jds = np.linspace(jd - 90, jd, 100) - pos = np.array([neospy.propagate_two_body([state], jd)[0].pos for jd in jds]).T + pos = np.array([kete.propagate_two_body([state], jd)[0].pos for jd in jds]).T ax.plot(pos[0], pos[1], pos[2], color="black", alpha=0.1, lw=0.2) ax.scatter(0, 0, 0, color="red") diff --git a/src/examples/plot_observability.py b/src/examples/plot_observability.py index 2b0c335..b168f9c 100644 --- a/src/examples/plot_observability.py +++ b/src/examples/plot_observability.py @@ -22,14 +22,14 @@ import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np -import neospy +import kete # Inputs: # ------- -obj = neospy.HorizonsProperties.fetch("Eros", update_name=False) +obj = kete.HorizonsProperties.fetch("Eros", update_name=False) -start_time = neospy.Time.from_ymd(2023, 11, 1).jd -end_time = neospy.Time.from_ymd(2024, 11, 1).jd +start_time = kete.Time.from_ymd(2023, 11, 1).jd +end_time = kete.Time.from_ymd(2024, 11, 1).jd # Observers position: site = "Palomar Mountain" @@ -45,7 +45,7 @@ if obj.h_mag is None: print("Horizons doesn't have an h mag for this object, no mags will be computed!") -state = neospy.propagate_n_body([obj.state], start_time)[0] +state = kete.propagate_n_body([obj.state], start_time)[0] mags = [] solar_elon = [] @@ -55,16 +55,16 @@ for t in times: # For each time, compute the geometry, then compute the mag as well as all of the # various angle and distance values. - state = neospy.propagate_n_body([state], t)[0] - sun2obs = neospy.spice.mpc_code_to_ecliptic(site, t).pos - earth2obs = neospy.spice.mpc_code_to_ecliptic(site, t, center="399").pos + state = kete.propagate_n_body([state], t)[0] + sun2obs = kete.spice.mpc_code_to_ecliptic(site, t).pos + earth2obs = kete.spice.mpc_code_to_ecliptic(site, t, center="399").pos sun2obj = state.pos obs2obj = -sun2obs + sun2obj # if we cannot compute mag, set the mag to NAN and keep moving if obj.h_mag is not None: - mag = neospy.flux.hg_apparent_mag( + mag = kete.flux.hg_apparent_mag( sun2obj=sun2obj, sun2obs=sun2obs, h_mag=obj.h_mag, g_param=g_phase ) mag = np.clip(mag, -1000, 1000) @@ -77,7 +77,7 @@ phases.append((-sun2obj).angle_between(-obs2obj)) dist.append(obs2obj.r) -dates = [neospy.Time(t).to_datetime() for t in times] +dates = [kete.Time(t).to_datetime() for t in times] plt.figure(dpi=150, figsize=(8, 5)) plt.suptitle(f"{obj.desig}") @@ -126,12 +126,12 @@ for t in day_steps: elevation = [] - state = neospy.propagate_n_body([state], t + substep_time / 2)[0] + state = kete.propagate_n_body([state], t + substep_time / 2)[0] nights = [] for subrange in substeps: - approx_state = neospy.propagate_two_body([state], t + subrange)[0] - sun2obs = neospy.spice.mpc_code_to_ecliptic(site, t + subrange).pos - earth2obs = neospy.spice.mpc_code_to_ecliptic( + approx_state = kete.propagate_two_body([state], t + subrange)[0] + sun2obs = kete.spice.mpc_code_to_ecliptic(site, t + subrange).pos + earth2obs = kete.spice.mpc_code_to_ecliptic( site, t + subrange, center="399" ).pos @@ -146,7 +146,7 @@ night_len.append(sum(nights) * substep_time) elevations.append(elevation) -dates = [neospy.Time(t + step_size / 2).to_datetime() for t in day_steps] +dates = [kete.Time(t + step_size / 2).to_datetime() for t in day_steps] for ang in [0, 15, 30, 45, 60, 75]: plt.plot( dates, diff --git a/src/examples/plot_phases.py b/src/examples/plot_phases.py index e954422..733b21e 100644 --- a/src/examples/plot_phases.py +++ b/src/examples/plot_phases.py @@ -3,32 +3,32 @@ ========================================= """ -import neospy +import kete import numpy as np import matplotlib.pyplot as plt # Fetch known orbits from the MPC -orbits = neospy.mpc.fetch_known_orbit_data() +orbits = kete.mpc.fetch_known_orbit_data() # Subselect NEO population -neos = neospy.population.neo(orbits.peri_dist, orbits.ecc) +neos = kete.population.neo(orbits.peri_dist, orbits.ecc) neo_subset = orbits[neos] # Convert the dataframe to States -neos = neospy.mpc.table_to_states(neo_subset) +neos = kete.mpc.table_to_states(neo_subset) # Note that some of the objects will have NAN positions, which is result of # them hitting the earth after discovery. # Pick your favorite time to observe -jd = neospy.Time.from_iso("2024-07-03T23:11:42.748000+00:00").jd +jd = kete.Time.from_iso("2024-07-03T23:11:42.748000+00:00").jd # Move the entire population of asteroids to that time using 2-body # mechanics, this can be directly substituted with propagate_n_body if you # want more precision. -sun2earth = neospy.spice.get_state("Earth", jd).pos -states = neospy.propagate_two_body(neos, jd) +sun2earth = kete.spice.get_state("Earth", jd).pos +states = kete.propagate_two_body(neos, jd) # Compute the expected V-mags for these objects at this time mags = [] @@ -38,7 +38,7 @@ sun2obj = state.pos obj2earth = sun2earth - sun2obj mags.append( - neospy.flux.hg_apparent_mag( + kete.flux.hg_apparent_mag( sun2obj=sun2obj, sun2obs=sun2earth, h_mag=neo_subset.h_mag.iloc[i], diff --git a/src/examples/plot_thermal_model.py b/src/examples/plot_thermal_model.py index 325e797..6f01d5f 100644 --- a/src/examples/plot_thermal_model.py +++ b/src/examples/plot_thermal_model.py @@ -7,7 +7,7 @@ The geometry is such that the sun is 1 AU away from the asteroid along the X-axis. """ -import neospy +import kete import numpy as np import matplotlib as mpl import matplotlib.cm as cm @@ -24,9 +24,9 @@ beaming = 1.4 # Define the geometry -geom = neospy.shape.TriangleEllipsoid(12) +geom = kete.shape.TriangleEllipsoid(12) obj2sun = np.array([1, 0, 0]) -# Note: The TriangleEllipsoid geometry is not used by default in the neospy code. +# Note: The TriangleEllipsoid geometry is not used by default in the kete code. # This is because its facet normals tend to be slightly correlated with one another. # These correlations can be eliminated by setting the number of facets high enough, # but for a low facet count, the FibonacciLattice converges to the exact answer @@ -36,20 +36,20 @@ # Compute the temperature at the subsolar point on the object. # Note that FRM uses a beaming = pi -neatm_subsolar_temp = neospy.flux.sub_solar_temperature( +neatm_subsolar_temp = kete.flux.sub_solar_temperature( -obj2sun, vis_albedo, g_phase, emissivity, beaming ) -frm_subsolar_temp = neospy.flux.sub_solar_temperature( +frm_subsolar_temp = kete.flux.sub_solar_temperature( -obj2sun, vis_albedo, g_phase, emissivity ) # Compute the FRM and NEATM facet temperatures for the object -neatm_facet_temps = neospy.flux.neatm_facet_temps( +neatm_facet_temps = kete.flux.neatm_facet_temps( geom.normals, neatm_subsolar_temp, obj2sun, ) -frm_facet_temps = neospy.flux.frm_facet_temps( +frm_facet_temps = kete.flux.frm_facet_temps( geom.normals, frm_subsolar_temp, obj2sun, diff --git a/src/examples/plot_trojans.py b/src/examples/plot_trojans.py index aa0130b..9adba91 100644 --- a/src/examples/plot_trojans.py +++ b/src/examples/plot_trojans.py @@ -3,20 +3,20 @@ ======================== """ -import neospy +import kete import numpy as np import matplotlib.pyplot as plt # Load orbit data and select just the jupiter trojans -orbs = neospy.mpc.fetch_known_orbit_data() -subset = orbs[neospy.population.jup_trojan(orbs.peri_dist, orbs.ecc)] +orbs = kete.mpc.fetch_known_orbit_data() +subset = orbs[kete.population.jup_trojan(orbs.peri_dist, orbs.ecc)] # Construct the states and propagate them to a common epoch -states = neospy.mpc.table_to_states(subset) -states = neospy.propagate_n_body(states, states[0].jd) +states = kete.mpc.table_to_states(subset) +states = kete.propagate_n_body(states, states[0].jd) # Where is jupiter? -jupiter = neospy.spice.get_state("Jupiter", states[0].jd) +jupiter = kete.spice.get_state("Jupiter", states[0].jd) # found it! # Compute the positions, and relative longitudinal distance from jupiter diff --git a/src/examples/plot_uncertainty.py b/src/examples/plot_uncertainty.py index 886d20d..10d363d 100644 --- a/src/examples/plot_uncertainty.py +++ b/src/examples/plot_uncertainty.py @@ -8,7 +8,7 @@ import matplotlib.pyplot as plt import numpy as np -import neospy +import kete # Inputs: # ------- @@ -23,18 +23,18 @@ # Calculating Samples # ------------------- -obj = neospy.HorizonsProperties.fetch(obj_name) +obj = kete.HorizonsProperties.fetch(obj_name) g = obj.g_phase if obj.g_phase else 0.15 # Sample time -cur_jd = neospy.Time.now().jd +cur_jd = kete.Time.now().jd jd_e = cur_jd + days_into_future jd_s = obj.epoch - 10 jds = np.arange(jd_s, jd_e, time_step) # Sample the covariance matrix cov = np.array(obj.covariance.cov_matrix) -samples = neospy.covariance.generate_sample_from_cov(n_samples, cov) +samples = kete.covariance.generate_sample_from_cov(n_samples, cov) labels, values = zip(*obj.covariance.params) values = np.array(values) @@ -44,15 +44,15 @@ for sample in samples: sample = sample + values params = dict(zip(labels, sample)) - states.append(neospy.CometElements(obj.desig, obj.covariance.epoch, **params).state) + states.append(kete.CometElements(obj.desig, obj.covariance.epoch, **params).state) # Propagate the position of all states to all time steps, recording the V mags mags = [] for jd in jds: - states = neospy.propagate_n_body(states, jd) - earth = neospy.spice.get_state("earth", jd) + states = kete.propagate_n_body(states, jd) + earth = kete.spice.get_state("earth", jd) m = [ - neospy.flux.hg_apparent_mag( + kete.flux.hg_apparent_mag( sun2obj=x.pos, sun2obs=earth.pos, h_mag=obj.h_mag, g_param=g ) for x in states @@ -64,8 +64,8 @@ brightest_jd = jds[brightest_idx] # position at lowest mag -states = neospy.propagate_n_body(states, brightest_jd) -earth = neospy.spice.get_state("earth", brightest_jd) +states = kete.propagate_n_body(states, brightest_jd) +earth = kete.spice.get_state("earth", brightest_jd) vecs = [(s.pos - earth.pos).as_equatorial for s in states] ras = np.array([v.ra for v in vecs]) decs = np.array([v.dec for v in vecs]) @@ -83,7 +83,7 @@ plt.plot(jds - cur_jd, mags, c="C0", alpha=0.05) plt.ylabel("V Mag") -ymd_today = "-".join(f"{x:0.0f}" for x in neospy.Time(cur_jd).ymd) +ymd_today = "-".join(f"{x:0.0f}" for x in kete.Time(cur_jd).ymd) plt.xlabel(f"Days from Today ({ymd_today})") plt.axvline(obj.epoch - cur_jd, ls="--", label="Epoch of fit", c="k") @@ -103,7 +103,7 @@ idx_sort = np.argsort(ras) decs = decs[idx_sort] ras = np.unwrap(ras[idx_sort], period=360) -ymd = "-".join(f"{x:0.0f}" for x in neospy.Time(brightest_jd).ymd) +ymd = "-".join(f"{x:0.0f}" for x in kete.Time(brightest_jd).ymd) plt.subplot(1, 2, 2) plt.title(f"On-Sky Position at Lowest Mag\n{ymd}") diff --git a/src/examples/solar_spectrum.py b/src/examples/solar_spectrum.py index db72105..4c1296a 100644 --- a/src/examples/solar_spectrum.py +++ b/src/examples/solar_spectrum.py @@ -5,7 +5,7 @@ Plot the true Solar spectrum vs a black body approximation. """ -import neospy +import kete import numpy as np import matplotlib.pyplot as plt @@ -22,21 +22,21 @@ # This is the 2000 ASTM Standard Extraterrestrial Spectrum Reference E-490-00: # https://www.nrel.gov/grid/solar-resource/spectra-astm-e490.html -solar_flux = [neospy.flux.solar_flux(dist_from_sun, w) for w in wavelengths] +solar_flux = [kete.flux.solar_flux(dist_from_sun, w) for w in wavelengths] # %% # Black Body # ---------- # Compute black body for the sun from base principles. -sun_r_au = neospy.constants.SUN_RADIUS_M / neospy.constants.AU_M +sun_r_au = kete.constants.SUN_RADIUS_M / kete.constants.AU_M # black body radiation is Janskys / steradian, it needs to be integrated over the # steradian. black_body_flux = np.array( [ - neospy.flux.black_body_flux( - temp=neospy.constants.SUN_TEMP, + kete.flux.black_body_flux( + temp=kete.constants.SUN_TEMP, wavelength=w, ) for w in wavelengths diff --git a/src/neospy/__init__.py b/src/kete/__init__.py similarity index 100% rename from src/neospy/__init__.py rename to src/kete/__init__.py diff --git a/src/neospy/cache.py b/src/kete/cache.py similarity index 73% rename from src/neospy/cache.py rename to src/kete/cache.py index a307e43..8730ef4 100644 --- a/src/neospy/cache.py +++ b/src/kete/cache.py @@ -6,30 +6,24 @@ import logging import urllib import os -import zipfile import shutil from urllib3.util.retry import Retry -from .deprecation import rename, deprecated - -CACHE_DIR = os.getenv("NEOSPY_CACHE_DIR", "~/.neospy/") +CACHE_DIR = os.getenv("kete_CACHE_DIR", "~/.kete/") """ Cache directory location is set by this global variable. By default this puts cache information into the home directory under a hidden folder. -This may be either set by the environmental variable `NEOSPY_CACHE_DIR` or -by changing this variable after importing neospy. +This may be either set by the environmental variable `kete_CACHE_DIR` or +by changing this variable after importing kete. """ logger = logging.getLogger(__name__) __all__ = [ "cache_path", - "cached_file_download", - "cached_gzip_json_download", - "cached_zip_download", "get_cache_size", ] @@ -38,7 +32,7 @@ def cache_path(subfolder=""): """ Helper function to return the absolute location of the cache folder. - The cache folder contains files which are downloaded during use of neospy and + The cache folder contains files which are downloaded during use of kete and are not required for basic function. """ path = os.path.abspath(os.path.expanduser(os.path.expandvars(CACHE_DIR))) @@ -50,7 +44,7 @@ def cache_path(subfolder=""): def cache_ls(subfolder=""): - """List the contents of the neospy cache directory""" + """List the contents of the kete cache directory""" path = os.path.join(cache_path(), subfolder) if not os.path.isdir(path): return ValueError(f"({path} is not a directory.)") @@ -140,38 +134,3 @@ def download_json(url, force_download=False, subfolder=""): with gzip.open(filename, "rb") as f: raw_data = f.read().decode() return json.loads(raw_data) - - -@deprecated( - deprecated_version="v0.2.4", - additional_msg=" This will be removed in v0.2.5", -) -def cached_zip_download(url, force_download=False, subfolder=""): - """ - Download a zipped file to the cache directory and unzip it in place. - Returning the path to the folder where it is unzipped. - - This operation is cached, so requesting the same URL will result in the previously - fetched results being returned. Setting force_download to true will force the cached - file to be re-downloaded. - """ - filename = download_file(url, force_download, subfolder=subfolder) - parent_dir, file = os.path.split(filename) - zipfile.ZipFile(filename).extractall(parent_dir) - return os.path.join(parent_dir, file.replace(".zip", "")) - - -cached_gzip_json_download = download_json -rename( - download_json, - deprecated_version="v0.2.4", - additional_msg=" Cached files are now always gzipped.", - old_name="cached_gzip_json_download", -) - - -cached_file_download = rename( - download_file, - deprecated_version="v0.2.4", - old_name="cached_file_download", -) diff --git a/src/neospy/constants.py b/src/kete/constants.py similarity index 100% rename from src/neospy/constants.py rename to src/kete/constants.py diff --git a/src/neospy/conversion.py b/src/kete/conversion.py similarity index 100% rename from src/neospy/conversion.py rename to src/kete/conversion.py diff --git a/src/neospy/covariance.py b/src/kete/covariance.py similarity index 99% rename from src/neospy/covariance.py rename to src/kete/covariance.py index 10e76b0..d3f9f49 100644 --- a/src/neospy/covariance.py +++ b/src/kete/covariance.py @@ -1,6 +1,6 @@ from scipy.stats import chi2 import numpy as np -import neospy +import kete def generate_sample_from_cov(n_samples, cov, seed=None): @@ -66,7 +66,7 @@ def vec_circle(normal, n_steps=1000): # Construct a vector in the plane defined by the normal vec = plane_basis(normal)[0] - vec = neospy.Vector(vec) + vec = kete.Vector(vec) angles = np.linspace(0.0, 360, n_steps) vecs = [] diff --git a/src/neospy/deprecation.py b/src/kete/deprecation.py similarity index 93% rename from src/neospy/deprecation.py rename to src/kete/deprecation.py index e0e8658..51344dc 100644 --- a/src/neospy/deprecation.py +++ b/src/kete/deprecation.py @@ -14,7 +14,7 @@ def decorate(func): def wrapped(*args, **kwargs): warnings.warn( ( - f"Function `{func.__name__}` was deprecated in neospy version " + f"Function `{func.__name__}` was deprecated in kete version " f"'{deprecated_version}.{additional_msg}" ), category=DeprecationWarning, @@ -37,7 +37,7 @@ def rename(new_func, deprecated_version, additional_msg=None, old_name=None): def wrapped(*args, **kwargs): warnings.warn( ( - f"Function `{old_name}` was renamed in neospy version " + f"Function `{old_name}` was renamed in kete version " f"'{deprecated_version}'. Use `{new_func.__name__}` instead." f"{additional_msg}" ), diff --git a/src/neospy/flux.py b/src/kete/flux.py similarity index 100% rename from src/neospy/flux.py rename to src/kete/flux.py diff --git a/src/neospy/fov.py b/src/kete/fov.py similarity index 100% rename from src/neospy/fov.py rename to src/kete/fov.py diff --git a/src/neospy/horizons.py b/src/kete/horizons.py similarity index 98% rename from src/neospy/horizons.py rename to src/kete/horizons.py index 9823cff..286a830 100644 --- a/src/neospy/horizons.py +++ b/src/kete/horizons.py @@ -83,7 +83,7 @@ def fetch(name, update_name=True, cache=True, update_cache=False, exact_name=Fal } lookup_rev = dict(x[::-1] for x in lookup.items()) - for neospy_v, jpl_v in lookup.items(): + for kete_v, jpl_v in lookup.items(): val = [ float(p["value"]) for p in props["orbit"]["elements"] @@ -91,7 +91,7 @@ def fetch(name, update_name=True, cache=True, update_cache=False, exact_name=Fal ] if len(val) == 0: continue - phys[neospy_v] = val[0] + phys[kete_v] = val[0] phys["epoch"] = float(props["orbit"]["epoch"]) if "moid" in props["orbit"] and props["orbit"]["moid"] is not None: phys["moid"] = float(props["orbit"]["moid"]) @@ -126,11 +126,11 @@ def fetch(name, update_name=True, cache=True, update_cache=False, exact_name=Fal "diameter": "diameter", "vis_albedo": "albedo", } - for neospy_v, jpl_v in lookup.items(): + for kete_v, jpl_v in lookup.items(): val = [p["value"] for p in props["phys_par"] if p["name"] == jpl_v] if len(val) == 0: continue - phys[neospy_v] = float(val[0]) + phys[kete_v] = float(val[0]) phys["group"] = props.get("object", {}).get("orbit_class", {}).get("name", None) return HorizonsProperties(**phys) @@ -286,7 +286,7 @@ def fetch_spice_kernel( .. code-block:: python - from neospy import horizons, Time + from kete import horizons, Time jd_start = Time.from_ymd(1900, 1, 1) jd_end = Time.from_ymd(2100, 1, 1) horizons.fetch_spice_kernel("10p", jd_start, jd_end) diff --git a/src/neospy/irsa.py b/src/kete/irsa.py similarity index 97% rename from src/neospy/irsa.py rename to src/kete/irsa.py index 484b482..fd0b726 100644 --- a/src/neospy/irsa.py +++ b/src/kete/irsa.py @@ -63,7 +63,7 @@ def query_irsa_tap( .. testcode:: :skipif: True - import neospy + import kete import pandas as pd # Column names cannot match the column names in the IRSA table you are querying @@ -73,15 +73,15 @@ def query_irsa_tap( ['bar', 55232.963786, 49.14175, 21.63811111]], columns=['name', 'mjd0', 'ra0', 'dec0']) - jd = neospy.Time.from_mjd(56823.933738).jd + jd = kete.Time.from_mjd(56823.933738).jd # This time corresponds to this phase: - phase = neospy.wise.mission_phase_from_jd(jd) + phase = kete.wise.mission_phase_from_jd(jd) # Single source table on IRSA is then: phase.source_table # The columns of data available in this source table are - column_information = neospy.irsa.IRSA_column_data(phase.source_table) + column_information = kete.irsa.IRSA_column_data(phase.source_table) # Note that lots of information is available in column_information @@ -99,7 +99,7 @@ def query_irsa_tap( " and (((mjd - mjd0) < 0.0001) " + " and ((mjd0 - mjd) < 0.0001))") - result = neospy.irsa.query_irsa_tap(query, upload_table=data) + result = kete.irsa.query_irsa_tap(query, upload_table=data) This is a blocking operation using TAP Async queries. This submits the query, receives a response from IRSA containing a URL, then queries that URL for job diff --git a/src/neospy/mpc.py b/src/kete/mpc.py similarity index 93% rename from src/neospy/mpc.py rename to src/kete/mpc.py index 8582f42..f3c2aa6 100644 --- a/src/neospy/mpc.py +++ b/src/kete/mpc.py @@ -9,7 +9,7 @@ from . import conversion, constants from .time import Time from .vector import Vector, Frames, CometElements -from .cache import cached_gzip_json_download +from .cache import download_json from . import _core @@ -27,7 +27,7 @@ def find_obs_code(name: str): return the [lat, lon, altitude, description, obs code] in degrees and km as appropriate. - >>> neospy.mpc.find_obs_code("Palomar Mountain") + >>> kete.mpc.find_obs_code("Palomar Mountain") (33.35412, 243.13746, 1.69615, 'Palomar Mountain', '675') Parameters @@ -57,7 +57,7 @@ def num_to_base62(n: int, base_len=6) -> str: """ Convert an integer to a base 62 MPC string of the specified length. - >>> neospy.mpc.num_to_base62(63, 3) + >>> kete.mpc.num_to_base62(63, 3) '011' """ @@ -73,7 +73,7 @@ def base62_to_num(n: str) -> int: """ Convert a base 62 MPC string into an integer. - >>> neospy.mpc.base62_to_num('011') + >>> kete.mpc.base62_to_num('011') 63 """ @@ -105,13 +105,13 @@ def unpack_permanent_designation(designation): """ Convert an MPC 5 character permanent designation into an unpacked representation. - >>> neospy.mpc.unpack_permanent_designation("~AZaz") + >>> kete.mpc.unpack_permanent_designation("~AZaz") '3140113' - >>> neospy.mpc.unpack_permanent_designation("C3456") + >>> kete.mpc.unpack_permanent_designation("C3456") '123456' - >>> neospy.mpc.unpack_permanent_designation("0021P") + >>> kete.mpc.unpack_permanent_designation("0021P") '21P' - >>> neospy.mpc.unpack_permanent_designation("J005S") + >>> kete.mpc.unpack_permanent_designation("J005S") 'Jupiter V' Parameters @@ -141,11 +141,11 @@ def pack_permanent_designation(unpacked): """ Convert an MPC asteroid number into an MPC 5 character packed designation. - >>> neospy.mpc.pack_permanent_designation('3140113') + >>> kete.mpc.pack_permanent_designation('3140113') '~AZaz' - >>> neospy.mpc.pack_permanent_designation('21P') + >>> kete.mpc.pack_permanent_designation('21P') '0021P' - >>> neospy.mpc.pack_permanent_designation('Saturn V') + >>> kete.mpc.pack_permanent_designation('Saturn V') 'S005S' Parameters @@ -193,7 +193,7 @@ def unpack_provisional_designation(packed: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.unpack_provisional_designation("J98SA8Q") + >>> kete.mpc.unpack_provisional_designation("J98SA8Q") '1998 SQ108' Parameters @@ -228,7 +228,7 @@ def pack_provisional_designation(unpacked: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.pack_provisional_designation("1998 SQ108") + >>> kete.mpc.pack_provisional_designation("1998 SQ108") 'J98SA8Q' Parameters @@ -262,7 +262,7 @@ def pack_satellite_designation(unpacked: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.pack_satellite_designation("Jupiter XIII") + >>> kete.mpc.pack_satellite_designation("Jupiter XIII") 'J013S' Parameters @@ -288,7 +288,7 @@ def unpack_satellite_designation(packed: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.unpack_satellite_designation("J013S") + >>> kete.mpc.unpack_satellite_designation("J013S") 'Jupiter XIII' Parameters @@ -322,10 +322,10 @@ def pack_comet_designation(unpacked: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.pack_comet_designation("C/2020 F3") + >>> kete.mpc.pack_comet_designation("C/2020 F3") 'CK20F030' - >>> neospy.mpc.pack_comet_designation("1P/Halley") + >>> kete.mpc.pack_comet_designation("1P/Halley") '0001P' Parameters @@ -392,7 +392,7 @@ def unpack_comet_designation(packed: str): See https://www.minorplanetcenter.net/iau/info/PackedDes.html for more details. - >>> neospy.mpc.unpack_comet_designation("CI70Q010") + >>> kete.mpc.unpack_comet_designation("CI70Q010") 'C/1870 Q1' Parameters @@ -425,10 +425,10 @@ def unpack_designation(packed: str): Accepts either a packed provisional designation or permanent designation and returns the unpacked representation. - >>> neospy.mpc.unpack_designation("J98SA8Q") + >>> kete.mpc.unpack_designation("J98SA8Q") '1998 SQ108' - >>> neospy.mpc.unpack_designation("~AZaz") + >>> kete.mpc.unpack_designation("~AZaz") '3140113' Parameters @@ -452,10 +452,10 @@ def pack_designation(unpacked: str): Accepts either a unpacked provisional designation or permanent designation and returns the packed representation. - >>> neospy.mpc.pack_designation("1998 SQ108") + >>> kete.mpc.pack_designation("1998 SQ108") 'J98SA8Q' - >>> neospy.mpc.pack_designation("3140113") + >>> kete.mpc.pack_designation("3140113") '~AZaz' Parameters @@ -494,7 +494,7 @@ def fetch_known_packed_designations(force_download=False): Ceres has 4 entries, which all map to '00001'. """ # download the data from the MPC - packed_ids = cached_gzip_json_download( + packed_ids = download_json( "https://minorplanetcenter.net/Extended_Files/mpc_ids_packed.json.gz", force_download, ) @@ -536,7 +536,7 @@ def fetch_known_designations(force_download=False): Ceres has 4 entries, which all map to '1'. """ # download the data from the MPC - known_ids = cached_gzip_json_download( + known_ids = download_json( "https://minorplanetcenter.net/Extended_Files/mpc_ids.json.gz", force_download, ) @@ -577,7 +577,7 @@ def fetch_known_packed_to_full_names(force_download=False): Ceres has 4 entries, since it has 4 unique packed designations. """ orb = fetch_known_orbit_data(force_download=force_download) - packed_ids = cached_gzip_json_download( + packed_ids = download_json( "https://minorplanetcenter.net/Extended_Files/mpc_ids_packed.json.gz", force_download, ) @@ -648,7 +648,7 @@ def fetch_known_orbit_data(url=None, force_download=False): """ if url is None: url = "https://minorplanetcenter.net/Extended_Files/mpcorb_extended.json.gz" - objs = cached_gzip_json_download(url, force_download) + objs = download_json(url, force_download) objects = [] for obj in objs: # "Principal_design" is always a preliminary designation @@ -691,7 +691,7 @@ def fetch_known_comet_orbit_data(force_download=False): MPC. Object names are set to the packed normalized MPC representation. """ url = "https://minorplanetcenter.net/Extended_Files/cometels.json.gz" - objs = cached_gzip_json_download(url, force_download) + objs = download_json(url, force_download) objects = [] for comet in objs: name = pack_comet_designation(comet.get("Designation_and_name").split("(")[0]) @@ -728,7 +728,7 @@ def mpc_known_orbit_filtered(filt): filt: Filter function which defines which group to select. The filter function must accept 3 parameters, `peri_dist, eccentricity, h_mag`, and return a bool. - See `neospy.population` for a collection of filter functions which + See `kete.population` for a collection of filter functions which are used to generation model populations. """ orbs = fetch_known_orbit_data() @@ -744,17 +744,17 @@ def table_to_states(orbit_dataframe): .. testcode:: :skipif: True - import neospy + import kete # Load all MPC orbits - orbits = neospy.mpc.fetch_known_orbit_data() + orbits = kete.mpc.fetch_known_orbit_data() # Subset the table to be only NEOs - neos = neospy.population.neo(orbits.peri_dist, orbits.ecc) + neos = kete.population.neo(orbits.peri_dist, orbits.ecc) neo_subset = orbits[neos] # load the state object from this table - state = neospy.mpc.table_to_states(neo_subset) + state = kete.mpc.table_to_states(neo_subset) Parameters ---------- @@ -836,12 +836,12 @@ class MPCObservation: .. testcode:: :skipif: True - import neospy + import kete import gzip # Download the database of unnumbered observations from the MPC url = "https://www.minorplanetcenter.net/iau/ECS/MPCAT-OBS/UnnObs.txt.gz" - path = neospy.data.cached_file_download(url) + path = kete.data.download_file(url) # Fetch all lines from the file which contain C51 (WISE) observatory code. obs_code = "C51".encode() @@ -849,7 +849,7 @@ class MPCObservation: lines = [line.decode() for line in f if obs_code == line[77:80]] # Parse lines into a list of MPCObservations - observations = neospy.mpc.MPCObservation.from_lines(lines) + observations = kete.mpc.MPCObservation.from_lines(lines) """ diff --git a/src/neospy/neos.py b/src/kete/neos.py similarity index 100% rename from src/neospy/neos.py rename to src/kete/neos.py diff --git a/src/neospy/population.py b/src/kete/population.py similarity index 99% rename from src/neospy/population.py rename to src/kete/population.py index bf2c507..f5152ff 100644 --- a/src/neospy/population.py +++ b/src/kete/population.py @@ -310,8 +310,8 @@ def plot_groups(): .. plot:: :context: close-figs - import neospy - neospy.population.plot_groups(); + import kete + kete.population.plot_groups(); """ diff --git a/src/neospy/power_law.py b/src/kete/power_law.py similarity index 100% rename from src/neospy/power_law.py rename to src/kete/power_law.py diff --git a/src/neospy/propagation.py b/src/kete/propagation.py similarity index 100% rename from src/neospy/propagation.py rename to src/kete/propagation.py diff --git a/src/neospy/rust/covariance.rs b/src/kete/rust/covariance.rs similarity index 98% rename from src/neospy/rust/covariance.rs rename to src/kete/rust/covariance.rs index 521c0dd..121d0d3 100644 --- a/src/neospy/rust/covariance.rs +++ b/src/kete/rust/covariance.rs @@ -2,12 +2,12 @@ use std::{collections::HashMap, fmt::Debug}; use crate::state::PyState; use crate::{elements::PyCometElements, vector::VectorLike}; -use neospy_core::{errors::Error, io::FileIO}; +use kete_core::{errors::Error, io::FileIO}; use pyo3::prelude::*; use serde::{Deserialize, Serialize}; /// Covariance uncertainty representation of an objects state. -#[pyclass(frozen, get_all, module = "neospy")] +#[pyclass(frozen, get_all, module = "kete")] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Covariance { /// Designation of the object diff --git a/src/neospy/rust/elements.rs b/src/kete/rust/elements.rs similarity index 96% rename from src/neospy/rust/elements.rs rename to src/kete/rust/elements.rs index dd74aad..1ab045c 100644 --- a/src/neospy/rust/elements.rs +++ b/src/kete/rust/elements.rs @@ -1,5 +1,5 @@ -use neospy_core::elements; -use neospy_core::prelude; +use kete_core::elements; +use kete_core::prelude; use pyo3::{pyclass, pymethods, PyResult}; use crate::state::PyState; @@ -26,7 +26,7 @@ use crate::state::PyState; /// The JD time of perihelion. /// lon_of_ascending: /// The longitude of ascending node, in degrees. -#[pyclass(module = "neospy", frozen, name = "CometElements")] +#[pyclass(module = "kete", frozen, name = "CometElements")] #[derive(Clone, Debug)] pub struct PyCometElements(pub elements::CometElements); @@ -102,7 +102,7 @@ impl PyCometElements { match &self.0.desig { prelude::Desig::Name(s) => s.clone(), prelude::Desig::Naif(s) => { - neospy_core::spice::try_name_from_id(*s).unwrap_or(s.to_string()) + kete_core::spice::try_name_from_id(*s).unwrap_or(s.to_string()) } prelude::Desig::Perm(s) => format!("{:?}", s), prelude::Desig::Prov(s) => s.clone(), diff --git a/src/neospy/rust/fitting.rs b/src/kete/rust/fitting.rs similarity index 91% rename from src/neospy/rust/fitting.rs rename to src/kete/rust/fitting.rs index b8947cf..5f339b8 100644 --- a/src/neospy/rust/fitting.rs +++ b/src/kete/rust/fitting.rs @@ -1,4 +1,4 @@ -use neospy_core::{fitting, stats}; +use kete_core::{fitting, stats}; use pyo3::pyfunction; #[pyfunction] diff --git a/src/neospy/rust/flux/common.rs b/src/kete/rust/flux/common.rs similarity index 99% rename from src/neospy/rust/flux/common.rs rename to src/kete/rust/flux/common.rs index 0fff0c2..add5e47 100644 --- a/src/neospy/rust/flux/common.rs +++ b/src/kete/rust/flux/common.rs @@ -1,11 +1,11 @@ use crate::{frame::PyFrames, vector::VectorLike}; use itertools::Itertools; use nalgebra::UnitVector3; -use neospy_core::constants::{ +use kete_core::constants::{ w1_color_correction, w2_color_correction, w3_color_correction, w4_color_correction, C_V, }; -use neospy_core::flux::*; -use neospy_core::prelude::Error; +use kete_core::flux::*; +use kete_core::prelude::Error; use pyo3::{pyfunction, PyResult}; /// Calculate the visible flux at the observer assuming a convex faceted object made up diff --git a/src/neospy/rust/flux/mod.rs b/src/kete/rust/flux/mod.rs similarity index 100% rename from src/neospy/rust/flux/mod.rs rename to src/kete/rust/flux/mod.rs diff --git a/src/neospy/rust/flux/models.rs b/src/kete/rust/flux/models.rs similarity index 90% rename from src/neospy/rust/flux/models.rs rename to src/kete/rust/flux/models.rs index 1ea152b..6ae5457 100644 --- a/src/neospy/rust/flux/models.rs +++ b/src/kete/rust/flux/models.rs @@ -3,7 +3,7 @@ use rayon::prelude::*; use serde::{Deserialize, Serialize}; -use neospy_core::{ +use kete_core::{ flux::{HGParams, ObserverBands}, io::FileIO, }; @@ -27,12 +27,12 @@ use crate::{frame::PyFrames, vector::VectorLike}; /// Expected flux in the V-band using the HG model. /// magnitudes : /// Magnitudes in the different bands if zero mags were available. -#[pyclass(frozen, module = "neospy.flux", name = "ModelResults")] +#[pyclass(frozen, module = "kete.flux", name = "ModelResults")] #[derive(Clone, Debug, Serialize, Deserialize)] -pub struct PyModelResults(pub neospy_core::flux::ModelResults); +pub struct PyModelResults(pub kete_core::flux::ModelResults); -impl From for PyModelResults { - fn from(value: neospy_core::flux::ModelResults) -> Self { +impl From for PyModelResults { + fn from(value: kete_core::flux::ModelResults) -> Self { Self(value) } } @@ -50,7 +50,7 @@ impl PyModelResults { v_band_flux: f64, magnitudes: Option>, ) -> Self { - neospy_core::flux::ModelResults { + kete_core::flux::ModelResults { fluxes, magnitudes, thermal_fluxes, @@ -107,7 +107,7 @@ impl PyModelResults { #[staticmethod] #[pyo3(name = "load")] pub fn py_load(filename: String) -> PyResult { - Ok(Self(neospy_core::flux::ModelResults::load(filename)?)) + Ok(Self(kete_core::flux::ModelResults::load(filename)?)) } /// Save a list to a binary file. @@ -115,14 +115,14 @@ impl PyModelResults { #[pyo3(name = "save_list")] pub fn py_save_list(vec: Vec, filename: String) -> PyResult<()> { let vec: Vec<_> = vec.into_iter().map(|x| x.0).collect(); - Ok(neospy_core::flux::ModelResults::save_vec(&vec, filename)?) + Ok(kete_core::flux::ModelResults::save_vec(&vec, filename)?) } /// Load a list from a binary file. #[staticmethod] #[pyo3(name = "load_list")] pub fn py_load_list(filename: String) -> PyResult> { - let res = neospy_core::flux::ModelResults::load_vec(filename)?; + let res = kete_core::flux::ModelResults::load_vec(filename)?; Ok(res.into_iter().map(Self).collect()) } @@ -175,12 +175,12 @@ impl PyModelResults { /// Emissivity of the object, defaults to `0.9`. /// zero_mags: /// Optional - If zero mags are provided then magnitudes may be computed. -#[pyclass(frozen, module = "neospy.flux", name = "NeatmParams")] +#[pyclass(frozen, module = "kete.flux", name = "NeatmParams")] #[derive(Clone, Debug)] -pub struct PyNeatmParams(pub neospy_core::flux::NeatmParams); +pub struct PyNeatmParams(pub kete_core::flux::NeatmParams); -impl From for PyNeatmParams { - fn from(value: neospy_core::flux::NeatmParams) -> Self { +impl From for PyNeatmParams { + fn from(value: kete_core::flux::NeatmParams) -> Self { Self(value) } } @@ -214,7 +214,7 @@ impl PyNeatmParams { bands: band_wavelength, zero_mags, }; - Ok(neospy_core::flux::NeatmParams { + Ok(kete_core::flux::NeatmParams { obs_bands, beaming, band_albedos, @@ -248,12 +248,12 @@ impl PyNeatmParams { let band_albedos = match band_albedos.try_into() { Ok(v) => v, - Err(_) => Err(neospy_core::errors::Error::ValueError( + Err(_) => Err(kete_core::errors::Error::ValueError( "4 Albedos must be provided, one for each WISE band.".into(), ))?, }; Ok( - neospy_core::flux::NeatmParams::new_wise(band_albedos, beaming, hg_params, emissivity) + kete_core::flux::NeatmParams::new_wise(band_albedos, beaming, hg_params, emissivity) .into(), ) } @@ -282,12 +282,12 @@ impl PyNeatmParams { let band_albedos = match band_albedos.try_into() { Ok(v) => v, - Err(_) => Err(neospy_core::errors::Error::ValueError( + Err(_) => Err(kete_core::errors::Error::ValueError( "4 Albedos must be provided, one for each WISE band.".into(), ))?, }; Ok( - neospy_core::flux::NeatmParams::new_neos(band_albedos, beaming, hg_params, emissivity) + kete_core::flux::NeatmParams::new_neos(band_albedos, beaming, hg_params, emissivity) .into(), ) } @@ -393,7 +393,7 @@ impl PyNeatmParams { #[staticmethod] #[pyo3(name = "load")] pub fn py_load(filename: String) -> PyResult { - Ok(Self(neospy_core::flux::NeatmParams::load(filename)?)) + Ok(Self(kete_core::flux::NeatmParams::load(filename)?)) } fn __repr__(&self) -> String { @@ -419,14 +419,14 @@ impl PyNeatmParams { #[pyo3(name = "save_list")] pub fn py_save_list(vec: Vec, filename: String) -> PyResult<()> { let vec: Vec<_> = vec.into_iter().map(|x| x.0).collect(); - Ok(neospy_core::flux::NeatmParams::save_vec(&vec, filename)?) + Ok(kete_core::flux::NeatmParams::save_vec(&vec, filename)?) } /// Load a list from a binary file. #[staticmethod] #[pyo3(name = "load_list")] pub fn py_load_list(filename: String) -> PyResult> { - let res = neospy_core::flux::NeatmParams::load_vec(filename)?; + let res = kete_core::flux::NeatmParams::load_vec(filename)?; Ok(res.into_iter().map(Self).collect()) } } @@ -464,12 +464,12 @@ impl PyNeatmParams { /// Emissivity of the object, defaults to `0.9`. /// zero_mags: /// Optional - If zero mags are provided then magnitudes may be computed. -#[pyclass(frozen, module = "neospy.flux", name = "FrmParams")] +#[pyclass(frozen, module = "kete.flux", name = "FrmParams")] #[derive(Clone, Debug)] -pub struct PyFrmParams(pub neospy_core::flux::FrmParams); +pub struct PyFrmParams(pub kete_core::flux::FrmParams); -impl From for PyFrmParams { - fn from(value: neospy_core::flux::FrmParams) -> Self { +impl From for PyFrmParams { + fn from(value: kete_core::flux::FrmParams) -> Self { Self(value) } } @@ -501,7 +501,7 @@ impl PyFrmParams { zero_mags, }; - Ok(neospy_core::flux::FrmParams { + Ok(kete_core::flux::FrmParams { obs_bands, band_albedos, hg_params, @@ -532,11 +532,11 @@ impl PyFrmParams { let band_albedos = match band_albedos.try_into() { Ok(v) => v, - Err(_) => Err(neospy_core::errors::Error::ValueError( + Err(_) => Err(kete_core::errors::Error::ValueError( "4 Albedos must be provided, one for each WISE band.".into(), ))?, }; - Ok(neospy_core::flux::FrmParams::new_wise(band_albedos, hg_params, emissivity).into()) + Ok(kete_core::flux::FrmParams::new_wise(band_albedos, hg_params, emissivity).into()) } /// Create a new FrmParams with NEOS bands and zero magnitudes. @@ -561,11 +561,11 @@ impl PyFrmParams { let band_albedos = match band_albedos.try_into() { Ok(v) => v, - Err(_) => Err(neospy_core::errors::Error::ValueError( + Err(_) => Err(kete_core::errors::Error::ValueError( "4 Albedos must be provided, one for each WISE band.".into(), ))?, }; - Ok(neospy_core::flux::FrmParams::new_neos(band_albedos, hg_params, emissivity).into()) + Ok(kete_core::flux::FrmParams::new_neos(band_albedos, hg_params, emissivity).into()) } /// Evaluate the thermal model at the provided observer and object positions. @@ -663,7 +663,7 @@ impl PyFrmParams { #[staticmethod] #[pyo3(name = "load")] pub fn py_load(filename: String) -> PyResult { - Ok(Self(neospy_core::flux::FrmParams::load(filename)?)) + Ok(Self(kete_core::flux::FrmParams::load(filename)?)) } fn __repr__(&self) -> String { @@ -687,14 +687,14 @@ impl PyFrmParams { #[pyo3(name = "save_list")] pub fn py_save_list(vec: Vec, filename: String) -> PyResult<()> { let vec: Vec<_> = vec.into_iter().map(|x| x.0).collect(); - Ok(neospy_core::flux::FrmParams::save_vec(&vec, filename)?) + Ok(kete_core::flux::FrmParams::save_vec(&vec, filename)?) } /// Load a list from a binary file. #[staticmethod] #[pyo3(name = "load_list")] pub fn py_load_list(filename: String) -> PyResult> { - let res = neospy_core::flux::FrmParams::load_vec(filename)?; + let res = kete_core::flux::FrmParams::load_vec(filename)?; Ok(res.into_iter().map(Self).collect()) } } diff --git a/src/neospy/rust/flux/reflected.rs b/src/kete/rust/flux/reflected.rs similarity index 97% rename from src/neospy/rust/flux/reflected.rs rename to src/kete/rust/flux/reflected.rs index 125e214..81c8b1e 100644 --- a/src/neospy/rust/flux/reflected.rs +++ b/src/kete/rust/flux/reflected.rs @@ -1,7 +1,7 @@ use crate::{frame::PyFrames, vector::VectorLike}; -use neospy_core::constants; -use neospy_core::flux::hg_phase_curve_correction; -use neospy_core::flux::HGParams; +use kete_core::constants; +use kete_core::flux::hg_phase_curve_correction; +use kete_core::flux::HGParams; use pyo3::pyfunction; /// This computes the phase curve correction in the IAU format. diff --git a/src/neospy/rust/fovs/checks.rs b/src/kete/rust/fovs/checks.rs similarity index 98% rename from src/neospy/rust/fovs/checks.rs rename to src/kete/rust/fovs/checks.rs index dcbfb79..07dc760 100644 --- a/src/neospy/rust/fovs/checks.rs +++ b/src/kete/rust/fovs/checks.rs @@ -1,5 +1,5 @@ use super::*; -use neospy_core::{fov::FOV, propagation::propagate_n_body_spk}; +use kete_core::{fov::FOV, propagation::propagate_n_body_spk}; use pyo3::prelude::*; use rayon::prelude::*; diff --git a/src/neospy/rust/fovs/collection.rs b/src/kete/rust/fovs/collection.rs similarity index 89% rename from src/neospy/rust/fovs/collection.rs rename to src/kete/rust/fovs/collection.rs index abd19a7..710b60b 100644 --- a/src/neospy/rust/fovs/collection.rs +++ b/src/kete/rust/fovs/collection.rs @@ -1,5 +1,5 @@ use super::*; -use neospy_core::prelude::*; +use kete_core::prelude::*; use pyo3::exceptions; use pyo3::prelude::*; @@ -15,9 +15,9 @@ pub enum FOVListLike { } impl FOVListLike { - /// Convert to a vector of neospy core fovs. + /// Convert to a vector of kete core fovs. /// Frames will always be ecliptic - pub fn into_sorted_vec_fov(self) -> Vec { + pub fn into_sorted_vec_fov(self) -> Vec { let mut fovs = match self { FOVListLike::Vec(v) => v, FOVListLike::FOVList(list) => list.0, @@ -33,7 +33,7 @@ impl FOVListLike { } } -#[pyclass(module = "neospy", sequence)] +#[pyclass(module = "kete", sequence)] #[derive(Debug, Clone)] pub struct FOVList(pub Vec); @@ -67,7 +67,7 @@ impl FOVList { /// Save the fov list into a file. fn save(&self, filename: String) -> PyResult<()> { let mut f = BufWriter::new(File::create(filename)?); - let fovs: Vec = + let fovs: Vec = self.0.iter().map(|fov| fov.clone().unwrap()).collect(); let _ = encode_into_std_write(fovs, &mut f, bincode::config::legacy()) @@ -80,7 +80,7 @@ impl FOVList { fn load(filename: String) -> PyResult { let mut f = BufReader::new(File::open(filename)?); - let fovs: Vec = + let fovs: Vec = decode_from_std_read(&mut f, bincode::config::legacy()) .map_err(|_| Error::IOError("Failed to read from file".into()))?; let fovs: Vec = fovs.into_iter().map(|x| x.into()).collect(); diff --git a/src/neospy/rust/fovs/definitions.rs b/src/kete/rust/fovs/definitions.rs similarity index 97% rename from src/neospy/rust/fovs/definitions.rs rename to src/kete/rust/fovs/definitions.rs index 72d5512..57a0eff 100644 --- a/src/neospy/rust/fovs/definitions.rs +++ b/src/kete/rust/fovs/definitions.rs @@ -1,6 +1,6 @@ use nalgebra::Vector3; -use neospy_core::fov::{self, NeosBand}; -use neospy_core::fov::{FovLike, SkyPatch}; +use kete_core::fov::{self, NeosBand}; +use kete_core::fov::{FovLike, SkyPatch}; use pyo3::{exceptions, prelude::*}; use crate::vector::VectorLike; @@ -9,49 +9,49 @@ use crate::{state::PyState, vector::Vector}; /// Field of view of a WISE CMOS chip. /// Since all WISE CMOS see the same patch of sky, there is no differentiation /// of the individual wavelength bands. -#[pyclass(module = "neospy", frozen, name = "WiseCmos")] +#[pyclass(module = "kete", frozen, name = "WiseCmos")] #[derive(Clone, Debug)] #[allow(clippy::upper_case_acronyms)] pub struct PyWiseCmos(pub fov::WiseCmos); /// Field of view of a NEOS CMOS chip. -#[pyclass(module = "neospy", frozen, name = "NeosCmos")] +#[pyclass(module = "kete", frozen, name = "NeosCmos")] #[derive(Clone, Debug)] #[allow(clippy::upper_case_acronyms)] pub struct PyNeosCmos(pub fov::NeosCmos); /// Field of view of a NEOS Visit. -#[pyclass(module = "neospy", frozen, name = "NeosVisit")] +#[pyclass(module = "kete", frozen, name = "NeosVisit")] #[derive(Clone, Debug)] #[allow(clippy::upper_case_acronyms)] pub struct PyNeosVisit(pub fov::NeosVisit); /// Field of view of a Single ZTF chips/quad combination. -#[pyclass(module = "neospy", frozen, name = "ZtfCcdQuad")] +#[pyclass(module = "kete", frozen, name = "ZtfCcdQuad")] #[derive(Clone, Debug)] #[allow(clippy::upper_case_acronyms)] pub struct PyZtfCcdQuad(pub fov::ZtfCcdQuad); /// Field of view of all 64 ZTF chips/quad combinations. /// This is a meta collection of individual ZTF CCD Quad FOVs. -#[pyclass(module = "neospy", frozen, name = "ZtfField", sequence)] +#[pyclass(module = "kete", frozen, name = "ZtfField", sequence)] #[derive(Clone, Debug)] #[allow(clippy::upper_case_acronyms)] pub struct PyZtfField(pub fov::ZtfField); /// Generic Rectangular Field of view. -#[pyclass(module = "neospy", frozen, name = "RectangleFOV")] +#[pyclass(module = "kete", frozen, name = "RectangleFOV")] #[derive(Clone, Debug)] pub struct PyGenericRectangle(pub fov::GenericRectangle); /// Generic Cone field of view. -#[pyclass(module = "neospy", frozen, name = "ConeFOV")] +#[pyclass(module = "kete", frozen, name = "ConeFOV")] #[derive(Clone, Debug)] pub struct PyGenericCone(pub fov::GenericCone); /// Omni Directional field of view. -#[pyclass(module = "neospy", frozen, name = "OmniDirectionalFOV")] +#[pyclass(module = "kete", frozen, name = "OmniDirectionalFOV")] #[derive(Clone, Debug)] pub struct PyOmniDirectional(pub fov::OmniDirectional); diff --git a/src/neospy/rust/fovs/mod.rs b/src/kete/rust/fovs/mod.rs similarity index 100% rename from src/neospy/rust/fovs/mod.rs rename to src/kete/rust/fovs/mod.rs diff --git a/src/neospy/rust/frame.rs b/src/kete/rust/frame.rs similarity index 92% rename from src/neospy/rust/frame.rs rename to src/kete/rust/frame.rs index 3b439be..6324f55 100644 --- a/src/neospy/rust/frame.rs +++ b/src/kete/rust/frame.rs @@ -1,8 +1,8 @@ -use neospy_core::frames::*; +use kete_core::frames::*; use pyo3::prelude::*; -/// Defined inertial frames supported by the python side of NEOSpy -#[pyclass(frozen, eq, eq_int, name = "Frames", module = "neospy")] +/// Defined inertial frames supported by the python side of kete +#[pyclass(frozen, eq, eq_int, name = "Frames", module = "kete")] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PyFrames { Ecliptic, diff --git a/src/neospy/rust/horizons.rs b/src/kete/rust/horizons.rs similarity index 98% rename from src/neospy/rust/horizons.rs rename to src/kete/rust/horizons.rs index e0b47a0..e5c1fd7 100644 --- a/src/neospy/rust/horizons.rs +++ b/src/kete/rust/horizons.rs @@ -3,13 +3,13 @@ use std::fmt::Debug; use crate::covariance::Covariance; use crate::elements::PyCometElements; use crate::state::PyState; -use neospy_core::{io::FileIO, prelude}; +use kete_core::{io::FileIO, prelude}; use pyo3::prelude::*; use serde::{Deserialize, Serialize}; /// Horizons object properties /// Physical, orbital, and observational properties of a solar system object as recorded in JPL Horizons. -#[pyclass(frozen, get_all, module = "neospy")] +#[pyclass(frozen, get_all, module = "kete")] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct HorizonsProperties { /// The MPC designation of the object. diff --git a/src/neospy/rust/kepler.rs b/src/kete/rust/kepler.rs similarity index 95% rename from src/neospy/rust/kepler.rs rename to src/kete/rust/kepler.rs index e7fe9e3..2f6b8ec 100644 --- a/src/neospy/rust/kepler.rs +++ b/src/kete/rust/kepler.rs @@ -1,7 +1,7 @@ use itertools::Itertools; +use kete_core::state::State; +use kete_core::{constants, propagation}; use nalgebra::Vector3; -use neospy_core::state::State; -use neospy_core::{constants, propagation}; use pyo3::{exceptions, PyErr}; use pyo3::{pyfunction, PyResult}; use rayon::prelude::*; @@ -44,7 +44,7 @@ pub fn compute_eccentric_anomaly_py( .collect()) } -/// Propagate the :class:`~neospy.State` for all the objects to the specified time. +/// Propagate the :class:`~kete.State` for all the objects to the specified time. /// This assumes 2 body interactions. /// /// This is a multi-core operation. diff --git a/src/neospy/rust/lib.rs b/src/kete/rust/lib.rs similarity index 95% rename from src/neospy/rust/lib.rs rename to src/kete/rust/lib.rs index 84e083a..6b1fa7a 100644 --- a/src/neospy/rust/lib.rs +++ b/src/kete/rust/lib.rs @@ -1,4 +1,4 @@ -//! Core neospy library code, which are wrappers over the neospy_core rust package. +//! Core kete library code, which are wrappers over the kete_core rust package. #![deny( bad_style, @@ -45,9 +45,9 @@ mod vector; // code which is difficult to avoid. // There are many structs in this interface which are just thin wrappers over // the underlying Rust objects. Examples include [`state::PyState`] which is a thin -// wrapper over [`neospy_core::state::State`]. These allow rust objects to exist in +// wrapper over [`kete_core::state::State`]. These allow rust objects to exist in // the python while still being reasonably fast. These wrappers also frequently expose -// the binary save/loading features written into the neospy_core code. Typically these +// the binary save/loading features written into the kete_core code. Typically these // wrappers are the same name as the underlying struct, with 'Py' appended on the // front. diff --git a/src/neospy/rust/nongrav.rs b/src/kete/rust/nongrav.rs similarity index 94% rename from src/neospy/rust/nongrav.rs rename to src/kete/rust/nongrav.rs index 4465a55..5159c1a 100644 --- a/src/neospy/rust/nongrav.rs +++ b/src/kete/rust/nongrav.rs @@ -1,4 +1,4 @@ -use neospy_core::{errors::Error, propagation::NonGravModel}; +use kete_core::{errors::Error, propagation::NonGravModel}; use pyo3::{pyclass, pymethods, PyResult}; /// Non-gravitational force models. @@ -16,7 +16,7 @@ use pyo3::{pyclass, pymethods, PyResult}; /// Yarkovsky effect, see :py:meth:`NonGravModel.new_asteroid`, which is a convenience /// function over the :py:meth:`NonGravModel.new_comet` method, but with 1/r^2 falloff. /// -#[pyclass(frozen, module = "neospy.propagation", name = "NonGravModel")] +#[pyclass(frozen, module = "kete.propagation", name = "NonGravModel")] #[derive(Debug, Clone)] pub struct PyNonGravModel(pub NonGravModel); @@ -154,7 +154,7 @@ impl PyNonGravModel { pub fn __repr__(&self) -> String { match self.0 { NonGravModel::Dust { beta} => format!( - "neospy.propagation.NonGravModel.new_dust(beta={:?})", + "kete.propagation.NonGravModel.new_dust(beta={:?})", beta ), NonGravModel::JplComet { @@ -167,7 +167,7 @@ impl PyNonGravModel { n, k, } => format!( - "neospy.propagation.NonGravModel.new_comet(a1={:?}, a2={:?}, a3={:?}, alpha={:?}, r_0={:?}, m={:?}, n={:?}, k={:?})", + "kete.propagation.NonGravModel.new_comet(a1={:?}, a2={:?}, a3={:?}, alpha={:?}, r_0={:?}, m={:?}, n={:?}, k={:?})", a1, a2, a3, alpha, r_0, m, n, k, ), } diff --git a/src/neospy/rust/propagation.rs b/src/kete/rust/propagation.rs similarity index 96% rename from src/neospy/rust/propagation.rs rename to src/kete/rust/propagation.rs index d4529df..0f1e1f0 100644 --- a/src/neospy/rust/propagation.rs +++ b/src/kete/rust/propagation.rs @@ -1,11 +1,11 @@ -use itertools::Itertools; -use neospy_core::{ +use kete_core::{ errors::Error, propagation::{self, moid, NonGravModel}, spice::{self, get_spk_singleton}, state::State, time::{scales::TDB, Time}, }; +use itertools::Itertools; use pyo3::{pyfunction, PyResult, Python}; use rayon::prelude::*; @@ -38,7 +38,7 @@ pub fn moid_py(state_a: PyState, state_b: Option) -> PyResult { Ok(moid(state_a.0, state_b)?) } -/// Propagate the provided :class:`~neospy.State` using N body mechanics to the +/// Propagate the provided :class:`~kete.State` using N body mechanics to the /// specified times, no approximations are made, this can be very CPU intensive. /// /// This does not compute light delay, however it does include corrections for general @@ -63,7 +63,7 @@ pub fn moid_py(state_a: PyState, state_b: Option) -> PyResult { /// Returns /// ------- /// Iterable -/// A :class:`~neospy.State` at the new time. +/// A :class:`~kete.State` at the new time. #[pyfunction] #[pyo3(name = "propagate_n_body", signature = (states, jd, include_asteroids=false, non_gravs=None, suppress_errors=true))] @@ -157,7 +157,7 @@ pub fn propagation_n_body_spk_py( /// Propagation using this will treat the Earth and Moon as a single object for /// performance reasons. /// -/// Propagate the provided :class:`~neospy.State` using N body mechanics to the +/// Propagate the provided :class:`~kete.State` using N body mechanics to the /// specified times, very few approximations are made, this can be very CPU intensive. /// /// This does not compute light delay, however it does include corrections for general @@ -191,7 +191,7 @@ pub fn propagation_n_body_spk_py( /// Returns /// ------- /// Iterable -/// A :class:`~neospy.State` at the new time. +/// A :class:`~kete.State` at the new time. #[pyfunction] #[pyo3(name = "propagate_n_body_long", signature = (states, jd_final, planet_states=None, non_gravs=None, batch_size=10))] pub fn propagation_n_body_py( diff --git a/src/neospy/rust/simult_states.rs b/src/kete/rust/simult_states.rs similarity index 96% rename from src/neospy/rust/simult_states.rs rename to src/kete/rust/simult_states.rs index ebf3a6d..10c929b 100644 --- a/src/neospy/rust/simult_states.rs +++ b/src/kete/rust/simult_states.rs @@ -1,6 +1,6 @@ -use neospy_core::errors::Error; -use neospy_core::io::FileIO; -use neospy_core::simult_states::SimultaneousStates; +use kete_core::errors::Error; +use kete_core::io::FileIO; +use kete_core::simult_states::SimultaneousStates; use pyo3::exceptions; use pyo3::prelude::*; use pyo3::{pyclass, pymethods, PyResult}; @@ -14,7 +14,7 @@ use crate::{fovs::AllowedFOV, frame::PyFrames, state::PyState}; /// If the FOV is provided, it is implied that the states which are present /// in this file were objects seen by the FOV. /// -#[pyclass(module = "neospy", frozen, sequence, name = "SimultaneousStates")] +#[pyclass(module = "kete", frozen, sequence, name = "SimultaneousStates")] #[derive(Debug)] pub struct PySimultaneousStates(pub Box); diff --git a/src/neospy/rust/spice/daf.rs b/src/kete/rust/spice/daf.rs similarity index 91% rename from src/neospy/rust/spice/daf.rs rename to src/kete/rust/spice/daf.rs index dcea178..9673ff6 100644 --- a/src/neospy/rust/spice/daf.rs +++ b/src/kete/rust/spice/daf.rs @@ -1,4 +1,4 @@ -use neospy_core::spice::DafFile; +use kete_core::spice::DafFile; use pyo3::{pyfunction, PyResult}; /// Given a DAF file, return the comments contained within the header. diff --git a/src/neospy/rust/spice/mod.rs b/src/kete/rust/spice/mod.rs similarity index 90% rename from src/neospy/rust/spice/mod.rs rename to src/kete/rust/spice/mod.rs index 9122a47..3e947f3 100644 --- a/src/neospy/rust/spice/mod.rs +++ b/src/kete/rust/spice/mod.rs @@ -16,7 +16,7 @@ use pyo3::pyfunction; #[pyo3(name = "observatory_codes")] pub fn obs_codes() -> Vec<(f64, f64, f64, String, String)> { let mut codes = Vec::new(); - for row in neospy_core::io::obs_codes::OBS_CODES.iter() { + for row in kete_core::io::obs_codes::OBS_CODES.iter() { codes.push(( row.lat, row.lon, diff --git a/src/neospy/rust/spice/pck.rs b/src/kete/rust/spice/pck.rs similarity index 92% rename from src/neospy/rust/spice/pck.rs rename to src/kete/rust/spice/pck.rs index 96256f2..435f297 100644 --- a/src/neospy/rust/spice/pck.rs +++ b/src/kete/rust/spice/pck.rs @@ -1,5 +1,5 @@ -use neospy_core::prelude::*; -use neospy_core::spice::{get_pck_singleton, get_spk_singleton}; +use kete_core::prelude::*; +use kete_core::spice::{get_pck_singleton, get_spk_singleton}; use pyo3::{pyfunction, PyResult}; use crate::frame::PyFrames; @@ -24,7 +24,7 @@ pub fn pck_load_py(filenames: Vec) -> PyResult<()> { /// vector in the sun centered ecliptic frame. /// /// This requires the `earth_000101_*.pck` file to be loaded which contains the -/// instantaneous earth frame information. The one provided by neospy has dates from +/// instantaneous earth frame information. The one provided by kete has dates from /// around 2000 to early 2024. New files may be downloaded from the NAIF website for /// additional precision or years of epoch. The current file is accurate to ~5 cm /// precision. @@ -67,7 +67,7 @@ pub fn pck_earth_frame_py( /// Convert a [`State`] to the Earth's surface reference frame. /// /// This requires the `earth_000101_*.pck` file to be loaded which contains the -/// instantaneous earth frame information. The one provided by neospy has dates from +/// instantaneous earth frame information. The one provided by kete has dates from /// around 2000 to early 2024. New files may be downloaded from the NAIF website for /// additional precision or years of epoch. The current file is accurate to ~5 cm /// precision. diff --git a/src/neospy/rust/spice/spk.rs b/src/kete/rust/spice/spk.rs similarity index 98% rename from src/neospy/rust/spice/spk.rs rename to src/kete/rust/spice/spk.rs index 28ab32d..8d84cdf 100644 --- a/src/neospy/rust/spice/spk.rs +++ b/src/kete/rust/spice/spk.rs @@ -1,4 +1,4 @@ -use neospy_core::spice::{get_spk_singleton, try_name_from_id}; +use kete_core::spice::{get_spk_singleton, try_name_from_id}; use pyo3::{pyfunction, PyResult, Python}; use crate::frame::PyFrames; diff --git a/src/neospy/rust/spice/tle.rs b/src/kete/rust/spice/tle.rs similarity index 100% rename from src/neospy/rust/spice/tle.rs rename to src/kete/rust/spice/tle.rs diff --git a/src/neospy/rust/state.rs b/src/kete/rust/state.rs similarity index 96% rename from src/neospy/rust/state.rs rename to src/kete/rust/state.rs index fb6e913..9ea25f5 100644 --- a/src/neospy/rust/state.rs +++ b/src/kete/rust/state.rs @@ -2,12 +2,12 @@ use crate::elements::PyCometElements; use crate::frame::*; use crate::time::PyTime; use crate::vector::*; -use neospy_core::prelude; +use kete_core::prelude; use pyo3::prelude::*; /// Representation of the state of an object at a specific moment in time. /// -#[pyclass(frozen, module = "neospy", name = "State")] +#[pyclass(frozen, module = "kete", name = "State")] #[derive(Clone, Debug)] pub struct PyState(pub prelude::State); @@ -144,7 +144,7 @@ impl PyState { match &self.0.desig { prelude::Desig::Name(s) => s.clone(), prelude::Desig::Naif(s) => { - neospy_core::spice::try_name_from_id(*s).unwrap_or(s.to_string()) + kete_core::spice::try_name_from_id(*s).unwrap_or(s.to_string()) } prelude::Desig::Perm(s) => format!("{:?}", s), prelude::Desig::Prov(s) => s.clone(), diff --git a/src/neospy/rust/state_transition.rs b/src/kete/rust/state_transition.rs similarity index 87% rename from src/neospy/rust/state_transition.rs rename to src/kete/rust/state_transition.rs index 8a52ba5..1093558 100644 --- a/src/neospy/rust/state_transition.rs +++ b/src/kete/rust/state_transition.rs @@ -1,5 +1,5 @@ -use neospy_core::prelude::*; -use neospy_core::propagation::compute_state_transition; +use kete_core::prelude::*; +use kete_core::propagation::compute_state_transition; use pyo3::pyfunction; use crate::time::PyTime; diff --git a/src/neospy/rust/time.rs b/src/kete/rust/time.rs similarity index 97% rename from src/neospy/rust/time.rs rename to src/kete/rust/time.rs index e3c68d9..53bb813 100644 --- a/src/neospy/rust/time.rs +++ b/src/kete/rust/time.rs @@ -1,4 +1,4 @@ -use neospy_core::{ +use kete_core::{ errors::Error, time::{ scales::{TAI, TDB, UTC}, @@ -30,7 +30,7 @@ use pyo3::prelude::*; /// scaling: /// Accepts 'tdb', 'tai', 'utc', and 'tt', but they are converted to TDB /// immediately. -#[pyclass(frozen, module = "neospy", name = "Time")] +#[pyclass(frozen, module = "kete", name = "Time")] #[derive(Debug)] pub struct PyTime(Time); @@ -134,7 +134,7 @@ impl PyTime { /// Return (year, month, day), where day is a float. /// - /// >>> neospy.Time.from_ymd(2010, 1, 1).ymd + /// >>> kete.Time.from_ymd(2010, 1, 1).ymd /// (2010, 1, 1.0) #[getter] pub fn ymd(&self) -> (i64, u32, f64) { diff --git a/src/neospy/rust/vector.rs b/src/kete/rust/vector.rs similarity index 98% rename from src/neospy/rust/vector.rs rename to src/kete/rust/vector.rs index 15fb36b..f538416 100644 --- a/src/neospy/rust/vector.rs +++ b/src/kete/rust/vector.rs @@ -1,16 +1,16 @@ -use neospy_core::frames::rotate_around; +use kete_core::frames::rotate_around; use pyo3::exceptions; use std::f64::consts::FRAC_PI_2; use crate::frame::*; +use kete_core::prelude::*; use nalgebra::Vector3; -use neospy_core::prelude::*; use pyo3::class::basic::CompareOp; use pyo3::prelude::*; use pyo3::{PyResult, Python}; /// Vector class which is a vector along with a reference frame. -#[pyclass(sequence, frozen, module = "neospy")] +#[pyclass(sequence, frozen, module = "kete")] #[derive(Clone, Debug)] pub struct Vector { pub raw: [f64; 3], diff --git a/src/neospy/shape.py b/src/kete/shape.py similarity index 98% rename from src/neospy/shape.py rename to src/kete/shape.py index 719c6fd..d67bbed 100644 --- a/src/neospy/shape.py +++ b/src/kete/shape.py @@ -107,7 +107,7 @@ class TriangleEllipsoid(TriangleFaceted): """ A simple ellipsoid/sphere made up of triangle facets. - This is a subclass of :class:`~neospy.shape.TriangleFaceted` which + This is a subclass of :class:`~kete.shape.TriangleFaceted` which constructs an approximate Ellipsoid geometry out of triangle facets. See https://arxiv.org/abs/1502.04816 @@ -129,10 +129,10 @@ class TriangleEllipsoid(TriangleFaceted): .. plot:: :context: close-figs - >>> import neospy + >>> import kete >>> import matplotlib.pyplot as plt >>> from mpl_toolkits.mplot3d.art3d import Poly3DCollection - >>> geom = neospy.shape.TriangleEllipsoid(6) + >>> geom = kete.shape.TriangleEllipsoid(6) >>> # Plot the results >>> plt.figure(dpi=150, figsize=(4, 4)) >>> plt.subplot(111, projection="3d") diff --git a/src/neospy/spice.py b/src/kete/spice.py similarity index 93% rename from src/neospy/spice.py rename to src/kete/spice.py index 7f6a9e6..241cc66 100644 --- a/src/neospy/spice.py +++ b/src/kete/spice.py @@ -8,7 +8,7 @@ from .time import Time from . import _core from .constants import AU_KM -from .cache import cached_file_download, cache_path +from .cache import download_file, cache_path from .vector import Frames, State __all__ = [ @@ -40,7 +40,7 @@ def _validate_time(time: Union[float, Time]) -> float: """ Verifies that the time provided is either a `float` or - :class:`~neospy.time.Time` object. + :class:`~kete.time.Time` object. Parameters ---------- @@ -78,7 +78,7 @@ def get_state( frame: Frames = Frames.Ecliptic, ) -> State: """ - Calculates the :class:`~neospy.State` of the target object at the + Calculates the :class:`~kete.State` of the target object at the specified time `jd`. This defaults to the ecliptic heliocentric state, though other centers may be @@ -88,7 +88,7 @@ def get_state( ---------- target: The names of the target object, this can include any object name listed in - :meth:`~neospy.spice.loaded_objects` + :meth:`~kete.spice.loaded_objects` jd: Julian time (TDB) of the desired record. center: @@ -117,10 +117,10 @@ def name_lookup(name: Union[int, str]) -> tuple[str, int]: Given the provided partial name or integer, find the full name contained within the loaded SPICE kernels. - >>> neospy.spice.name_lookup("jupi") + >>> kete.spice.name_lookup("jupi") ('jupiter barycenter', 5) - >>> neospy.spice.name_lookup(10) + >>> kete.spice.name_lookup(10) ('sun', 10) If there are multiple names, but an exact match, the exact match is returned. In @@ -128,10 +128,10 @@ def name_lookup(name: Union[int, str]) -> tuple[str, int]: will return the exact match. Putting ``eart`` will raise an exception as there are 2 partial matches. - >>> neospy.spice.name_lookup("Earth") + >>> kete.spice.name_lookup("Earth") ('earth', 399) - >>> neospy.spice.name_lookup("Earth b") + >>> kete.spice.name_lookup("Earth b") ('earth barycenter', 3) Parameters @@ -211,7 +211,7 @@ def kernel_fetch_from_url(url, force_download: bool = False): """ Download the target url into the cache folder of spice kernels. """ - cached_file_download(url, force_download=force_download, subfolder="kernels") + download_file(url, force_download=force_download, subfolder="kernels") def kernel_reload(filenames: Optional[list[str]] = None, include_cache=False): @@ -220,14 +220,14 @@ def kernel_reload(filenames: Optional[list[str]] = None, include_cache=False): kernels. If `include_cache` is true, this will reload the kernels contained within the - neospy cache folder as well. + kete cache folder as well. Parameters ---------- filenames : Paths to the specified files to load, this must be a list of filenames. include_cache: - This decides if all of the files contained within the neospy cache should + This decides if all of the files contained within the kete cache should be loaded in addition to the specified files. """ _core.spk_reset() @@ -316,7 +316,7 @@ def earth_pos_to_ecliptic( latitude and longitude, not geocentric. The frame conversion is done using a high precision PCK file from the NAIF/JPL - website. The file provided in neospy is valid from ~2000 to ~2024. This file + website. The file provided in kete is valid from ~2000 to ~2024. This file gives positional error on the scale of a few cm. Additionally a lower resolution file is provided which is valid until 2099, and will be used automatically when querying past the end of the high resolution file. @@ -355,7 +355,7 @@ def moon_illumination_frac(jd: Union[float, Time], observer: str = "399"): This is a simple approximation using basic spherical geometry, and defaults to having the observer located at the geocenter of the Earth. - >>> neospy.spice.moon_illumination_frac(Time.from_ymd(2024, 2, 24)) + >>> kete.spice.moon_illumination_frac(Time.from_ymd(2024, 2, 24)) 0.9964936478732302 Parameters diff --git a/src/neospy/state_transition.py b/src/kete/state_transition.py similarity index 100% rename from src/neospy/state_transition.py rename to src/kete/state_transition.py diff --git a/src/neospy/time.py b/src/kete/time.py similarity index 87% rename from src/neospy/time.py rename to src/kete/time.py index 2499d0b..f36af19 100644 --- a/src/neospy/time.py +++ b/src/kete/time.py @@ -17,15 +17,15 @@ def _year_float(self) -> float: Note that Time is TDB Scaled, causing UTC to be a few seconds different. - >>> neospy.Time.from_ymd(2010, 1, 1).year_float + >>> kete.Time.from_ymd(2010, 1, 1).year_float 2010.0 - >>> neospy.Time(2457754.5, scaling='utc').year_float + >>> kete.Time(2457754.5, scaling='utc').year_float 2017.0 2016 was a leap year, so 366 days instead of 365. - >>> neospy.Time(2457754.5 - 366, scaling='utc').year_float + >>> kete.Time(2457754.5 - 366, scaling='utc').year_float 2016.0 """ tup = datetime.datetime.fromisoformat(self.iso).timetuple() @@ -48,7 +48,7 @@ def _local_time(self, timezone=None) -> str: from zoneinfo import available_timezones, ZoneInfo available_timezones() # List all available timezones timezone = ZoneInfo("US/Pacific") - neospy.Time.j2000().local_time(timezone) + kete.Time.j2000().local_time(timezone) """ @@ -80,7 +80,7 @@ def d_h_m_s_to_float_days( Convert floats of days, hours, minutes, and seconds into a single float in units of days. - >>> neospy.time.d_h_m_s_to_float_days(1, 11, 59, 60) + >>> kete.time.d_h_m_s_to_float_days(1, 11, 59, 60) 1.5 """ @@ -94,10 +94,10 @@ def days_in_year(year: int) -> int: """ Return the number of days in the specified year, specifically for leap years. - >>> neospy.time.days_in_year(2016) + >>> kete.time.days_in_year(2016) 366 - >>> neospy.time.days_in_year(2017) + >>> kete.time.days_in_year(2017) 365 Parameters diff --git a/src/neospy/vector.py b/src/kete/vector.py similarity index 100% rename from src/neospy/vector.py rename to src/kete/vector.py diff --git a/src/neospy/wise.py b/src/kete/wise.py similarity index 99% rename from src/neospy/wise.py rename to src/kete/wise.py index b86f5ff..1a50c5d 100644 --- a/src/neospy/wise.py +++ b/src/kete/wise.py @@ -79,7 +79,7 @@ """ This table contains calibrated flux correction values for the 4 different WISE bands. -This is provided as reference, however neospy has built in interpolation methods for +This is provided as reference, however kete has built in interpolation methods for these black-body correction terms. See :func:`w1_color_correction` or similarly named functions for other bands. """ diff --git a/src/neospy/ztf.py b/src/kete/ztf.py similarity index 100% rename from src/neospy/ztf.py rename to src/kete/ztf.py diff --git a/src/neospy_core/Cargo.toml b/src/kete_core/Cargo.toml similarity index 96% rename from src/neospy_core/Cargo.toml rename to src/kete_core/Cargo.toml index 28535f9..fd1c905 100644 --- a/src/neospy_core/Cargo.toml +++ b/src/kete_core/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "neospy_core" +name = "kete_core" version = "0.2.5" edition = "2021" [lib] -name = "neospy_core" +name = "kete_core" [dependencies] argmin = "*" diff --git a/src/neospy_core/README.md b/src/kete_core/README.md similarity index 93% rename from src/neospy_core/README.md rename to src/kete_core/README.md index 14ae18e..66c66ba 100644 --- a/src/neospy_core/README.md +++ b/src/kete_core/README.md @@ -1,11 +1,11 @@ -# NEOSpy Core +# kete Core Library which supports calculations related to Minor Planets. This includes orbit propagation, flux calculations, loading SPICE files, and basic statistical analysis. -This library can be used entirely independently from the Python wrapper NEOSpy. +This library can be used entirely independently from the Python wrapper kete. ## Tests diff --git a/src/neospy_core/benches/propagation.rs b/src/kete_core/benches/propagation.rs similarity index 99% rename from src/neospy_core/benches/propagation.rs rename to src/kete_core/benches/propagation.rs index a1a3319..1bc4c91 100644 --- a/src/neospy_core/benches/propagation.rs +++ b/src/kete_core/benches/propagation.rs @@ -3,8 +3,8 @@ use std::time::Duration; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; use lazy_static::lazy_static; -use neospy_core::prelude::*; -use neospy_core::*; +use kete_core::prelude::*; +use kete_core::*; use pprof::criterion::{Output, PProfProfiler}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; diff --git a/src/neospy_core/benches/spice.rs b/src/kete_core/benches/spice.rs similarity index 87% rename from src/neospy_core/benches/spice.rs rename to src/kete_core/benches/spice.rs index 6760a2c..b1cd168 100644 --- a/src/neospy_core/benches/spice.rs +++ b/src/kete_core/benches/spice.rs @@ -1,6 +1,6 @@ extern crate criterion; use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use neospy_core::{spice::get_spk_singleton, state::State}; +use kete_core::{spice::get_spk_singleton, state::State}; use pprof::criterion::{Output, PProfProfiler}; fn spice_get_raw_state(jd: f64) { @@ -22,7 +22,7 @@ fn spice_get_state(jd: f64) { let spice = get_spk_singleton().try_read().unwrap(); for _ in 0..1000 { let _ = spice - .try_get_state(5, jd, 10, neospy_core::frames::Frame::Ecliptic) + .try_get_state(5, jd, 10, kete_core::frames::Frame::Ecliptic) .unwrap(); } } @@ -30,7 +30,7 @@ fn spice_get_state(jd: f64) { pub fn spice_benchmark(c: &mut Criterion) { let spice = get_spk_singleton().try_read().unwrap(); let state = spice - .try_get_state(5, 2451545.0, 10, neospy_core::frames::Frame::Ecliptic) + .try_get_state(5, 2451545.0, 10, kete_core::frames::Frame::Ecliptic) .unwrap(); c.bench_function("spice_get_raw_state", |b| { b.iter(|| spice_get_raw_state(black_box(2451545.0))) diff --git a/src/neospy_core/benches/thermal.rs b/src/kete_core/benches/thermal.rs similarity index 89% rename from src/neospy_core/benches/thermal.rs rename to src/kete_core/benches/thermal.rs index 7767f1f..724f3b8 100644 --- a/src/neospy_core/benches/thermal.rs +++ b/src/kete_core/benches/thermal.rs @@ -1,6 +1,6 @@ extern crate criterion; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; -use neospy_core::flux::{FrmParams, HGParams, NeatmParams}; +use kete_core::flux::{FrmParams, HGParams, NeatmParams}; use pprof::criterion::{Output, PProfProfiler}; fn neatm_bench(params: &NeatmParams) { @@ -28,14 +28,14 @@ pub fn neatm_benchmark(c: &mut Criterion) { ) .unwrap(); let wise_params = NeatmParams { - obs_bands: neospy_core::flux::ObserverBands::Wise, + obs_bands: kete_core::flux::ObserverBands::Wise, band_albedos: vec![0.2; 4], beaming: 1.0, hg_params: hg_params.clone(), emissivity: 0.9, }; let generic_params = NeatmParams { - obs_bands: neospy_core::flux::ObserverBands::Generic { + obs_bands: kete_core::flux::ObserverBands::Generic { bands: vec![1000.0; 4], zero_mags: None, solar_correction: vec![1.0; 4], @@ -67,13 +67,13 @@ pub fn frm_benchmark(c: &mut Criterion) { ) .unwrap(); let wise_params = FrmParams { - obs_bands: neospy_core::flux::ObserverBands::Wise, + obs_bands: kete_core::flux::ObserverBands::Wise, band_albedos: vec![0.2; 4], hg_params: hg_params.clone(), emissivity: 0.9, }; let generic_params = FrmParams { - obs_bands: neospy_core::flux::ObserverBands::Generic { + obs_bands: kete_core::flux::ObserverBands::Generic { bands: vec![1000.0; 4], zero_mags: None, solar_correction: vec![1.0; 4], diff --git a/src/neospy_core/data/20000001.bsp b/src/kete_core/data/20000001.bsp similarity index 100% rename from src/neospy_core/data/20000001.bsp rename to src/kete_core/data/20000001.bsp diff --git a/src/neospy_core/data/20000002.bsp b/src/kete_core/data/20000002.bsp similarity index 100% rename from src/neospy_core/data/20000002.bsp rename to src/kete_core/data/20000002.bsp diff --git a/src/neospy_core/data/20000004.bsp b/src/kete_core/data/20000004.bsp similarity index 100% rename from src/neospy_core/data/20000004.bsp rename to src/kete_core/data/20000004.bsp diff --git a/src/neospy_core/data/20000010.bsp b/src/kete_core/data/20000010.bsp similarity index 100% rename from src/neospy_core/data/20000010.bsp rename to src/kete_core/data/20000010.bsp diff --git a/src/neospy_core/data/20000704.bsp b/src/kete_core/data/20000704.bsp similarity index 100% rename from src/neospy_core/data/20000704.bsp rename to src/kete_core/data/20000704.bsp diff --git a/src/neospy_core/data/de440s.bsp b/src/kete_core/data/de440s.bsp similarity index 100% rename from src/neospy_core/data/de440s.bsp rename to src/kete_core/data/de440s.bsp diff --git a/src/neospy_core/data/earth_000101_240215_231123.bpc b/src/kete_core/data/earth_000101_240215_231123.bpc similarity index 100% rename from src/neospy_core/data/earth_000101_240215_231123.bpc rename to src/kete_core/data/earth_000101_240215_231123.bpc diff --git a/src/neospy_core/data/earth_200101_990825_predict.bpc b/src/kete_core/data/earth_200101_990825_predict.bpc similarity index 100% rename from src/neospy_core/data/earth_200101_990825_predict.bpc rename to src/kete_core/data/earth_200101_990825_predict.bpc diff --git a/src/neospy_core/data/leap_second.dat b/src/kete_core/data/leap_second.dat similarity index 100% rename from src/neospy_core/data/leap_second.dat rename to src/kete_core/data/leap_second.dat diff --git a/src/neospy_core/data/mpc_obs.tsv b/src/kete_core/data/mpc_obs.tsv similarity index 100% rename from src/neospy_core/data/mpc_obs.tsv rename to src/kete_core/data/mpc_obs.tsv diff --git a/src/neospy_core/data/naif_ids.csv b/src/kete_core/data/naif_ids.csv similarity index 100% rename from src/neospy_core/data/naif_ids.csv rename to src/kete_core/data/naif_ids.csv diff --git a/src/neospy_core/data/readme.md b/src/kete_core/data/readme.md similarity index 92% rename from src/neospy_core/data/readme.md rename to src/kete_core/data/readme.md index 9ae8fef..3618b09 100644 --- a/src/neospy_core/data/readme.md +++ b/src/kete_core/data/readme.md @@ -1,4 +1,4 @@ -Collection of data files which are used by neospy_core. +Collection of data files which are used by kete_core. Files ending in BSP or BPC are are packed binary SPICE kernels. These are loaded and packed into the final rust binary, and are included automatically. diff --git a/src/neospy_core/data/wise.bsp b/src/kete_core/data/wise.bsp similarity index 100% rename from src/neospy_core/data/wise.bsp rename to src/kete_core/data/wise.bsp diff --git a/src/neospy_core/src/constants/gravity.rs b/src/kete_core/src/constants/gravity.rs similarity index 100% rename from src/neospy_core/src/constants/gravity.rs rename to src/kete_core/src/constants/gravity.rs diff --git a/src/neospy_core/src/constants/mod.rs b/src/kete_core/src/constants/mod.rs similarity index 100% rename from src/neospy_core/src/constants/mod.rs rename to src/kete_core/src/constants/mod.rs diff --git a/src/neospy_core/src/constants/neos.rs b/src/kete_core/src/constants/neos.rs similarity index 100% rename from src/neospy_core/src/constants/neos.rs rename to src/kete_core/src/constants/neos.rs diff --git a/src/neospy_core/src/constants/universal.rs b/src/kete_core/src/constants/universal.rs similarity index 100% rename from src/neospy_core/src/constants/universal.rs rename to src/kete_core/src/constants/universal.rs diff --git a/src/neospy_core/src/constants/wise.rs b/src/kete_core/src/constants/wise.rs similarity index 100% rename from src/neospy_core/src/constants/wise.rs rename to src/kete_core/src/constants/wise.rs diff --git a/src/neospy_core/src/elements.rs b/src/kete_core/src/elements.rs similarity index 100% rename from src/neospy_core/src/elements.rs rename to src/kete_core/src/elements.rs diff --git a/src/neospy_core/src/errors.rs b/src/kete_core/src/errors.rs similarity index 98% rename from src/neospy_core/src/errors.rs rename to src/kete_core/src/errors.rs index a2de2f7..3b68371 100644 --- a/src/neospy_core/src/errors.rs +++ b/src/kete_core/src/errors.rs @@ -1,12 +1,12 @@ //! # Errors -//! Errors emitted by NEOSpy_core +//! Errors emitted by kete_core /// Define all errors which may be raise by this crate, as well as optionally provide /// conversion to pyo3 error types which allow for the errors to be raised in Python. use chrono::ParseError; use std::{error, fmt, io}; -/// neospy specific result. +/// kete specific result. pub type NeosResult = Result; /// Possible Errors which may be raised by this crate. diff --git a/src/neospy_core/src/fitting/mod.rs b/src/kete_core/src/fitting/mod.rs similarity index 100% rename from src/neospy_core/src/fitting/mod.rs rename to src/kete_core/src/fitting/mod.rs diff --git a/src/neospy_core/src/fitting/newton.rs b/src/kete_core/src/fitting/newton.rs similarity index 97% rename from src/neospy_core/src/fitting/newton.rs rename to src/kete_core/src/fitting/newton.rs index f85be23..dac91e3 100644 --- a/src/neospy_core/src/fitting/newton.rs +++ b/src/kete_core/src/fitting/newton.rs @@ -7,7 +7,7 @@ use crate::{errors::Error, prelude::NeosResult}; /// respect to the input variable. /// /// ``` -/// use neospy_core::fitting::newton_raphson; +/// use kete_core::fitting::newton_raphson; /// let f = |x| { 1.0 * x * x - 1.0 }; /// let d = |x| { 2.0 * x }; /// let root = newton_raphson(f, d, 0.0, 1e-10).unwrap(); diff --git a/src/neospy_core/src/fitting/reduced_chi2.rs b/src/kete_core/src/fitting/reduced_chi2.rs similarity index 100% rename from src/neospy_core/src/fitting/reduced_chi2.rs rename to src/kete_core/src/fitting/reduced_chi2.rs diff --git a/src/neospy_core/src/flux/comets.rs b/src/kete_core/src/flux/comets.rs similarity index 100% rename from src/neospy_core/src/flux/comets.rs rename to src/kete_core/src/flux/comets.rs diff --git a/src/neospy_core/src/flux/common.rs b/src/kete_core/src/flux/common.rs similarity index 100% rename from src/neospy_core/src/flux/common.rs rename to src/kete_core/src/flux/common.rs diff --git a/src/neospy_core/src/flux/frm.rs b/src/kete_core/src/flux/frm.rs similarity index 100% rename from src/neospy_core/src/flux/frm.rs rename to src/kete_core/src/flux/frm.rs diff --git a/src/neospy_core/src/flux/mod.rs b/src/kete_core/src/flux/mod.rs similarity index 100% rename from src/neospy_core/src/flux/mod.rs rename to src/kete_core/src/flux/mod.rs diff --git a/src/neospy_core/src/flux/neatm.rs b/src/kete_core/src/flux/neatm.rs similarity index 100% rename from src/neospy_core/src/flux/neatm.rs rename to src/kete_core/src/flux/neatm.rs diff --git a/src/neospy_core/src/flux/reflected.rs b/src/kete_core/src/flux/reflected.rs similarity index 100% rename from src/neospy_core/src/flux/reflected.rs rename to src/kete_core/src/flux/reflected.rs diff --git a/src/neospy_core/src/flux/shapes.rs b/src/kete_core/src/flux/shapes.rs similarity index 100% rename from src/neospy_core/src/flux/shapes.rs rename to src/kete_core/src/flux/shapes.rs diff --git a/src/neospy_core/src/flux/sun.rs b/src/kete_core/src/flux/sun.rs similarity index 100% rename from src/neospy_core/src/flux/sun.rs rename to src/kete_core/src/flux/sun.rs diff --git a/src/neospy_core/src/fov/fov_like.rs b/src/kete_core/src/fov/fov_like.rs similarity index 100% rename from src/neospy_core/src/fov/fov_like.rs rename to src/kete_core/src/fov/fov_like.rs diff --git a/src/neospy_core/src/fov/generic.rs b/src/kete_core/src/fov/generic.rs similarity index 100% rename from src/neospy_core/src/fov/generic.rs rename to src/kete_core/src/fov/generic.rs diff --git a/src/neospy_core/src/fov/mod.rs b/src/kete_core/src/fov/mod.rs similarity index 100% rename from src/neospy_core/src/fov/mod.rs rename to src/kete_core/src/fov/mod.rs diff --git a/src/neospy_core/src/fov/neos.rs b/src/kete_core/src/fov/neos.rs similarity index 100% rename from src/neospy_core/src/fov/neos.rs rename to src/kete_core/src/fov/neos.rs diff --git a/src/neospy_core/src/fov/patches.rs b/src/kete_core/src/fov/patches.rs similarity index 100% rename from src/neospy_core/src/fov/patches.rs rename to src/kete_core/src/fov/patches.rs diff --git a/src/neospy_core/src/fov/wise.rs b/src/kete_core/src/fov/wise.rs similarity index 100% rename from src/neospy_core/src/fov/wise.rs rename to src/kete_core/src/fov/wise.rs diff --git a/src/neospy_core/src/fov/ztf.rs b/src/kete_core/src/fov/ztf.rs similarity index 100% rename from src/neospy_core/src/fov/ztf.rs rename to src/kete_core/src/fov/ztf.rs diff --git a/src/neospy_core/src/frames/definitions.rs b/src/kete_core/src/frames/definitions.rs similarity index 100% rename from src/neospy_core/src/frames/definitions.rs rename to src/kete_core/src/frames/definitions.rs diff --git a/src/neospy_core/src/frames/mod.rs b/src/kete_core/src/frames/mod.rs similarity index 100% rename from src/neospy_core/src/frames/mod.rs rename to src/kete_core/src/frames/mod.rs diff --git a/src/neospy_core/src/frames/wgs_84.rs b/src/kete_core/src/frames/wgs_84.rs similarity index 100% rename from src/neospy_core/src/frames/wgs_84.rs rename to src/kete_core/src/frames/wgs_84.rs diff --git a/src/neospy_core/src/io/mod.rs b/src/kete_core/src/io/mod.rs similarity index 100% rename from src/neospy_core/src/io/mod.rs rename to src/kete_core/src/io/mod.rs diff --git a/src/neospy_core/src/io/obs_codes.rs b/src/kete_core/src/io/obs_codes.rs similarity index 100% rename from src/neospy_core/src/io/obs_codes.rs rename to src/kete_core/src/io/obs_codes.rs diff --git a/src/neospy_core/src/io/serde_const_arr.rs b/src/kete_core/src/io/serde_const_arr.rs similarity index 100% rename from src/neospy_core/src/io/serde_const_arr.rs rename to src/kete_core/src/io/serde_const_arr.rs diff --git a/src/neospy_core/src/lib.rs b/src/kete_core/src/lib.rs similarity index 97% rename from src/neospy_core/src/lib.rs rename to src/kete_core/src/lib.rs index 2327c10..7c0e354 100644 --- a/src/neospy_core/src/lib.rs +++ b/src/kete_core/src/lib.rs @@ -1,5 +1,5 @@ -//! # NEOSpy Core -//! This library contains all of the mathematical functions required for NEOSpy to +//! # kete Core +//! This library contains all of the mathematical functions required for kete to //! function. //! //! This crate is left as a stand alone Rust crate, completely independent of the diff --git a/src/neospy_core/src/propagation/acceleration.rs b/src/kete_core/src/propagation/acceleration.rs similarity index 100% rename from src/neospy_core/src/propagation/acceleration.rs rename to src/kete_core/src/propagation/acceleration.rs diff --git a/src/neospy_core/src/propagation/kepler.rs b/src/kete_core/src/propagation/kepler.rs similarity index 100% rename from src/neospy_core/src/propagation/kepler.rs rename to src/kete_core/src/propagation/kepler.rs diff --git a/src/neospy_core/src/propagation/mod.rs b/src/kete_core/src/propagation/mod.rs similarity index 100% rename from src/neospy_core/src/propagation/mod.rs rename to src/kete_core/src/propagation/mod.rs diff --git a/src/neospy_core/src/propagation/nongrav.rs b/src/kete_core/src/propagation/nongrav.rs similarity index 100% rename from src/neospy_core/src/propagation/nongrav.rs rename to src/kete_core/src/propagation/nongrav.rs diff --git a/src/neospy_core/src/propagation/radau.rs b/src/kete_core/src/propagation/radau.rs similarity index 100% rename from src/neospy_core/src/propagation/radau.rs rename to src/kete_core/src/propagation/radau.rs diff --git a/src/neospy_core/src/propagation/runge_kutta.rs b/src/kete_core/src/propagation/runge_kutta.rs similarity index 100% rename from src/neospy_core/src/propagation/runge_kutta.rs rename to src/kete_core/src/propagation/runge_kutta.rs diff --git a/src/neospy_core/src/propagation/state_transition.rs b/src/kete_core/src/propagation/state_transition.rs similarity index 100% rename from src/neospy_core/src/propagation/state_transition.rs rename to src/kete_core/src/propagation/state_transition.rs diff --git a/src/neospy_core/src/simult_states.rs b/src/kete_core/src/simult_states.rs similarity index 100% rename from src/neospy_core/src/simult_states.rs rename to src/kete_core/src/simult_states.rs diff --git a/src/neospy_core/src/spice/binary.rs b/src/kete_core/src/spice/binary.rs similarity index 100% rename from src/neospy_core/src/spice/binary.rs rename to src/kete_core/src/spice/binary.rs diff --git a/src/neospy_core/src/spice/daf.rs b/src/kete_core/src/spice/daf.rs similarity index 100% rename from src/neospy_core/src/spice/daf.rs rename to src/kete_core/src/spice/daf.rs diff --git a/src/neospy_core/src/spice/interpolation.rs b/src/kete_core/src/spice/interpolation.rs similarity index 100% rename from src/neospy_core/src/spice/interpolation.rs rename to src/kete_core/src/spice/interpolation.rs diff --git a/src/neospy_core/src/spice/mod.rs b/src/kete_core/src/spice/mod.rs similarity index 100% rename from src/neospy_core/src/spice/mod.rs rename to src/kete_core/src/spice/mod.rs diff --git a/src/neospy_core/src/spice/naif_ids.rs b/src/kete_core/src/spice/naif_ids.rs similarity index 100% rename from src/neospy_core/src/spice/naif_ids.rs rename to src/kete_core/src/spice/naif_ids.rs diff --git a/src/neospy_core/src/spice/pck.rs b/src/kete_core/src/spice/pck.rs similarity index 100% rename from src/neospy_core/src/spice/pck.rs rename to src/kete_core/src/spice/pck.rs diff --git a/src/neospy_core/src/spice/pck_segments.rs b/src/kete_core/src/spice/pck_segments.rs similarity index 100% rename from src/neospy_core/src/spice/pck_segments.rs rename to src/kete_core/src/spice/pck_segments.rs diff --git a/src/neospy_core/src/spice/spk.rs b/src/kete_core/src/spice/spk.rs similarity index 99% rename from src/neospy_core/src/spice/spk.rs rename to src/kete_core/src/spice/spk.rs index 0c6a61b..c8d1e6b 100644 --- a/src/neospy_core/src/spice/spk.rs +++ b/src/kete_core/src/spice/spk.rs @@ -7,8 +7,8 @@ /// /// Here is a small worked example: /// ``` -/// use neospy_core::spice::get_spk_singleton; -/// use neospy_core::frames::Frame; +/// use kete_core::spice::get_spk_singleton; +/// use kete_core::frames::Frame; /// /// // get a read-only reference to the [`SegmentCollection`] /// let singleton = get_spk_singleton().try_read().unwrap(); diff --git a/src/neospy_core/src/spice/spk_segments.rs b/src/kete_core/src/spice/spk_segments.rs similarity index 100% rename from src/neospy_core/src/spice/spk_segments.rs rename to src/kete_core/src/spice/spk_segments.rs diff --git a/src/neospy_core/src/state.rs b/src/kete_core/src/state.rs similarity index 100% rename from src/neospy_core/src/state.rs rename to src/kete_core/src/state.rs diff --git a/src/neospy_core/src/stats/ks_test.rs b/src/kete_core/src/stats/ks_test.rs similarity index 100% rename from src/neospy_core/src/stats/ks_test.rs rename to src/kete_core/src/stats/ks_test.rs diff --git a/src/neospy_core/src/stats/mod.rs b/src/kete_core/src/stats/mod.rs similarity index 100% rename from src/neospy_core/src/stats/mod.rs rename to src/kete_core/src/stats/mod.rs diff --git a/src/neospy_core/src/stats/quantile.rs b/src/kete_core/src/stats/quantile.rs similarity index 100% rename from src/neospy_core/src/stats/quantile.rs rename to src/kete_core/src/stats/quantile.rs diff --git a/src/neospy_core/src/time/leap_second.rs b/src/kete_core/src/time/leap_second.rs similarity index 100% rename from src/neospy_core/src/time/leap_second.rs rename to src/kete_core/src/time/leap_second.rs diff --git a/src/neospy_core/src/time/mod.rs b/src/kete_core/src/time/mod.rs similarity index 100% rename from src/neospy_core/src/time/mod.rs rename to src/kete_core/src/time/mod.rs diff --git a/src/neospy_core/src/time/scales.rs b/src/kete_core/src/time/scales.rs similarity index 99% rename from src/neospy_core/src/time/scales.rs rename to src/kete_core/src/time/scales.rs index a65e56b..9647f64 100644 --- a/src/neospy_core/src/time/scales.rs +++ b/src/kete_core/src/time/scales.rs @@ -30,7 +30,7 @@ pub trait TimeScale { /// TDB Scaled JD time. /// /// This is in good agreement with "Ephemeris Time" - Which is commonly referred -/// to as the time units used by the JPL Ephemeris, and is used in NEOSpy as the +/// to as the time units used by the JPL Ephemeris, and is used in kete as the /// base time scaling. /// /// This is essentially the rate of time from an observer not on the surface of diff --git a/src/tests/flux/test_common.py b/src/tests/flux/test_common.py index a7f70ac..e362b1a 100644 --- a/src/tests/flux/test_common.py +++ b/src/tests/flux/test_common.py @@ -1,8 +1,8 @@ import numpy as np import pytest -from neospy import constants, Vector, conversion +from kete import constants, Vector, conversion -from neospy.flux import ( +from kete.flux import ( black_body_flux, sub_solar_temperature, hg_apparent_flux, diff --git a/src/tests/flux/test_model.py b/src/tests/flux/test_model.py index f16518d..d3ffae6 100644 --- a/src/tests/flux/test_model.py +++ b/src/tests/flux/test_model.py @@ -1,12 +1,12 @@ import numpy as np -import neospy +import kete SUN2OBS = [0, 1, 0] SUN2OBJ = [1, 1, 0] def test_neos_neatm_model(): - model = neospy.flux.NeatmParams.new_neos( + model = kete.flux.NeatmParams.new_neos( "visible", vis_albedo=0.3, band_albedos=[0.3, 0.3], @@ -21,7 +21,7 @@ def test_neos_neatm_model(): def test_neos_frm_model(): - model = neospy.flux.FrmParams.new_neos( + model = kete.flux.FrmParams.new_neos( "visible", vis_albedo=0.3, band_albedos=[0.3, 0.3], @@ -35,7 +35,7 @@ def test_neos_frm_model(): def test_wise_neatm_model(): - model = neospy.flux.NeatmParams.new_wise( + model = kete.flux.NeatmParams.new_wise( "visible", vis_albedo=0.3, band_albedos=[0.3, 0.3, 0.3, 0.3], diff --git a/src/tests/test_conversion.py b/src/tests/test_conversion.py index 98975f2..43eeb0e 100644 --- a/src/tests/test_conversion.py +++ b/src/tests/test_conversion.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from neospy import constants -from neospy.conversion import ( +from kete import constants +from kete.conversion import ( compute_albedo, compute_diameter, compute_earth_radius, diff --git a/src/tests/test_horizons.py b/src/tests/test_horizons.py index b0a7c2b..dadda93 100644 --- a/src/tests/test_horizons.py +++ b/src/tests/test_horizons.py @@ -1,11 +1,11 @@ import pytest -import neospy +import kete @pytest.fixture(scope="session") def ceres_properties(): """HorizonsObjectProperties built from Ceres""" - return neospy.HorizonsProperties( + return kete.HorizonsProperties( desig="Ceres", group=None, vis_albedo=0.09, @@ -32,13 +32,13 @@ def test_object_properties(ceres_properties): @pytest.mark.horizons def test_fetch_horizons(): - obj = neospy.HorizonsProperties.fetch("Ceres") + obj = kete.HorizonsProperties.fetch("Ceres") _ = obj.state _ = obj.elements @pytest.mark.horizons def test_cache_horizons(): - jd = neospy.Time.j2000().jd - neospy.horizons.fetch_spice_kernel("phaethon", jd, jd + 365, update_cache=True) - neospy.horizons.fetch_spice_kernel("phaethon", jd, jd + 365, update_cache=False) + jd = kete.Time.j2000().jd + kete.horizons.fetch_spice_kernel("phaethon", jd, jd + 365, update_cache=True) + kete.horizons.fetch_spice_kernel("phaethon", jd, jd + 365, update_cache=False) diff --git a/src/tests/test_mpc.py b/src/tests/test_mpc.py index 1e3ebe7..4011e9f 100644 --- a/src/tests/test_mpc.py +++ b/src/tests/test_mpc.py @@ -1,5 +1,5 @@ import pytest -from neospy import mpc +from kete import mpc @pytest.mark.parametrize( diff --git a/src/tests/test_population.py b/src/tests/test_population.py index 888471d..5297c87 100644 --- a/src/tests/test_population.py +++ b/src/tests/test_population.py @@ -1,5 +1,5 @@ import numpy as np -from neospy import population, power_law +from kete import population, power_law def test_population(): diff --git a/src/tests/test_propagation.py b/src/tests/test_propagation.py index 75bd59f..f92f5ff 100644 --- a/src/tests/test_propagation.py +++ b/src/tests/test_propagation.py @@ -1,6 +1,6 @@ import pytest import numpy as np -from neospy import ( +from kete import ( constants, spice, propagate_two_body, @@ -10,7 +10,7 @@ State, Time, ) -from neospy.propagation import NonGravModel +from kete.propagation import NonGravModel @pytest.fixture(scope="session") diff --git a/src/tests/test_shape.py b/src/tests/test_shape.py index 3e27c58..5cb13a0 100644 --- a/src/tests/test_shape.py +++ b/src/tests/test_shape.py @@ -1,9 +1,9 @@ -import neospy +import kete import numpy as np def test_triangle_ellipsoid(): - geom = neospy.shape.TriangleEllipsoid(6) + geom = kete.shape.TriangleEllipsoid(6) norms = geom.normals assert len(norms) > 100 diff --git a/src/tests/test_spice.py b/src/tests/test_spice.py index 0549986..0c33b50 100644 --- a/src/tests/test_spice.py +++ b/src/tests/test_spice.py @@ -1,9 +1,9 @@ import numpy as np import pytest -from neospy import spice, State, Time, Frames -from neospy.mpc import find_obs_code -from neospy.spice import SpkInfo +from kete import spice, State, Time, Frames +from kete.mpc import find_obs_code +from kete.spice import SpkInfo # Turn off flake8 checker for this file. # flake8: noqa diff --git a/src/tests/test_state.py b/src/tests/test_state.py index 1580ccf..fd722bd 100644 --- a/src/tests/test_state.py +++ b/src/tests/test_state.py @@ -1,7 +1,7 @@ import pytest import numpy as np import os -from neospy.vector import CometElements, State, SimultaneousStates +from kete.vector import CometElements, State, SimultaneousStates class TestlState: diff --git a/src/tests/test_time.py b/src/tests/test_time.py index f41e864..4cd57da 100644 --- a/src/tests/test_time.py +++ b/src/tests/test_time.py @@ -1,4 +1,4 @@ -from neospy.time import Time +from kete.time import Time class TestTime: diff --git a/src/tests/test_vector.py b/src/tests/test_vector.py index d6f5627..4ab8cbd 100644 --- a/src/tests/test_vector.py +++ b/src/tests/test_vector.py @@ -1,6 +1,6 @@ import numpy as np import pytest -from neospy.vector import Vector, Frames +from kete.vector import Vector, Frames @pytest.fixture(scope="function") diff --git a/src/tests/test_wise.py b/src/tests/test_wise.py index e3b11d7..d1d95b5 100644 --- a/src/tests/test_wise.py +++ b/src/tests/test_wise.py @@ -1,4 +1,4 @@ -from neospy.wise import ( +from kete.wise import ( MISSION_PHASES, mission_phase_from_jd, mission_phase_from_scan,