sdapy.snerun.snobject

class sdapy.snerun.snobject(objid, errors='ignore', aliasid=None, z=None, ra=None, dec=None, mkwebv=None, hostebv=None, sntype=None, dm=None, jdpeak=None, fig=None, ax=None, ax1=None, ax2=None, ax3=None, ax4=None, ax5=None, updatepar=False, **kwargs)

snobject: define snobject for one SN, handle its data and fittings.

See also

snelist

Methods

add_flux([source])

add flux and eflux column, based on mag, emag, and/or limmag column.

add_lc(df[, source])

Add a lightcurve into self.lc, with a given source name

add_mag([source])

add mag and/or limmag/emag column, based on flux, eflux column.

all_fittings()

Show all fittings done so far.

bb_bol([index, returnv, fastsedfitting])

Calculate bolometric LCs with diluted blackbody fits (that were fitted with the snobject.run_fit on sed engine).

bb_colors([xpred, index, returnv])

Match or interpolate multiple band LCs, for blackbody (BB) construction.

bin_df(df[, deltah, xkey])

Bin dataframe.

bin_fp_atlas([binDays, resultsPath, ...])

Bin ATLAS forced photometry with Dave's code, https://gist.github.com/thespacedoctor/86777fa5a9567b7939e8d84fd8cf6a76

bin_lc([returnv])

Bin multiband LCs.

calc_colors([xpred, index, returnv])

Calculate colors for two bands.

calibrate_baseline([ax, key, source, xmin, ...])

Calculate ZTF forced photometry baseline from different fields with different filters.

clip_lc(**kwargs)

Removes outlier data points using GP interpolation.

combine_multi_obs(**kwargs)

Bin and combine observations from common epoch.

correct_baseline(baseline[, key, source])

Correct baseline for ZTF, when targets was covered by multiple CCDs.

cut_lc(**kwargs)

Cut LC if it's too long.

dm_error(filt[, verbose])

Estimate the distance module errors, including errors from milky ebv, redshift and hubble constants.

est_hostebv_with_colours([index, returnv])

Estimate host ebv with color comparison approach.

flux_to_mag(flux[, dflux, sigma, units, zp, ...])

Converts from fluxes into magnitudes.

get_alert_ztf([source])

Parse and add local ZTF alert photometic data to snobject.lc.

get_external_phot(filename[, source])

Parse and add user defined photometric data to snobject.lc

get_external_spectra(filename, epoch[, tel])

Parse and add user defined photometric data to snobject.spec.

get_fp_atlas(**kwargs)

Parse and add local ATLAS forced (binned or not binned) photometric data to snobject.lc (with source name as atlasfp).

get_fp_ztf([seeing_cut])

Parse and add local ZTF forced photometic data to snobject.lc.

get_local_spectra([source])

Parse amd add local ZTF fritz/marshal spectra to snobject.spec.

get_model([engine, model, source])

Get model with specific model name, and/or engine name, and/or source name.

get_oac([which])

Parse and add local Open Astronomical Catalog data to snobject.lc (with source name as oac)

get_par(par[, index, engine, model, source, ...])

Get specific parameter value and error, of a fitted model.

lyman_bol([xpred, index, returnv])

Calculate bolometric LC from colours, with Lyman bolometric correction.

mag_to_flux(mag[, magerr, limmag, sigma, ...])

Convert from magnitude to fluxes.

match_colors([style])

Match colors.

merge_df_cols(_snobject__df)

Merge dataframes

mjd_now([jd])

Get current juliand date via astropy.time

oac_phot_url(url)

(static) make url to query OAC

parse_coo([verbose, deg, hpx, nside])

handle SN coordinate

query_alert_ztf([source])

Qeury ZTF alert photometry via ztfquery, see https://github.com/MickaelRigault/ztfquery.

query_fp_atlas(**kwargs)

Qeury ATLAS forced photometry, see https://fallingstar-data.com/forcedphot/static/apiexample.py.

query_fp_ztf([get_email])

Qeury ZTF forced photometry, see documentation: https://irsa.ipac.caltech.edu/data/ZTF/docs/forcedphot.pdf, and the web query: https://ztfweb.ipac.caltech.edu/cgi-bin/requestForcedPhotometry.cgi.

query_oac([db, which])

