Releases: DeepskyLog/laravel-astronomy-library
Releases · DeepskyLog/laravel-astronomy-library
Version 6.7.7
- Artisan command
astronomy:updateOrbitalElements(src/deepskylog/AstronomyLibrary/Commands/UpdateOrbitalElements.php): downloads JPL small-body element files (ELEMENTS.COMETandELEMENTS.NUMBR), parses comet and asteroid orbital elements and imports them into theCometsOrbitalElementsandAsteroidsOrbitalElementsmodels. 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
Update to use laravel 13.
v6.7.5: Improve comet photometry extraction and add robust SBDB fallback
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, slopen, and phase coefficient/G when available) are persisted to thecomets_orbital_elementsmodel.
Changed (Model):
CometsOrbitalElements(src/deepskylog/AstronomyLibrary/Models/CometsOrbitalElements.php):- Exposes photometry fields in
$fillable:H,n,phase_coeff,n_pre,n_postso theastronomy:updateCometPhotometrycommand can persist discovered values. - Uses
nameas the primary key and disables timestamps (no behavior change, documented for clarity).
- Exposes photometry fields in
Version 6.7.4
Changed:
- Improved the
astronomy:updateCometPhotometryartisan command (src/deepskylog/AstronomyLibrary/Commands/UpdateCometPhotometry.php):- Add configurable HTTP client verification via environment variables:
AERITH_VERIFY(acceptstrue/falseor a path to a CA bundle) andAERITH_CA_BUNDLEto 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-Agentto reduce simple blocking byaerith.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 thecomets_orbital_elementsmodel (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 anHvalue when aerith.net scraping does not yield photometry (method included for fallback resolution).
- Add configurable HTTP client verification via environment variables:
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_BUNDLEappropriately.
Version 6.7.3
Fixed:
- Renamed the photometry migration class in the publishable stub from
AddPhotometryToCometsTabletoAddPhotometryToCometsOrbitalElementsTableto 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
Fixed:
- Removed a duplicated PHP block from the photometry migration stub so published migrations no longer contain two
<?phptags (preventing parse errors when host apps runphp artisan migrate). The corrected stub issrc/database/migrations/add_photometry_to_comets_orbital_elements_table.php.stuband 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
Changed:
- Hardened package migrations and stubs to be idempotent: create-table stubs and data-import migrations now check
Schema::hasTable/Schema::hasColumnbefore creating/importing to avoid "table already exists" errors when published into projects that already have the tables. - Fixed
CreateAsteroidsOrbitalElementsTabledown()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.stuband updated the service provider to publish it so host apps will receive the migration viavendor:publish. - Made the photometry migration idempotent (guards around each added column) and made rollback safe by dropping only existing columns.
Version 6.7.0
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-commanddebug 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(addsH,n,phase_coeff,n_pre,n_post). - Migration stub:
src/database/migrations/add_photometry_to_comets_orbital_elements_table.php.stub.
- Runtime migration:
- Artisan command:
astronomy:updateCometPhotometry(src/deepskylog/AstronomyLibrary/Commands/UpdateCometPhotometry.php) to fetch photometric parameters (attempts Seiichi Yoshida /aerith.net). - Command registration:
AstronomyLibraryServiceProvider.phpandConsole/Kernel.phpregister the new command. - Model:
src/deepskylog/AstronomyLibrary/Models/CometsOrbitalElements.phpexposes 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..$$EOEblocks reliably, retry record-id resolution, prefer DASTCOM records and try SB-CAP fallback when needed, and surface theused_commandused for queries.- Targets: photometric magnitude models and API updates implemented in
src/deepskylog/AstronomyLibrary/Targets/Elliptic.php,src/deepskylog/AstronomyLibrary/Targets/Parabolic.phpandsrc/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(usesscripts/horizons_radec.php). - Tests & fixtures: new DE440-based Horizons tests (
tests/Unit/PlanetHorizonsDE440Test.php,tests/Unit/PrintPlanetCoordsTest.php) and updated fixtures inscripts/(includingscripts/horizons_resp_Jupiter.json,scripts/horizons_resp_Mars.json, updatedscripts/horizons_resp.json,scripts/horizons_raw.txt,scripts/horizons_block.txt). - Commands / scheduling:
UpdateOrbitalElementsand related scheduling notes updated so orbital-element and photometry updates are runnable (weekly scheduling noted inreadme.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
nexponents 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
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 toscripts/horizons_raw.txt,scripts/horizons_block.txtandscripts/horizons_resp.jsonto 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 inElliptictargets.
Changed:
Elliptictarget: 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
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.