Skip to content

Feature/astrometry for testing - #1

Open
AmberLee2427 wants to merge 47 commits into
acrisp3:devfrom
AmberLee2427:feature/astrometry-for-testing
Open

Feature/astrometry for testing#1
AmberLee2427 wants to merge 47 commits into
acrisp3:devfrom
AmberLee2427:feature/astrometry-for-testing

Conversation

@AmberLee2427

@AmberLee2427 AmberLee2427 commented Dec 26, 2025

Copy link
Copy Markdown

See docuentation/source/astrometry.rst for details on what was added and how to run it.

I don't think this works with multi-lenses and multi-sources turned on at the same time.

I haven't run a smoke test but I'm falling asleep, so it will have to wait until tomorrow. The math looks correct to read; the centroids are blended and the noise follows Gould & Yee (2014). The syntax might be cooked, but that should be obvious because something won't run properly.

If you run a quick set, we can look closer for any tomfoolery. I'll run a very quick smoke test tomorrow.

Let me know if you have merge dramas with your local branch.

Pull request overview

This PR implements basic astrometry functionality for the gulls microlensing simulator. The implementation adds the ability to compute and output centroid positions of lensed sources in the lens frame, including proper error modeling based on photometric precision and seeing conditions. The feature enables astrometric simulations using the VBM (Variable Brightness Method) low-level functions with noise approximations from Gould & Yee (2014).

Key changes:

  • Added two new configuration parameters (ASTROMETRY_ON and ASTROMETRIC_SYS_FLOOR) to control astrometry calculations
  • Renamed Asrc1/Asrc2 variables to musrc1/musrc2 for consistency with magnification nomenclature
  • Implemented centroid calculation for single and binary source configurations with flux-weighted blending
Show a summary per file
File Description
src/structures.h Added astrometry control parameters to filekeywords struct; renamed source magnification vectors from Asrc to musrc
src/readParamfile.cpp Added parsing for new astrometry configuration parameters (ASTROMETRY_ON, ASTROMETRIC_SYS_FLOOR)
src/timeSequencer.cpp Updated memory allocation to use renamed musrc1/musrc2 vectors
src/pllxLightcurveGeneratorMultiple.cpp Enabled VBM astrometry output; stored centroid positions during lightcurve generation; fixed sprintf to snprintf
src/pllxLightcurveGenerator.cpp Enabled VBM astrometry output; implemented flux-weighted centroid blending for binary sources; stored positions during lightcurve generation
src/photometry.cpp Implemented Gould & Yee (2014) astrometric error model; added flux-weighted blending with lens/background stars; applied Gaussian noise to centroids
src/outputLightcurve.cpp Updated output to use renamed musrc1/musrc2 magnification values
documentation/source/astrometry.rst New comprehensive documentation describing astrometry parameters, coordinate systems, noise model, and affected files
documentation/gulls_documentation.md Moved vestigial user documentation for gulls simulator installation and usage into documentation/
README.md Added brief description of new astrometry feature

- Implemented astrometric error calculations based on photometric precision in `photometry.cpp`.
- Updated `lightcurveGenerator.cpp` and `pllxLightcurveGeneratorMultiple.cpp` to handle centroid information for multiple sources.
- Introduced new parameters for astrometry in `readParamfile.cpp` and `structures.h` to control astrometric features.
- Added documentation for new astrometric functionalities and parameter configurations.
@AmberLee2427
AmberLee2427 marked this pull request as draft December 26, 2025 12:07
@AmberLee2427
AmberLee2427 marked this pull request as ready for review December 26, 2025 12:08
AmberLee2427 and others added 22 commits December 27, 2025 04:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Guard against division by zero in astrometry calculations
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
@AmberLee2427

Copy link
Copy Markdown
Author

It's tomorrow and I did in fact drop a bracket in photometry.cpp. CI runs without anything suspicious in the logs now, but I didn't tell it to upload artifacts on a success. So I still need to do a sanity-check run and peruse the outputs.

@AmberLee2427

Copy link
Copy Markdown
Author

lightcurves look normal without astrometry on

Copilot AI and others added 4 commits December 27, 2025 13:11
- Extract gulls version from executable output
- v2.1.0 validates minimal lens-frame columns (x_centroid, y_centroid, etc.)
- v2.2.0+ validates full sky-frame columns (true_N_centroid_mas, etc.)
- Skip astrometry plotting for v2.1.0 (lens-frame only)

Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
Make smoke test astrometry validation version-aware for v2.1.0 vs v2.2.0+
@AmberLee2427

Copy link
Copy Markdown
Author

bugger. exited with -11. I feel like I've had this error before but I don't know what it means. This might take me a while to fix

@AmberLee2427

Copy link
Copy Markdown
Author

I think it's PSF dramas. It might work for your run set-up.

Copilot AI and others added 5 commits December 30, 2025 08:09
…culation

Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
…ed; normalize base paths in parameter file reading
Fix segfault from incorrect loop bound in photometry companion flux calculation
@AmberLee2427

AmberLee2427 commented Dec 30, 2025

Copy link
Copy Markdown
Author

It was a bad loop. Just me miss-understanding parameters in Event.

I merged with your dev and my CI was not happy. I'm just getting them to play nice now.

Copilot AI and others added 2 commits December 30, 2025 08:54
Co-authored-by: AmberLee2427 <26697369+AmberLee2427@users.noreply.github.com>
@AmberLee2427

Copy link
Copy Markdown
Author

Missing bracket again. I hate C.

@AmberLee2427

Copy link
Copy Markdown
Author

Tentatively, I think this is good now. It's going to need a more complete sample and a sanity check from Matt.

Smoke Test Results

This release was validated with automated smoke tests. The plots below show sample lightcurves generated by the different Gulls executables:

smoke_croin_0_0_0.all_astrometry_plot.png

smoke_croin_0_0_0.all_astrometry_plot.png

smoke_croin_0_0_0.all_plot.png

smoke_croin_0_0_0.all_plot.png

smoke_croin_binary_0_0_0.det_astrometry_plot.png

smoke_croin_binary_0_0_0.det_astrometry_plot.png

smoke_croin_binary_0_0_0.det_plot.png

smoke_croin_binary_0_0_0.det_plot.png

smoke_fish_0_0_0.all_astrometry_plot.png

smoke_fish_0_0_0.all_astrometry_plot.png

smoke_fish_0_0_0.all_plot.png

smoke_fish_0_0_0.all_plot.png

smoke_fish_binary_0_0_0.det_astrometry_plot.png

smoke_fish_binary_0_0_0.det_astrometry_plot.png

smoke_fish_binary_0_0_0.det_plot.png

smoke_fish_binary_0_0_0.det_plot.png

smoke_std_0_0_0.all_astrometry_plot.png

smoke_std_0_0_0.all_astrometry_plot.png

smoke_std_0_0_0.all_plot.png

smoke_std_0_0_0.all_plot.png

smoke_std_binary_0_0_0.det_astrometry_plot.png

smoke_std_binary_0_0_0.det_astrometry_plot.png

smoke_std_binary_0_0_0.det_plot.png

smoke_std_binary_0_0_0.det_plot.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants