Commit Graph

2227 Commits

Author SHA1 Message Date
Don Cross
707382aaf2 Raytracer: minor coding style fixes. 2021-12-18 17:27:36 -05:00
Don Cross
51260bcbc1 Raytracer: modernized C++ iterator loops. 2021-12-18 17:23:01 -05:00
Don Cross
60728cf8b5 Raytracer: eliminated unnecessary class Optics.
Now that I have eliminated refraction and reflection
from the astronomy raytracer, there is no need for an
Optics class that represents matte, gloss, and index
of refraction.
2021-12-18 17:12:04 -05:00
Don Cross
503ee86bef Removed more fossils from the raytracer. 2021-12-18 17:05:27 -05:00
Don Cross
05db236ae1 Removed reflection and refraction from raytracer.
Reflections and transparent refractions are not needed
for planet images. I removed all this unnecessary code.
2021-12-18 16:53:22 -05:00
Don Cross
8ef54a58cf More efficient raytrace of Jupiter's moons.
Model Jupiter's moons using the Sphere class, rather
than the Spheroid class. Sphere is more efficient
to calculate.
2021-12-18 16:43:29 -05:00
Don Cross
216f2628d8 Trimmed more stuff from raytracer. 2021-12-18 16:35:00 -05:00
Don Cross
8ae0b7e16c Trimmed some debug code from the raytracer. 2021-12-18 16:23:20 -05:00
Don Cross
c93df6d4d4 Add raytracer test to the demo tests.
Verify that the raytracer builds and runs without error.
2021-12-15 20:04:45 -05:00
Don Cross
232cc9480b Added spin and zoom options to Jupiter raytracer. 2021-12-15 19:32:38 -05:00
Don Cross
cfe633af8f Allow flipping the raytraced image.
The raytracer now accepts a -f option to
flip the image, to match the inverted view
through some telescopes.
2021-12-15 19:15:17 -05:00
Don Cross
680fb48627 I had incorrect date/time for the Jupiter image.
I went back and discovered I made an error
converting local time to UTC when I calculated
the Jupiter raytrace image. Now it matches the
actual photo.
2021-12-14 21:40:26 -05:00
Don Cross
415d1c57d1 Fixed raytracer problems due to numeric scale.
I had lots of problems with using AU as my scale units.
By changing to 10000*km units, the vector equation solver
works correctly again, and I actually get an image of Jupiter
and its moons. However, it does not match the test photo:
Ganymede does not appear close to the planet, nor is there
a shadow of it on the planet. I will have to debug that
separately.
2021-12-14 20:35:42 -05:00
Don Cross
bc93faeb04 More work in progress: Jupiter imager.
Starting to work through adaptation of existing
raytracer code to generate geometrically accurate
images of Jupiter and its moons. Not yet working,
but I believe I am at least aiming the camera in
the right direction.
2021-12-13 21:00:04 -05:00
Don Cross
88a1ab7290 Work in progress: Jupiter raytracer. 2021-12-13 16:37:10 -05:00
Don Cross
210319d407 Python documentation fixes.
The documentation for the Python function `SearchAltitude`
was missing a mention of the `altitude` parameter.
I searched for similar mistakes in Python, C#, and C,
having just completed the same exercise in the JavaScript code.

I also found several places where extraneous newlines
between the parameter documentation caused the Markdown
to be rendered incorrectly.
2021-12-10 20:32:43 -05:00
Don Cross
7448727549 Fixed #143 - Fixed JS documentation mistakes.
Added documentation about the missing `date` parameter
to the `Elongation` function in the JavaScript version.
I reviewed all the other JavaScript functions to make sure there
were no other similar mistakes with parameters or return types.

Along the way, I discovered and fixed some other issues:

Fixed miscellaneous typos in the documentation.

Consistently refer to enumeration values like `Body.Earth`
instead of strings like `"Earth"`. I want to encourage
use of the enumerations because they make type-checking easier,
especially for TypeScript code.

