spino.pipeline.phase_telluric_plot module

Telluric Position Plot

Adds a per-event diagnostic page to the phase scheduler’s per-event PDFs.

Everything on the page is in the Earth frame, where tellurics sit at 0 km/s:
  • the telluric cross-correlation, i.e. the sky-transmission spectrum correlated with itself over an RV grid (peak at 0 km/s);

  • the same curve translated by vtot = vsys − ⟨vbary⟩, which is where the stellar lines fall when observed from the ground;

  • the planetary RV, whose orbital solution comes from phase_kepler (circular, Keplerian, or an envelope over all ω when the argument of periastron is unknown), with the circular approximation drawn alongside it for comparison whenever the orbit is eccentric.

Synthetic exposures (1 h before window start → 1 h after window end at 300 s cadence) are generated to estimate ⟨vbary⟩ via astropy’s SkyCoord.radial_velocity_correction.

spino.pipeline.phase_telluric_plot.compute_synthetic_exposure_times(event, exp_time_s=300.0, pad_hours=1.0)[source]

Locate the in-event time interval and return a uniform Time grid sampling [t_start − pad, t_end + pad] every exp_time_s seconds.

Returns:

times – UTC times of the synthetic exposure midpoints.

Return type:

astropy.time.Time

spino.pipeline.phase_telluric_plot.compute_planet_telluric_drv(event, observatory, target, vsys_kms, kp_kms, t14_h, pad_min=30.0, step_s=200.0)[source]

Sample the planet–telluric RV difference on a fine time grid spanning [T₁ − pad, T₄ + pad] with step_s cadence.

Tellurics sit at 0 km/s in the Earth frame, so:

ΔRV(t) = V_p(t) − 0 = V_sys + V_p,orbit(t) − V_bary(t)

V_p,orbit comes from phase_kepler.orbit_solution: the circular K_p·sin(2π·φ) for e below phase_kepler.ECC_MIN, the Keplerian trace when e and ω are both known, and the circular trace plus an envelope over all ω when e is known but ω is not.

The midpoint of the transit is reconstructed from the linear ephemeris (T₀, P) by picking the orbit number whose predicted midpoint sits closest to the centre of the observable window of event. This means the grid covers the whole transit even when the observable window only captures part of it.

Returns:

t_min_from_mid (minutes from T_mid), bjd_tdb (JD_TDB, no light-travel correction, same convention as the existing plot), phase, vbary (km/s), v_planet (km/s), drv (km/s, ≡ v_planet), the circular reference drv_circ and, under an envelope, its bounds drv_lo/drv_hi (None otherwise); the orbital metadata mode, ecc, omega_used, kp_circ, kp_ecc, max_dev_circ; plus scalar stats mean, min, max, span and the reference values t_mid_bjd_tdb and t14_h. min/max/span cover the envelope when there is one, so the overlap band reflects the full uncertainty. None when inputs are insufficient.

Return type:

dict | None

spino.pipeline.phase_telluric_plot.compute_barycentric_velocity(times_utc, ra_deg, dec_deg, lat_deg, lon_deg, alt_m)[source]

Barycentric velocity correction [km/s] at each UTC time.

Uses SkyCoord.radial_velocity_correction(‘barycentric’, …), which returns the velocity at which the observer is moving toward the target in the barycentric frame, the modern, canonical equivalent of the IDL helcorr and the user’s hand-rolled helcorr_velocity.

spino.pipeline.phase_telluric_plot.load_telluric_model(fits_path, lam_min_nm, lam_max_nm)[source]

Load and slice the GIANO-B sky-transmission FITS file.

The FITS HDU 1 has a binary table with columns ‘lam’ (microns) and ‘trans’. We convert wavelengths to nm and restrict to the requested range. Cached on (path, range).

Parameters:
spino.pipeline.phase_telluric_plot.plot_telluric_position(event, obs, target, vsys_kms, sky_fits_path, lam_range_nm, rv_grid_kms, pad_hours, exp_time_s, pdf, kp_kms=None, drv_pad_min=30.0, drv_step_s=200.0)[source]

Append one telluric-position page to pdf for the given event.

When kp_kms is finite, an additional vertical band marks the range of velocities the planet’s signal sweeps through during the observation. The trace behind that band comes from phase_kepler.orbit_solution, so for an eccentric orbit it is Keplerian rather than Kp · sin(2π·φ); the circular approximation is then overlaid for comparison, and an ω envelope is shown when the catalogue gives no argument of periastron.

Returns the figure (already written to pdf and closed), or None when the page was skipped.

Skips silently (with a one-shot warning) when:
  • vsys_kms is None,

  • sky_fits_path is empty/missing,

  • event has no in-window samples (degenerate case).