Commit Graph

2227 Commits

Author SHA1 Message Date
Don Cross
7da3b6cb8f Merge branch 'master' into dependabot/npm_and_yarn/website/prismjs-1.25.0 2021-11-05 21:37:47 -04:00
Don Cross
0d1d5c8626 Merge branch 'dependabot/npm_and_yarn/website/path-parse-1.0.7' 2021-11-05 21:36:42 -04:00
Don Cross
6ec07b146f Merge branch 'master' into dependabot/npm_and_yarn/website/path-parse-1.0.7 2021-11-05 21:27:34 -04:00
Don Cross
592fd6e48f Fixed lingering merge conflict markers in README.md. 2021-11-05 21:22:04 -04:00
dependabot[bot]
a3a5ea3df9 Bump tar from 6.1.0 to 6.1.11 in /website
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-06 01:10:56 +00:00
dependabot[bot]
c3bac850bb Bump prismjs from 1.23.0 to 1.25.0 in /website
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.25.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-06 01:10:56 +00:00
dependabot[bot]
8f5128deb4 Bump path-parse from 1.0.6 to 1.0.7 in /website
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-06 01:10:51 +00:00
Don Cross
c667fcf336 npm package version 2.0.8 npm_2.0.8 2021-11-05 21:07:24 -04:00
Don Cross
45ea0ea113 Fixed #131 - Added phase_fraction in C, C#.
The C and C# Illumination functions now return
a `phase_fraction` result to complement `phase_angle`.
This makes them consistent with the Python and JavaScript
versions.
2021-11-05 20:27:58 -04:00
Don Cross
3f788aaaee Fixed #126 - Added support for lunar libration.
There is now a Libration function in all 4 supported languages.
The returned structure contains libration angles in
ecliptic latitude and ecliptic longitude, along with
the Moon's ecliptic position and distance.
Also included is the Moon's apparent angular diameter.
2021-11-05 19:14:46 -04:00
Don Cross
296f23af76 Libration functions now calculate apparent angular diameter of the Moon.
All 4 languages have added a `diam_deg` field to the
structure returned by the Libration function.
It is the apparent angular diameter of the Moon as
seen from the center of the Earth, expressed in degrees.
2021-11-05 16:02:14 -04:00
Don Cross
eab9c275b9 Implemented lunar libration function for JavaScript. 2021-11-05 14:46:56 -04:00
Don Cross
f1e9313054 Implemented libration in Python. 2021-11-04 15:44:03 -04:00
Don Cross
c72dd30ada C# Libration implemented
C# Libration(../../libration/mooninfo_2020.txt): PASS (8785 test cases, max_diff_elon = 0.12984487564674296 arcmin, max_diff_elat = 1.665274961400911 arcmin, max_diff_distance = 52.860241484013386)
C# Libration(../../libration/mooninfo_2021.txt): PASS (8760 test cases, max_diff_elon = 0.10404742496932684 arcmin, max_diff_elat = 1.6466732189634214 arcmin, max_diff_distance = 53.88185173016973)

