You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple script to search for and download ZTF frames from the IPAC archive, convert them to TIFF, and standardize their sizes for stacking.
I have always wondered what ZTF images would look like when stacked in each separate ZTF filter: Sloan g', Sloan r', Sloan i', and then converted to RGB. For this task, I needed a way to list all images ZTF have produced for a part of the sky, download them, cut them to the same size, and do all of it with a selection of parameters such as exposure time, magnitude limit, etc. So here it is, along with a gallery section below if you want to see images I produced with this script.
Features
1. Bulk downloading FITS files from the ZTF archive by specifying:
1.1 J2000d Coordinates: coordinates you want to use as the center of the search region.
1.2 Radius of search: This value along with coordinates will determine the polygon in the sky that is required to be in the image in order for it to be downloaded.
1.3 Filter zr, zg or zi
1.4 Minimum acceptable mag limit for frames: It is useful for determining the quality of each frame as mag limit is impacted by factors like humidity, moon phase, etc. when the frame was captured.
1.5 Exposure Time: Most ZTF images are 30s frames, but you can change it to 300s as ZTF also generates them from time to time.
1.6 (Optional) Amount of frames to download: If it is set to "0", the script will download all frames that meet the requirements.
2. Automatic conversion of downloaded FITS files into TIF files as it is an easier file format to work with when using image editing software.
3. Standardization of image sizes. When considering all downloaded images, it is often the case that they will vary in their sizes. For example, most images are 450x450, but some are 451x450 and some are 449x451. I don't know the exact mechanism behind it, but by using "standardize_image_sizes", you can input an edge length of the square. So, for example, you can change the size of all images to 440x440. It is important as, for example, DeepSkyStacker struggles with stacking images with different sizes.
Installation
Clone this repository and install dependencies:
pip install -r requirements.txt
Ensure you have Python 3, PIL (Pillow), Astropy, Requests, Pandas, and NumPy available in your environment.
Usage
Edit the variables in main.py (coordinates, radius, exposure time, etc.) to suit your needs.
Run the script
The script will output your images in the output folder [it will save them as fits, tif, standardized_size tifs]
Gallery of images I made by using frames extracted with this script:
M51 galaxy: zg 286x30s, zr 433x30s, zi 70x30s
M82 galaxy, zg 166x30s, zr 351x30s, zi 2x30s
Hubble Deep Field, zr 283x30s. GIF overlays Hubble image of HDF and image made with ZTF data (HDF)
Horse Head Nebula, zg 12x30s, zr 47x30s, 1x30s
Attributions:
ZTF Science Data Processing System: Masci et al. (2019)
ZTF Technical Specifications and Survey Design: Bellm et al. (2019)