Photometry (local and global) for host galaxy of supernovae
Project description
HostPhot
Conda environment
It is recommended to create an environment for every new project:
conda create -n hostphot pip
conda activate hostphot
pip install hostphot
Modules
Cutouts
This module allows you to download image cutouts from PS1
, DES
and SDSS
. For this, you can use get_PS1_images()
, get_DES_images()
and get_SDSS_images()
, respectively. For example:
from hostphot.cutouts import get_PS1_images
ra, dec = 30, 100
size = 400 # in pixels
filters = 'grizy'
fits_images = get_PS1_images(ra, dec, size, filters)
where fits_images
is a list with the fits images in the given filters.
You can also use download_multiband_images()
for multiple images:
from hostphot.cutouts import download_multiband_images
download_multiband_images(sn_name, ra, dec, size,
work_dir, filters,
overwrite, survey)
where work_dir
is where all the images will be downloaded. A Subdirectory inside work_dir
will be created with the SN name as the directory name.
Local Photometry
Local photometry can be obtained for the downloaded images. For this, use extract_local_photometry()
for a single image:
from hostphot.local_photometry import extract_local_photometry
fits_file = 'path/to/local/fits_file'
ra, dec = 30, 100
z = 0.01 # redshift
ap_radius = 4 # aperture for the photometry in kpc
survey = 'PS1'
extract_local_photometry(fits_file, ra, dec, z, ap_radius, survey)
which returns mag
and mag_err
. You can also use multi_local_photometry()
for multiple images:
from hostphot.local_photometry import multi_local_photometry
multi_local_photometry(name_list, ra_list, dec_list, z_list,
ap_radius, work_dir, filters,
survey, correct_extinction)
where work_dir
should be the same as used in download_multiband_images()
and name_list
should contain the names of the SNe used in download_multiband_images()
as well. This produces a pandas DataFrame as an output where, e.g., column g
is the g-band magnitude and g_err
its uncertainty.
Global Photometry
Global photometry can be obtained in a similar way to local photometry. Use extract_global_photometry()
for a single image:
from hostphot.global_photometry import extract_global_photometry
survey = 'PS1'
extract_global_photometry(fits_file, host_ra, host_ra, survey=survey)
which returns mag
and mag_err
. You can also use multi_global_photometry()
for multiple images:
from hostphot.global_photometry import multi_global_photometry
survey = 'PS1'
correct_extinction = True
multi_global_photometry(name_list, host_ra_list, host_dec_list, work_dir, filters,
survey=survey, correct_extinction=correct_extinction)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hostphot-0.2.0.tar.gz
.
File metadata
- Download URL: hostphot-0.2.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f5c9ea1e096cf0ac15cf5b5bb648bf641eaf07c4b722f5e543a01e4463837e6 |
|
MD5 | 9614095fa99548af6c440b5fa00ea3fd |
|
BLAKE2b-256 | 027e5f8116069dc7f62fd8602de2b96c450637ef084f11e0150a199a32927835 |
File details
Details for the file hostphot-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: hostphot-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e1dd2fc2da9bc6a2d49941c05fa2add4b5867ede3565b51c7772106bcc3211 |
|
MD5 | eaf1e381cf9bfb5139209e9e31f29f79 |
|
BLAKE2b-256 | f84eb95dfcf14a59f19cdd8843921c661c3e01b8ecc71d411e4647caaca26767 |