Python tool to scrape mean extinction (Av) and standard deviation values from the Zaritsky & Harris extinction maps of the SMC and LMC.
It queries data from the MCPS data products webpage: https://www.as.arizona.edu/~dennis/mcsurvey/Data_Products.html
Please cite Zaritsky, Harris, Thompson, Grebel, and Massey 2002, AJ, 123, 855 (SMC) and/or Zaritsky, Harris, Thompson, and Grebel, 2004, AJ, 128, 1606 (LMC) if you use the data obtained from this package.
- Python 3.12.11 or higher (tested)
- Dependencies below listed in
requirements.txt:- requests 2.31.0 or higher (tested)
- beautifulsoup4 4.12.3 or higher (tested)
Install dependencies using pip:
pip install -r requirements.txtClone the repo and install dependencies:
git clone https://github.com/AnnaOG/zh_scraper.git
cd zh_scraper
pip install -r requirements.txtFunction:
get_extinction(galaxy, ra, dec, radius, teff='all')Inputs:
galaxy(str):"LMC"or"SMC"ra(float): Right Ascension in units of hours (decimal, e.g., 5.25 for 5h15m)dec(float): Declination in units of degrees (decimal, e.g., -69.5 for -69°30′)radius(float): Search radius in arcminutes (maximum 12)teff(str):'all','cool', or'hot'(default ='all')
You can convert your coordinates to the correct units using the units and coordinates functions in the astropy package, or by using Jan Skowron's flexible converter website.
Returns:
(mean_av, stdev_av)as floats.- Raises
ValueErrorif no stars are found within the radius or if inputs are invalid.
Run the script directly from a terminal:
python zh_scraper.py --galaxy SMC --ra 1.168 --dec -72.614 --radius 3 --teff allFor help and argument details:
python zh_scraper.py --helpImport and use the function in a Python notebook or script:
from zh_scraper import get_extinction
mean_av, stdev_av = get_extinction('SMC', 1.168, -72.614, 3, teff='all')
print(mean_av, stdev_av)To view the function docstring:
help(get_extinction)