Query OAC data, via OACAPI (https://github.com/astrocatalogs/OACAPI)

query_spectra([source])

Qeury ZTF spectra via ztfquery, see https://github.com/MickaelRigault/ztfquery.

rapid([ax, returnv])

Run astrorapid codes (a Deep learning classifier to distiinguish LCs between different SNe type) on snobject.lc.

rapid_plot(ax, class_names, class_color[, ...])

(static) Make astrorapid plot.

read_c10([filename, verbose])

Read colour templates.

read_kwargs(**kwargs)

Define a proper way to read and update optional parameters

run(**kwargs)

Running a lot of actions for one SN, according to default settings.

run_fit(enginetype[, source])

Run model fittings on varies of data from different engines.

run_gp([source])

Run Gaussian Process interpolation via george package on multiband lightcurves, i.e. snobject.lc.

savefig(**kwargs)

Save snobject.fig to data directory.

set_peak_bol_main([model_name, source_name, ...])

Set peak time and fluxes with bolometric LC fittings.

set_peak_gp([returnv])

Set peak time and fluxes with GP interpolation.

set_peak_multiband_main([model_name, returnv])

Set peak time and fluxes with multiband LC fittings.

set_texp_bol_main([model_name, source_name, ...])

Set the explosion epoch with bol_main LC fittings.

set_texp_midway([returnv])

Set the explosion epoch with the first detection and the last non-detection of sbobject.lc.

set_texp_pl([model_name, returnv])

Set the explosion epoch with multiband_early LC fittings.

set_vexp([model_name, returnv])

Return peak velocity from models with specv_evolution engine.

show_corner(ax[, index, gp, engine, model, ...])

Make contour plots for model samplings.

showfig([ax])

Show the stored figure, that was saved by the snobject.savefig.

summarize_plot([ax, savefig])

Show a summarize plot, including flux/mag/bolometric LCs, colour curve and the spectra.

sym_mag(w, f, filt[, verbose])

Synthetic magnitudes with filter transmission curves.

__init__(objid, errors='ignore', aliasid=None, z=None, ra=None, dec=None, mkwebv=None, hostebv=None, sntype=None, dm=None, jdpeak=None, fig=None, ax=None, ax1=None, ax2=None, ax3=None, ax4=None, ax5=None, updatepar=False, **kwargs)

initialize snelist

Parameters
objidstr

object ID string

errorsstr

Control raising of exceptions on invalid data for provided dtype.

  • raise : allow exceptions to be raised

  • ignore : suppress exceptions. On error return original object

  • warning : suppress exceptions. On error print it as warning

aliasidstr

other name of object

zfloat

redshift

rastr

R.A. in hh:mm:ss

decstr

Dec. in dd:mm:dd

mkwebvfloat

milky way extinction, E(B-V)

hostebvfloat

host galaxy extinction, E(B-V)

sntypestr

transient/supernova type

dmfloat

distance module

jdpeakfloat

julian date of peak epoch

figmatplotlib.subplot

for figures

axmatplotlib.axes

for flux lightcurve plot

ax1matplotlib.axes

for spectra plot

ax2matplotlib.axes

for magnitude lightcurve plot

ax3matplotlib.axes

for colour plot

ax4matplotlib.axes

for luminosoty plot

ax4matplotlib.axes

for SED plot

updateparbool

if update parameter, when reading them

kwargsKeyword Arguments

see https://github.com/saberyoung/HAFFET/blob/master/sdapy/data/default_par.txt, snobject part

Notes

Using sdapy instead of haffet

Examples

>>> from sdapy import snerun
>>> a = snerun.snobject('sss')
>>> a
<sdapy.snerun.snobject object at 0x7fa4c8284780>

Methods

__init__(objid[, errors, aliasid, z, ra, ...])

initialize snelist

add_flux([source])

add flux and eflux column, based on mag, emag, and/or limmag column.

add_lc(df[, source])

Add a lightcurve into self.lc, with a given source name

add_mag([source])

add mag and/or limmag/emag column, based on flux, eflux column.

all_fittings()

Show all fittings done so far.

bb_bol([index, returnv, fastsedfitting])

Calculate bolometric LCs with diluted blackbody fits (that were fitted with the snobject.run_fit on sed engine).

bb_colors([xpred, index, returnv])

Match or interpolate multiple band LCs, for blackbody (BB) construction.

bin_df(df[, deltah, xkey])

Bin dataframe.

bin_fp_atlas([binDays, resultsPath, ...])

Bin ATLAS forced photometry with Dave's code, https://gist.github.com/thespacedoctor/86777fa5a9567b7939e8d84fd8cf6a76

bin_lc([returnv])

Bin multiband LCs.

calc_colors([xpred, index, returnv])

Calculate colors for two bands.

calibrate_baseline([ax, key, source, xmin, ...])

Calculate ZTF forced photometry baseline from different fields with different filters.

clip_lc(**kwargs)

Removes outlier data points using GP interpolation.

combine_multi_obs(**kwargs)

Bin and combine observations from common epoch.

correct_baseline(baseline[, key, source])

Correct baseline for ZTF, when targets was covered by multiple CCDs.

cut_lc(**kwargs)

Cut LC if it's too long.

dm_error(filt[, verbose])

Estimate the distance module errors, including errors from milky ebv, redshift and hubble constants.

est_hostebv_with_colours([index, returnv])

Estimate host ebv with color comparison approach.

flux_to_mag(flux[, dflux, sigma, units, zp, ...])

Converts from fluxes into magnitudes.

get_alert_ztf([source])

Parse and add local ZTF alert photometic data to snobject.lc.

get_external_phot(filename[, source])

Parse and add user defined photometric data to snobject.lc

get_external_spectra(filename, epoch[, tel])

Parse and add user defined photometric data to snobject.spec.

get_fp_atlas(**kwargs)

Parse and add local ATLAS forced (binned or not binned) photometric data to snobject.lc (with source name as atlasfp).

get_fp_ztf([seeing_cut])

Parse and add local ZTF forced photometic data to snobject.lc.

get_local_spectra([source])

Parse amd add local ZTF fritz/marshal spectra to snobject.spec.

get_model([engine, model, source])

Get model with specific model name, and/or engine name, and/or source name.

get_oac([which])

Parse and add local Open Astronomical Catalog data to snobject.lc (with source name as oac)

get_par(par[, index, engine, model, source, ...])

Get specific parameter value and error, of a fitted model.

lyman_bol([xpred, index, returnv])

Calculate bolometric LC from colours, with Lyman bolometric correction.

mag_to_flux(mag[, magerr, limmag, sigma, ...])

Convert from magnitude to fluxes.

match_colors([style])

Match colors.

merge_df_cols(_snobject__df)

Merge dataframes

mjd_now([jd])

Get current juliand date via astropy.time

oac_phot_url(url)

(static) make url to query OAC

parse_coo([verbose, deg, hpx, nside])

handle SN coordinate

query_alert_ztf([source])

Qeury ZTF alert photometry via ztfquery, see https://github.com/MickaelRigault/ztfquery.

query_fp_atlas(**kwargs)

Qeury ATLAS forced photometry, see https://fallingstar-data.com/forcedphot/static/apiexample.py.

query_fp_ztf([get_email])

Qeury ZTF forced photometry, see documentation: https://irsa.ipac.caltech.edu/data/ZTF/docs/forcedphot.pdf, and the web query: https://ztfweb.ipac.caltech.edu/cgi-bin/requestForcedPhotometry.cgi.

query_oac([db, which])

Query OAC data, via OACAPI (https://github.com/astrocatalogs/OACAPI)

query_spectra([source])

Qeury ZTF spectra via ztfquery, see https://github.com/MickaelRigault/ztfquery.

rapid([ax, returnv])

Run astrorapid codes (a Deep learning classifier to distiinguish LCs between different SNe type) on snobject.lc.

rapid_plot(ax, class_names, class_color[, ...])

(static) Make astrorapid plot.

read_c10([filename, verbose])

Read colour templates.

read_kwargs(**kwargs)

Define a proper way to read and update optional parameters

run(**kwargs)

Running a lot of actions for one SN, according to default settings.

run_fit(enginetype[, source])

Run model fittings on varies of data from different engines.

run_gp([source])

Run Gaussian Process interpolation via george package on multiband lightcurves, i.e. snobject.lc.

savefig(**kwargs)

Save snobject.fig to data directory.

set_peak_bol_main([model_name, source_name, ...])

Set peak time and fluxes with bolometric LC fittings.

set_peak_gp([returnv])

Set peak time and fluxes with GP interpolation.

set_peak_multiband_main([model_name, returnv])

Set peak time and fluxes with multiband LC fittings.

set_texp_bol_main([model_name, source_name, ...])

Set the explosion epoch with bol_main LC fittings.

set_texp_midway([returnv])

Set the explosion epoch with the first detection and the last non-detection of sbobject.lc.

set_texp_pl([model_name, returnv])

Set the explosion epoch with multiband_early LC fittings.

set_vexp([model_name, returnv])

Return peak velocity from models with specv_evolution engine.

show_corner(ax[, index, gp, engine, model, ...])

Make contour plots for model samplings.

showfig([ax])

Show the stored figure, that was saved by the snobject.savefig.

summarize_plot([ax, savefig])

Show a summarize plot, including flux/mag/bolometric LCs, colour curve and the spectra.

sym_mag(w, f, filt[, verbose])

Synthetic magnitudes with filter transmission curves.

Attributes

keys2query_lc

keys to query LCs from OAC catalog, if value True, key mush be included by transient, otherwise, could be empty.

keys2query_spec

keys to query spectra from OAC catalog

urllist

different url origins for the Open Astronomical Catalog (OAC) catalog

version

Static version info