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:
If, instead, you would like to get the reddening as a function of distance in a list of (l,b) directions:
3.0, 4.0
1,2
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