Commit Graph

2227 Commits

Author SHA1 Message Date
Don Cross
fc75276e79 Windows CI: execute verify_clean.bat after run.bat.
From the GitHub Actions logs, it looks like verify_clean.bat
is not running after run.bat, like I intended. I'm guessing I
need to add "call" before both batch files to ensure that
control returns to the caller.
2022-01-10 16:19:58 -05:00
Ebrahim Byagowi
f68c8766dd Add files necessary for pip package upload 2022-01-11 00:34:41 +03:30
Don Cross
884539fde4 Windows CI: attempt downloading and running doxygen. 2022-01-10 16:01:00 -05:00
Don Cross
57a71af403 Windows CI: try using 'py' command to run Python programs.
Weirdly, the python program for generating constellation
data did not seem to run, but that failure did not break
the build directly. I am adding an explicity 'py' command
to run each Python program. Also added a check for missing
output constellation test data.
2022-01-09 22:06:28 -05:00
Don Cross
acf3877e31 Windows CI: turn off doxygen / generating C docs for now. 2022-01-09 21:38:09 -05:00
Don Cross
139fde6fe8 Windows CI: Upgraded Visual Studio target platform of C programs. 2022-01-09 20:42:28 -05:00
Don Cross
27adf8a3e0 Windows CI: second attempt to run msbuild.exe. 2022-01-09 20:09:32 -05:00
Don Cross
4ef515953e Windows CI: attempt to put msbuild.exe in PATH. 2022-01-09 19:57:30 -05:00
Don Cross
7d117f9d8c Windows CI: explicitly end md5 checksum files with LF.
The version of md5sum.exe that runs in GitHub Actions
gets confused when its input file ends with CRLF,
which is weird because this is supposed to be a Windows
environment. So I added a .gitattributes to force
these checksum files to have LF line endings.
2022-01-09 19:46:21 -05:00
Don Cross
e9922a48bb Windows CI: put quotes around executables.
In the GitHub Actions CI environment, the program md5sum.exe
resides in "C:\Program Files\Git\usr\bin\md5sum.exe".
Therefore, to execute it, I need quotes around the executable.
2022-01-09 17:43:46 -05:00
Don Cross
15a330c64d Windows CI: specify cmd instead of PowerShell. 2022-01-09 17:36:38 -05:00
Don Cross
e8aaee2e09 Windows CI: another attempt at multiple commands. 2022-01-09 17:25:25 -05:00
Don Cross
3c3d36bcea Fixed syntax errors in yml 2022-01-09 15:48:57 -05:00
Don Cross
8ad3488b65 Starting to work on GitHub Actions tests for Windows.
I'm certain this will fail, but I at least want to
start creating automated tests for building Astronomy
Engine on Windows.
2022-01-09 15:39:01 -05:00
Don Cross
37c8aeafa9 Moved 'windows' directory away from root.
The 'windows' directory is mainly useful for
maintainers, not end users. So I moved it out of
the root to reduce distraction for a first-time
visitor.

While I was fixing up resulting breakage in
Visual Studio project files, I noticed I still had
some hard-coded absolute paths that would only work
on my own Windows laptop (e.g. "c:\don\github\astronomy").
I replaced those with relative paths that will work
regardless of what directory the repo is cloned into.
2022-01-09 12:55:41 -05:00
Don Cross
b7ac00ed17 Browser demos: fix date parsing for Safari.
Safari does not work when you try to do this in JavaScript:

    const date = new Date('2022-01-08 17:26:59');

Instead, it requires a 'T' between the date and the time:

    const date = new Date('2022-01-08T17:26:59');

Fixed this issue in the moonradar.html and positions.html demos.
We still render the date/time as normal, with the space,
but parse it by replacing the space with 'T'.

