# A finite star behind a planetary lens Independent scientific exercises for OGLE-2005-BLG-390. This folder runs without the SandboxPhysics repository, browser, account or protected Lab Engine. Tested with Python 3.12.12, NumPy 2.4.4, SciPy 1.17.1, and Apple clang C++ on macOS. Use Python 3.12 and a C++11 compiler; Linux compilation uses a shared object rather than a macOS dynamic library. ```sh python3 -m venv .venv . .venv/bin/activate python -m pip install -r requirements.txt python verify_package.py python fetch_observations.py --output observations python fetch_reference.py --output reference python replay_results.py --materials . --output replay-summary.json python verify_science.py --materials . --output science-summary.json ``` The two download commands need internet access. Subsequent calculations use only local files. Both downloaders reject changed byte counts or SHA-256 values. They distinguish an anonymous origin HTTP fetch from a verified cache. Never rerun a compiler against a dynamic library while another process has that library loaded; run fitting commands in sequence or use separate folders. `replay_results.py` compiles the downloaded reference and reevaluates all frozen model/profile parameter vectors on the five original tables. It refits station zero points and source fractions. Its absolute chi-square tolerance is 0.15 across numerical-library platforms; that tolerance is numerical, not a statistical uncertainty. It is a forward replay, not an optimizer search. `verify_science.py` independently reruns 110 synthetic finite-source image-area states and checks three source-size examples against separately compiled positive uniform-contour annuli. Float64 spatial envelopes are not formally outward-rounded certificates; sampled-state agreement is not a guarantee for every intermediate state. ## Run a fresh finite search ```sh python fit_event.py --materials . --output fresh-fit --maximum-evaluations 100 python fit_point_binary.py --materials . --baseline-results fresh-fit/fit-history.json --output fresh-point-source python fit_parallax.py --materials . --baseline-results fresh-fit/fit-history.json --output fresh-parallax python profile_event.py --materials . --baseline-results fresh-fit/fit-history.json --parallax-results fresh-parallax/parallax-history.json --output fresh-profiles python refine_profiles.py --materials . --profiles fresh-profiles/profile-history.json --output refined-profiles python verify_event_sensitivity.py --materials . --baseline-results fresh-fit/fit-history.json --parallax-results fresh-parallax/parallax-history.json --output sensitivity.json ``` These searches take minutes, potentially longer on other machines. Every start, stopping message, evaluation cap and active bound is kept. The internal model label `point` means one point-mass lens **with a fixed finite source**, not a zero-radius star. Separate `*-point-source` binaries really set the source radius to zero. Four finite-source starts are used per wide/close branch, plus three mass-ratio seeds per zero-radius branch and both impact signs for annual parallax. These are finite searches, not a global map of all separated solutions. The frozen aggregate results include initial failures and their continuations. For the amplitude-five parallax profile, directly rescaled neighboring starts found chi-square around 708; interpolating the geometry and direction between the good amplitude-two and amplitude-ten solutions found 217.63. The low-ratio endpoint also needed continued work. Do not mistake a bad local profile point for a physical exclusion. Expanded close-parallax searches require `fit_parallax.py --parallax-limit 30 --only-model close`; the retained capped runs were continued with `--seed-results` and `--maximum-evaluations 400`. Their best large-parallax fit is around 238.97, still above the best wide solution around 216.87. The model fixes supplied Gaussian magnitude errors and uses an independently profiled baseline and source fraction per station, constrained to fractions from zero to one. It does not rescale errors, fit correlated noise, model binary orbital motion or infer a Galaxy population posterior. The likelihood retains Gaussian normalization. Residuals are predicted minus observed magnitude. Fresh fits can follow different local paths. Compare best-found branches and profiles at rounded scientific precision; do not require byte-identical optimizer output or call an evaluation cap convergence. This exercise does not replicate the discovery paper's full 650-point data reduction or its physical mass precision. The five origin files contain 308 samples. The improvement from zero to annual wide parallax is only about 2.13 chi-square units; event timescale alone is not a mass measurement. ## Input and output conventions - Each observation has three original columns: relative day coordinate, instrumental magnitude and reported magnitude error. The dates match HJD minus 2450000 and the event chronology, but the files contain no precise time-scale or exposure header. Preserve that uncertainty; do not relabel them BJD/TDB. - Binary masses are positive and sum to one. Angular coordinates use the Einstein radius of total mass, origin at the center of mass, binary axis along positive real x, secondary on the positive side. `source_trajectory` rotates `(tau + i*impact)` by the stated angle. Source radius and separation share the same angular unit. - The normalized linear limb law is `I/mean = 1-Gamma+1.5*Gamma*sqrt(1-r*r/rho/rho)`. Mean source intensity is one. I stations use Gamma 0.538, RoboNet R uses 0.626; the unknown custom-red MOA response is tested as both. Positive annulus weights are explicitly normalized at Gamma zero, 0.538 and one. - Earth positions are JPL DE441 geometric ICRF heliocentric vectors in AU, velocities in AU/day and epochs in TDB. The retained response has 161 six-hour nodes over JD 2453570–2453610. Projection subtracts position and velocity at a fixed reference epoch. A common Earth-epoch shift also moves that reference epoch. This is a sensitivity probe, not a conversion of the original photometry's unknown time standard. - Fit parameters are `[t0, log(tE_days), impact, separation, log(mass_ratio), trajectory_angle_radians, log(source_radius)]`; annual parallax appends north and east components. Zero-radius binary histories store only the first six entries and explicitly set the physical radius to zero. Logarithms in vectors are natural logarithms. All model-level numerical digits are computation records, not claimed observational precision. - Optimizer scripts can create local row-wise prediction files for your own analysis. They must remain in your local run. The site's public materials contain only aggregate fitted quantities, profiles, diagnostics and independently generated synthetic states. ## Sources and permissions The exact five photometry URLs, bytes, row counts and SHA-256 values are in `observation-sources.json`. They are published by the OGLE author project, not live EWS products. An explicit redistribution license was not found, so no original or transformed photometry is included. The named downloader fetches the files directly from `ogle.astrouw.edu.pl` under `SandboxPhysics-Public-Tutorial/1.0`. `reference-sources.json` pins VBBinaryLensing commit `1b2ee9608373e50c28110f27347b1c31a004372c`. Its source and LGPL-3.0 license are obtained directly from the named upstream repository. The package contains our separate caller, not upstream source or a compiled binary. Keep the downloaded license with that reference. Methods: Bozza et al. 2018, DOI 10.1093/mnras/sty1791. Discovery: Beaulieu et al. 2006, astro-ph/0601563v1. Earth vectors: NASA/JPL Horizons; preserve the complete response and provenance file. The newly authored standalone science code is MIT licensed in `LICENSE-science.txt`. `package-manifest.json` lists exact package inputs. `aggregate-results.json` retains finite searches and failed attempts; `event-forward-reference-results.json` independently checks all 308 fitted predictions in four difficult models without redistributing row-wise observations. `event-sensitivity-results.json` keeps fixed-geometry, nuisance-refitted sensitivity tests; hypothetical exposures do not supply missing metadata. `synthetic-*` files contain our simulated states, not observed photometry. To fetch the site ZIP without an authenticated browser: ```sh curl --fail --location --user-agent 'SandboxPhysics-Public-Tutorial/1.0' \ 'https://sandboxphysics.com/stories/microlensing-planets/materials/microlensing-science.zip' \ --output microlensing-science.zip ```