Skip to content

Releases: DeepskyLog/laravel-astronomy-library

Version 6.7.7

16 Apr 07:26

Choose a tag to compare

  • Artisan command astronomy:updateOrbitalElements (src/deepskylog/AstronomyLibrary/Commands/UpdateOrbitalElements.php): downloads JPL small-body element files (ELEMENTS.COMET and ELEMENTS.NUMBR), parses comet and asteroid orbital elements and imports them into the CometsOrbitalElements and AsteroidsOrbitalElements models. Performs epoch conversion (adds 2400000.5), truncates target tables before import, and uses batched inserts (500 rows) for performance. Includes basic error handling for download failures.

Version 6.7.6

01 Apr 14:19

Choose a tag to compare

Update to use laravel 13.

v6.7.5: Improve comet photometry extraction and add robust SBDB fallback

28 Nov 14:46

Choose a tag to compare

Changed:

  • Improved aerith/SBDB fallback behavior and photometry persistence (already introduced earlier, documented here for visibility):
    • The command still attempts aerith.net year-specific pages and directory candidates, and falls back to JPL SBDB when aerith scraping yields no photometry.
    • Photometry values discovered (absolute magnitude H, slope n, and phase coefficient/G when available) are persisted to the comets_orbital_elements model.

Changed (Model):

  • CometsOrbitalElements (src/deepskylog/AstronomyLibrary/Models/CometsOrbitalElements.php):
    • Exposes photometry fields in $fillable: H, n, phase_coeff, n_pre, n_post so the astronomy:updateCometPhotometry command can persist discovered values.
    • Uses name as the primary key and disables timestamps (no behavior change, documented for clarity).

Version 6.7.4

26 Nov 07:53

Choose a tag to compare

Changed:

  • Improved the astronomy:updateCometPhotometry artisan command (src/deepskylog/AstronomyLibrary/Commands/UpdateCometPhotometry.php):
    • Add configurable HTTP client verification via environment variables: AERITH_VERIFY (accepts true/false or a path to a CA bundle) and AERITH_CA_BUNDLE to allow running in environments with custom CA bundles or where verification needs disabling for troubleshooting.
    • Use a short request timeout and a browser-like User-Agent to reduce simple blocking by aerith.net.
    • Expand and harden aerith.net lookup heuristics: generate multiple candidate URLs (name-based slugs, zero-padded periodic designations such as 0103P, plain designation directories, and year-specific pages), try directory pages and prefer newest year pages when available, and fall back gracefully to directory/index pages.
    • More robust HTML parsing for photometry: scan page text nodes for H = ..., n = ... and phase coefficient patterns and persist discovered values to the comets_orbital_elements model (H, n, phase_coeff). Improved logging when photometry is found or not.
    • Improved error handling around HTTP requests (404 handling, request exception logging and continued attempts against other candidate URLs).
    • Added an SBDB fallback helper method (sbdbFallback) to query JPL's SBDB API for an H value when aerith.net scraping does not yield photometry (method included for fallback resolution).

Fixed / Notes:

  • The photometry updater is now more resilient to variation in aerith.net page layout and index pages; environments with custom CA bundles or strict SSL settings should set AERITH_VERIFY/AERITH_CA_BUNDLE appropriately.

Version 6.7.3

21 Nov 08:40

Choose a tag to compare

Fixed:

  • Renamed the photometry migration class in the publishable stub from AddPhotometryToCometsTable to AddPhotometryToCometsOrbitalElementsTable to avoid duplicate-class collisions when multiple published migration files exist in host applications. Re-publish migrations to pick up the updated class name.

Version 6.7.2

21 Nov 08:28

Choose a tag to compare

Fixed:

  • Removed a duplicated PHP block from the photometry migration stub so published migrations no longer contain two <?php tags (preventing parse errors when host apps run php artisan migrate). The corrected stub is src/database/migrations/add_photometry_to_comets_orbital_elements_table.php.stub and contains a single idempotent migration class.
  • Ensured the package publishes the photometry migration stub (service provider updated) and verified the migration is idempotent and rollback-safe.

Version 6.7.1

20 Nov 21:38

Choose a tag to compare

Changed:

  • Hardened package migrations and stubs to be idempotent: create-table stubs and data-import migrations now check Schema::hasTable/Schema::hasColumn before creating/importing to avoid "table already exists" errors when published into projects that already have the tables.
  • Fixed CreateAsteroidsOrbitalElementsTable down() method which previously dropped the wrong table name.
  • Added a publishable photometry migration stub: src/database/migrations/add_photometry_to_comets_orbital_elements_table.php.stub and updated the service provider to publish it so host apps will receive the migration via vendor:publish.
  • Made the photometry migration idempotent (guards around each added column) and made rollback safe by dropping only existing columns.

Version 6.7.0

20 Nov 21:20

Choose a tag to compare