Thanks to @ebraminio for reporting this!
2022-01-08 17:24:39 -05:00
Don Cross
e1f22fb743 Fixed #145 - support building on macOS. 2022-01-07 22:14:27 -05:00
Don Cross
15d1312060 Made Jupiter rotation matrix code gen one digit shorter.
This is another attempt to get consistent generated code
between Linux and macOS.
2022-01-07 21:38:41 -05:00
Don Cross
1ace122c9e Consistent generated tables between Linux, macOS.
The code generator was creating slightly different numeric
values for the Pluto state tables and the Jupiter rotation matrix.
I decreased the output precision by one decimal digit.
This should allow the code generator to produce identical
source code on both Linux and macOS.
2022-01-07 21:02:59 -05:00
Don Cross
753554db67 Make demo tests less sensitive to tiny floating point errors.
More work getting MacOS build process to work.
Avoid excessive number of floating point digits of
output in the demo tests, so that insignificant
floating point variations don't cause unit test failures.
2022-01-07 20:19:23 -05:00
Don Cross
cb4c9a6549 Fixed mistake in raytracer. Stop using 'realpath'.
I found a mistake in the raytracer's Spheroid class,
thanks to a warning about an unused member variable.
I don't believe it had any effect on the currently
generated images, but it was important to fix it before
I ever do any set operations on Spheroids.

On macOS, there is no 'realpath' command by default.
So I eliminated some more attempts to use 'realpath'
in the demo test scripts.

Renamed the GitHub Actions tests to be consistent:
    Astronomy-Engine-Linux
    Astronomy-Engine-Macos
2022-01-07 18:30:15 -05:00
Don Cross
515c2802de Merge branch 'master' of https://github.com/ebraminio/astronomy into macos 2022-01-07 17:18:03 -05:00
Don Cross
862889f62f Raytracer: fix build warnings for macOS. 2022-01-07 17:17:25 -05:00
Ebrahim Byagowi
4a0902fa10 CI: Add a macos bot 2022-01-07 12:18:00 +03:30
Ebrahim Byagowi
d36b181044 Mention macOS buildability in generate/README.md 2022-01-07 12:18:00 +03:30
Don Cross
0547aafc2b Made 'camera' demo checks tolerant of floating point roundoff.
The demo tests on Mac OS failed because of very tiny
floating point discrepancies that don't matter.
Changed the output of the "Moon check" so that slight
differences in vector residue no longer fail the unit tests.
2022-01-06 21:25:26 -05:00
Don Cross
cd776e1d39 Mac OS: increased tolerances comparing different language calculations.
Two different people are currently helping me get the
build process working on Mac OS. They both ran into different
amounts of comparison error in the calculations for different
langauges. I updated the 'diffcalc' bash script to have
slightly less strict tolerances, so the unit tests pass.
2022-01-06 20:55:27 -05:00
Don Cross
9775206988 Deleted the unfinished html Jupiter imager. 2022-01-05 20:40:33 -05:00
Don Cross
b50a8fdce2 Merge branch 'jupiter_moons_imager' 2022-01-05 20:35:31 -05:00
Don Cross
6753e6b8e6 Raytracer: Explicitly build astronomy.c as C++.
Based on a discovery made by someone helping me get
Astronomy Engine building on the Mac. In some versions
of g++ (aliased to clang), if you don't explicitly tell
the compiler to treat .c files as C++, it gives a warning
that escalates to an error due to -Werror.

So I added the same fix to the raytracer build:
pass in the option '-x c++'.
2022-01-04 20:03:28 -05:00
Don Cross
58342f97b9 Explicitly build astronomy.c as C++ for C++ test.
When built using g++ as an alias for clang,
as reportedly happens on Mac OS, we need to explicitly
tell g++ (using option '-x c++') to compile astronomy.c
as C++. Otherwise, it will fail with a deprecation warning.
2022-01-04 19:04:56 -05:00
Don Cross
b2f9219b56 Updated copyrights for 2022. 2022-01-04 18:55:20 -05:00
Don Cross
a23a3c7efb Raytracer: finished planet color table. 2022-01-03 19:56:18 -05:00
Don Cross
590218d139 Raytrace: fixed problem rendering Pluto.
Pluto is so far away that is angular size seen from Earth
is very small. I had to tweak my internal scaling constants
so that the raytracer was able to resolve it.
2022-01-02 20:47:28 -05:00
Don Cross
103e09d04c Raytracer: added radius data for other bodies.
Added radius data for the Sun, Moon, and remaining planets.
Test the raytracer for all other bodies except the Earth and Sun.
There is a problem with Pluto that I still need to figure out.
Fixed an issue in the doxygen-to-markdown translator I wrote
(hydrogen.js): it did not handle when one #define referred
to another #define. Created a more generic markdown expansion
that works in all cases, and creates embedded hyperlinks.
2022-01-02 20:32:45 -05:00
Don Cross
2277b5c26d Raytrace: Refactor scale constants to be global. 2022-01-02 19:20:22 -05:00
Don Cross
8a95ff0ee3 Raytrace: Default to auto-spinning the planet. 2022-01-02 19:05:16 -05:00
Don Cross
4fee2659da Raytracer: auto-zoom to planet's angular diameter. 2022-01-02 17:18:14 -05:00
Don Cross
7a3d1bd085 Jupiter raytrace: factor out code for adding moons. 2022-01-01 19:59:24 -05:00
Don Cross
6aac859020 Saturn raytrace: forgot to orient the planet's equator. 2022-01-01 19:36:48 -05:00
Don Cross
e158dab271 Raytrace: Added Saturn. Updated copyrights for 2022.
Added Saturn and its rings to the raytrace demo.

