<jupyter_start><jupyter_text>Quick example on how to get VLASS and Skymapper images Import statement.<jupyter_code>import pandas as pd 
from astropy.io import fits 
from astropy.table import Table
from qso_toolbox import catalog_tools as ct, image_tools as it, photometry_tools as pt, utils as ut<jupyter_output><empty_output><jupyter_text>Open example catalog file and select test set.<jupyter_code>df_hdf = pd.read_hdf('./data/stripe82_milliquas_190210.hdf5',key='data')
print(df_hdf[:2])
test_set = df_hdf.query('340 < mq_ra < 350 and -1.26 < mq_dec < 0')<jupyter_output>mq_ra    mq_dec                   mq_name   mq_z mq_cite
0  0.006464 -0.559066  SDSS J000001.55-003332.6  2.219   DR14Q
1  0.006855  0.583184  SDSS J000001.64+003459.4  2.271   DR14Q<jupyter_text>Creating the cutouts directory if it does not exist already.<jupyter_code>! mkdir cutouts 
! ls<jupyter_output>mkdir: cutouts: File exists
GettingStarted.ipynb
HowTo-1-DownloadingImageCutouts.ipynb
HowTo-2-CalculatingForcedPhotometry.ipynb
HowTo-3-OffsetStarsAndFindingCharts.ipynb
Untitled.ipynb
Untitled1.ipynb
[34mcutouts[m[m
[34mdata[m[m
data.txt
fc_PGC 1132088.png
fc_SDSS J224007.89-011522.1.png
fc_SDSS J224009.37-003856.5.png
fc_SDSS J224011.46-011448.6.png
fc_SDSS J224013.39-005404.4.png
fc_SDSS J224014.28-001121.1.png
fc_SDSS J224017.28-011442.8.png
fc_SDSS J224018.29-005223.7.png
fc_SDSS J224018.58-000656.8.png
fc_SDSS J224022.77-000151.9.png
imviewgui_example.py
mp_test.py
temp.hdf5
temp_offset_df.csv
tmp.tar.gz
vlass_quicklook_summary.hdf5<jupyter_text>Downloading VLASS Images The normal *get_photometry* routine only downloads the most recent VLASS image. The main reason is that the saved file needs to be uniquely identifiable by the other routines in the qso_toolbox (finding charts, image viewer GUI) and the current tools were not designed to support multiple images from a the same RA, Dec with the same survey, data release, and band. For VLASS the toolbox will first download the full image (*_raw.fits*) and then create a cutout from that image, if possible. If the position of the source is outside the pixel in the raw image it will return a warning that it could not create the image. Obviously, this can still be improved in the future to make the warning more transparent. The *get_photometry* example for the first 3 images in the test_set:<jupyter_code>surveys = ['vlass']
bands = ['3GHz']
fovs = [200]

ct.get_photometry(test_set[:3], 'mq_ra', 'mq_dec', surveys, bands, './cutouts/', fovs, verbosity=2)<jupyter_output>[INFO] Get photometry for J224007.14-005332.81_vlass_3GHz_fov200
-98011.39942455292 86400
True
[INFO] Downloading VLASS quicklook summary table.<jupyter_text>To download all VLASS images from all epochs at a given position, you can import *download_vlass_images(ra, dec, fov, image_folder_path)* from the *vlass_quicklook* module. This works simply on RA, and Dec. If you wanted to retrieve all VLASS images for the first 3 files in the test_set it would look like this:<jupyter_code>from qso_toolbox import vlass_quicklook as vql

fov = 100

for idx in test_set.index[:3]:
    ra = test_set.loc[idx,'mq_ra']
    dec = test_set.loc[idx,'mq_dec']

    vql.download_vlass_images(ra, dec, 100,
                              './cutouts/', verbosity=2)<jupyter_output>1611567329.2477305 86400
False
[INFO] Downloading raw VLASS images.
1611567329.2477305 86400
False
[INFO] Source appears in more than one tile
[INFO] tile T10t34, obsdate 2017-12-15, epoch VLASS1.1
[INFO] tile T10t34, obsdate 2020-07-17, epoch VLASS2.1
[INFO] Returning all tiles:
567    T10t34
566    T10t34
Name: name, dtype: object
[INFO] VLASS1.1.ql.T10t34.J224000-003000.10.2048.v1/ is closest subtile
[INFO] with a source distance of 0.39357 deg 
Download of J224007.14-005332.81_vlass_3GHz_VLASS1.1_raw to ./cutouts/ completed
[INFO] Generating VLASS cutout image.
[INFO] Generate VLASS cutout centered on 340.03 -0.89
[INFO] Cutout with a FOV of 100 generated.
[INFO] Cutout saved as ./cutouts//J224007.14-005332.81_vlass_3GHz_VLASS1.1_fov100.fits
[INFO] Downloading raw VLASS images.
1611567329.2477305 86400
False
[INFO] Source appears in more than one tile
[INFO] tile T10t34, obsdate 2017-12-15, epoch VLASS1.1
[INFO] tile T10t34, obsdate 2020-07-17, epoch VLASS2.1
[INFO] Returning all t[...]<jupyter_text>The images saved with this routine will have the epoch written in the file name, e.g., "J224007.14-005332.81_vlass_3GHz_VLASS1.1_fov100.fits"  Downloading Skymapper imagesAs I mentioned before, the qso_toolbox currently does not have a system for taking care of multiple epoch images for the same source, survey, and band. **Therefore, the current Skymapper download routine only downloads the most recent ('mjd_obs') images classified as "image_type=main" with the largest exposure times ('exptime').**In the future, we could think of downloading all main survey images and automatically generating a stacked image. I have no experience how to do this, but I am happy to work together with you to try this.For now you can get Skymapper data using the normal *get_photometry* function:<jupyter_code>surveys = ['skymapper']*5
bands = ['u', 'g', 'r','i','z']
fovs = [200]*5
print(test_set[:1][['mq_ra','mq_dec']])
ct.get_photometry(test_set[:10], 'mq_ra', 'mq_dec', surveys, bands, './cutouts/', fovs, verbosity=2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09017923823749066, 'fraction_numerical': 0.10287528005974608, 'mean_word_length': 5.032657657657658, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '19556', 'license': 'MIT', 'n_tokens_mistral': 2270, 'n_tokens_neox': 1890, 'n_words': 608, 'path': 'examples/.ipynb_checkpoints/HowTo-4 Downloading VLASS and Skymapper images-checkpoint.ipynb', 'repo_name': 'jtschindler/qso_toolbox', 'size': '5356'}