Skip to main content

Global and local photometry of galaxies hosting supernovae or other transients

Project description

HostPhot

Global and local photometry of galaxies hosting supernovae or other transients

repo documentation status license Tests and Publish Python Version PyPI DOI

Read the full documentation at hostphot.readthedocs.io.


Conda environment

It is recommended to create an environment before installing HostPhot:

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:

from hostphot.cutouts import download_images
download_images(name='SN2004eo', ra=308.22579, dec=9.92853, survey='PS1')

Image Pre-processing

Coadds can be created and stars can be masked out of the images:

from hostphot.coadd import coadd_images

coadd_filters = 'riz'
survey = 'PS1'
coadd_images('SN2004eo', coadd_filters, survey)   # creates a new fits file
from hostphot.image_masking import create_mask

host_ra, host_dec = 308.2092, 9.92755  # coods of host galaxy of SN2004eo
coadd_mask_params = create_mask(name, host_ra, host_dec,
                                 filt=coadd_filters, survey=survey,
                                 extract_params=True)  # we can extract the mask parameters from the coadd

for filt in 'grizy':
    create_mask(name, host_ra, host_dec, filt, survey=survey,
                common_params=coadd_mask_params)

Local Photometry

Local photometry can be obtained for multiple circular apertures:

import hostphot.local_photometry as lp

ap_radii = [1, 2, 3, 4]  # in units of kpc
results = lp.multi_band_phot(name='SN2004eo', ra=308.22579, dec=9.92853, z=0.0157,
                   survey='PS1', ap_radii=ap_radii, use_mask=True, save_plots=True)

Global Photometry

Global photometry can be obtained in a similar way to local photometry, using common aperture:

import hostphot.global_photometry as gp

host_ra, host_dec = 308.2092, 9.92755  # coods of host galaxy of SN2004eo
results = gp.multi_band_phot(name='SN2004eo', host_ra, host_dec, survey='PS1',
                            use_mask=True, common_aperture=True, coadd_filters='riz',
                            optimze_kronrad=True, save_plots=True)

Citing HostPhot

If you make use of HostPhot, please cite:

@software{hostphot,
  author       = {Tom\'as E. M\"uller-Bravo and
                  Llu\'is Galbany},
  title        = {HostPhot},
  month        = apr,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v1.0.1},
  doi          = {10.5281/zenodo.6469981},
  url          = {https://doi.org/10.5281/zenodo.6469981}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

HostPhot-2.0.0.tar.gz (44.3 kB view hashes)

Uploaded Source

Built Distribution

HostPhot-2.0.0-py3-none-any.whl (51.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page