Stage 10
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.
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:
The terminal should give you something like this:
Successfully reloaded meta file
Starting s10
Determining Source Positions for Direct Images: 8%|8 | 1/8 [00:01<00:15, 1.45s/it]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 17%|#6 | 2/8 [00:02<00:13, 1.36s/it]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 25%|##5 | 3/8 [00:03<00:11, 1.26s/it]
Your guess for di_rmax is outside of the image.
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 42%|####1 | 5/8 [00:05<00:07, 1.14s/it]
Your guess for di_rmax is outside of the image.
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 58%|#####8 | 7/8 [00:07<00:05, 1.10s/it]
Your guess for di_rmax is outside of the image.
Determining Source Positions for Direct Images: 100%|#########| 8/8 [00:08<00:04, 1.11s/it]
Your guess for di_rmax is outside of the image.
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 images as plots into a new directory: run directory + /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:
Successfully reloaded meta file
Starting s10
Determining Source Positions for Direct Images: 100%|#| 8/8 [00:06<00:00, 1.26i
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 then saved into a new file called 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: