What actually happens behind the scenes when ChatGPT helps process exoplanet observations? A detailed account of my October 6 experiment
I recently used ChatGPT/Codex to help calibrate, reduce, and analyze two exoplanet observing sequences acquired on October 6, 2026, at The Maury Lewin Astronomical Observatory: TOI-1516 b and Kepler-695 b , observed with my Celestron C14 EdgeHD and ZWO ASI2600MM Pro.
I wanted to explain what happened behind the scenes, including the actual software used. Saying âAI processed my observationsâ leaves out most of the information needed to evaluate or reproduce the work.
In this experiment, ChatGPT/Codex served as the interface and programming assistant. It retrieved files, wrote and executed Python scripts, selected and configured scientific libraries, inspected results, and produced reports. The calibration, photometry, time conversions, and transit calculations were performed by executable software operating on the FITS images.
The analysis used a custom Python workflow. It did not run AstroImageJ, EXOTIC, PixInsight, ASTAP, or Astrometry.net. Those distinctions matter because the reader should know precisely which methods produced the measurements.
1. Getting the observations into the analysis environment
I supplied the Google Drive folder containing the observations:
G:\My Drive\The Maury Lewin Observatory\C-14\October 6th 2026
The Google Drive connector returned file information in JSON format . This was an inventory containing filenames, identifiers, byte sizes, and information needed to retrieve the files.
The JSON was not the astronomical image data. The scientific input consisted of the actual FITS files , including their pixel arrays and headers.
An initial folder listing returned only 100 items. The retrieval was repeated with a larger listing limit, producing an inventory of 824 items:
- 750 TOI-1516 b science exposures of 15 seconds each.
- 41 Kepler-695 b science exposures of 300 seconds each.
- 10 bias frames.
- 10 dark frames of 300 seconds.
- 10 flat frames of 20 seconds.
- Two reference images.
- One additional folder.
The 821 FITS files were downloaded using Python and curl , with concurrent downloads and retries. Each downloaded fileâs byte size was checked against the Drive inventory.
That check established that the local downloads had the expected sizes. It was a transfer check, not a claim that every pixel or header entry had been independently validated.
2. Reading the FITS headers and examining the calibration material
The workflow used Astropyâs FITS interface , astropy.io.fits , to read image arrays and observing metadata.
The headers identified the C14 EdgeHD, ASI2600MM Pro, R filter, 2Ă2 binning, gain 50, offset 25, and a science-frame temperature of approximately â12°C.
The calibration frames were examined before use. This revealed an important problem: the original 20-second flat frames were saturated, with their pixels at 65,535 ADU. These frames could not provide a useful measurement of relative sensitivity across the detector.
I subsequently supplied five 5-second flat frames. Their median signal was approximately 27,300 ADU, and they were not saturated. They matched the science data in filter, binning, gain, offset, and recorded rotator angle.
There were still qualifications: the replacement flats were taken at approximately â10°C, and their recorded focus position differed from that of the science frames. Those differences were documented rather than treated as perfect calibration matches.
This is one example of why a reduction needs inspection of the actual data. A folder containing files named âFLATâ does not establish that those files are usable.
3. Identifying the target and comparison stars
The astrometric identification used three principal components:
- Astroquery/VizieR to retrieve Gaia DR3 catalog stars.
- Photutils , specifically
DAOStarFinder , to detect stars in the images.
- Astroalign to match stellar patterns between catalog coordinates and detector coordinates.
The catalog positions were projected into approximate local sky coordinates. Astroalign then matched patterns of stars and calculated a transformation into image-pixel coordinates.
The resulting solution located each target and provided detector positions for potential comparison stars. The matching reported 29 stars for the TOI field and 48 for the Kepler field, with positional residuals of approximately 1.53 and 1.27 pixels, respectively.
There is an important technical qualification here: this was catalog-based star identification and a sky-to-detector coordinate transformation . It did not produce and write a complete conventional WCS solution into the FITS headers.
It therefore should not be described as having run an ASTAP or Astrometry.net plate solve. The method was sufficient to identify the stars used in the photometry, but its purpose and output were narrower than a full astrometric reduction.
4. Calibrating the science images
Calibration was performed using NumPy and custom Python code .
The process was:
- Median-combine the bias frames to create a master bias.
- Median-combine the 300-second dark frames.
- Subtract the master bias from the master dark and divide by 300 seconds to obtain a dark signal per second.
- Subtract bias and the scaled dark contribution from each replacement flat.
- Normalize each flat, then median-combine them into a normalized master flat.
- Apply the calibration to each science exposure.
The science-frame calculation was:
[ I_{\mathrm{calibrated}} = \frac{I_{\mathrm{raw}}-B-tD}{F} ]
Here, (B) is the master bias, (D) is the estimated dark signal per second, (t) is the exposure duration, and (F) is the normalized master flat.
The 300-second Kepler exposures had matching-duration dark frames. The 15-second TOI exposures and 5-second flats used the dark signal scaled from the 300-second darks.
That scaling is an assumption of this reduction. There were no matching 15-second darks or 5-second flat darks in the material used. The reports disclosed this limitation, along with the flat temperature and focus differences.
The raw FITS images were preserved.
5. Following the stars as the field moved
The workflow could not assume that each star remained at the same pixel position throughout the night.
The TOI sequence showed substantial movement across the detectorâroughly 148 pixels in one coordinate and 185 in the other. The Kepler sequence moved by approximately one pixel.
An initial extraction using fixed coordinates was inadequate for the moving TOI field. The workflow was corrected to register the individual frames before measuring the stars.
Registration used scikit-imageâs phase_cross_correlation on downsampled, logarithmically transformed images. This estimated each frameâs shift relative to a reference frame.
The estimated shift moved the target and comparison-star positions into the current frame. Local intensity-weighted centroids then refined the positions.
This matters because an aperture that does not follow a moving star can produce a light curve dominated by extraction errors. Tracking the field was an essential part of the reduction.
6. Measuring stellar flux and building differential light curves
Photometry used custom Python/NumPy routines with circular apertures.
The workflow tested three aperture radii:
- 8 pixels.
- 10 pixels.
- 12 pixels.
For each star, the local background was estimated in an annulus between 20 and 30 pixels from its center. A three-sigma rejection step removed outlying sky pixels before calculating the background level.
The code summed the aperture pixels and subtracted the estimated sky contribution. It also calculated approximate per-star flux uncertainties using the stellar signal, camera gain, and measured background scatter.
Up to 20 comparison-star candidates were considered. Five comparison stars were selected using their out-of-transit scatter. Each comparison light curve was normalized, and the median of the normalized comparisons formed the reference ensemble.
The target flux was divided by that ensemble to produce the differential light curve.
An additional check star was examined separately. The analysis also tested how the fitted result changed with aperture size and with individual comparison stars removed.
These checks are useful because the result should not depend excessively on one aperture choice or one comparison star.
A qualification is that choosing comparison stars from the same observing sequence is itself an analysis decision. It does not prove that all remaining systematic effects have been removed.
7. Converting the observation times
The time conversion used Astropyâs Time , EarthLocation , and SkyCoord classes .
The FITS MJD-AVG values supplied the mid-exposure UTC timestamps. Those were converted to BJD_TDB , including the barycentric light-travel-time correction for the targetâs direction.
This step is essential when comparing observed transit timing with predictions stated in BJD_TDB. UTC timestamps and barycentric dynamical timestamps cannot simply be substituted for one another.
The calculation used the recorded observatory latitude and longitude. An elevation of 0 meters was used because the actual elevation had not been verified within this analysis; that assumption was documented.
8. Modeling the transit and including limb darkening
Transit models were calculated with batman-package .
The fits used:
- A circular orbit.
- Quadratic limb darkening.
- Numerical integration over each exposure, using a supersampling factor of 11.
- A baseline consisting of an intercept and a linear trend with time.
The quadratic limb-darkening law was:
[ \frac{I(\mu)}{I(1)} = 1-u_1(1-\mu)-u_2(1-\mu)^2 ]
The nominal coefficients were:
| Target |
(u_1) |
(u_2) |
Source used |
| TOI-1516 b |
0.21 |
0.34 |
R-band ground-based fit reported by Sonbas and collaborators |
| Kepler-695 b |
0.5394 |
0.1709 |
Interpolation of Claret & Bloemen R-band ATLAS tables |
The Kepler interpolation used the adopted stellar effective temperature, surface gravity, metallicity, and a microturbulence value of 2 km/s. The table retrieval used Astroquery/VizieR, and the interpolation used SciPyâs LinearNDInterpolator .
The nominal transit fits were optimized with SciPyâs optimize.least_squares . Fitted quantities included the transit midpoint, planet-to-star radius ratio, scaled orbital separation, impact parameter, and baseline parameters.
Including limb darkening matters because the brightness of the stellar disk changes from center to edge. A physically modeled transit therefore has a different shape from a simple rectangular dip, especially during ingress and egress.
9. Estimating uncertainty and testing the result
The analysis used 250 moving-block residual bootstrap trials .
Residuals were resampled in blocks of approximately five minutes, with at least two points per block. The purpose was to retain some of the short-timescale correlation in the residuals rather than treating every point as independent.
The bootstrap also varied the limb-darkening coefficients and refitted the transit. The adopted coefficient perturbations were:
- TOI-1516 b: standard deviations of 0.03 and 0.04.
- Kepler-695 b: standard deviations of 0.05 and 0.05.
The actual timestamps and gaps remained part of the fitting procedure.
Additional checks included:
- Changing aperture size.
- Removing individual comparison stars.
- Examining the independent check star.
- Comparing the transit fit with a linear baseline-only model using BIC.
- Comparing reductions with and without flat-field correction.
This was a bootstrap-based uncertainty analysis. It was not an MCMC run or a full Bayesian posterior calculation.
The resulting uncertainties describe the variation captured by this procedure. They do not guarantee coverage of every possible calibration error, baseline error, or model assumption.
10. Comparing observed and predicted transit properties
The fitted models were used to derive transit midpoint, first and fourth contact times, duration, and modeled depth.
First contact, (T_1), is the beginning of ingress. Fourth contact, (T_4), is the end of egress. The ingress and egress intervals also involve second and third contacts, (T_2) and (T_3); these should not be confused with a single timestamp.
The observing-planner image supplied predicted start, midpoint, end, and depth values. Those predictions were compared with the fitted values on a consistent time basis.
For TOI-1516 b, the final analysis gave approximately:
| Quantity |
Observed result |
Difference from supplied planner |
| Modeled depth |
(18.57 \pm 0.71) ppt |
Planner depth: 17.5 ppt |
| Midpoint |
BJD_TDB 2461320.952777 |
(+1.26 \pm 1.55) minutes |
| First contact |
BJD_TDB 2461320.891265 |
(-4.23 \pm 4.22) minutes |
| Fourth contact |
BJD_TDB 2461321.014290 |
(+6.75 \pm 3.73) minutes |
One ppt is a 0.1% change in normalized flux, so the fitted TOI depth was approximately 1.86%.
The flat correction affected the result: the TOI fitted depth was approximately 19.98 ppt without the replacement flat correction and 18.57 ppt with it. That difference provides a concrete example of calibration affecting the scientific measurement.
The Kepler-695 b sequence was much less conclusive. Its fitted depth was approximately (26.3 \pm 17.0) ppt, compared with a planner depth of 11.4 ppt. The transit model improved BIC by only about 3 relative to the linear baseline model.
The Kepler timing and depth results were therefore reported as exploratory. The large uncertainties and weak model preference do not support a secure claim of an anomalous transit depth or a transit-timing variation. The fitted grazing geometry also left second and third contact unresolved.
A fit returning numerical values is not, by itself, evidence that those values are scientifically well constrained.
11. Producing the plots, reports, and reproducibility package
Matplotlib generated the light curves, model overlays, diagnostic plots, field images with target and comparison-star labels, and calibration illustrations.
ReportLab generated three PDF reports:
- A scientific report describing the reduction, models, comparisons, uncertainties, and limitations.
- A STEM report explaining the observations and analysis more accessibly.
- An AAVSO-oriented report organizing the observational and analysis information.
The PDFs were rendered with PyMuPDF and Poppler for visual checks. Pillow was used for image assembly and contact sheets.
The analysis exported several complementary file types:
- CSV: numerical light-curve tables.
- NPZ: compressed numerical arrays.
- JSON: coordinates, settings, fit results, and summaries.
- Python scripts: the executable reduction and analysis workflow.
- PDF and image files: reports and figures.
Pythonâs zipfile module assembled the analysis package. The purpose was to provide material that another person could inspect and use to reproduce the work, rather than asking them to accept a report without the underlying calculations.
The main processing sequence was:
inventory.json â solve_gaia.py â photometry.py â final_fit.py â enrich.py â reports.py
12. The software versions recorded for this run
| Software |
Version |
Principal role |
| NumPy |
2.3.5 |
Array calculations, calibration, photometry, resampling |
| SciPy |
1.17.0 |
Optimization, interpolation, supporting calculations |
| Astropy |
8.0.1 |
FITS access, astronomical coordinates, time conversion |
| Photutils |
3.0.0 |
Star detection |
| Astroalign |
2.6.2 |
Stellar-pattern matching |
| batman-package |
2.5.3 |
Limb-darkened transit models |
| ReportLab |
4.4.9 |
PDF generation |
Other components included Astroquery, scikit-image, Matplotlib, Pillow, PyMuPDF, Poppler, curl , and Pythonâs standard-library tools.
NINA was the acquisition software recorded in the FITS headers. The numerical reduction ran on the analysis environmentâs CPU; it did not use my observatory computerâs RTX 3090 GPU.
What I think this experiment demonstrates
My interest is in whether a conversational AI can help an observer construct, execute, document, and examine a scientific reduction using established computational tools.
In this case, the work included discovering saturated flats, replacing them with usable calibration data, correcting the extraction to follow a drifting field, applying barycentric time conversion, fitting limb-darkened transit models, testing sensitivity to reduction choices, and distinguishing a comparatively well-constrained result from a weak one.
Those are concrete operations that can be inspected in code and numerical outputs.
The experiment also shows why detailed disclosure matters. âAI analyzed itâ says very little. A useful account identifies the input files, calibration assumptions, software, photometric method, timing convention, model, uncertainty procedure, and limitations.
For an independent assessment, I would want another reduction of the same framesâpotentially in AstroImageJ or another established pipelineâand a comparison of the extracted light curves, timing, depth, and uncertainties. Agreement would strengthen confidence; disagreement would provide a specific problem to investigate.
I welcome technical comments on the actual choices made here, particularly dark scaling, comparison-star selection, baseline modeling, limb-darkening assumptions, and the treatment of correlated noise. Those are the kinds of questions that can improve this experiment and help determine where this approach is useful.
â Pablo Lewin
The Maury Lewin Astronomical Observatory