As a side effect of running the unit tests, copyrights
got updated for 2022. Happy New Year!
2021-12-31 22:25:16 -05:00
Don Cross
c86445ccce Mac fix: eliminate 'realpath' from makedoc script.
The program 'realpath' does not come installed on Mac OS.
This caused the bash script 'makedoc' to fail on Mac.
The only place I used realpath was to convert relative
paths to absolute paths for filenames passed to
check_internal_links.py.

It turns out Python has a standard function os.path.realpath()
that does the same thing, so I moved the logic into the
Python script itself. Thus makedoc no longer needs the
realpath program, and the Python function will work on
all platforms.

There is a general lesson here: in the future I will
consider moving more of my scripting logic into Python.
It has proven to be more portable than a mixture
of bash scripts and Windows batch files.
2021-12-30 11:08:09 -05:00
Don Cross
5dbd6ea612 Fixed another abs() warning in novas.c.
There was one more place where novas.c calls abs()
that caused a warning when compiled on the Mac.
It was passing long int to abs(). To be abundantly
cautious, instead of using labs(), I just manually
check for negative values and toggle -- inline abs.
2021-12-30 11:05:19 -05:00
Don Cross
51c6f6a591 Fixed warnings in novas.c on Mac builds.
I received a report that there are compiler warnings
that break the build in novas.c when building on the Mac.
In two cases, long integers are passed to abs(), which expects
its argument to be int. The warnings broke the build
of the 'generate' program. I patched the code so these
warnings should no longer occur, though I do not have a
Mac to test. Will ask the correspondent to test for me.
2021-12-29 14:48:25 -05:00
Don Cross
8731f1d229 Raytracer: started to generalize planet imager.
Refactored the Jupiter imager to be a generic planet imager.
Added support for drawing an image of Venus.
Verified that its extreme crescent phase looks correct
for the current date.
I will add radius constants to astronomy.h for each body I support.
2021-12-28 20:45:55 -05:00
Don Cross
3502906204 Raytracer: added -v option to print verbose messages. 2021-12-28 19:54:35 -05:00
Don Cross
1de7085ac2 Raytracer: auto-rotate image for planet's axis.
The raytracer now includes the option -s (without a numeric
spin angle on the command line) to automatically calculate
the spin angle needed to bring the planet's north pole
exactly upward in the generated image.
2021-12-27 21:37:52 -05:00
Don Cross
082194d2b6 Jupiter raytracer: better rotation matrix.
Improved the way I create the rotation matrix that
aims the virtual camera at Jupiter. The camera still
aims exactly at Jupiter, but this time it defaults
to having the left/right pixel direction aligning
with the Earth's equator. By experiment, I can spin
the longitudinal camera axis by -10 degrees and get
a good fit with Jupiter's equatorial plane. I will
adjust this more exactly in a future commit.
2021-12-20 21:44:58 -05:00
Don Cross
e57dd0a26b Added aim test sanity check in raytracer.
Instead of just printing both unit vectors that should be the same,
actually check that they point the same direction with a very
tight tolerance.
2021-12-19 21:33:34 -05:00
Don Cross
70489c3dc6 Raytracer: allow specifying non-square images.
Now the raytracer requires the user to pass in
both the pixel width and pixel height on the command line.
This allows for generating non-square images, which will
be necessary for the general case of imaging the moons
with respect to the planet.
2021-12-19 17:27:33 -05:00