Added:

  • Prefer DASTCOM element files for small-body orbital elements when available to reduce ambiguous designation lookups.
  • Fallback resolution using SB-CAP (small-body catalog) when DASTCOM lookups fail.
  • --used-command debug output exposed by the Horizons helper (scripts/horizons_radec.php) and included in JSON responses to aid troubleshooting.
  • Comet photometry support:
    • Runtime migration: src/deepskylog/AstronomyLibrary/Database/Migrations/2025_11_20_000001_add_photometry_to_comets_table.php (adds H, n, phase_coeff, n_pre, n_post).
    • Migration stub: src/database/migrations/add_photometry_to_comets_orbital_elements_table.php.stub.
  • Artisan command: astronomy:updateCometPhotometry (src/deepskylog/AstronomyLibrary/Commands/UpdateCometPhotometry.php) to fetch photometric parameters (attempts Seiichi Yoshida / aerith.net).
  • Command registration: AstronomyLibraryServiceProvider.php and Console/Kernel.php register the new command.
  • Model: src/deepskylog/AstronomyLibrary/Models/CometsOrbitalElements.php exposes and persists photometry fields when available.
  • README/docs: migration instructions and worked examples for comet photometry and magnitude calculations were added to readme.md.
  • Tests: unit tests covering comet photometry ingestion and Horizons-based coordinate checks were added/updated (see tests/Unit/*Comets*, CometsHorizonsTest, PlanetHorizonsDE440Test).

Changed:

  • scripts/horizons_radec.php: prefer JSON output, extract $$SOE..$$EOE blocks reliably, retry record-id resolution, prefer DASTCOM records and try SB-CAP fallback when needed, and surface the used_command used for queries.
  • Targets: photometric magnitude models and API updates implemented in src/deepskylog/AstronomyLibrary/Targets/Elliptic.php, src/deepskylog/AstronomyLibrary/Targets/Parabolic.php and src/deepskylog/AstronomyLibrary/Targets/NearParabolic.php (asteroid H–G model, comet H + 5 log10(delta) + n log10(r) with optional phase term and pre/post-perihelion exponents).
  • Planetary Horizons: optional JPL/Horizons ephemeris lookup added to src/deepskylog/AstronomyLibrary/Targets/Planet.php (uses scripts/horizons_radec.php).
  • Tests & fixtures: new DE440-based Horizons tests (tests/Unit/PlanetHorizonsDE440Test.php, tests/Unit/PrintPlanetCoordsTest.php) and updated fixtures in scripts/ (including scripts/horizons_resp_Jupiter.json, scripts/horizons_resp_Mars.json, updated scripts/horizons_resp.json, scripts/horizons_raw.txt, scripts/horizons_block.txt).
  • Commands / scheduling: UpdateOrbitalElements and related scheduling notes updated so orbital-element and photometry updates are runnable (weekly scheduling noted in readme.md).

Fixed:

  • Hardened parsing and record-resolution heuristics for Horizons responses to avoid sporadic failures when Horizons returns index pages or ambiguous matches.
  • Comet magnitude computation: hardened handling for missing photometry (falls back to sensible defaults) and correct application of pre-/post-perihelion n exponents and optional phase coefficients when present.
  • Tests: relaxed numeric assertions where appropriate and added tests that validate the new Horizons integration and photometry ingestion.

Version 6.6.0

19 Nov 08:39

Choose a tag to compare

Added:

  • scripts/horizons_radec.php — a small CLI helper that queries the JPL Horizons ephemeris service and returns structured JSON (apparent RA/Dec) for observer-based ephemerides. The helper writes optional debug artifacts to scripts/horizons_raw.txt, scripts/horizons_block.txt and scripts/horizons_resp.json to aid troubleshooting.
  • PHPUnit integration tests that exercise the Horizons helper and library integration (unit/integration tests under tests/Unit/*Horizons*).
  • docs/getting_radec.md — documentation covering how to obtain authoritative RA/Dec for small bodies using the Horizons helper and how to enable Horizons mode in Elliptic targets.

Changed:

  • Elliptic target: added a Horizons integration path — when enabled the library will invoke the helper to obtain authoritative apparent RA/Dec for observer-based ephemerides instead of using only internal propagation. Also added setters to enable Horizons mode and to provide an explicit Horizons designation.
  • Improved canonicalisation of orbital elements in Elliptic::setOrbitalElements() (angle wrapping and inclination handling) to reduce ambiguity when propagating elements.

Fixed:

  • Hardened parsing and record-resolution heuristics for Horizons responses (helper now prefers JSON output, extracts $$SOE..$$EOE blocks robustly, and retries record-id resolution when an index search is returned).

Version 6.5.1

15 Nov 21:36

Choose a tag to compare

Changed

  • Increased diamter precision for planets by removing final rounding in magnitude() (reduces 0.1 quantization in graphs). Affected: Jupiter, Mercury, Venus, Mars, Neptune, Uranus, Saturn.