Various astronomy scripts
-
Download DECalS Image Script:
decal_image_download.pyDownloading optical image from DeCALS servers (https://www.legacysurvey.org/decamls/)
python decal_image_download.py <index> <ra> <dec> <name> <redshift> <fraction_size>- <redshift>: set value to
0when you do not know the redshift - <fraction_size>: 1 = 2048px, 2 = 2048/2, 4 = 2048/4; (Increase to zoom in and reduce the file size)
Example:
Download jpeg:python decal_image_download.py 1 57.8554 -15.4054 test 0.2 4Download FITS file:
python decal_image_download.py 1 57.8554 -15.4054 test 0.2 4 --fits1.1 Fixed the order of FITS images in order to open with ds9
Requirements: Need to install
aplpyfor this code to work.python decal_image_download_fits_fixed.py <outfilename_from_first_step.fits> - <redshift>: set value to
-
Download SDSS Catalog Data:
download_SDSS_catalog_withSciServer.ipynb- This code can only be run on SciServer https://apps.sciserver.org/compute/, and cannot be run on your own machine.
- To get access to the SciServer, You will have to create an account at https://apps.sciserver.org/login-portal/.
- Please follow the installation steps in the Example-Notebooks to be able to run your own codes https://github.com/sciserver/Example-Notebooks#installation.
- Once you create a persistent folder in
/Storage/<username>/persistent/, upload this code to that folder. The script should work in this environment. Additional Information:- One of the main components of the code is using SQL to query the data we want. Here is a quick tutorial on how to use SQL: https://www.w3schools.com/sql/.
- Description of each column in each SDSS Table can be found here https://skyserver.sdss.org/dr14/en/help/docs/tabledesc.aspx.
-
Download LS DR10 Photometry Script: ls_dr10_catalog_download.py
- This script queries LS DR10 Tractor catalog via NOIRLab TAP service and extracts multi-band photometry (optical + WISE) within a sky region. Documentation: https://datalab.noirlab.edu/tap
python ls_dr10_catalog_download.py --ra <ra> --dec <dec> --name <name> --radius <radius>Arguments
- : Right Ascension of target center (in degrees)
- : Declination of target center (in degrees)
- : Label for output file name
- : Search radius in degrees (default = 0.0166667 ≈ 1 arcmin)
Output
- CSV file containing:
- Astrometry (RA, Dec)
- Optical + WISE fluxes (dereddened)
- Flux inverse variance
- Galactic transmission factors
- Morphology and quality flags
Query sources around a cluster center:
python ls_dr10_catalog_download.py --ra 150.11632 --dec 2.20583 --name clusterA --radius 0.02SED Photometry (LS DR10)
For each band (g, r, i, z, w1, w2, …):
- Use dereddened flux for SED
- dered_flux = flux / mw_transmission
- Flux error
- sigma_flux = 1 / sqrt(flux_ivar)
- sigma_dered_flux = sigma_flux / mw_transmission
- Magnitude
- mag = 22.5 - 2.5 * log10(dered_flux)
- Magnitude error
- mag_err = (2.5 / ln(10)) / (flux * sqrt(flux_ivar))