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 my_stars_file.csv
The my_stars_file.csv must contain a header and values separated by comma like :
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:


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
  2. then run this:
    awk -F ',' '{ system("FILE=l"$1"b"$2".csv;curl -o $FILE -X GET -G -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 :