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-1.0.0.tar.gz
.
File metadata
- Download URL: hostphot-1.0.0.tar.gz
- Upload date:
- Size: 30.0 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 | 41c0c7725da1d86cb59f97910a8880e7a95af771ff5a932932d79a638a683599 |
|
MD5 | 307ee330c2b4c9312c126e7309a76be8 |
|
BLAKE2b-256 | 3e153d31788fbca2b073589aeca50dea037daf2a5fc61af19fca4c141964a6bb |
File details
Details for the file hostphot-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: hostphot-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.0 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 | e2ec0e5db0c5242288d0d38d631a72168e423e684d3e76e15b30eebb5349b188 |
|
MD5 | 8fc2cdbc639eeafeb70c2869e404db9b |
|
BLAKE2b-256 | 062db7eb7c03447f9f49177b81333d7b820a7b5a105bffa644f5b6059f69b394 |