From 9eb5678893faee9e783391364db0377b3a81e502 Mon Sep 17 00:00:00 2001 From: ivenzor Date: Tue, 26 Nov 2024 11:14:34 -0600 Subject: [PATCH] Fix mesh not to extend beyond image borders. Re-enable AAVSO comparison stars by default on Colab. --- exotic/api/colab.py | 2 +- exotic/exotic.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exotic/api/colab.py b/exotic/api/colab.py index 3b3f04ed..c7662d0f 100644 --- a/exotic/api/colab.py +++ b/exotic/api/colab.py @@ -370,7 +370,7 @@ def make_inits_file(planetary_params, image_dir, output_dir, first_image, targ_c "Observing Notes": "%s", "Plate Solution? (y/n)": "y", - "Add Comparison Stars from AAVSO? (y/n)": "n", + "Add Comparison Stars from AAVSO? (y/n)": "y", "Target Star X & Y Pixel": %s, "Comparison Star(s) X & Y Pixel": %s, diff --git a/exotic/exotic.py b/exotic/exotic.py index 70fa219c..f3961366 100644 --- a/exotic/exotic.py +++ b/exotic/exotic.py @@ -1272,7 +1272,9 @@ def aperPhot(data, starIndex, xc, yc, r=5, dr=5): def skybg_phot(data, starIndex, xc, yc, r=10, dr=5, ptol=99, debug=False): # create a crude annulus to mask out bright background pixels - xv, yv = mesh_box([xc, yc], np.round(r + dr)) + # the box will not extend beyond the borders of the image + image_height, image_width = data.shape + xv, yv = mesh_box([xc, yc], np.round(r + dr), maxx=image_width, maxy=image_height) rv = ((xv - xc) ** 2 + (yv - yc) ** 2) ** 0.5 mask = (rv > r) & (rv < (r + dr)) try: