snobject – class deal with one single object

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

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

Below provide various of functions for snobject:

  • General

snobject.__init__(objid[, errors, aliasid, ...])

initialize snelist

snobject.version

Static version info

snobject.urllist

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

snobject.keys2query_lc

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

snobject.keys2query_spec

keys to query spectra from OAC catalog

snobject.read_kwargs(**kwargs)

Define a proper way to read and update optional parameters

snobject.run(**kwargs)

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

  • Lightcurves:

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

handle SN coordinate

snobject.mjd_now([jd])

Get current juliand date via astropy.time

snobject.query_fp_atlas(**kwargs)

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

snobject.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.

snobject.query_alert_ztf([source])

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

snobject.query_oac([db, which])

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

snobject.get_alert_ztf([source])

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

snobject.get_fp_ztf([seeing_cut])

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

snobject.get_fp_atlas(**kwargs)

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

snobject.get_oac([which])

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

snobject.get_external_phot(filename[, source])

Parse and add user defined photometric data to snobject.lc

snobject.bin_lc([returnv])

Bin multiband LCs.

snobject.clip_lc(**kwargs)

Removes outlier data points using GP interpolation.

snobject.cut_lc(**kwargs)

Cut LC if it's too long.

snobject.correct_baseline(baseline[, key, ...])

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

snobject.calibrate_baseline([ax, key, ...])

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

snobject.rapid([ax, returnv])

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

snobject.rapid_plot(ax, class_names, class_color)

(static) Make astrorapid plot.

snobject._nepochs(**kwargs)

How many epochs of photometry in each band.

snobject._ncolors(**kwargs)

How many color epochs.

snobject._peak_accuracy([within])

How accurate a peak can be determined, i.e. how many photometric points available within a range to the peak.

snobject._earlypoints(**kwargs)

How many early datapoints for power law fittings (ask texp and fpeak available).

  • Spectra:

snobject.query_spectra([source])

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

snobject.get_local_spectra([source])

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

snobject.get_external_spectra(filename, epoch)

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

  • SED ann bolometric LCs:

snobject.dm_error(filt[, verbose])

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

snobject.read_c10([filename, verbose])

Read colour templates.

snobject.est_hostebv_with_colours([index, ...])

Estimate host ebv with color comparison approach.

snobject.calc_colors([xpred, index, returnv])

Calculate colors for two bands.

snobject.lyman_bol([xpred, index, returnv])

Calculate bolometric LC from colours, with Lyman bolometric correction.

snobject.bb_colors([xpred, index, returnv])

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

snobject.bb_bol([index, returnv, fastsedfitting])

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

snobject._to_luminosity(m, f[, em])

Convert magnitude to luminosity.

snobject._cal_spectrum(ws, fluxes, efluxes, ...)

Absolute calibrate or mangle the spetrum

  • Fittings:

snobject.run_gp([source])

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

snobject.run_fit(enginetype[, source])

Run model fittings on varies of data from different engines.

snobject.set_peak_gp([returnv])

Set peak time and fluxes with GP interpolation.

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

Set peak time and fluxes with bolometric LC fittings.

snobject.set_peak_multiband_main([...])

Set peak time and fluxes with multiband LC fittings.

snobject.set_vexp([model_name, returnv])

Return peak velocity from models with specv_evolution engine.

snobject.set_texp_pl([model_name, returnv])

Set the explosion epoch with multiband_early LC fittings.

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

Set the explosion epoch with bol_main LC fittings.

snobject.set_texp_midway([returnv])

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

snobject._flux_at(filt, phase[, ...])

Estimate flux at a given epoch.

snobject._flux_at_list(filt, phaselist[, ...])

Estimate fluxes for a list of epochs.

snobject._mag_at(filt, phase[, ...])

Estimate apparent magnitude at a given epoch.

snobject._mag_at_list(filt, phaselist[, ...])

Estimate apparent magnitudes from a list of epochs.

snobject._absmag_at(filt, phase[, ...])

Estimate absolute magnitude at a given epoch.

snobject._absmag_at_list(filt, phaselist[, ...])

Estimate absolute magnitudes from a list of phases.

snobject._color_at(filt1, filt2, phase[, ...])

Estimate colour at a given phase.

snobject._rate_at(filt, phase1, phase2[, ...])

Estimate the magnitude different of two phases on a given filter.

snobject.all_fittings()

Show all fittings done so far.

snobject.get_model([engine, model, source])

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

snobject.get_par(par[, index, engine, ...])

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

  • Plots:

snobject.summarize_plot([ax, savefig])

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

snobject._ax([show_title, show_legend, ...])

Flux LC plot.

snobject._ax1([show_title, show_telluric, ...])

Spectra plot.

snobject._ax2([show_title, show_legend, ...])

Magnitude LC plot.

snobject._ax3([xpred, index, show_title, ...])

Colour curve plot.

snobject._ax4([xpred, index, show_title, ...])

luminosity LCs plot

snobject._ax5(phase[, index, interpolation, ...])

show constructed SED of specific epochs

snobject._ax6([show_title, show_legend, ...])

show spectral velocity evolution.

snobject.show_corner(ax[, index, gp, ...])

Make contour plots for model samplings.

snobject.savefig(**kwargs)

Save snobject.fig to data directory.

snobject.showfig([ax])

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

  • Others

snobject.add_lc(df[, source])

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

snobject.add_flux([source])

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

snobject._add_flux(df, zp, sigma)

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

snobject.add_mag([source])

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

snobject._add_mag(df, zp, sigma)

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

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

Convert from magnitude to fluxes.

snobject.flux_to_mag(flux[, dflux, sigma, ...])

Converts from fluxes into magnitudes.

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

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

snobject._get_fp_atlas(f[, binned])

(static) parse local ATLAS forced (binned or not binned) photometric data to snobject.lc

snobject.oac_phot_url(url)

(static) make url to query OAC

snobject._get_par(par, operator[, par2, ...])

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

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

Synthetic magnitudes with filter transmission curves.

snobject.match_colors([style])

Match colors.

snobject.combine_multi_obs(**kwargs)

Bin and combine observations from common epoch.

snobject.bin_df(df[, deltah, xkey])

Bin dataframe.

snobject.merge_df_cols(_snobject__df)

Merge dataframes

read_kwargs(kwargs, clsname[, check, verbose])

Read default parameters.

print_logo([returns])

Print HAFFET Logo.

check_dir([check, askifdirmissed, update])

Check HAFFET data directory, if any folders or files missing, will copy into the data directory.

There’re some other functions used by the snobject:

read_default.read_default(filename[, wdir, ...])

Read default parameters from a file.

read_default.get_keypairs([filename, wdir, ...])

get keypairs that would be used by online services, e.g.

read_default.get_parameters([filename, ...])

get default parameters for each SN

gaussian_process.fit_gp(x_data, y_data[, ...])

Fits data with gaussian process.

model_fitters.get_engine()

get all possible engines of HAFFET

model_fitters.get_model([which_engine, ...])

get all possible models of a given engine

model_fitters.get_pars(which[, with_alias])

get parameter of a given model

model_fitters.fit_model(x_data, y_data, ...)

Fits data with analytic models.

specline_handler.handle_spectra(z, ebv[, t0])

Handle spectra for one SN

specline_handler.handle_spectrum(wave, flux, ...)

Handle one single spectrum

image_tool.handle_image(ra, dec[, img, ax, ...])

Make finder by downloading images from online archive, e.g.