Stilism reddening query script

The following script (download) allows obtaining the reddening for a list of stars. To use it, simply launch on the command line :

python3 stilism_dist.py my_stars_file.csv
The my_stars_file.csv must contain a header and values separated by comma like :
source_id,l,b,distance
1420142214,1,2,10
2551445225,2,2,20
with l and b in degrees and distance in parsec.

The script will add the following columns to the input in a new file called my_stars_file_with_stilism_reddening.csv:

source_id,l,b,distance,distance[pc][stilism],reddening[mag][stilism],distance_uncertainty[pc][stilism],reddening_uncertainty_min[mag][stilism],reddening_uncertainty_max[mag][stilism]

One caveat: if the given distance is beyond the extinction cube, then the distance[pc][stilism] field is the maximum distance of the cube, rather than the input distance, and the given reddening is consequently a lower bound of the actual reddening.

Most probably, the coordinates and distances have been obtained from the Gaia catalogue, using the parallax. Here is a typical Vizier query that would give the needed input data:

vizquery -source=I/345/gaia2 -mime=csv -out=l,b,Plx,e_Plx -c="HD 226868" -c.rm=0.1

You may also wish to look at the developer’s corner of Vizier here.

In this case, you will have to convert the star parallax to distance. So, the gory details:

  • random errors: as the parallaxes have uncertainties, these uncertainties should introduce supplementary uncertainties to the reddening. A logical way to proceed would be to compute the reddening offset obtained at ±1 sigma of parallaxes and add them quadratically to the lower and upper reddening_uncertainties given above.
  • systematic errors: starting from symmetric uncertainties on the parallax, it is known that the transformation to distance should give asymmetric uncertainties on distances. However, the extinction cube had actually been produced using parallaxes rather than distances (and is thus slightly distorted). Consequently, now using the stars parallaxes to get the reddening should hopefully give a result not too incorrect. Obviously, adding on top of this the possible presence of large random errors on the parallaxes will produce very uncertain results.

Stilism reddening function query script

If, instead, you would like to get the reddening as a function of distance in a list of (l,b) directions:

  1. create a file myCoord.csv containing e.g.
    3.0, 4.0
    1,2
  2. then run this:
    awk -F ',' '{ system("FILE=l"$1"b"$2".csv;curl -o $FILE -X GET -G https://stilism.obspm.fr/reddening -d frame=galactic -d vlong="$1" -d ulong=deg -d vlat="$2" -d ulat=deg -d file=$FILE") }' myCoord.csv

and you will get one file per coordinate, e.g. l1b2.csv :

"distance","reddening","distance_uncertainty","reddening_uncertainty_min","reddening_uncertainty_max"
0,0.0,13.0,0.014,0.014
5,0.0,12.0,0.015,0.015