C Libration(libration/mooninfo_2020.txt): PASS (8785 test cases, max_diff_elon = 0.1298 arcmin, max_diff_elat = 1.6653 arcmin, max_diff_distance = 52.860 km)
C Libration(libration/mooninfo_2021.txt): PASS (8760 test cases, max_diff_elon = 0.1040 arcmin, max_diff_elat = 1.6467 arcmin, max_diff_distance = 53.882 km)
2021-11-03 20:28:39 -04:00
Don Cross
395a6bb786 C Libration: Include Moon's position in the return value.
Because I have to perform the expensive calculation to find
the Moon's ecliptic coordinates, I might as well return them
to the caller. This could help reduce calculation overhead
for some uses, and doesn't add any significant cost.
2021-11-03 19:12:04 -04:00
Don Cross
308cb8899b C Libration: eliminated earth tilt calculation.
I could not measure a significant difference in calculation
accuracy from doing the expensive earth-tilt step.
I removed it to significantly speed up the calculation.
2021-11-03 16:21:38 -04:00
Don Cross
405a89fdf3 C Libration functions appear to be working.
Based on PJ Naughter's formulas at:
http://www.naughter.com/aa.html
2021-11-02 21:28:18 -04:00
Don Cross
6156be38ca Verify that astronomy.c can be built as C++.
I discovered that when I tried to build astronomy.c as C++ code,
I got several errors and warnings. So I fixed those issues and
added a C++ build-check to the unit tests.
2021-10-31 18:48:00 -04:00
Don Cross
d68dc629aa Verify that astronomy.c can be built as C++.
I discovered that when I tried to build astronomy.c as C++ code,
I got several errors and warnings. So I fixed those issues and
added the C++ build-check to the unit tests.
2021-10-31 16:19:07 -04:00
Don Cross
e268637828 Fixed warnings reported by gcc 11.2.0.
The newer gcc generates warnings when a function
is declared to take a sized array parameter, but the caller
passes an array of smaller dimension. In these cases, the
intention was to pass arrays of variable size, so I deleted
the specific array sizes.
2021-10-16 20:30:47 -04:00
Don Cross
adf65e1f1f Throw an exception for invalid refraction option.
In JavaScript and Python, throw an exception if provided
an invalid refraction option. Especially in JavaScript,
it was too easy to pass in a value like 'true', which did
not calculate refraction as expected.
2021-10-12 14:31:13 -04:00
Don Cross
d4890dba59 C LibrationTest: starting to implement unit test.
I don't have a libration function working yet, but this
is the beginning of the unit test for it. It just parses
an input file created by NASA.
2021-10-06 17:18:57 -04:00
Don Cross
9c4b6e9f87 Fixed pylint problems on Raspberry Pi.
The current Raspbian uses an older version of pylint
that suffers from a recursion overflow. Hacked a deeper
recursion limit to work around this issue.
Also directly calling 'pylint' does not work in Raspbian.
Instead of trying to figure out why, I just use 'python3 -m'
to invoke pylint.
2021-09-26 19:30:55 -04:00
Don Cross
25cba04356 Added pylint to unit tests. Fixed warnings. 2021-09-25 19:51:48 -04:00
Don Cross
6d4cb068c5 Implemented C# function SearchAltitude. npm_2.0.7 2021-09-23 15:44:06 -04:00
Don Cross
d3621e7206 Implemented Python function SearchAltitude. 2021-09-23 14:27:56 -04:00
Don Cross
4b64ceeb0d Implemented C function Astronomy_SearchAltitude. 2021-09-23 11:57:44 -04:00
Don Cross
42240288b0 JS SearchAltitude: improved documentation and parameter checking. 2021-09-23 10:43:20 -04:00
Don Cross
24571444d9 JS SearchAltitude implemented.
Refactored SearchRiseSet to create a new function
InternalSearchAltitude. SearchRiseSet calls InternalSearchAltitude,
and the new function SearchAltitude also cals InternalSearchAltitude.
This causes the code to be only a tiny big larger.
2021-09-22 19:45:33 -04:00
Don Cross
0038bbbc39 Started JS Twilight unit test.
This is the beginning of adding support for calculating
civil, nautical, and astronomical twilight (dawn/dusk).
Just added the stubbed unit test without the call in place
for the new function that will be added: SearchAltitude.
2021-09-22 17:24:21 -04:00
Don Cross
fb384d369e Work around inconsistent output from different doxygen versions.
I'm doing Astronomy Engine development from different
Debian versions (Buster and Bullseye). Buster installs
doxygen version 1.8.13, but Bullseye installs version 1.9.1.
These two versions of doxygen generate slightly different output
for function pointer typedefs: the older version adds an extra
space between the '*' and the defined type name.

I need the output to be exactly the same so that
the continuous integration tests don't see any changed
files in git after they finish running.

So I added an extra step in hydrogen.js (the code I wrote
that converts the doxygen output into markdown) to squash
multiple contiguous spaces into a single space in the
typedef output.
2021-09-19 21:40:01 -04:00
Don Cross
dc5bb5317b No longer assume typescript is installed globally.
The unit tests for the calendar.ts demo program
assumed that the 'tsc' typescript compiler was
installed globally. Redirect it to the typescript
installed in the 'generate' folder.

