Stage 10
1) Stage summary This stage determines the position of the star in each direct image.
Let’s look at an example using the two GJ1214 visits from earlier:
You can run Stage 10 first without giving any guess on where the star is located. This will save a plot showing you the direct image which you can then use to refine your guess.
Run PACMAN
Navigate to pacman_run_files and open run_pacman.py.
Comment out Stage 03 and uncomment Stage 10:
# meta = s03.run03(pcf_path=pcf_path)
meta = s10.run10(pcf_path=pcf_path)
First run
For demonstration purposes, in this first run I did not change the settings in the pcf file from a previous analysis of a different dataset:
Then run:
python run_pacman.py
The terminal should give you something like this:
Starting s10
Using Stage 03 input directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage03/s03_run_2026-05-26_12-51-37
Location of the new Stage 10 run directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage10/s10_run_2026-05-26_12-57-19
Determining Source Positions for Direct Images: 0%| | 0/8 [00:00<?, ?it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 12%|# | 1/8 [00:00<00:02, 2.34it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 25%|## | 2/8 [00:00<00:01, 3.03it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 38%|### | 3/8 [00:00<00:01, 3.41it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 50%|#### | 4/8 [00:01<00:01, 3.62it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 62%|##### | 5/8 [00:01<00:00, 3.74it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 75%|###### | 6/8 [00:01<00:00, 3.83it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 88%|####### | 7/8 [00:01<00:00, 3.89it/s]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 100%|########| 8/8 [00:02<00:00, 3.64it/s]
There is one DI per orbit.
Saving Metadata
Finished s10
We see that we got error messages that our guesses were outside of the image. To determine where the star actually is, this run saved the plots into the current Stage 10 workdir under:
stage10/s10_run_*/figs/images
You will end up with plots like this one:
You can see that our “initial guess” (the red box in the plot) was off by a lot from the star. Let’s try again with a better guess, now that we know where the star is.
Second run
By estimating by eye we can tell the star is approximately at row = 140 and col = 30. So our new guess is:
The terminal should give you something like this:
Starting s10
Using Stage 03 input directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage03/s03_run_2026-05-26_12-51-37
Location of the new Stage 10 run directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage10/s10_run_2026-05-26_13-00-32
Determining Source Positions for Direct Images: 100%|########| 8/8 [00:05<00:00, 1.38it/s]
There is one DI per orbit.
Saving Metadata
Finished s10
You will end up with plots like this one:
This time we have the star in our cutout box! A second plot shows you the best fit to the star by using a 2D gaussian.
The positions of the star in physical pixels are saved into:
stage10/s10_run_*/xrefyref.txt
================== ====== ====== ============ ================= ==================
t_bjd ivisit iorbit iorbit_cumul pos1 pos2
================== ====== ====== ============ ================= ==================
2456365.030605767 0 0 0 513.5751003519881 400.9023915133169
2456365.0933193467 0 1 1 513.5831871134241 400.9111813814192
2456365.1597948293 0 2 2 513.5639884795908 400.9423132631601
2456365.2262823465 0 3 3 513.5889400604503 400.9387251323913
2456366.626046778 1 0 4 513.5802999658981 400.8416831318307
2456366.688829974 1 1 5 513.5876981245825 400.89056794294913
2456366.755305807 1 2 6 513.6272047871058 400.8762487482847
2456366.8217931264 1 3 7 513.6367339483681 400.9059724090331
================== ====== ====== ============ ================= ==================
You might notice that the fit resulted in a target location of approximately row = 513 and col = 403 but in the plots the target is closer to row = 140 and col = 30 (estimating by eye). This is because the table accounted for the offset in X and Y to subarray start. This information can be found in the header:
Also note that you have two s10 runs in your Stage 10 directory. You can delete the first one if you want to save space. PACMAN will not use the first run for the next stages, it will automatically use the most recent one. So as long as you have the second run in there, you are good to go for the next stages.