Reworked `AstroTime` parameters to `FlexibleDateTime` parameters
in all exported functions. This is completely backward-compatible,
and allows callers more flexibility with passing `AstroTime`,
`Date`, or numeric day values.
2021-12-10 19:16:10 -05:00
Don Cross
82a4d2c996 Starting to work on a rendering demo of Jupiter and its moons. 2021-12-09 21:43:34 -05:00
Don Cross
3c69959606 Render Astronomy Engine logo with consistent aspect ratio. 2021-12-09 20:27:28 -05:00
Don Cross
f0ab974452 Display Astronomy Engine logo on the front page. 2021-12-08 22:25:39 -05:00
Don Cross
2a418bcf77 Uploading new logo. 2021-12-08 22:22:24 -05:00
Don Cross
f994d8d04c Fixed #141 - Upgrade C# code to .NET 6.
Now that Microsoft has officially released .NET 6,
I have upgraded the C# version of Astronomy Engine to use it.
No source code changes were needed. I just bumped the
version number in the project files, and targeted .NET 6
in the GitHub Actions continuous integration tests.
Fixed some obsolete wording in generate/README.md.
2021-12-07 17:06:04 -05:00
Don Cross
945e70a98f Fixed #106 - Calculate rotation axis of Sun, Moon, and planets. 2021-12-07 15:31:54 -05:00
Don Cross
e6c28a9a40 C: Found much more accurate Moon axis formulas.
I went back to the 2009 version of the IAU paper at:
https://astropedia.astrogeology.usgs.gov/alfresco/d/d/workspace/SpacesStore/28fd9e81-1964-44d6-a58b-fbbf61e64e15/WGCCRE2009reprint.pdf
and found formulas for the Moon's rotation axis and spin angle.
The north pole vector agrees with JPL Horizons to within 0.26 arcminutes,
which is much better than the 5.7 arcminutes I was getting using my
own formulas. So now I believe I'm ready to start porting the formulas
to the other 3 languages (C#, JavaScript, Python).
2021-12-07 14:10:24 -05:00
Don Cross
919973e11d Slight changes to moon axis calculation.
Added more test data for the Moon axis to better cover its orbital motion.
Tweaked the polar axis inclination to better match the test data.
2021-12-06 20:18:44 -05:00
Don Cross
a652da7b9e Rough version of Moon's rotation axis in C.
I used Cassini's Laws to derive an approximate solution
to the Moon's rotation axis. The error is on the order of
5 arcminutes. I still need to correct for physical libration.

I also need to find test data for the Moon's prime meridian
so that I can implement the spin angle calculation.
(I could use test data for all the planets' spins, for that matter.)
2021-12-05 13:22:00 -05:00
Don Cross
6cfd5d467b Fix generating markdown docs for Python.
In Windows I am running Python 3.7.8.
For some reason, it fails to write Unicode Greek letters
I use in the Markdown documentation unless I explicitly
specify to use utf-8 encoding. I thought that was the default,
because it works fine in Linux running 3.9.2.
I'm not sure whether the issue is due to Windows or
to a change in the Python version. Regardless, I am
explicitly specifying the file encoding to make the
documentation translator I wrote (pydown.py) work.
2021-12-03 22:25:53 -05:00
Don Cross
bbffebf88c Merge branch 'master' into axis 2021-12-03 21:51:54 -05:00
Don Cross
0ab6ac0cae Fixed Windows build issue in makedoc.bat.
This issue affected maintainers (mostly me) only.
Developers who are using Astronomy Engine do not need
to worry about this.

Running the source generator on Windows was broken because
I forgot to copy a step over from the Linux build that
prevents building tutorial pages in the master branch.
I didn't notice this until now because makedoc.bat also
had a bug where it detected an error but did not stop
execution... it just kept going and made it hard to
notice something was wrong.
2021-12-03 21:40:05 -05:00
Don Cross
f4297b78ae Added NASA moon libration data for 2022.
Moon libration data from NASA is now available for the
2022 calendar year. I added it to the existing libration
unit tests.
2021-12-03 16:31:21 -05:00
Don Cross
c36f16e1be PY RotationAxis function. 2021-12-02 16:11:50 -05:00
Don Cross
4235ee1715 JS RotationAxis function. 2021-12-01 21:26:29 -05:00
Don Cross
df518aeb84 Implemented C# RotationAxis. Improved C RotationAxis docs. 2021-11-30 22:12:34 -05:00
Don Cross
62dae5d893 Eliminated C constants MIN_BODY, MAX_BODY.
I don't think it's a good idea to imply that the body constants
are always going to be consecutive, or that it makes sense to
iterate over them. The caller needs to understand the body enough
to know which operations are allowed and which aren't.

So I removed the constants MIN_BODY and MAX_BODY.
2021-11-30 20:54:22 -05:00
Don Cross
afc472be77 C RotationAxis: added rotation model for the Earth.
This model uses the existing precession and nutation models
to calculate the north pole vector. Then it converts the vector
to equatorial coordinates.
2021-11-30 19:59:44 -05:00
Don Cross
55a2e8fd3b C RotationAxis: added code and test data for Pluto. 2021-11-29 21:19:18 -05:00
Don Cross
ad0611755a C RotationAxis: added Jupiter ... Neptune. 2021-11-29 21:08:44 -05:00
Don Cross
318fc416af C RotationAxis: Added Venus and Mars. 2021-11-29 20:49:00 -05:00
Don Cross
20ff46bb27 C RotationAxis: calculate north pole vector.
Calculate the vector that points in the direction
of the body's north pole.
The unit test now checks for excessive angle
between the expected north pole vector and the
calculated north pole vector.
2021-11-28 21:51:47 -05:00
Don Cross
ec35f21827 Starting body rotation axis calculation.
I'm starting to implement formulas from the IAU 2015 report:
https://astropedia.astrogeology.usgs.gov/download/Docs/WGCCRE/WGCCRE2015reprint.pdf

This is a work in progress. The unit test is partially finished.
The C function Astronomy_RotationAxis() works only for the Sun and Mercury.
I want to also return a rotation matrix that reports the rotating
frame in a way more suited to graphics work. I will add this to
the type astro_axis_t later.
2021-11-28 20:44:57 -05:00
Don Cross
f0be3be9a0 Document and data files for planet rotation axes.
I am starting to work on calculation of the north pole
axes of various solar system bodies. Here I include a reference
source document, along with some test data, all described by
the README.md file.
2021-11-26 20:24:19 -05:00
Don Cross
4c59d93015 Added another state vector sanity check.
Compare state vectors with the initial states used
to integrate the DE405 ephemeris.
This is just yet another confidence check that calculations
are correct.
2021-11-25 21:26:35 -05:00
Don Cross
f95316c113 Fixes for the Windows build process. 2021-11-24 21:33:06 -05:00
Don Cross
36a8370f4d Tell GitHub Actions to install doxygen, xsltproc.
These tools are needed for generating documentation
for the C version of Astronomy Engine.
This is an attempt to fix the current CI build failure.
2021-11-24 20:03:57 -05:00
Don Cross
d1d34d5254 Enable generation of C documentation by default.
When building Astronomy Engine for publication,
I was disabling generation of C documentation by default,
because I used to have issues getting deterministic output
in the CI tests (GitHub Actions). Now I have reason to believe
it will work reliably, so I am turning on C docs generation
by default.

If this fails the CI test, I will have to make the CI test
explicitly disable this step until I figure out how to fix it.
Otherwise (and preferably) the CI test will ensure that the
published C documentation is always up to date, and will fail
the build if there are any issues generating the docs.

I also had forgotten to enable installing dependencies for
my custom tool `hydrogen` in the Windows build. I added a fix
for that.
2021-11-24 19:37:13 -05:00
Don Cross
91341df4a0 Moved website/tutorials to separate branch.
For now, I'm keeping beta/unfinished website and tutorial stuff
outside the master branch to reduce confusion for newcomers.
It will stay in the `tutorials` branch for any ongoing development.
If we finish it and make it ready for public use, then I will
bring it back into `master`.

Updated the `makedoc` script to gracefully skip steps
involving tutorials or website if they are absent.

Also, we were not installing packages needed for `hydrogen`
to generate C documentation. This broke document generation
on freshly-cloned repos.
2021-11-24 19:17:29 -05:00
Don Cross
523b91fde2 Fixed JavaScript unit tests for Windows.
I noticed on a freshly-cloned Astronomy Engine on Windows,
I started getting JavaScript test failures. The problem was the
script generate/test.js had an inconsistent way of reading text
from files and splitting it into lines. Some of the tests
did not account for \r\n line endings in Windows text files.

So I created a unified approach: a new function ReadLines
that works correctly for Linux and Windows, regardless
of the variant line endings.

This may not work on Mac OS, but I don't have an easy
way of testing that myself. But at least now I can fix
issues like that in one place.
2021-11-24 08:30:54 -05:00
Don Cross
04cd457122 Deleted obsolete GitHub Pages control files. 2021-11-23 21:31:37 -05:00
Don Cross
aa334a0067 Moved code generation directories beneath 'generate'.
I'm trying to make it easier for first-time visitors to
this project to find the source code and documentation
to get started quickly. Moved directories that are only
used by contributors (mostly myself) out of the root
and into the 'generate' directory where they are less
distracting.
2021-11-23 21:23:54 -05:00
Don Cross
eb91d20c4e Directly link to source directory, out of genererate directory. 2021-11-23 20:52:09 -05:00