I could have just made typescript a dependency,
but it seemed wasteful of disk space to have two
copies of the same thing (it is currently 54MB).
2021-09-18 21:59:06 -04:00
Don Cross
e03289a8cc Fixed #120 - google-closure-compiler now works on Raspberry Pi.
Worked around an issue where the npm package google-closure-compiler
assumes the current architecture is Intel x64.
This caused a broken install on the Raspberry Pi.
Detect non-Intel architecture and fall back to installing
only the Java version of the Closure compiler.
2021-09-18 21:56:02 -04:00
Don Cross
57177a506e Resolved security issue CVE-2021-23343.
The following security issue was reported by
Dependabot for the code generator script:

https://github.com/advisories/GHSA-hj48-42vr-x3v9

The issue was that the npm package path-parse 1.0.6
had a regex denial-of-service attack.
I have updated to use path-parse 1.0.7.

The user-facing Astronomy Engine library has no external
dependencies, so there is no need for most users to
be concerned with this change. The only affected component
was the internal code generator used to produce the
distributed source files, which is only run on my own
machine and the GitHub CI hook when I push a new change.

I verified that this update has no effect on the generated code.
2021-08-12 10:10:27 -04:00
Don Cross
b32b2705ee Fixed JS doc formatting mistake.
The formatting of the JS documentation for class
GlobalSolarEclipseInformation was messed up in the
generated Markdown file. Fixed that issue in the
JS comments.

Bumping npm version to 2.0.6, to include recent
barycentric state and Earth gravity calculations.
npm_2.0.6
2021-07-23 19:25:03 -04:00
Don Cross
aa2eb01dbf Python ObserverGravity function. 2021-07-19 22:09:49 -04:00
Don Cross
a9479832dd JavaScript ObserverGravity function. 2021-07-19 17:27:33 -04:00
Don Cross
1e53f09630 C# ObserverGravity function. 2021-07-19 17:09:08 -04:00
Don Cross
37084a156d C Earth gravity calculation.
Implemented the C function Astronomy_ObserverGravity.
It implements the WGS 84 Ellipsoidal Gravity Formula,
yielding the effective observed gravitational acceleration
at a location on or above the Earth's surface.
Wrote a demo program that also serves as a unit test.
I verified a few of the calculations, so the file
demo/c/test/gravity_correct.txt also serves as correct
unit test output.
2021-07-19 14:23:27 -04:00
Don Cross
b7fe4788ab Fixed #115 - Merge branch 'aberration' 2021-07-14 21:56:28 -04:00
Don Cross
131638a964 equator_of_date.js demo now corrects aberration. 2021-07-14 21:54:58 -04:00
Don Cross
56b4852542 Documented the BaryState functions. 2021-07-14 20:28:15 -04:00
Don Cross
827e083e34 Implemented Python aberration unit test. 2021-07-14 20:09:28 -04:00
Don Cross
bd29e67663 Implemented C# AberrationTest. 2021-07-13 22:00:01 -04:00
Don Cross
0d23d46f74 Implemented Python function BaryState. 2021-07-13 20:43:50 -04:00
Don Cross
0ee6b22279 C# BaryState implemented. 2021-07-12 22:23:14 -04:00
Don Cross
77854a8bd7 Web page demo: moon radar pulse round trip.
Added a web page that calculates the round trip time
of a radar pulse from an observer at a given location on
the surface of the Earth to bounce from the Moon and return
back to that observer.
2021-07-12 19:45:45 -04:00
Don Cross
e2e21f5681 Ported AberrationTest from C to JS.
The aberration unit test that relies on barycentric
velocity calculation for the Earth's geocenter
has been ported from C to JS and shows identical results.
2021-07-11 20:41:27 -04:00
Don Cross
e398aa43a4 JS: Implemented BaryState function.
Ported the C version of BaryState to JavaScript.

Fixed an issue in both the C and JS unit tests:
the JPL Horizons data is given in terms of TT, not UT.
2021-07-11 19:40:27 -04:00
Don Cross
5de0979f7c C: successful validation of aberration correction.
I updated the C aberration unit test to use the barycentric
velocity of the Earth to adjust the apparent position of
a star. This brought the error compared to JPL Horizons
data down from 20.5+ arcseconds to less than 0.4 arcseconds.
Success!
2021-07-11 16:34:03 -04:00