Stage 01
1) Stage summary Next we download the locations of HST. This will be later used for the barycentric correction.
Warning
This step needs an internet connection!
2) Run PACMAN
Navigate to pacman_run_files and open run_pacman.py. Comment out Stage 00 and uncomment Stage 01:
# meta = s00.run00(pcf_path=pcf_path)
meta = s01.run01(pcf_path=pcf_path)
Then run:
python run_pacman.py
3) What happens?
PACMAN reads the most recent stage00/s00_run_* directory and creates a new timestamped Stage 01 workdir:
stage01/s01_run_YYYY-MM-DD_HH-MM-SS
The HORIZONS files are saved in:
stage01/s01_run_*/ancil/horizons
After running Stage 01 you should get an output like this:
Starting s01
Using Stage 00 input directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage00/s00_run_2026-05-26_12-33-34
Location of the new Stage 01 run directory: /Users/sebastianzieba/Desktop/Projects/Observations/Hubble/GJ1214_13021_2026/stage01/s01_run_2026-05-26_12-41-21
Retrieving Horizons file for every visit: 100%|##########| 2/2 [00:01<00:00, 1.95it/s]
Saving Metadata
Finished s01
We now accessed the HORIZONS system by JPL and downloaded a file containing the positions of HST during the observations.
The files are saved in the current Stage 01 workdir under ancil/horizons.
Two new .txt files were saved there; a Horizons file for each visit.
Each file contains the X, Y and Z position of HST relative to the solar system barycenter. The X,Y,Z positions of HST were downloaded for 5 minute intervals starting one hour before the first exposure in the observations and one hour after the observations.
For example, the first of the two horizon files should look like this (due to its length, we just display the first 100 lines):
API VERSION: 1.2
API SOURCE: NASA/JPL Horizons API
*******************************************************************************
Revised: Jun 15, 2026 Hubble Space Telescope -48
http://hubblesite.org
BACKGROUND:
Launched: April 24, 1990 [from space shuttle Discovery (STS-31)]
Deployed: April 25, 1990
NOTE: HST ephemeris data can be unreliable during times of the following
space shuttle servicing missions
Servicing Mission 1 : 1993 (December 02-14)
Servicing Mission 2 : 1997 (February 11-21)
Servicing Mission 3A: 1999 (December 19-28)
Servicing Mission 3B: 2002 (March 01-12)
Servicing Mission 4 : 2009 (May 11-25)
HUBBLE SPACE TELESCOPE:
Length : 43.5 ft (13.2 m) Weight : 24,500 lb (11,110 kg)
Maximum Diameter: 14 ft (4.2 m) Data return : ~120 Gigabytes (GB)/week
Generic orbit facts:
Altitude : 569 km, or 353 miles Inclination : 28.5 deg. to equator
Orbit period : 97 minutes Orbital speed: 28,000 kph (17500 mph)
SPACECRAFT TRAJECTORY:
The trajectory here is a concatenation of publicly released JSpOC two-line
elements. These can usually only be propagated reliably "days" into the
future, and are updated frequently to maintain accuracy.
*******************************************************************************
*******************************************************************************
Ephemeris / API_USER Mon Jun 15 06:53:18 2026 Pasadena, USA / Horizons
*******************************************************************************
Target body name: Hubble Space Telescope (spacecraft) (-48) {source: hst}
Center body name: Solar System Barycenter (0) {source: DE441}
Center-site name: BODY CENTER
*******************************************************************************
Start time : A.D. 2013-Mar-13 11:42:48.7368 TDB
Stop time : A.D. 2013-Mar-13 19:09:00.8489 TDB
Step-size : 5 minutes
*******************************************************************************
Center geodetic : 0.0, 0.0, 0.0 {E-lon(deg),Lat(deg),Alt(km)}
Center cylindric: 0.0, 0.0, 0.0 {E-lon(deg),Dxy(km),Dz(km)}
Center radii : (undefined)
Output units : KM-S
Calendar mode : Mixed Julian/Gregorian
Output type : GEOMETRIC cartesian states
Output format : 3 (position, velocity, LT, range, range-rate)
Reference frame : ICRF
*******************************************************************************
JDTDB
X Y Z
VX VY VZ
LT RG RR
*******************************************************************************
$$SOE
2456364.988064083 = A.D. 2013-Mar-13 11:42:48.7368 TDB
X =-1.476849972746460E+08 Y = 1.657369809487122E+07 Z = 7.180590092721683E+06
VX= 1.124469740120957E+00 VY=-2.245676220899436E+01 VZ=-1.440991107409014E+01
LT= 4.962948023131740E+02 RG= 1.487854386780905E+08 RR=-4.313127534136052E+00
2456364.991536306 = A.D. 2013-Mar-13 11:47:48.7368 TDB
X =-1.476849537536302E+08 Y = 1.656716248425722E+07 Z = 7.176158351496282E+06
VX=-9.118630983538658E-01 VY=-2.121219500286351E+01 VZ=-1.508138768549086E+01
LT= 4.962915170474923E+02 RG= 1.487844537802166E+08 RR=-2.184259441659198E+00
2456364.995008528 = A.D. 2013-Mar-13 11:52:48.7368 TDB
X =-1.476855791506415E+08 Y = 1.656090617028599E+07 Z = 7.171576495652867E+06
VX=-3.294660988606023E+00 VY=-2.061148350171794E+01 VZ=-1.540167705461108E+01
LT= 4.962905275153165E+02 RG= 1.487841571259333E+08 RR= 2.337262744785270E-01
2456364.998480750 = A.D. 2013-Mar-13 11:57:48.7368 TDB
X =-1.476869396743573E+08 Y = 1.655472461287610E+07 Z = 7.166955984635292E+06
VX=-5.768462207804187E+00 VY=-2.071814866150926E+01 VZ=-1.533684718111376E+01
LT= 4.962919949007825E+02 RG= 1.487845970370291E+08 RR= 2.681895732314584E+00
2456365.001952972 = A.D. 2013-Mar-13 12:02:48.7368 TDB
X =-1.476890228025485E+08 Y = 1.654840555082083E+07 Z = 7.162412267814920E+06
VX=-8.068677573636077E+00 VY=-2.151972955164883E+01 VZ=-1.489444275291370E+01
LT= 4.962958175571894E+02 RG= 1.487857430405894E+08 RR= 4.898706958098199E+00
2456365.005425194 = A.D. 2013-Mar-13 12:07:48.7368 TDB
X =-1.476917388658129E+08 Y = 1.654175173693300E+07 Z = 7.158052387132999E+06
VX=-9.950237315415565E+00 VY=-2.292961304442889E+01 VZ=-1.412240485185445E+01
LT= 4.963016426927418E+02 RG= 1.487874893722948E+08 RR= 6.648293987939666E+00
2456365.008897417 = A.D. 2013-Mar-13 12:12:48.7368 TDB
X =-1.476949309064330E+08 Y = 1.653460187947692E+07 Z = 7.153963582165676E+06
VX=-1.121356630312142E+01 VY=-2.479697631003339E+01 VZ=-1.310356195834120E+01
LT= 4.963089049494413E+02 RG= 1.487896665420814E+08 RR= 7.745405920917496E+00
2456365.012369639 = A.D. 2013-Mar-13 12:17:48.7368 TDB
X =-1.476983915652978E+08 Y = 1.652684757045135E+07 Z = 7.150204108541911E+06
VX=-1.172508178284310E+01 VY=-2.692326767310935E+01 VZ=-1.194655927160717E+01
LT= 4.963168871114777E+02 RG= 1.487920595340584E+08 RR= 8.074346480188195E+00
2456365.015841861 = A.D. 2013-Mar-13 12:22:48.7368 TDB
X =-1.477018850698271E+08 Y = 1.651844455269592E+07 Z = 7.146797167642449E+06
VX=-1.143051047788563E+01 VY=-2.908310094541235E+01 VZ=-1.077439550464584E+01
LT= 4.963247960890338E+02 RG= 1.487944305858802E+08 RR= 7.600405006950029E+00
2456365.019314083 = A.D. 2013-Mar-13 12:27:48.7368 TDB
X =-1.477051720369841E+08 Y = 1.650941732381496E+07 Z = 7.143728487755763E+06
VX=-1.036027434163702E+01 VY=-3.104744864493249E+01 VZ=-9.711730633370799E+00
You should now have a directory structure similar to this:
user
└── Desktop
└── Projects
└── Observations
└── Hubble
└── GJ1214_13021
├── pacman_run_files
│ ├── run_pacman.py
│ ├── fit_par.txt
│ └── obs_par.pcf
├── stage00
│ └── s00_run_2022-03-04_15-10-29
│ ├── fit_par.txt
│ ├── obs_par.pcf
│ ├── s00.log
│ ├── WFC3_Meta_Save.dat
│ └── filelist.txt
└── stage01
└── s01_run_2022-03-04_15-10-29
├── fit_par.txt
├── obs_par.pcf
├── s01.log
├── WFC3_Meta_Save.dat
└── filelist.txt
└── ancil
└── horizons
├── horizons_results_v0.txt
└── horizons_results_v1.txt
The next Stage uses the information in these files to convert from MJD to BJD.