rzellem / EXOTIC

EXOplanet Transit Interpretation Code
Other
86 stars 45 forks source link

Negative aperture values in FOV plots. #1348

Open ivenzor opened 4 days ago

ivenzor commented 4 days ago

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 commented 3 days ago

https://uol-ets.slack.com/archives/CKUNBCY2K/p1731980152315939

ivenzor commented 1 day ago

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