Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative aperture values & Negative Pixel Scale in FOV plots #1348

Open
ivenzor opened this issue Nov 19, 2024 · 2 comments · May be fixed by #1349
Open

Negative aperture values & Negative Pixel Scale in FOV plots #1348

ivenzor opened this issue Nov 19, 2024 · 2 comments · May be fixed by #1349
Assignees
Labels
bug Something isn't working

Comments

@ivenzor
Copy link
Contributor

ivenzor commented Nov 19, 2024

In exotic a negative aperture is used to mark that no comparison stars is being used. When reporting the aperture in those cases, the negative aperture is converted to positive using abs:

            if photometry_info['min_aperture'] == 0:  # psf
                log_info(f"Best Comparison Star: #{photometry_info['comp_star_num']}")
                log_info(f"Minimum Residual Scatter: {round(photometry_info['min_std'] * 100, 4)}%")
                log_info("Optimal Method: PSF photometry")
            elif photometry_info['min_aperture'] < 0:  # no comp star
                log_info("Best Comparison Star: None")
                log_info(f"Minimum Residual Scatter: {round(photometry_info['min_std'] * 100, 4)}%")
                log_info(f"Optimal Aperture: {abs(np.round(photometry_info['min_aperture'], 2))}")
                log_info(f"Optimal Annulus: {np.round(photometry_info['min_annulus'], 2)}")
            else:
                log_info(f"Best Comparison Star: #{photometry_info['comp_star_num']}")
                log_info(f"Minimum Residual Scatter: {round(photometry_info['min_std'] * 100, 4)}%")
                log_info(f"Optimal Aperture: {np.round(photometry_info['min_aperture'], 2)}")
                log_info(f"Optimal Annulus: {np.round(photometry_info['min_annulus'], 2)}")
            log_info("*********************************************\n")

Another example:

        #######################################################################
        # print final extracted planetary parameters
        #######################################################################

        log_info("\n*********************************************************")
        log_info("FINAL PLANETARY PARAMETERS\n")
        log_info(f"          Mid-Transit Time [BJD_TDB]: {round_to_2(myfit.parameters['tmid'], myfit.errors['tmid'])} +/- {round_to_2(myfit.errors['tmid'])}")
        log_info(f"  Radius Ratio (Planet/Star) [Rp/R*]: {round_to_2(myfit.parameters['rprs'], myfit.errors['rprs'])} +/- {round_to_2(myfit.errors['rprs'])}")
        log_info(f"           Transit depth [(Rp/R*)^2]: {round_to_2(100. * (myfit.parameters['rprs'] ** 2.))} +/- {round_to_2(100. * 2. * myfit.parameters['rprs'] * myfit.errors['rprs'])} [%]")
        log_info(f"           Orbital Inclination [inc]: {round_to_2(myfit.parameters['inc'], myfit.errors['inc'])} +/- {round_to_2(myfit.errors['inc'])}")
        log_info(f"               Airmass coefficient 1: {round_to_2(myfit.parameters['a1'], myfit.errors['a1'])} +/- {round_to_2(myfit.errors['a1'])}")
        log_info(f"               Airmass coefficient 2: {round_to_2(myfit.parameters['a2'], myfit.errors['a2'])} +/- {round_to_2(myfit.errors['a2'])}")
        log_info(f"                    Residual scatter: {round_to_2(100. * np.std(myfit.residuals / np.median(myfit.data)))} %")
        if fitsortext == 1:
            if photometry_info['min_aperture'] >= 0:
                log_info(f"                Best Comparison Star: #{bestCompStar} - {comp_coords}")
            else:
                log_info("                 Best Comparison Star: None")
            if photometry_info['min_aperture'] == 0:
                log_info("                       Optimal Method: PSF photometry")
            else:
                log_info(f"                    Optimal Aperture: {abs(np.round(photometry_info['min_aperture'], 2))}")
                log_info(f"                     Optimal Annulus: {np.round(photometry_info['min_annulus'], 2)}")
        log_info(f"              Transit Duration [day]: {round_to_2(np.mean(durs), np.std(durs))} +/- {round_to_2(np.std(durs))}")
        log_info("*********************************************************")

However when printing the FOV plot, the raw min_aperture is used and as a result the plot can show a negative aperture value when photometry_info['min_aperture'] < 0 which is confusing:

            plot_fov(photometry_info['min_aperture'], photometry_info['min_annulus'], sigma,
                     centroid_positions['x_targ'][0], centroid_positions['y_targ'][0],
                     centroid_positions['x_ref'][0], centroid_positions['y_ref'][0],
                     firstImage, img_scale_str, pDict['pName'], exotic_infoDict['save'], exotic_infoDict['date'], opt_method, min_aper_fov, min_annulus_fov)

image (1)

@ivenzor
Copy link
Contributor Author

ivenzor commented Nov 20, 2024

@ivenzor
Copy link
Contributor Author

ivenzor commented Nov 22, 2024

This issue has been extended to indlude the negative pixel values reported in the FOV plots:

DARK FRAME 1 STATISTICS:
Min value: 512
Max value: 4095
Mean value: 4078.89
Median value: 4095.00

DARK FRAME 2 STATISTICS:
Min value: 174
Max value: 3141
Mean value: 289.19
Median value: 289.00

GENERAL DARK STATISTICS:
Min value: 343.5
Max value: 3618.0
Mean value: 2184.04
Median value: 2192.00

RAW FIRST IMAGE STATISTICS:
Min value: 215
Max value: 4095
Mean value: 386.43
Median value: 385.00

FIRST IMAGE AFTER CALIBRATION STATISTICS:
Min value: -3231.0
Max value: 1905.0
Mean value: -1797.61
Median value: -1807.50

@tamimfatahi tamimfatahi added the bug Something isn't working label Nov 24, 2024
@ivenzor ivenzor changed the title Negative aperture values in FOV plots. Negative aperture values & Negative Pixel Scale in FOV plots Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants