-
Notifications
You must be signed in to change notification settings - Fork 14
SPICE only implementation #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
aaaad63
d832ef3
31e3188
011dd44
3ea74e8
b1efd34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,42 @@ | ||
| libassist: | ||
| $(MAKE) -C src | ||
| @ln -f -s src/libassist.so . | ||
| @if [ "$(MAKELEVEL)" -eq "0" ]; then echo "To compile the example problems, go to a subdirectory of examples/ and execute make there."; fi | ||
| @if [ "$(MAKELEVEL)" -eq "0" ]; then echo "To run tests, run 'make test' or go to a subdirectory of examples/ and execute make there."; fi | ||
|
|
||
| all: libassist | ||
|
|
||
| clean: | ||
| $(MAKE) -C src clean | ||
| $(MAKE) -C doc clean | ||
| @if [ -d doc ] && [ -f doc/Makefile ]; then $(MAKE) -C doc clean; fi | ||
| @-rm -f *.so | ||
| @pip uninstall -y assist | ||
| @python setup.py clean --all | ||
| @pip uninstall -y assist 2>/dev/null || true | ||
| @python setup.py clean --all 2>/dev/null || true | ||
| @rm -rf assist.* | ||
|
|
||
| .PHONY: doc | ||
| doc: | ||
| cd doc/doxygen && doxygen | ||
| $(MAKE) -C doc html | ||
| @if [ -d doc/doxygen ]; then cd doc/doxygen && doxygen; fi | ||
| @if [ -d doc ] && [ -f doc/Makefile ]; then $(MAKE) -C doc html; fi | ||
|
|
||
|
|
||
| # Iterate through each directory in the unit_tests directory and compile the test files | ||
| # then run them | ||
| test: | ||
| @echo "Running tests ..." | ||
| @set -e; \ | ||
| for dir in $(wildcard unit_tests/*); do \ | ||
| if [ -d $$dir ]; then \ | ||
| echo "Entering directory $$dir"; \ | ||
| if $(MAKE) -C $$dir; then \ | ||
| if [ -f "$$dir/rebound" ]; then \ | ||
| (cd $$dir && LD_LIBRARY_PATH=$(REB_DIR):. ./rebound); \ | ||
| else \ | ||
| echo "No rebound executable found in $$dir"; \ | ||
| exit 1; \ | ||
| fi \ | ||
| else \ | ||
| echo "Make failed in $$dir"; \ | ||
| exit 1; \ | ||
| fi \ | ||
| fi \ | ||
| done | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,18 +25,36 @@ Now we can install numpy, REBOUND, and ASSIST: | |
| pip install rebound | ||
| pip install assist | ||
|
|
||
| To use use ASSIST, you also need to download ephemeris data files. One file for planet ephemeris and another suplementary file for asteroid ephemeris. The following commands download these files with curl. You can also manually download them using your browser. Note that these are large files, almost 1GB in size. | ||
| To use use ASSIST, you also need to download ephemeris data files. One file for planet ephemeris and another suplementary file for asteroid ephemeris. You can do this with Python packages or by downloading files directly. Note that these are large files, almost 1GB in size. | ||
|
|
||
| pip install naif-de440 | ||
| pip install jpl-small-bodies-de441-n16 | ||
|
|
||
|
|
||
| You can initialize the ephemeris data from the packages like so: | ||
|
|
||
| python3 | ||
|
|
||
| >>> import assist | ||
| >>> from naif_de440 import de440 | ||
| >>> from jpl_small_bodies_de441_n16 import de441_n16 | ||
| >>> ephem = assist.Ephem(de440, de441_n16) | ||
|
Comment on lines
+28
to
+41
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope it's okay that I demonstrate how the python packages can be used in lieu of downloading the files from JPL.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion downloading a single file from an ftp server with curl is better in every way over using pip and should be the first and recommended option. Reason: I don't think the average user understands all nuances of the python packaging ecosystem. For example, where do the files get installed? Globally, in a virtual environment? Does it get cached? I think this matters, because the files are so large here. |
||
|
|
||
| The variables to the ephemeris files are simply path strings to the files. Alternatively, you can download these files with curl or your browser. | ||
|
|
||
| mkdir data | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440 -o data/linux_p1550p2650.440 | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de440.bsp -o data/de440.bsp | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/small_bodies/asteroids_de441/sb441-n16.bsp -o data/sb441-n16.bsp | ||
|
|
||
| Now you can try out if assist works. | ||
| Now you can point assist to those files directly, like so: | ||
|
|
||
| python3 | ||
|
|
||
| >>> import assist | ||
| >>> ephem = assist.Ephem("data/linux_p1550p2650.440", "data/sb441-n16.bsp") | ||
| >>> ephem = assist.Ephem("data/de440.bsp", "data/sb441-n16.bsp") | ||
|
|
||
| Once you've initialized the ephemeris data, you can test that assist is working by running the following commands: | ||
|
|
||
| >>> print(ephem.jd_ref) | ||
| >>> ephem.get_particle("Earth", 0) | ||
|
|
||
|
|
@@ -51,12 +69,12 @@ To install the C version of ASSIST, first clone the REBOUND and then the ASSIST | |
|
|
||
| To use use ASSIST, you also need to download ephemeris data files. One file for planet ephemeris and another suplementary file for asteroid ephemeris. The following commands download these files with curl. You can also manually download them using your browser. Note that these are large files, almost 1GB in size. | ||
|
|
||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440 -o assist/data/linux_p1550p2650.440 | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de440.bsp -o assist/data/de440.bsp | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/small_bodies/asteroids_de441/sb441-n16.bsp -o assist/data/sb441-n16.bsp | ||
|
|
||
| For some of the examples, you will also need the planet ephemeris file with an extended coverage. Note that this file is 2.6GB in size. | ||
|
|
||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de441/linux_m13000p17000.441 -o assist/data/linux_m13000p17000.441 | ||
| curl https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de441.bsp -o assist/data/de441.bsp | ||
|
|
||
| Next, go to one of the example directories and compile the problem file. This will also trigger the installation of the REBOUND and ASSIST shared libraries. | ||
|
|
||
|
|
@@ -81,5 +99,6 @@ ASSIST is open source, freely distributed under the [GNU General Public license, | |
| * Robert Weryk, University of Western Ontario | ||
| * Dan Tamayo, Harvey Mudd College, <[email protected]> | ||
| * David M. Hernandez, Center for Astrophysics | Harvard & Smithsonian | ||
| * Alec Koumjian, Asteroid Institute | B612 Foundation, <[email protected]> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| This is the standard location for the ephemeris files, i.e.: | ||
| linux_m13000p17000.441 & sb441-n16.bsp | ||
| de441.bsp & sb441-n16.bsp | ||
|
|
||
| You can download them from: | ||
|
|
||
| https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440 | ||
| https://ssd.jpl.nasa.gov/ftp/eph/planets/bsp/de440.bsp | ||
| https://ssd.jpl.nasa.gov/ftp/eph/small_bodies/asteroids_de441/sb441-n16.bsp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted an easy way to run all the c unit tests locally.