rzellem / EXOTIC

EXOplanet Transit Interpretation Code
Other
85 stars 45 forks source link

Tiny Image Scale reported when users use another tool for plate solving before EXOTIC #1310

Closed ivenzor closed 4 weeks ago

ivenzor commented 1 month ago

Some users are reporting tiny image scale when using a tool for plate solve before EXOTIC (see attached image) FOV_WASP-43 b_07-MAY-2014_SquaredStretch (1)

I have located the relevant section of the code, function get_img_scale

    if wcs_file:
        wcs_hdr = fits.getheader(wcs_file)
        astrometry_scale = [key.value.split(' ') for key in wcs_hdr._cards if 'scale:' in str(key.value)]

        if astrometry_scale:
            img_scale_num = astrometry_scale[0][1]
            img_scale_units = astrometry_scale[0][2]
        else:
            wcs = WCS(wcs_hdr).proj_plane_pixel_scales()
            img_scale_num = (wcs[0].value + wcs[1].value) / 2
            img_scale_units = "arsec/pixel"

The tiny values comes from that else clause, e.g.:

img_scale Image scale in arsec/pixel: 0.0014532234679896525
img_scale_num 0.00145322346799
ivenzor commented 1 month ago

WCS(wcs_hdr).proj_plane_pixel_scales() returns the pixel scales in degrees per pixel, not arcseconds per pixel, we need to multiply by 3600 to get the correct arcsec/pixel value:

img_scale_num = ((wcs[0].value + wcs[1].value) / 2) * 3600 # Convert to arcsec/pixel I will create a PR to fix this.