Sample R code of Pwz estimation

Updated on 2018/09/27 by K. Isogai

Download
sample R code pwz.R

Usage:
After loading pwz.R by using
  source("pwz.R")
Please, enter
  pwz(ra,dec,plx,Gmag,Gbp,Grp,plxe,Gmage,Gbpe,Grpe,ObsEpoch)
Example 1. (WZ Sge observed in 2015):
  pwz(20.126828, 17.703988, 22.1564, 15.2103, 15.2115, 15.0582, 0.0395, 0.0034, 0.0111, 0.0154, 2015)

Example 2. (WZ Sge with no error):
  pwz(20.126828, 17.703988, 22.1564, 15.2103, 15.2115, 15.0582)

Argments:
ra: Right Ascension (hour)
dec: Declination (degree)
plx: Parallax (mas)
Gmag: Gaia G magnitude (mag)
Gbp: Gaia BP magnitude (mag)
Grp: Gaia RP magnitude (mag)
plxe: Parallax error (mas)
  Default=0
Gmage: Gaia G magnitude error (mag)
  Default=0
Gbpe: Gaia BP magnitude error (mag)
  Default=0
Grpe: Gaia RP magnitude error (mag)
  Default=0
ObsEpoch: Observation Epoch (year)
  Default=2014.73 (mean date of Gaia DR2)
  This value is used to query the NED about galactic extintions.

Output:
The estimated Pwz is printed on standard output and the pwz function returns a data.frame:
  data.frame(Pwz, Pwz_err, Mg0, Mg0_err, Gcol0, Gcol0_err, Ag, Ag_err, Abp, Abp_err, Arp, Arp_err)
Pwz: Estimated WZ Sge-type DN probability
Pwz_err: Error of Pwz
Mg0: Absolute Gaia Magnitude subtracted by the galactic extinction
Mg0_err: Error of Mg0
Gcol0: De-reddened Gaia color (Gbp - Grp - Abp + Arp )
Gcol0_err: Error of Gcol0
Ag: Galactic extinction of Gaia G mag
Ag_err: Error of Ag
Abp: Galactic extinction of Gaia BP mag
Abp_err: Error of Abp
Arp: Galactic extinction of Gaia RP mag
Arp_err: Error of Arp