partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
valid | jhk_to_sdssg | Converts given J, H, Ks mags to an SDSS g magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS g band magnitude. | astrobase/magnitudes.py | def jhk_to_sdssg(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS g magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS g band magnitude.
'''
return convert_constant... | def jhk_to_sdssg(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS g magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS g band magnitude.
'''
return convert_constant... | [
"Converts",
"given",
"J",
"H",
"Ks",
"mags",
"to",
"an",
"SDSS",
"g",
"magnitude",
"value",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/magnitudes.py#L296-L316 | [
"def",
"jhk_to_sdssg",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
")",
":",
"return",
"convert_constants",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
",",
"SDSSG_JHK",
",",
"SDSSG_JH",
",",
"SDSSG_JK",
",",
"SDSSG_HK",
",",
"SDSSG_J",
",",
"SDSSG_H",
",",
"SDSSG... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | jhk_to_sdssr | Converts given J, H, Ks mags to an SDSS r magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS r band magnitude. | astrobase/magnitudes.py | def jhk_to_sdssr(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS r magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS r band magnitude.
'''
return convert_constant... | def jhk_to_sdssr(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS r magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS r band magnitude.
'''
return convert_constant... | [
"Converts",
"given",
"J",
"H",
"Ks",
"mags",
"to",
"an",
"SDSS",
"r",
"magnitude",
"value",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/magnitudes.py#L320-L340 | [
"def",
"jhk_to_sdssr",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
")",
":",
"return",
"convert_constants",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
",",
"SDSSR_JHK",
",",
"SDSSR_JH",
",",
"SDSSR_JK",
",",
"SDSSR_HK",
",",
"SDSSR_J",
",",
"SDSSR_H",
",",
"SDSSR... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | jhk_to_sdssi | Converts given J, H, Ks mags to an SDSS i magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS i band magnitude. | astrobase/magnitudes.py | def jhk_to_sdssi(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS i magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS i band magnitude.
'''
return convert_constant... | def jhk_to_sdssi(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS i magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS i band magnitude.
'''
return convert_constant... | [
"Converts",
"given",
"J",
"H",
"Ks",
"mags",
"to",
"an",
"SDSS",
"i",
"magnitude",
"value",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/magnitudes.py#L344-L364 | [
"def",
"jhk_to_sdssi",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
")",
":",
"return",
"convert_constants",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
",",
"SDSSI_JHK",
",",
"SDSSI_JH",
",",
"SDSSI_JK",
",",
"SDSSI_HK",
",",
"SDSSI_J",
",",
"SDSSI_H",
",",
"SDSSI... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | jhk_to_sdssz | Converts given J, H, Ks mags to an SDSS z magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS z band magnitude. | astrobase/magnitudes.py | def jhk_to_sdssz(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS z magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS z band magnitude.
'''
return convert_constant... | def jhk_to_sdssz(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS z magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS z band magnitude.
'''
return convert_constant... | [
"Converts",
"given",
"J",
"H",
"Ks",
"mags",
"to",
"an",
"SDSS",
"z",
"magnitude",
"value",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/magnitudes.py#L368-L388 | [
"def",
"jhk_to_sdssz",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
")",
":",
"return",
"convert_constants",
"(",
"jmag",
",",
"hmag",
",",
"kmag",
",",
"SDSSZ_JHK",
",",
"SDSSZ_JH",
",",
"SDSSZ_JK",
",",
"SDSSZ_HK",
",",
"SDSSZ_J",
",",
"SDSSZ_H",
",",
"SDSSZ... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | absolute_gaia_magnitude | Calculates the GAIA absolute magnitude for object (or array of objects).
Given a G mag and the parallax measured by GAIA, gets the absolute mag using
the usual equation::
G - M_G = 5 x log10(d_pc) - 5
M_G = 5 - 5log10(d_pc) + G
Parameters
----------
gaia_mag : float or array-like... | astrobase/magnitudes.py | def absolute_gaia_magnitude(gaia_mag,
gaia_parallax_mas,
gaia_mag_err=None,
gaia_parallax_err_mas=None):
'''Calculates the GAIA absolute magnitude for object (or array of objects).
Given a G mag and the parallax measured by GAI... | def absolute_gaia_magnitude(gaia_mag,
gaia_parallax_mas,
gaia_mag_err=None,
gaia_parallax_err_mas=None):
'''Calculates the GAIA absolute magnitude for object (or array of objects).
Given a G mag and the parallax measured by GAI... | [
"Calculates",
"the",
"GAIA",
"absolute",
"magnitude",
"for",
"object",
"(",
"or",
"array",
"of",
"objects",
")",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/magnitudes.py#L437-L511 | [
"def",
"absolute_gaia_magnitude",
"(",
"gaia_mag",
",",
"gaia_parallax_mas",
",",
"gaia_mag_err",
"=",
"None",
",",
"gaia_parallax_err_mas",
"=",
"None",
")",
":",
"# get the distance",
"# we're using the naive calculation of d. this is inaccurate as stated in",
"# Bailer-Jones 2... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | aov_theta | Calculates the Schwarzenberg-Czerny AoV statistic at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequency : float
The test frequency to calculate the theta statistic at.
binsize : float
The phase bin siz... | astrobase/periodbase/saov.py | def aov_theta(times, mags, errs, frequency,
binsize=0.05, minbin=9):
'''Calculates the Schwarzenberg-Czerny AoV statistic at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequency : float
The test fre... | def aov_theta(times, mags, errs, frequency,
binsize=0.05, minbin=9):
'''Calculates the Schwarzenberg-Czerny AoV statistic at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequency : float
The test fre... | [
"Calculates",
"the",
"Schwarzenberg",
"-",
"Czerny",
"AoV",
"statistic",
"at",
"a",
"test",
"frequency",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/saov.py#L70-L162 | [
"def",
"aov_theta",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"frequency",
",",
"binsize",
"=",
"0.05",
",",
"minbin",
"=",
"9",
")",
":",
"period",
"=",
"1.0",
"/",
"frequency",
"fold_time",
"=",
"times",
"[",
"0",
"]",
"phased",
"=",
"phase_mags... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _aov_worker | This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = binsize
task[5] = minbin
Return... | astrobase/periodbase/saov.py | def _aov_worker(task):
'''This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = binsize
... | def _aov_worker(task):
'''This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = binsize
... | [
"This",
"is",
"a",
"parallel",
"worker",
"for",
"the",
"function",
"below",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/saov.py#L166-L202 | [
"def",
"_aov_worker",
"(",
"task",
")",
":",
"times",
",",
"mags",
",",
"errs",
",",
"frequency",
",",
"binsize",
",",
"minbin",
"=",
"task",
"try",
":",
"theta",
"=",
"aov_theta",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"frequency",
",",
"binsi... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | get_frequency_grid | This calculates a frequency grid for the period finding functions in this
module.
Based on the autofrequency function in astropy.stats.lombscargle.
http://docs.astropy.org/en/stable/_modules/astropy/stats/lombscargle/core.html#LombScargle.autofrequency
Parameters
----------
times : np.array
... | astrobase/periodbase/__init__.py | def get_frequency_grid(times,
samplesperpeak=5,
nyquistfactor=5,
minfreq=None,
maxfreq=None,
returnf0dfnf=False):
'''This calculates a frequency grid for the period finding functions in this
module... | def get_frequency_grid(times,
samplesperpeak=5,
nyquistfactor=5,
minfreq=None,
maxfreq=None,
returnf0dfnf=False):
'''This calculates a frequency grid for the period finding functions in this
module... | [
"This",
"calculates",
"a",
"frequency",
"grid",
"for",
"the",
"period",
"finding",
"functions",
"in",
"this",
"module",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/__init__.py#L78-L137 | [
"def",
"get_frequency_grid",
"(",
"times",
",",
"samplesperpeak",
"=",
"5",
",",
"nyquistfactor",
"=",
"5",
",",
"minfreq",
"=",
"None",
",",
"maxfreq",
"=",
"None",
",",
"returnf0dfnf",
"=",
"False",
")",
":",
"baseline",
"=",
"times",
".",
"max",
"(",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | independent_freq_count | This estimates M: the number of independent frequencies in the periodogram.
This follows the terminology on page 3 of Zechmeister & Kurster (2009)::
M = DELTA_f / delta_f
where::
DELTA_f = freq.max() - freq.min()
delta_f = 1.0/(times.max() - times.min())
Parameters
---------... | astrobase/periodbase/__init__.py | def independent_freq_count(frequencies, times, conservative=True):
'''This estimates M: the number of independent frequencies in the periodogram.
This follows the terminology on page 3 of Zechmeister & Kurster (2009)::
M = DELTA_f / delta_f
where::
DELTA_f = freq.max() - freq.min()
... | def independent_freq_count(frequencies, times, conservative=True):
'''This estimates M: the number of independent frequencies in the periodogram.
This follows the terminology on page 3 of Zechmeister & Kurster (2009)::
M = DELTA_f / delta_f
where::
DELTA_f = freq.max() - freq.min()
... | [
"This",
"estimates",
"M",
":",
"the",
"number",
"of",
"independent",
"frequencies",
"in",
"the",
"periodogram",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/__init__.py#L141-L188 | [
"def",
"independent_freq_count",
"(",
"frequencies",
",",
"times",
",",
"conservative",
"=",
"True",
")",
":",
"M",
"=",
"frequencies",
".",
"ptp",
"(",
")",
"*",
"times",
".",
"ptp",
"(",
")",
"if",
"conservative",
":",
"M_eff",
"=",
"min",
"(",
"[",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | bootstrap_falsealarmprob | Calculates the false alarm probabilities of periodogram peaks using
bootstrap resampling of the magnitude time series.
The false alarm probability here is defined as::
(1.0 + sum(trialbestpeaks[i] > peak[j]))/(ntrialbestpeaks + 1)
for each best periodogram peak j. The index i is for each bootstra... | astrobase/periodbase/__init__.py | def bootstrap_falsealarmprob(lspinfo,
times,
mags,
errs,
nbootstrap=250,
magsarefluxes=False,
sigclip=10.0,
npeaks=No... | def bootstrap_falsealarmprob(lspinfo,
times,
mags,
errs,
nbootstrap=250,
magsarefluxes=False,
sigclip=10.0,
npeaks=No... | [
"Calculates",
"the",
"false",
"alarm",
"probabilities",
"of",
"periodogram",
"peaks",
"using",
"bootstrap",
"resampling",
"of",
"the",
"magnitude",
"time",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/__init__.py#L268-L500 | [
"def",
"bootstrap_falsealarmprob",
"(",
"lspinfo",
",",
"times",
",",
"mags",
",",
"errs",
",",
"nbootstrap",
"=",
"250",
",",
"magsarefluxes",
"=",
"False",
",",
"sigclip",
"=",
"10.0",
",",
"npeaks",
"=",
"None",
")",
":",
"# figure out how many periods to w... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | make_combined_periodogram | This just puts all of the period-finders on a single periodogram.
This will renormalize all of the periodograms so their values lie between 0
and 1, with values lying closer to 1 being more significant. Periodograms
that give the same best periods will have their peaks line up together.
Parameters
... | astrobase/periodbase/__init__.py | def make_combined_periodogram(pflist, outfile, addmethods=False):
'''This just puts all of the period-finders on a single periodogram.
This will renormalize all of the periodograms so their values lie between 0
and 1, with values lying closer to 1 being more significant. Periodograms
that give the same... | def make_combined_periodogram(pflist, outfile, addmethods=False):
'''This just puts all of the period-finders on a single periodogram.
This will renormalize all of the periodograms so their values lie between 0
and 1, with values lying closer to 1 being more significant. Periodograms
that give the same... | [
"This",
"just",
"puts",
"all",
"of",
"the",
"period",
"-",
"finders",
"on",
"a",
"single",
"periodogram",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/__init__.py#L509-L589 | [
"def",
"make_combined_periodogram",
"(",
"pflist",
",",
"outfile",
",",
"addmethods",
"=",
"False",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"for",
"pf",
"in",
"pflist",
":",
"if",
"pf",
"[",
"'method'",
"]",
"==",
"'pdm'",
":",
"plt... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | read_original_textlc | Read .epdlc, and .tfalc light curves and return a corresponding labelled
dict (if LC from <2012) or astropy table (if >=2012). Each has different
keys that can be accessed via .keys()
Input:
lcpath: path (string) to light curve data, which is a textfile with HAT
LC data.
Example:
dat = rea... | astrobase/hatsurveys/texthatlc.py | def read_original_textlc(lcpath):
'''
Read .epdlc, and .tfalc light curves and return a corresponding labelled
dict (if LC from <2012) or astropy table (if >=2012). Each has different
keys that can be accessed via .keys()
Input:
lcpath: path (string) to light curve data, which is a textfile wit... | def read_original_textlc(lcpath):
'''
Read .epdlc, and .tfalc light curves and return a corresponding labelled
dict (if LC from <2012) or astropy table (if >=2012). Each has different
keys that can be accessed via .keys()
Input:
lcpath: path (string) to light curve data, which is a textfile wit... | [
"Read",
".",
"epdlc",
"and",
".",
"tfalc",
"light",
"curves",
"and",
"return",
"a",
"corresponding",
"labelled",
"dict",
"(",
"if",
"LC",
"from",
"<2012",
")",
"or",
"astropy",
"table",
"(",
"if",
">",
"=",
"2012",
")",
".",
"Each",
"has",
"different",... | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/texthatlc.py#L54-L167 | [
"def",
"read_original_textlc",
"(",
"lcpath",
")",
":",
"LOGINFO",
"(",
"'reading original HAT text LC: {:s}'",
".",
"format",
"(",
"lcpath",
")",
")",
"N_lines_to_parse_comments",
"=",
"50",
"with",
"open",
"(",
"lcpath",
",",
"'rb'",
")",
"as",
"file",
":",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | traptransit_fit_magseries | This fits a trapezoid transit model to a magnitude time series.
Parameters
----------
times,mags,errs : np.array
The input mag/flux time-series to fit a trapezoid planet-transit model
to.
period : float
The period to use for the model fit.
transitparams : list of floats
... | astrobase/lcfit/transits.py | def traptransit_fit_magseries(times, mags, errs,
transitparams,
sigclip=10.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''This fits a trapezoid transit mode... | def traptransit_fit_magseries(times, mags, errs,
transitparams,
sigclip=10.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''This fits a trapezoid transit mode... | [
"This",
"fits",
"a",
"trapezoid",
"transit",
"model",
"to",
"a",
"magnitude",
"time",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L85-L401 | [
"def",
"traptransit_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"transitparams",
",",
"sigclip",
"=",
"10.0",
",",
"plotfit",
"=",
"False",
",",
"magsarefluxes",
"=",
"False",
",",
"verbose",
"=",
"True",
")",
":",
"stimes",
",",
"smags",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _get_value | This decides if a value is to be fit for or is fixed in a model fit.
When you want to get the value of some parameter, but you're not sure if
it's being fit or if it is fixed. then, e.g. for `period`::
period_value = _get_value('period', fitparams, fixedparams) | astrobase/lcfit/transits.py | def _get_value(quantitystr, fitparams, fixedparams):
"""This decides if a value is to be fit for or is fixed in a model fit.
When you want to get the value of some parameter, but you're not sure if
it's being fit or if it is fixed. then, e.g. for `period`::
period_value = _get_value('period', fitp... | def _get_value(quantitystr, fitparams, fixedparams):
"""This decides if a value is to be fit for or is fixed in a model fit.
When you want to get the value of some parameter, but you're not sure if
it's being fit or if it is fixed. then, e.g. for `period`::
period_value = _get_value('period', fitp... | [
"This",
"decides",
"if",
"a",
"value",
"is",
"to",
"be",
"fit",
"for",
"or",
"is",
"fixed",
"in",
"a",
"model",
"fit",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L409-L426 | [
"def",
"_get_value",
"(",
"quantitystr",
",",
"fitparams",
",",
"fixedparams",
")",
":",
"# for Mandel-Agol fitting, sometimes we want to fix some parameters,",
"# and fit others. this function allows that flexibility.",
"fitparamskeys",
",",
"fixedparamskeys",
"=",
"fitparams",
".... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _transit_model | This returns a BATMAN planetary transit model.
Parameters
----------
times : np.array
The times at which the model will be evaluated.
t0 : float
The time of periastron for the transit.
per : float
The orbital period of the planet.
rp : float
The stellar radiu... | astrobase/lcfit/transits.py | def _transit_model(times, t0, per, rp, a, inc, ecc, w, u, limb_dark,
exp_time_minutes=2, supersample_factor=7):
'''This returns a BATMAN planetary transit model.
Parameters
----------
times : np.array
The times at which the model will be evaluated.
t0 : float
Th... | def _transit_model(times, t0, per, rp, a, inc, ecc, w, u, limb_dark,
exp_time_minutes=2, supersample_factor=7):
'''This returns a BATMAN planetary transit model.
Parameters
----------
times : np.array
The times at which the model will be evaluated.
t0 : float
Th... | [
"This",
"returns",
"a",
"BATMAN",
"planetary",
"transit",
"model",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L429-L500 | [
"def",
"_transit_model",
"(",
"times",
",",
"t0",
",",
"per",
",",
"rp",
",",
"a",
",",
"inc",
",",
"ecc",
",",
"w",
",",
"u",
",",
"limb_dark",
",",
"exp_time_minutes",
"=",
"2",
",",
"supersample_factor",
"=",
"7",
")",
":",
"params",
"=",
"batma... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _log_prior_transit | Assume priors on all parameters have uniform probability. | astrobase/lcfit/transits.py | def _log_prior_transit(theta, priorbounds):
'''
Assume priors on all parameters have uniform probability.
'''
# priorbounds contains the input priors, and because of how we previously
# sorted theta, its sorted keys tell us which parts of theta correspond to
# which physical quantities.
all... | def _log_prior_transit(theta, priorbounds):
'''
Assume priors on all parameters have uniform probability.
'''
# priorbounds contains the input priors, and because of how we previously
# sorted theta, its sorted keys tell us which parts of theta correspond to
# which physical quantities.
all... | [
"Assume",
"priors",
"on",
"all",
"parameters",
"have",
"uniform",
"probability",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L503-L521 | [
"def",
"_log_prior_transit",
"(",
"theta",
",",
"priorbounds",
")",
":",
"# priorbounds contains the input priors, and because of how we previously",
"# sorted theta, its sorted keys tell us which parts of theta correspond to",
"# which physical quantities.",
"allowed",
"=",
"True",
"for... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _log_likelihood_transit | Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
Note: the priorbounds are only needed to parse theta. | astrobase/lcfit/transits.py | def _log_likelihood_transit(theta, params, model, t, flux, err_flux,
priorbounds):
'''
Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
Note: the priorbound... | def _log_likelihood_transit(theta, params, model, t, flux, err_flux,
priorbounds):
'''
Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
Note: the priorbound... | [
"Given",
"a",
"batman",
"TransitModel",
"and",
"its",
"proposed",
"parameters",
"(",
"theta",
")",
"update",
"the",
"batman",
"params",
"object",
"with",
"the",
"proposed",
"parameters",
"and",
"evaluate",
"the",
"gaussian",
"likelihood",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L528-L568 | [
"def",
"_log_likelihood_transit",
"(",
"theta",
",",
"params",
",",
"model",
",",
"t",
",",
"flux",
",",
"err_flux",
",",
"priorbounds",
")",
":",
"u",
"=",
"[",
"]",
"for",
"ix",
",",
"key",
"in",
"enumerate",
"(",
"sorted",
"(",
"priorbounds",
".",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _log_likelihood_transit_plus_line | Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
Note: the priorbounds are only needed to parse theta. | astrobase/lcfit/transits.py | def _log_likelihood_transit_plus_line(theta, params, model, t, data_flux,
err_flux, priorbounds):
'''
Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
... | def _log_likelihood_transit_plus_line(theta, params, model, t, data_flux,
err_flux, priorbounds):
'''
Given a batman TransitModel and its proposed parameters (theta), update the
batman params object with the proposed parameters and evaluate the gaussian
likelihood.
... | [
"Given",
"a",
"batman",
"TransitModel",
"and",
"its",
"proposed",
"parameters",
"(",
"theta",
")",
"update",
"the",
"batman",
"params",
"object",
"with",
"the",
"proposed",
"parameters",
"and",
"evaluate",
"the",
"gaussian",
"likelihood",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L571-L625 | [
"def",
"_log_likelihood_transit_plus_line",
"(",
"theta",
",",
"params",
",",
"model",
",",
"t",
",",
"data_flux",
",",
"err_flux",
",",
"priorbounds",
")",
":",
"u",
"=",
"[",
"]",
"for",
"ix",
",",
"key",
"in",
"enumerate",
"(",
"sorted",
"(",
"priorbo... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | log_posterior_transit | Evaluate posterior probability given proposed model parameters and
the observed flux timeseries. | astrobase/lcfit/transits.py | def log_posterior_transit(theta, params, model, t, flux, err_flux, priorbounds):
'''
Evaluate posterior probability given proposed model parameters and
the observed flux timeseries.
'''
lp = _log_prior_transit(theta, priorbounds)
if not np.isfinite(lp):
return -np.inf
else:
r... | def log_posterior_transit(theta, params, model, t, flux, err_flux, priorbounds):
'''
Evaluate posterior probability given proposed model parameters and
the observed flux timeseries.
'''
lp = _log_prior_transit(theta, priorbounds)
if not np.isfinite(lp):
return -np.inf
else:
r... | [
"Evaluate",
"posterior",
"probability",
"given",
"proposed",
"model",
"parameters",
"and",
"the",
"observed",
"flux",
"timeseries",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L628-L638 | [
"def",
"log_posterior_transit",
"(",
"theta",
",",
"params",
",",
"model",
",",
"t",
",",
"flux",
",",
"err_flux",
",",
"priorbounds",
")",
":",
"lp",
"=",
"_log_prior_transit",
"(",
"theta",
",",
"priorbounds",
")",
"if",
"not",
"np",
".",
"isfinite",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | log_posterior_transit_plus_line | Evaluate posterior probability given proposed model parameters and
the observed flux timeseries. | astrobase/lcfit/transits.py | def log_posterior_transit_plus_line(theta, params, model, t, flux, err_flux,
priorbounds):
'''
Evaluate posterior probability given proposed model parameters and
the observed flux timeseries.
'''
lp = _log_prior_transit_plus_line(theta, priorbounds)
if not np.... | def log_posterior_transit_plus_line(theta, params, model, t, flux, err_flux,
priorbounds):
'''
Evaluate posterior probability given proposed model parameters and
the observed flux timeseries.
'''
lp = _log_prior_transit_plus_line(theta, priorbounds)
if not np.... | [
"Evaluate",
"posterior",
"probability",
"given",
"proposed",
"model",
"parameters",
"and",
"the",
"observed",
"flux",
"timeseries",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L641-L654 | [
"def",
"log_posterior_transit_plus_line",
"(",
"theta",
",",
"params",
",",
"model",
",",
"t",
",",
"flux",
",",
"err_flux",
",",
"priorbounds",
")",
":",
"lp",
"=",
"_log_prior_transit_plus_line",
"(",
"theta",
",",
"priorbounds",
")",
"if",
"not",
"np",
".... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | mandelagol_fit_magseries | This fits a Mandel & Agol (2002) planetary transit model to a flux time
series. You can fit and fix whatever parameters you want.
It relies on Kreidberg (2015)'s BATMAN implementation for the transit model,
emcee to sample the posterior (Foreman-Mackey et al 2013), `corner` to plot
it, and `h5py` to sa... | astrobase/lcfit/transits.py | def mandelagol_fit_magseries(
times, mags, errs,
fitparams,
priorbounds,
fixedparams,
trueparams=None,
burninpercent=0.3,
plotcorner=False,
samplesavpath=False,
n_walkers=50,
n_mcmc_steps=400,
eps=1e-4,
skipsampling=False,
... | def mandelagol_fit_magseries(
times, mags, errs,
fitparams,
priorbounds,
fixedparams,
trueparams=None,
burninpercent=0.3,
plotcorner=False,
samplesavpath=False,
n_walkers=50,
n_mcmc_steps=400,
eps=1e-4,
skipsampling=False,
... | [
"This",
"fits",
"a",
"Mandel",
"&",
"Agol",
"(",
"2002",
")",
"planetary",
"transit",
"model",
"to",
"a",
"flux",
"time",
"series",
".",
"You",
"can",
"fit",
"and",
"fix",
"whatever",
"parameters",
"you",
"want",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L661-L1060 | [
"def",
"mandelagol_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"fitparams",
",",
"priorbounds",
",",
"fixedparams",
",",
"trueparams",
"=",
"None",
",",
"burninpercent",
"=",
"0.3",
",",
"plotcorner",
"=",
"False",
",",
"samplesavpath",
"=",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | mandelagol_and_line_fit_magseries | The model fit by this function is: a Mandel & Agol (2002) transit, PLUS a
line. You can fit and fix whatever parameters you want.
A typical use case: you want to measure transit times of individual SNR >~
50 transits. You fix all the transit parameters except for the mid-time,
and also fit for a line l... | astrobase/lcfit/transits.py | def mandelagol_and_line_fit_magseries(
times, mags, errs,
fitparams,
priorbounds,
fixedparams,
trueparams=None,
burninpercent=0.3,
plotcorner=False,
timeoffset=0,
samplesavpath=False,
n_walkers=50,
n_mcmc_steps=400,
eps=1e-4... | def mandelagol_and_line_fit_magseries(
times, mags, errs,
fitparams,
priorbounds,
fixedparams,
trueparams=None,
burninpercent=0.3,
plotcorner=False,
timeoffset=0,
samplesavpath=False,
n_walkers=50,
n_mcmc_steps=400,
eps=1e-4... | [
"The",
"model",
"fit",
"by",
"this",
"function",
"is",
":",
"a",
"Mandel",
"&",
"Agol",
"(",
"2002",
")",
"transit",
"PLUS",
"a",
"line",
".",
"You",
"can",
"fit",
"and",
"fix",
"whatever",
"parameters",
"you",
"want",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/transits.py#L1063-L1530 | [
"def",
"mandelagol_and_line_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"fitparams",
",",
"priorbounds",
",",
"fixedparams",
",",
"trueparams",
"=",
"None",
",",
"burninpercent",
"=",
"0.3",
",",
"plotcorner",
"=",
"False",
",",
"timeoffset",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | list_trilegal_filtersystems | This just lists all the filter systems available for TRILEGAL. | astrobase/services/trilegal.py | def list_trilegal_filtersystems():
'''
This just lists all the filter systems available for TRILEGAL.
'''
print('%-40s %s' % ('FILTER SYSTEM NAME','DESCRIPTION'))
print('%-40s %s' % ('------------------','-----------'))
for key in sorted(TRILEGAL_FILTER_SYSTEMS.keys()):
print('%-40s %s... | def list_trilegal_filtersystems():
'''
This just lists all the filter systems available for TRILEGAL.
'''
print('%-40s %s' % ('FILTER SYSTEM NAME','DESCRIPTION'))
print('%-40s %s' % ('------------------','-----------'))
for key in sorted(TRILEGAL_FILTER_SYSTEMS.keys()):
print('%-40s %s... | [
"This",
"just",
"lists",
"all",
"the",
"filter",
"systems",
"available",
"for",
"TRILEGAL",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/trilegal.py#L478-L487 | [
"def",
"list_trilegal_filtersystems",
"(",
")",
":",
"print",
"(",
"'%-40s %s'",
"%",
"(",
"'FILTER SYSTEM NAME'",
",",
"'DESCRIPTION'",
")",
")",
"print",
"(",
"'%-40s %s'",
"%",
"(",
"'------------------'",
",",
"'-----------'",
")",
")",
"for",
"key",
"in",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | query_galcoords | This queries the TRILEGAL model form, downloads results, and parses them.
Parameters
----------
gal_lon,gal_lat : float
These are the center galactic longitude and latitude in degrees.
filtersystem : str
This is a key in the TRILEGAL_FILTER_SYSTEMS dict. Use the function
:py:f... | astrobase/services/trilegal.py | def query_galcoords(gal_lon,
gal_lat,
filtersystem='sloan_2mass',
field_deg2=1.0,
usebinaries=True,
extinction_sigma=0.1,
magnitude_limit=26.0,
maglim_filtercol=4,
... | def query_galcoords(gal_lon,
gal_lat,
filtersystem='sloan_2mass',
field_deg2=1.0,
usebinaries=True,
extinction_sigma=0.1,
magnitude_limit=26.0,
maglim_filtercol=4,
... | [
"This",
"queries",
"the",
"TRILEGAL",
"model",
"form",
"downloads",
"results",
"and",
"parses",
"them",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/trilegal.py#L491-L804 | [
"def",
"query_galcoords",
"(",
"gal_lon",
",",
"gal_lat",
",",
"filtersystem",
"=",
"'sloan_2mass'",
",",
"field_deg2",
"=",
"1.0",
",",
"usebinaries",
"=",
"True",
",",
"extinction_sigma",
"=",
"0.1",
",",
"magnitude_limit",
"=",
"26.0",
",",
"maglim_filtercol"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | query_radecl | This runs the TRILEGAL query for decimal equatorial coordinates.
Parameters
----------
ra,decl : float
These are the center equatorial coordinates in decimal degrees
filtersystem : str
This is a key in the TRILEGAL_FILTER_SYSTEMS dict. Use the function
:py:func:`astrobase.serv... | astrobase/services/trilegal.py | def query_radecl(ra,
decl,
filtersystem='sloan_2mass',
field_deg2=1.0,
usebinaries=True,
extinction_sigma=0.1,
magnitude_limit=26.0,
maglim_filtercol=4,
trilegal_version=1.6,
... | def query_radecl(ra,
decl,
filtersystem='sloan_2mass',
field_deg2=1.0,
usebinaries=True,
extinction_sigma=0.1,
magnitude_limit=26.0,
maglim_filtercol=4,
trilegal_version=1.6,
... | [
"This",
"runs",
"the",
"TRILEGAL",
"query",
"for",
"decimal",
"equatorial",
"coordinates",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/trilegal.py#L808-L928 | [
"def",
"query_radecl",
"(",
"ra",
",",
"decl",
",",
"filtersystem",
"=",
"'sloan_2mass'",
",",
"field_deg2",
"=",
"1.0",
",",
"usebinaries",
"=",
"True",
",",
"extinction_sigma",
"=",
"0.1",
",",
"magnitude_limit",
"=",
"26.0",
",",
"maglim_filtercol",
"=",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | read_model_table | This reads a downloaded TRILEGAL model file.
Parameters
----------
modelfile : str
Path to the downloaded model file to read.
Returns
-------
np.recarray
Returns the model table as a Numpy record array. | astrobase/services/trilegal.py | def read_model_table(modelfile):
'''
This reads a downloaded TRILEGAL model file.
Parameters
----------
modelfile : str
Path to the downloaded model file to read.
Returns
-------
np.recarray
Returns the model table as a Numpy record array.
'''
infd = gzip.op... | def read_model_table(modelfile):
'''
This reads a downloaded TRILEGAL model file.
Parameters
----------
modelfile : str
Path to the downloaded model file to read.
Returns
-------
np.recarray
Returns the model table as a Numpy record array.
'''
infd = gzip.op... | [
"This",
"reads",
"a",
"downloaded",
"TRILEGAL",
"model",
"file",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/trilegal.py#L932-L954 | [
"def",
"read_model_table",
"(",
"modelfile",
")",
":",
"infd",
"=",
"gzip",
".",
"open",
"(",
"modelfile",
")",
"model",
"=",
"np",
".",
"genfromtxt",
"(",
"infd",
",",
"names",
"=",
"True",
")",
"infd",
".",
"close",
"(",
")",
"return",
"model"
] | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _time_independent_equals | This compares two values in constant time.
Taken from tornado:
https://github.com/tornadoweb/tornado/blob/
d4eb8eb4eb5cc9a6677e9116ef84ded8efba8859/tornado/web.py#L3060 | astrobase/cpserver/checkplotserver_handlers.py | def _time_independent_equals(a, b):
'''
This compares two values in constant time.
Taken from tornado:
https://github.com/tornadoweb/tornado/blob/
d4eb8eb4eb5cc9a6677e9116ef84ded8efba8859/tornado/web.py#L3060
'''
if len(a) != len(b):
return False
result = 0
if isinstance(a... | def _time_independent_equals(a, b):
'''
This compares two values in constant time.
Taken from tornado:
https://github.com/tornadoweb/tornado/blob/
d4eb8eb4eb5cc9a6677e9116ef84ded8efba8859/tornado/web.py#L3060
'''
if len(a) != len(b):
return False
result = 0
if isinstance(a... | [
"This",
"compares",
"two",
"values",
"in",
"constant",
"time",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L3032-L3051 | [
"def",
"_time_independent_equals",
"(",
"a",
",",
"b",
")",
":",
"if",
"len",
"(",
"a",
")",
"!=",
"len",
"(",
"b",
")",
":",
"return",
"False",
"result",
"=",
"0",
"if",
"isinstance",
"(",
"a",
"[",
"0",
"]",
",",
"int",
")",
":",
"# python3 byt... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | FrontendEncoder.default | Overrides the default serializer for `JSONEncoder`.
This can serialize the following objects in addition to what
`JSONEncoder` can already do.
- `np.array`
- `bytes`
- `complex`
- `np.float64` and other `np.dtype` objects
Parameters
----------
... | astrobase/cpserver/checkplotserver_handlers.py | def default(self, obj):
'''Overrides the default serializer for `JSONEncoder`.
This can serialize the following objects in addition to what
`JSONEncoder` can already do.
- `np.array`
- `bytes`
- `complex`
- `np.float64` and other `np.dtype` objects
Para... | def default(self, obj):
'''Overrides the default serializer for `JSONEncoder`.
This can serialize the following objects in addition to what
`JSONEncoder` can already do.
- `np.array`
- `bytes`
- `complex`
- `np.float64` and other `np.dtype` objects
Para... | [
"Overrides",
"the",
"default",
"serializer",
"for",
"JSONEncoder",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L48-L85 | [
"def",
"default",
"(",
"self",
",",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"np",
".",
"ndarray",
")",
":",
"return",
"obj",
".",
"tolist",
"(",
")",
"elif",
"isinstance",
"(",
"obj",
",",
"bytes",
")",
":",
"return",
"obj",
".",
"d... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | IndexHandler.initialize | handles initial setup. | astrobase/cpserver/checkplotserver_handlers.py | def initialize(self, currentdir, assetpath, cplist,
cplistfile, executor, readonly, baseurl):
'''
handles initial setup.
'''
self.currentdir = currentdir
self.assetpath = assetpath
self.currentproject = cplist
self.cplistfile = cplistfile
... | def initialize(self, currentdir, assetpath, cplist,
cplistfile, executor, readonly, baseurl):
'''
handles initial setup.
'''
self.currentdir = currentdir
self.assetpath = assetpath
self.currentproject = cplist
self.cplistfile = cplistfile
... | [
"handles",
"initial",
"setup",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L408-L421 | [
"def",
"initialize",
"(",
"self",
",",
"currentdir",
",",
"assetpath",
",",
"cplist",
",",
"cplistfile",
",",
"executor",
",",
"readonly",
",",
"baseurl",
")",
":",
"self",
".",
"currentdir",
"=",
"currentdir",
"self",
".",
"assetpath",
"=",
"assetpath",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | IndexHandler.get | This handles GET requests to the index page.
TODO: provide the correct baseurl from the checkplotserver options dict,
so the frontend JS can just read that off immediately. | astrobase/cpserver/checkplotserver_handlers.py | def get(self):
'''This handles GET requests to the index page.
TODO: provide the correct baseurl from the checkplotserver options dict,
so the frontend JS can just read that off immediately.
'''
# generate the project's list of checkplots
project_checkplots = self.curr... | def get(self):
'''This handles GET requests to the index page.
TODO: provide the correct baseurl from the checkplotserver options dict,
so the frontend JS can just read that off immediately.
'''
# generate the project's list of checkplots
project_checkplots = self.curr... | [
"This",
"handles",
"GET",
"requests",
"to",
"the",
"index",
"page",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L424-L457 | [
"def",
"get",
"(",
"self",
")",
":",
"# generate the project's list of checkplots",
"project_checkplots",
"=",
"self",
".",
"currentproject",
"[",
"'checkplots'",
"]",
"project_checkplotbasenames",
"=",
"[",
"os",
".",
"path",
".",
"basename",
"(",
"x",
")",
"for"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | CheckplotHandler.get | This handles GET requests to serve a specific checkplot pickle.
This is an AJAX endpoint; returns JSON that gets converted by the
frontend into things to render. | astrobase/cpserver/checkplotserver_handlers.py | def get(self, checkplotfname):
'''This handles GET requests to serve a specific checkplot pickle.
This is an AJAX endpoint; returns JSON that gets converted by the
frontend into things to render.
'''
if checkplotfname:
# do the usual safing
self.checkp... | def get(self, checkplotfname):
'''This handles GET requests to serve a specific checkplot pickle.
This is an AJAX endpoint; returns JSON that gets converted by the
frontend into things to render.
'''
if checkplotfname:
# do the usual safing
self.checkp... | [
"This",
"handles",
"GET",
"requests",
"to",
"serve",
"a",
"specific",
"checkplot",
"pickle",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L485-L980 | [
"def",
"get",
"(",
"self",
",",
"checkplotfname",
")",
":",
"if",
"checkplotfname",
":",
"# do the usual safing",
"self",
".",
"checkplotfname",
"=",
"xhtml_escape",
"(",
"base64",
".",
"b64decode",
"(",
"url_unescape",
"(",
"checkplotfname",
")",
")",
")",
"#... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | CheckplotHandler.post | This handles POST requests.
Also an AJAX endpoint. Updates the persistent checkplot dict using the
changes from the UI, and then saves it back to disk. This could
definitely be faster by just loading the checkplot into a server-wide
shared dict or something. | astrobase/cpserver/checkplotserver_handlers.py | def post(self, cpfile):
'''This handles POST requests.
Also an AJAX endpoint. Updates the persistent checkplot dict using the
changes from the UI, and then saves it back to disk. This could
definitely be faster by just loading the checkplot into a server-wide
shared dict or some... | def post(self, cpfile):
'''This handles POST requests.
Also an AJAX endpoint. Updates the persistent checkplot dict using the
changes from the UI, and then saves it back to disk. This could
definitely be faster by just loading the checkplot into a server-wide
shared dict or some... | [
"This",
"handles",
"POST",
"requests",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L984-L1121 | [
"def",
"post",
"(",
"self",
",",
"cpfile",
")",
":",
"# if self.readonly is set, then don't accept any changes",
"# return immediately with a 400",
"if",
"self",
".",
"readonly",
":",
"msg",
"=",
"\"checkplotserver is in readonly mode. no updates allowed.\"",
"resultdict",
"=",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | CheckplotListHandler.get | This handles GET requests for the current checkplot-list.json file.
Used with AJAX from frontend. | astrobase/cpserver/checkplotserver_handlers.py | def get(self):
'''
This handles GET requests for the current checkplot-list.json file.
Used with AJAX from frontend.
'''
# add the reviewed key to the current dict if it doesn't exist
# this will hold all the reviewed objects for the frontend
if 'reviewed' not ... | def get(self):
'''
This handles GET requests for the current checkplot-list.json file.
Used with AJAX from frontend.
'''
# add the reviewed key to the current dict if it doesn't exist
# this will hold all the reviewed objects for the frontend
if 'reviewed' not ... | [
"This",
"handles",
"GET",
"requests",
"for",
"the",
"current",
"checkplot",
"-",
"list",
".",
"json",
"file",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L1150-L1164 | [
"def",
"get",
"(",
"self",
")",
":",
"# add the reviewed key to the current dict if it doesn't exist",
"# this will hold all the reviewed objects for the frontend",
"if",
"'reviewed'",
"not",
"in",
"self",
".",
"currentproject",
":",
"self",
".",
"currentproject",
"[",
"'revi... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | CheckplotListHandler.post | This handles POST requests.
Saves the changes made by the user on the frontend back to the current
checkplot-list.json file. | astrobase/cpserver/checkplotserver_handlers.py | def post(self):
'''This handles POST requests.
Saves the changes made by the user on the frontend back to the current
checkplot-list.json file.
'''
# if self.readonly is set, then don't accept any changes
# return immediately with a 400
if self.readonly:
... | def post(self):
'''This handles POST requests.
Saves the changes made by the user on the frontend back to the current
checkplot-list.json file.
'''
# if self.readonly is set, then don't accept any changes
# return immediately with a 400
if self.readonly:
... | [
"This",
"handles",
"POST",
"requests",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L1168-L1233 | [
"def",
"post",
"(",
"self",
")",
":",
"# if self.readonly is set, then don't accept any changes",
"# return immediately with a 400",
"if",
"self",
".",
"readonly",
":",
"msg",
"=",
"\"checkplotserver is in readonly mode. no updates allowed.\"",
"resultdict",
"=",
"{",
"'status'... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | LCToolHandler.get | This handles a GET request to run a specified LC tool.
Parameters
----------
cpfile : str
This is the checkplot file to run the tool on.
Returns
-------
str
Returns a JSON response.
Notes
-----
The URI structure is::
... | astrobase/cpserver/checkplotserver_handlers.py | def get(self, cpfile):
'''This handles a GET request to run a specified LC tool.
Parameters
----------
cpfile : str
This is the checkplot file to run the tool on.
Returns
-------
str
Returns a JSON response.
Notes
-----... | def get(self, cpfile):
'''This handles a GET request to run a specified LC tool.
Parameters
----------
cpfile : str
This is the checkplot file to run the tool on.
Returns
-------
str
Returns a JSON response.
Notes
-----... | [
"This",
"handles",
"a",
"GET",
"request",
"to",
"run",
"a",
"specified",
"LC",
"tool",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L1264-L3005 | [
"def",
"get",
"(",
"self",
",",
"cpfile",
")",
":",
"if",
"cpfile",
":",
"self",
".",
"cpfile",
"=",
"(",
"xhtml_escape",
"(",
"base64",
".",
"b64decode",
"(",
"url_unescape",
"(",
"cpfile",
")",
")",
")",
")",
"# see if this plot is in the current project",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | StandaloneHandler.initialize | This handles initial setup of the `RequestHandler`. | astrobase/cpserver/checkplotserver_handlers.py | def initialize(self, executor, secret):
'''
This handles initial setup of the `RequestHandler`.
'''
self.executor = executor
self.secret = secret | def initialize(self, executor, secret):
'''
This handles initial setup of the `RequestHandler`.
'''
self.executor = executor
self.secret = secret | [
"This",
"handles",
"initial",
"setup",
"of",
"the",
"RequestHandler",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L3064-L3071 | [
"def",
"initialize",
"(",
"self",
",",
"executor",
",",
"secret",
")",
":",
"self",
".",
"executor",
"=",
"executor",
"self",
".",
"secret",
"=",
"secret"
] | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | StandaloneHandler.get | This handles GET requests.
Returns the requested checkplot pickle's information as JSON.
Requires a pre-shared secret `key` argument for the operation to
complete successfully. This is obtained from a command-line argument. | astrobase/cpserver/checkplotserver_handlers.py | def get(self):
'''This handles GET requests.
Returns the requested checkplot pickle's information as JSON.
Requires a pre-shared secret `key` argument for the operation to
complete successfully. This is obtained from a command-line argument.
'''
provided_key = self.ge... | def get(self):
'''This handles GET requests.
Returns the requested checkplot pickle's information as JSON.
Requires a pre-shared secret `key` argument for the operation to
complete successfully. This is obtained from a command-line argument.
'''
provided_key = self.ge... | [
"This",
"handles",
"GET",
"requests",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver_handlers.py#L3076-L3500 | [
"def",
"get",
"(",
"self",
")",
":",
"provided_key",
"=",
"self",
".",
"get_argument",
"(",
"'key'",
",",
"default",
"=",
"None",
")",
"if",
"not",
"provided_key",
":",
"LOGGER",
".",
"error",
"(",
"'standalone URL hit but no secret key provided'",
")",
"retdi... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | extinction_query | This queries the 2MASS DUST service to find the extinction parameters
for the given `lon`, `lat`.
Parameters
----------
lon,lat: float
These are decimal right ascension and declination if `coordtype =
'equatorial'`. These are are decimal Galactic longitude and latitude if
`coor... | astrobase/services/dust.py | def extinction_query(lon, lat,
coordtype='equatorial',
sizedeg=5.0,
forcefetch=False,
cachedir='~/.astrobase/dust-cache',
verbose=True,
timeout=10.0,
jitter=5.0):
'''Thi... | def extinction_query(lon, lat,
coordtype='equatorial',
sizedeg=5.0,
forcefetch=False,
cachedir='~/.astrobase/dust-cache',
verbose=True,
timeout=10.0,
jitter=5.0):
'''Thi... | [
"This",
"queries",
"the",
"2MASS",
"DUST",
"service",
"to",
"find",
"the",
"extinction",
"parameters",
"for",
"the",
"given",
"lon",
"lat",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/dust.py#L88-L257 | [
"def",
"extinction_query",
"(",
"lon",
",",
"lat",
",",
"coordtype",
"=",
"'equatorial'",
",",
"sizedeg",
"=",
"5.0",
",",
"forcefetch",
"=",
"False",
",",
"cachedir",
"=",
"'~/.astrobase/dust-cache'",
",",
"verbose",
"=",
"True",
",",
"timeout",
"=",
"10.0"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | smooth_magseries_gaussfilt | This smooths the magseries with a Gaussian kernel.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
windowfwhm : int
This is an odd integer containing the FWHM of ... | astrobase/varbase/trends.py | def smooth_magseries_gaussfilt(mags, windowsize, windowfwhm=7):
'''This smooths the magseries with a Gaussian kernel.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
... | def smooth_magseries_gaussfilt(mags, windowsize, windowfwhm=7):
'''This smooths the magseries with a Gaussian kernel.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
... | [
"This",
"smooths",
"the",
"magseries",
"with",
"a",
"Gaussian",
"kernel",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L121-L147 | [
"def",
"smooth_magseries_gaussfilt",
"(",
"mags",
",",
"windowsize",
",",
"windowfwhm",
"=",
"7",
")",
":",
"convkernel",
"=",
"Gaussian1DKernel",
"(",
"windowfwhm",
",",
"x_size",
"=",
"windowsize",
")",
"smoothed",
"=",
"convolve",
"(",
"mags",
",",
"convker... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | smooth_magseries_savgol | This smooths the magseries with a Savitsky-Golay filter.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
polyorder : int
This is an integer containing the polynom... | astrobase/varbase/trends.py | def smooth_magseries_savgol(mags, windowsize, polyorder=2):
'''This smooths the magseries with a Savitsky-Golay filter.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
... | def smooth_magseries_savgol(mags, windowsize, polyorder=2):
'''This smooths the magseries with a Savitsky-Golay filter.
Parameters
----------
mags : np.array
The input mags/flux time-series to smooth.
windowsize : int
This is a odd integer containing the smoothing window size.
... | [
"This",
"smooths",
"the",
"magseries",
"with",
"a",
"Savitsky",
"-",
"Golay",
"filter",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L150-L175 | [
"def",
"smooth_magseries_savgol",
"(",
"mags",
",",
"windowsize",
",",
"polyorder",
"=",
"2",
")",
":",
"smoothed",
"=",
"savgol_filter",
"(",
"mags",
",",
"windowsize",
",",
"polyorder",
")",
"return",
"smoothed"
] | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _old_epd_diffmags | This calculates the difference in mags after EPD coefficients are
calculated.
final EPD mags = median(magseries) + epd_diffmags() | astrobase/varbase/trends.py | def _old_epd_diffmags(coeff, fsv, fdv, fkv, xcc, ycc, bgv, bge, mag):
'''
This calculates the difference in mags after EPD coefficients are
calculated.
final EPD mags = median(magseries) + epd_diffmags()
'''
return -(coeff[0]*fsv**2. +
coeff[1]*fsv +
coeff[2]*fdv**2.... | def _old_epd_diffmags(coeff, fsv, fdv, fkv, xcc, ycc, bgv, bge, mag):
'''
This calculates the difference in mags after EPD coefficients are
calculated.
final EPD mags = median(magseries) + epd_diffmags()
'''
return -(coeff[0]*fsv**2. +
coeff[1]*fsv +
coeff[2]*fdv**2.... | [
"This",
"calculates",
"the",
"difference",
"in",
"mags",
"after",
"EPD",
"coefficients",
"are",
"calculated",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L182-L211 | [
"def",
"_old_epd_diffmags",
"(",
"coeff",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"mag",
")",
":",
"return",
"-",
"(",
"coeff",
"[",
"0",
"]",
"*",
"fsv",
"**",
"2.",
"+",
"coeff",
"[",
"1",
"]... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _old_epd_magseries | Detrends a magnitude series given in mag using accompanying values of S in
fsv, D in fdv, K in fkv, x coords in xcc, y coords in ycc, background in
bgv, and background error in bge. smooth is used to set a smoothing
parameter for the fit function. Does EPD voodoo. | astrobase/varbase/trends.py | def _old_epd_magseries(times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge,
epdsmooth_windowsize=21,
epdsmooth_sigclip=3.0,
epdsmooth_func=smooth_magseries_signal_medfilt,
epdsmooth_extraparams=None):
... | def _old_epd_magseries(times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge,
epdsmooth_windowsize=21,
epdsmooth_sigclip=3.0,
epdsmooth_func=smooth_magseries_signal_medfilt,
epdsmooth_extraparams=None):
... | [
"Detrends",
"a",
"magnitude",
"series",
"given",
"in",
"mag",
"using",
"accompanying",
"values",
"of",
"S",
"in",
"fsv",
"D",
"in",
"fdv",
"K",
"in",
"fkv",
"x",
"coords",
"in",
"xcc",
"y",
"coords",
"in",
"ycc",
"background",
"in",
"bgv",
"and",
"back... | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L215-L308 | [
"def",
"_old_epd_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"epdsmooth_windowsize",
"=",
"21",
",",
"epdsmooth_sigclip",
"=",
"3.0",
",",
"epdsmooth_func",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _epd_function | This is the EPD function to fit using a smoothed mag-series. | astrobase/varbase/trends.py | def _epd_function(coeffs, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''
This is the EPD function to fit using a smoothed mag-series.
'''
return (coeffs[0]*fsv*fsv +
coeffs[1]*fsv +
coeffs[2]*fdv*fdv +
coeffs[3]*fdv +
coeffs[4]*fkv*fkv +
c... | def _epd_function(coeffs, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''
This is the EPD function to fit using a smoothed mag-series.
'''
return (coeffs[0]*fsv*fsv +
coeffs[1]*fsv +
coeffs[2]*fdv*fdv +
coeffs[3]*fdv +
coeffs[4]*fkv*fkv +
c... | [
"This",
"is",
"the",
"EPD",
"function",
"to",
"fit",
"using",
"a",
"smoothed",
"mag",
"-",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L316-L343 | [
"def",
"_epd_function",
"(",
"coeffs",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"iha",
",",
"izd",
")",
":",
"return",
"(",
"coeffs",
"[",
"0",
"]",
"*",
"fsv",
"*",
"fsv",
"+",
"coeffs",
"[",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _epd_residual | This is the residual function to minimize using scipy.optimize.leastsq. | astrobase/varbase/trends.py | def _epd_residual(coeffs, mags, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''
This is the residual function to minimize using scipy.optimize.leastsq.
'''
f = _epd_function(coeffs, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd)
residual = mags - f
return residual | def _epd_residual(coeffs, mags, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''
This is the residual function to minimize using scipy.optimize.leastsq.
'''
f = _epd_function(coeffs, fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd)
residual = mags - f
return residual | [
"This",
"is",
"the",
"residual",
"function",
"to",
"minimize",
"using",
"scipy",
".",
"optimize",
".",
"leastsq",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L347-L355 | [
"def",
"_epd_residual",
"(",
"coeffs",
",",
"mags",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"iha",
",",
"izd",
")",
":",
"f",
"=",
"_epd_function",
"(",
"coeffs",
",",
"fsv",
",",
"fdv",
",",
"fk... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _epd_residual2 | This is the residual function to minimize using
scipy.optimize.least_squares.
This variant is for :py:func:`.epd_magseries_extparams`. | astrobase/varbase/trends.py | def _epd_residual2(coeffs,
times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''This is the residual function to minimize using
scipy.optimize.least_squares.
This variant is for :py:func:`.epd_magseries_extparams`.
'''
f = _epd_function(coeffs,... | def _epd_residual2(coeffs,
times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd):
'''This is the residual function to minimize using
scipy.optimize.least_squares.
This variant is for :py:func:`.epd_magseries_extparams`.
'''
f = _epd_function(coeffs,... | [
"This",
"is",
"the",
"residual",
"function",
"to",
"minimize",
"using",
"scipy",
".",
"optimize",
".",
"least_squares",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L359-L371 | [
"def",
"_epd_residual2",
"(",
"coeffs",
",",
"times",
",",
"mags",
",",
"errs",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"iha",
",",
"izd",
")",
":",
"f",
"=",
"_epd_function",
"(",
"coeffs",
",",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | epd_magseries | Detrends a magnitude series using External Parameter Decorrelation.
Requires a set of external parameters similar to those present in HAT light
curves. At the moment, the HAT light-curve-specific external parameters are:
- S: the 'fsv' column in light curves,
- D: the 'fdv' column in light curves,
... | astrobase/varbase/trends.py | def epd_magseries(times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd,
magsarefluxes=False,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
epdsmooth_extraparams... | def epd_magseries(times, mags, errs,
fsv, fdv, fkv, xcc, ycc, bgv, bge, iha, izd,
magsarefluxes=False,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
epdsmooth_extraparams... | [
"Detrends",
"a",
"magnitude",
"series",
"using",
"External",
"Parameter",
"Decorrelation",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L375-L575 | [
"def",
"epd_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"fsv",
",",
"fdv",
",",
"fkv",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
",",
"iha",
",",
"izd",
",",
"magsarefluxes",
"=",
"False",
",",
"epdsmooth_sigclip",
"=",
"3.0",
",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | epd_magseries_extparams | This does EPD on a mag-series with arbitrary external parameters.
Parameters
----------
times,mags,errs : np.array
The input mag/flux time-series to run EPD on.
externalparam_arrs : list of np.arrays
This is a list of ndarrays of external parameters to decorrelate
against. The... | astrobase/varbase/trends.py | def epd_magseries_extparams(
times,
mags,
errs,
externalparam_arrs,
initial_coeff_guess,
magsarefluxes=False,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
epdsmooth_extraparams=None,
object... | def epd_magseries_extparams(
times,
mags,
errs,
externalparam_arrs,
initial_coeff_guess,
magsarefluxes=False,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
epdsmooth_extraparams=None,
object... | [
"This",
"does",
"EPD",
"on",
"a",
"mag",
"-",
"series",
"with",
"arbitrary",
"external",
"parameters",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L582-L781 | [
"def",
"epd_magseries_extparams",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"externalparam_arrs",
",",
"initial_coeff_guess",
",",
"magsarefluxes",
"=",
"False",
",",
"epdsmooth_sigclip",
"=",
"3.0",
",",
"epdsmooth_windowsize",
"=",
"21",
",",
"epdsmooth_func",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | rfepd_magseries | This uses a `RandomForestRegressor` to de-correlate the given magseries.
Parameters
----------
times,mags,errs : np.array
The input mag/flux time-series to run EPD on.
externalparam_arrs : list of np.arrays
This is a list of ndarrays of external parameters to decorrelate
again... | astrobase/varbase/trends.py | def rfepd_magseries(times, mags, errs,
externalparam_arrs,
magsarefluxes=False,
epdsmooth=True,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
... | def rfepd_magseries(times, mags, errs,
externalparam_arrs,
magsarefluxes=False,
epdsmooth=True,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
... | [
"This",
"uses",
"a",
"RandomForestRegressor",
"to",
"de",
"-",
"correlate",
"the",
"given",
"magseries",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/trends.py#L789-L952 | [
"def",
"rfepd_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"externalparam_arrs",
",",
"magsarefluxes",
"=",
"False",
",",
"epdsmooth",
"=",
"True",
",",
"epdsmooth_sigclip",
"=",
"3.0",
",",
"epdsmooth_windowsize",
"=",
"21",
",",
"epdsmooth_func",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | lcfit_features | This calculates various features related to fitting models to light
curves.
This function:
- calculates `R_ij` and `phi_ij` ratios for Fourier fit amplitudes and
phases.
- calculates the reduced chi-sq for fourier, EB, and planet transit fits.
- calculates the reduced chi-sq for fourier, E... | astrobase/varclass/periodicfeatures.py | def lcfit_features(times, mags, errs, period,
fourierorder=5,
# these are depth, duration, ingress duration
transitparams=(-0.01,0.1,0.1),
# these are depth, duration, depth ratio, secphase
ebparams=(-0.2,0.3,0.7,0.5),
... | def lcfit_features(times, mags, errs, period,
fourierorder=5,
# these are depth, duration, ingress duration
transitparams=(-0.01,0.1,0.1),
# these are depth, duration, depth ratio, secphase
ebparams=(-0.2,0.3,0.7,0.5),
... | [
"This",
"calculates",
"various",
"features",
"related",
"to",
"fitting",
"models",
"to",
"light",
"curves",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/periodicfeatures.py#L63-L484 | [
"def",
"lcfit_features",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"period",
",",
"fourierorder",
"=",
"5",
",",
"# these are depth, duration, ingress duration",
"transitparams",
"=",
"(",
"-",
"0.01",
",",
"0.1",
",",
"0.1",
")",
",",
"# these are depth, dur... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | periodogram_features | This calculates various periodogram features (for each periodogram).
The following features are obtained:
- For all best periods from all periodogram methods in `pgramlist`,
calculates the number of these with peaks that are at least
`sampling_peak_multiplier` x time-sampling periodogram peak at t... | astrobase/varclass/periodicfeatures.py | def periodogram_features(pgramlist, times, mags, errs,
sigclip=10.0,
pdiff_threshold=1.0e-4,
sidereal_threshold=1.0e-4,
sampling_peak_multiplier=5.0,
sampling_startp=None,
... | def periodogram_features(pgramlist, times, mags, errs,
sigclip=10.0,
pdiff_threshold=1.0e-4,
sidereal_threshold=1.0e-4,
sampling_peak_multiplier=5.0,
sampling_startp=None,
... | [
"This",
"calculates",
"various",
"periodogram",
"features",
"(",
"for",
"each",
"periodogram",
")",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/periodicfeatures.py#L488-L816 | [
"def",
"periodogram_features",
"(",
"pgramlist",
",",
"times",
",",
"mags",
",",
"errs",
",",
"sigclip",
"=",
"10.0",
",",
"pdiff_threshold",
"=",
"1.0e-4",
",",
"sidereal_threshold",
"=",
"1.0e-4",
",",
"sampling_peak_multiplier",
"=",
"5.0",
",",
"sampling_sta... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | phasedlc_features | This calculates various phased LC features for the object.
Some of the features calculated here come from:
Kim, D.-W., Protopapas, P., Bailer-Jones, C. A. L., et al. 2014, Astronomy
and Astrophysics, 566, A43, and references therein (especially Richards, et
al. 2011).
Parameters
----------
... | astrobase/varclass/periodicfeatures.py | def phasedlc_features(times,
mags,
errs,
period,
nbrtimes=None,
nbrmags=None,
nbrerrs=None):
'''This calculates various phased LC features for the object.
Some of the features cal... | def phasedlc_features(times,
mags,
errs,
period,
nbrtimes=None,
nbrmags=None,
nbrerrs=None):
'''This calculates various phased LC features for the object.
Some of the features cal... | [
"This",
"calculates",
"various",
"phased",
"LC",
"features",
"for",
"the",
"object",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/periodicfeatures.py#L820-L1085 | [
"def",
"phasedlc_features",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"period",
",",
"nbrtimes",
"=",
"None",
",",
"nbrmags",
"=",
"None",
",",
"nbrerrs",
"=",
"None",
")",
":",
"# get the finite values",
"finind",
"=",
"np",
".",
"isfinite",
"(",
"ti... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | stellingwerf_pdm_theta | This calculates the Stellingwerf PDM theta value at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequency : float
The test frequency to calculate the theta statistic at.
binsize : float
The phase bin size... | astrobase/periodbase/spdm.py | def stellingwerf_pdm_theta(times, mags, errs, frequency,
binsize=0.05, minbin=9):
'''
This calculates the Stellingwerf PDM theta value at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequenc... | def stellingwerf_pdm_theta(times, mags, errs, frequency,
binsize=0.05, minbin=9):
'''
This calculates the Stellingwerf PDM theta value at a test frequency.
Parameters
----------
times,mags,errs : np.array
The input time-series and associated errors.
frequenc... | [
"This",
"calculates",
"the",
"Stellingwerf",
"PDM",
"theta",
"value",
"at",
"a",
"test",
"frequency",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/spdm.py#L71-L141 | [
"def",
"stellingwerf_pdm_theta",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"frequency",
",",
"binsize",
"=",
"0.05",
",",
"minbin",
"=",
"9",
")",
":",
"period",
"=",
"1.0",
"/",
"frequency",
"fold_time",
"=",
"times",
"[",
"0",
"]",
"phased",
"=",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _stellingwerf_pdm_worker | This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = binsize
task[5] = minbin
Return... | astrobase/periodbase/spdm.py | def _stellingwerf_pdm_worker(task):
'''
This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = ... | def _stellingwerf_pdm_worker(task):
'''
This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form below::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = frequency
task[4] = ... | [
"This",
"is",
"a",
"parallel",
"worker",
"for",
"the",
"function",
"below",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/spdm.py#L145-L182 | [
"def",
"_stellingwerf_pdm_worker",
"(",
"task",
")",
":",
"times",
",",
"mags",
",",
"errs",
",",
"frequency",
",",
"binsize",
",",
"minbin",
"=",
"task",
"try",
":",
"theta",
"=",
"stellingwerf_pdm_theta",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"f... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | stellingwerf_pdm | This runs a parallelized Stellingwerf phase-dispersion minimization (PDM)
period search.
Parameters
----------
times,mags,errs : np.array
The mag/flux time-series with associated measurement errors to run the
period-finding on.
magsarefluxes : bool
If the input measurement... | astrobase/periodbase/spdm.py | def stellingwerf_pdm(times,
mags,
errs,
magsarefluxes=False,
startp=None,
endp=None,
stepsize=1.0e-4,
autofreq=True,
normalize=False,
... | def stellingwerf_pdm(times,
mags,
errs,
magsarefluxes=False,
startp=None,
endp=None,
stepsize=1.0e-4,
autofreq=True,
normalize=False,
... | [
"This",
"runs",
"a",
"parallelized",
"Stellingwerf",
"phase",
"-",
"dispersion",
"minimization",
"(",
"PDM",
")",
"period",
"search",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/spdm.py#L186-L487 | [
"def",
"stellingwerf_pdm",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"magsarefluxes",
"=",
"False",
",",
"startp",
"=",
"None",
",",
"endp",
"=",
"None",
",",
"stepsize",
"=",
"1.0e-4",
",",
"autofreq",
"=",
"True",
",",
"normalize",
"=",
"False",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | analytic_false_alarm_probability | This returns the analytic false alarm probabilities for periodogram
peak values.
FIXME: this doesn't actually work. Fix later.
The calculation follows that on page 3 of Zechmeister & Kurster (2009)::
FAP = 1 − [1 − Prob(z > z0)]**M
where::
M is the number of independent frequencies
... | astrobase/periodbase/spdm.py | def analytic_false_alarm_probability(lspinfo,
times,
conservative_nfreq_eff=True,
peakvals=None,
inplace=True):
'''This returns the analytic false alarm probabilities f... | def analytic_false_alarm_probability(lspinfo,
times,
conservative_nfreq_eff=True,
peakvals=None,
inplace=True):
'''This returns the analytic false alarm probabilities f... | [
"This",
"returns",
"the",
"analytic",
"false",
"alarm",
"probabilities",
"for",
"periodogram",
"peak",
"values",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/spdm.py#L491-L605 | [
"def",
"analytic_false_alarm_probability",
"(",
"lspinfo",
",",
"times",
",",
"conservative_nfreq_eff",
"=",
"True",
",",
"peakvals",
"=",
"None",
",",
"inplace",
"=",
"True",
")",
":",
"from",
"scipy",
".",
"stats",
"import",
"beta",
"frequencies",
"=",
"1.0"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | keplermag_to_sdssr | Converts magnitude measurements in Kepler band to SDSS r band.
Parameters
----------
keplermag : float or array-like
The Kepler magnitude value(s) to convert to fluxes.
kic_sdssg,kic_sdssr : float or array-like
The SDSS g and r magnitudes of the object(s) from the Kepler Input
... | astrobase/astrokep.py | def keplermag_to_sdssr(keplermag, kic_sdssg, kic_sdssr):
'''Converts magnitude measurements in Kepler band to SDSS r band.
Parameters
----------
keplermag : float or array-like
The Kepler magnitude value(s) to convert to fluxes.
kic_sdssg,kic_sdssr : float or array-like
The SDSS g... | def keplermag_to_sdssr(keplermag, kic_sdssg, kic_sdssr):
'''Converts magnitude measurements in Kepler band to SDSS r band.
Parameters
----------
keplermag : float or array-like
The Kepler magnitude value(s) to convert to fluxes.
kic_sdssg,kic_sdssr : float or array-like
The SDSS g... | [
"Converts",
"magnitude",
"measurements",
"in",
"Kepler",
"band",
"to",
"SDSS",
"r",
"band",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L138-L165 | [
"def",
"keplermag_to_sdssr",
"(",
"keplermag",
",",
"kic_sdssg",
",",
"kic_sdssr",
")",
":",
"kic_sdssgr",
"=",
"kic_sdssg",
"-",
"kic_sdssr",
"if",
"kic_sdssgr",
"<",
"0.8",
":",
"kepsdssr",
"=",
"(",
"keplermag",
"-",
"0.2",
"*",
"kic_sdssg",
")",
"/",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | read_kepler_fitslc | This extracts the light curve from a single Kepler or K2 LC FITS file.
This works on the light curves available at MAST:
- `kplr{kepid}-{somedatething}_llc.fits` files from the Kepler mission
- `ktwo{epicid}-c{campaign}_llc.fits` files from the K2 mission
Parameters
----------
lcfits : str
... | astrobase/astrokep.py | def read_kepler_fitslc(
lcfits,
headerkeys=LCHEADERKEYS,
datakeys=LCDATAKEYS,
sapkeys=LCSAPKEYS,
pdckeys=LCPDCKEYS,
topkeys=LCTOPKEYS,
apkeys=LCAPERTUREKEYS,
appendto=None,
normalize=False,
):
'''This extracts the light curve from a single Kepl... | def read_kepler_fitslc(
lcfits,
headerkeys=LCHEADERKEYS,
datakeys=LCDATAKEYS,
sapkeys=LCSAPKEYS,
pdckeys=LCPDCKEYS,
topkeys=LCTOPKEYS,
apkeys=LCAPERTUREKEYS,
appendto=None,
normalize=False,
):
'''This extracts the light curve from a single Kepl... | [
"This",
"extracts",
"the",
"light",
"curve",
"from",
"a",
"single",
"Kepler",
"or",
"K2",
"LC",
"FITS",
"file",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L244-L611 | [
"def",
"read_kepler_fitslc",
"(",
"lcfits",
",",
"headerkeys",
"=",
"LCHEADERKEYS",
",",
"datakeys",
"=",
"LCDATAKEYS",
",",
"sapkeys",
"=",
"LCSAPKEYS",
",",
"pdckeys",
"=",
"LCPDCKEYS",
",",
"topkeys",
"=",
"LCTOPKEYS",
",",
"apkeys",
"=",
"LCAPERTUREKEYS",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | consolidate_kepler_fitslc | This gets all Kepler/K2 light curves for the given `keplerid`
in `lcfitsdir`.
Searches recursively in `lcfitsdir` for all of the files belonging to the
specified `keplerid`. Sorts the light curves by time. Returns an
`lcdict`. This is meant to be used to consolidate light curves for a single
object... | astrobase/astrokep.py | def consolidate_kepler_fitslc(keplerid,
lcfitsdir,
normalize=True,
headerkeys=LCHEADERKEYS,
datakeys=LCDATAKEYS,
sapkeys=LCSAPKEYS,
pdckeys=... | def consolidate_kepler_fitslc(keplerid,
lcfitsdir,
normalize=True,
headerkeys=LCHEADERKEYS,
datakeys=LCDATAKEYS,
sapkeys=LCSAPKEYS,
pdckeys=... | [
"This",
"gets",
"all",
"Kepler",
"/",
"K2",
"light",
"curves",
"for",
"the",
"given",
"keplerid",
"in",
"lcfitsdir",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L615-L802 | [
"def",
"consolidate_kepler_fitslc",
"(",
"keplerid",
",",
"lcfitsdir",
",",
"normalize",
"=",
"True",
",",
"headerkeys",
"=",
"LCHEADERKEYS",
",",
"datakeys",
"=",
"LCDATAKEYS",
",",
"sapkeys",
"=",
"LCSAPKEYS",
",",
"pdckeys",
"=",
"LCPDCKEYS",
",",
"topkeys",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | read_k2sff_lightcurve | This reads a K2 SFF (Vandenberg+ 2014) light curve into an `lcdict`.
Use this with the light curves from the K2 SFF project at MAST.
Parameters
----------
lcfits : str
The filename of the FITS light curve file downloaded from MAST.
Returns
-------
lcdict
Returns an `lcdi... | astrobase/astrokep.py | def read_k2sff_lightcurve(lcfits):
'''This reads a K2 SFF (Vandenberg+ 2014) light curve into an `lcdict`.
Use this with the light curves from the K2 SFF project at MAST.
Parameters
----------
lcfits : str
The filename of the FITS light curve file downloaded from MAST.
Returns
--... | def read_k2sff_lightcurve(lcfits):
'''This reads a K2 SFF (Vandenberg+ 2014) light curve into an `lcdict`.
Use this with the light curves from the K2 SFF project at MAST.
Parameters
----------
lcfits : str
The filename of the FITS light curve file downloaded from MAST.
Returns
--... | [
"This",
"reads",
"a",
"K2",
"SFF",
"(",
"Vandenberg",
"+",
"2014",
")",
"light",
"curve",
"into",
"an",
"lcdict",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L816-L945 | [
"def",
"read_k2sff_lightcurve",
"(",
"lcfits",
")",
":",
"# read the fits file",
"hdulist",
"=",
"pyfits",
".",
"open",
"(",
"lcfits",
")",
"lchdr",
",",
"lcdata",
"=",
"hdulist",
"[",
"1",
"]",
".",
"header",
",",
"hdulist",
"[",
"1",
"]",
".",
"data",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | kepler_lcdict_to_pkl | This writes the `lcdict` to a Python pickle.
Parameters
----------
lcdict : lcdict
This is the input `lcdict` to write to a pickle.
outfile : str or None
If this is None, the object's Kepler ID/EPIC ID will determined from the
`lcdict` and used to form the filename of the outp... | astrobase/astrokep.py | def kepler_lcdict_to_pkl(lcdict, outfile=None):
'''This writes the `lcdict` to a Python pickle.
Parameters
----------
lcdict : lcdict
This is the input `lcdict` to write to a pickle.
outfile : str or None
If this is None, the object's Kepler ID/EPIC ID will determined from the
... | def kepler_lcdict_to_pkl(lcdict, outfile=None):
'''This writes the `lcdict` to a Python pickle.
Parameters
----------
lcdict : lcdict
This is the input `lcdict` to write to a pickle.
outfile : str or None
If this is None, the object's Kepler ID/EPIC ID will determined from the
... | [
"This",
"writes",
"the",
"lcdict",
"to",
"a",
"Python",
"pickle",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L953-L983 | [
"def",
"kepler_lcdict_to_pkl",
"(",
"lcdict",
",",
"outfile",
"=",
"None",
")",
":",
"if",
"not",
"outfile",
":",
"outfile",
"=",
"'%s-keplc.pkl'",
"%",
"lcdict",
"[",
"'objectid'",
"]",
".",
"replace",
"(",
"' '",
",",
"'-'",
")",
"# we're using pickle.HIGH... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | read_kepler_pklc | This turns the pickled lightcurve file back into an `lcdict`.
Parameters
----------
picklefile : str
The path to a previously written Kepler LC picklefile generated by
`kepler_lcdict_to_pkl` above.
Returns
-------
lcdict
Returns an `lcdict` (this is useable by most as... | astrobase/astrokep.py | def read_kepler_pklc(picklefile):
'''This turns the pickled lightcurve file back into an `lcdict`.
Parameters
----------
picklefile : str
The path to a previously written Kepler LC picklefile generated by
`kepler_lcdict_to_pkl` above.
Returns
-------
lcdict
Return... | def read_kepler_pklc(picklefile):
'''This turns the pickled lightcurve file back into an `lcdict`.
Parameters
----------
picklefile : str
The path to a previously written Kepler LC picklefile generated by
`kepler_lcdict_to_pkl` above.
Returns
-------
lcdict
Return... | [
"This",
"turns",
"the",
"pickled",
"lightcurve",
"file",
"back",
"into",
"an",
"lcdict",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L987-L1025 | [
"def",
"read_kepler_pklc",
"(",
"picklefile",
")",
":",
"if",
"picklefile",
".",
"endswith",
"(",
"'.gz'",
")",
":",
"infd",
"=",
"gzip",
".",
"open",
"(",
"picklefile",
",",
"'rb'",
")",
"else",
":",
"infd",
"=",
"open",
"(",
"picklefile",
",",
"'rb'"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | filter_kepler_lcdict | This filters the Kepler `lcdict`, removing nans and bad
observations.
By default, this function removes points in the Kepler LC that have ANY
quality flags set.
Parameters
----------
lcdict : lcdict
An `lcdict` produced by `consolidate_kepler_fitslc` or
`read_kepler_fitslc`.
... | astrobase/astrokep.py | def filter_kepler_lcdict(lcdict,
filterflags=True,
nanfilter='sap,pdc',
timestoignore=None):
'''This filters the Kepler `lcdict`, removing nans and bad
observations.
By default, this function removes points in the Kepler LC that hav... | def filter_kepler_lcdict(lcdict,
filterflags=True,
nanfilter='sap,pdc',
timestoignore=None):
'''This filters the Kepler `lcdict`, removing nans and bad
observations.
By default, this function removes points in the Kepler LC that hav... | [
"This",
"filters",
"the",
"Kepler",
"lcdict",
"removing",
"nans",
"and",
"bad",
"observations",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1058-L1182 | [
"def",
"filter_kepler_lcdict",
"(",
"lcdict",
",",
"filterflags",
"=",
"True",
",",
"nanfilter",
"=",
"'sap,pdc'",
",",
"timestoignore",
"=",
"None",
")",
":",
"cols",
"=",
"lcdict",
"[",
"'columns'",
"]",
"# filter all bad LC points as noted by quality flags",
"if"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _epd_function | This is the EPD function to fit.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-like
The flux measurement array being used.
xcc,ycc : array-like
Arrays of the x a... | astrobase/astrokep.py | def _epd_function(coeffs, fluxes, xcc, ycc, bgv, bge):
'''This is the EPD function to fit.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-like
The flux measurement array b... | def _epd_function(coeffs, fluxes, xcc, ycc, bgv, bge):
'''This is the EPD function to fit.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-like
The flux measurement array b... | [
"This",
"is",
"the",
"EPD",
"function",
"to",
"fit",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1190-L1229 | [
"def",
"_epd_function",
"(",
"coeffs",
",",
"fluxes",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
")",
":",
"epdf",
"=",
"(",
"coeffs",
"[",
"0",
"]",
"+",
"coeffs",
"[",
"1",
"]",
"*",
"npsin",
"(",
"2",
"*",
"MPI",
"*",
"xcc",
")",
"+",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _epd_residual | This is the residual function to minimize using scipy.optimize.leastsq.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-like
The flux measurement array being used.
xcc,ycc... | astrobase/astrokep.py | def _epd_residual(coeffs, fluxes, xcc, ycc, bgv, bge):
'''This is the residual function to minimize using scipy.optimize.leastsq.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-li... | def _epd_residual(coeffs, fluxes, xcc, ycc, bgv, bge):
'''This is the residual function to minimize using scipy.optimize.leastsq.
Parameters
----------
coeffs : array-like of floats
Contains the EPD coefficients that will be used to generate the EPD fit
function.
fluxes : array-li... | [
"This",
"is",
"the",
"residual",
"function",
"to",
"minimize",
"using",
"scipy",
".",
"optimize",
".",
"leastsq",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1233-L1265 | [
"def",
"_epd_residual",
"(",
"coeffs",
",",
"fluxes",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
")",
":",
"f",
"=",
"_epd_function",
"(",
"coeffs",
",",
"fluxes",
",",
"xcc",
",",
"ycc",
",",
"bgv",
",",
"bge",
")",
"residual",
"=",
"fluxes",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | epd_kepler_lightcurve | This runs EPD on the Kepler light curve.
Following Huang et al. 2015, we fit the following EPD function to a smoothed
light curve, and then subtract it to obtain EPD corrected magnitudes::
f = c0 +
c1*sin(2*pi*x) + c2*cos(2*pi*x) + c3*sin(2*pi*y) + c4*cos(2*pi*y) +
c5*sin(4*pi*... | astrobase/astrokep.py | def epd_kepler_lightcurve(lcdict,
xccol='mom_centr1',
yccol='mom_centr2',
timestoignore=None,
filterflags=True,
writetodict=True,
epdsmooth=5):
'''This runs EPD... | def epd_kepler_lightcurve(lcdict,
xccol='mom_centr1',
yccol='mom_centr2',
timestoignore=None,
filterflags=True,
writetodict=True,
epdsmooth=5):
'''This runs EPD... | [
"This",
"runs",
"EPD",
"on",
"the",
"Kepler",
"light",
"curve",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1269-L1472 | [
"def",
"epd_kepler_lightcurve",
"(",
"lcdict",
",",
"xccol",
"=",
"'mom_centr1'",
",",
"yccol",
"=",
"'mom_centr2'",
",",
"timestoignore",
"=",
"None",
",",
"filterflags",
"=",
"True",
",",
"writetodict",
"=",
"True",
",",
"epdsmooth",
"=",
"5",
")",
":",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | rfepd_kepler_lightcurve | This uses a `RandomForestRegressor` to fit and decorrelate Kepler light
curves.
Fits the X and Y positions, the background, and background error.
By default, this function removes points in the Kepler LC that have ANY
quality flags set.
Parameters
----------
lcdict : lcdict
An `l... | astrobase/astrokep.py | def rfepd_kepler_lightcurve(
lcdict,
xccol='mom_centr1',
yccol='mom_centr2',
timestoignore=None,
filterflags=True,
writetodict=True,
epdsmooth=23,
decorr='xcc,ycc',
nrftrees=200
):
'''This uses a `RandomForestRegressor` to fit and decorrelate K... | def rfepd_kepler_lightcurve(
lcdict,
xccol='mom_centr1',
yccol='mom_centr2',
timestoignore=None,
filterflags=True,
writetodict=True,
epdsmooth=23,
decorr='xcc,ycc',
nrftrees=200
):
'''This uses a `RandomForestRegressor` to fit and decorrelate K... | [
"This",
"uses",
"a",
"RandomForestRegressor",
"to",
"fit",
"and",
"decorrelate",
"Kepler",
"light",
"curves",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1476-L1691 | [
"def",
"rfepd_kepler_lightcurve",
"(",
"lcdict",
",",
"xccol",
"=",
"'mom_centr1'",
",",
"yccol",
"=",
"'mom_centr2'",
",",
"timestoignore",
"=",
"None",
",",
"filterflags",
"=",
"True",
",",
"writetodict",
"=",
"True",
",",
"epdsmooth",
"=",
"23",
",",
"dec... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | detrend_centroid | Detrends the x and y coordinate centroids for a Kepler light curve.
Given an `lcdict` for a single quarter of Kepler data, returned by
`read_kepler_fitslc`, this function returns this same dictionary,
appending detrended centroid_x and centroid_y values.
Here "detrended" means "finite, SAP quality fla... | astrobase/astrokep.py | def detrend_centroid(lcd, detrend='legendre', sigclip=None, mingap=0.5):
'''Detrends the x and y coordinate centroids for a Kepler light curve.
Given an `lcdict` for a single quarter of Kepler data, returned by
`read_kepler_fitslc`, this function returns this same dictionary,
appending detrended centro... | def detrend_centroid(lcd, detrend='legendre', sigclip=None, mingap=0.5):
'''Detrends the x and y coordinate centroids for a Kepler light curve.
Given an `lcdict` for a single quarter of Kepler data, returned by
`read_kepler_fitslc`, this function returns this same dictionary,
appending detrended centro... | [
"Detrends",
"the",
"x",
"and",
"y",
"coordinate",
"centroids",
"for",
"a",
"Kepler",
"light",
"curve",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1699-L1935 | [
"def",
"detrend_centroid",
"(",
"lcd",
",",
"detrend",
"=",
"'legendre'",
",",
"sigclip",
"=",
"None",
",",
"mingap",
"=",
"0.5",
")",
":",
"qnum",
"=",
"npunique",
"(",
"lcd",
"[",
"'quarter'",
"]",
")",
"try",
":",
"assert",
"qnum",
".",
"size",
"=... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | get_centroid_offsets | After running `detrend_centroid`, this gets positions of centroids during
transits, and outside of transits.
These positions can then be used in a false positive analysis.
This routine requires knowing the ingress and egress times for every
transit of interest within the quarter this routine is being ... | astrobase/astrokep.py | def get_centroid_offsets(lcd, t_ing_egr, oot_buffer_time=0.1, sample_factor=3):
'''After running `detrend_centroid`, this gets positions of centroids during
transits, and outside of transits.
These positions can then be used in a false positive analysis.
This routine requires knowing the ingress and e... | def get_centroid_offsets(lcd, t_ing_egr, oot_buffer_time=0.1, sample_factor=3):
'''After running `detrend_centroid`, this gets positions of centroids during
transits, and outside of transits.
These positions can then be used in a false positive analysis.
This routine requires knowing the ingress and e... | [
"After",
"running",
"detrend_centroid",
"this",
"gets",
"positions",
"of",
"centroids",
"during",
"transits",
"and",
"outside",
"of",
"transits",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L1939-L2055 | [
"def",
"get_centroid_offsets",
"(",
"lcd",
",",
"t_ing_egr",
",",
"oot_buffer_time",
"=",
"0.1",
",",
"sample_factor",
"=",
"3",
")",
":",
"# NOTE:",
"# Bryson+ (2013) gives a more complicated and more correct approach to this",
"# problem, computing offsets relative to positions... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _get_legendre_deg_ctd | This is a helper function for centroid detrending. | astrobase/astrokep.py | def _get_legendre_deg_ctd(npts):
'''This is a helper function for centroid detrending.
'''
from scipy.interpolate import interp1d
degs = nparray([4,5,6,10,15])
pts = nparray([1e2,3e2,5e2,1e3,3e3])
fn = interp1d(pts, degs, kind='linear',
bounds_error=False,
... | def _get_legendre_deg_ctd(npts):
'''This is a helper function for centroid detrending.
'''
from scipy.interpolate import interp1d
degs = nparray([4,5,6,10,15])
pts = nparray([1e2,3e2,5e2,1e3,3e3])
fn = interp1d(pts, degs, kind='linear',
bounds_error=False,
... | [
"This",
"is",
"a",
"helper",
"function",
"for",
"centroid",
"detrending",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L2063-L2077 | [
"def",
"_get_legendre_deg_ctd",
"(",
"npts",
")",
":",
"from",
"scipy",
".",
"interpolate",
"import",
"interp1d",
"degs",
"=",
"nparray",
"(",
"[",
"4",
",",
"5",
",",
"6",
",",
"10",
",",
"15",
"]",
")",
"pts",
"=",
"nparray",
"(",
"[",
"1e2",
","... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _legendre_dtr | This calculates the residual and chi-sq values for a Legendre
function fit.
Parameters
----------
x : np.array
Array of the independent variable.
y : np.array
Array of the dependent variable.
y_err : np.array
Array of errors associated with each `y` value. Used to cal... | astrobase/astrokep.py | def _legendre_dtr(x, y, y_err, legendredeg=10):
'''This calculates the residual and chi-sq values for a Legendre
function fit.
Parameters
----------
x : np.array
Array of the independent variable.
y : np.array
Array of the dependent variable.
y_err : np.array
Arra... | def _legendre_dtr(x, y, y_err, legendredeg=10):
'''This calculates the residual and chi-sq values for a Legendre
function fit.
Parameters
----------
x : np.array
Array of the independent variable.
y : np.array
Array of the dependent variable.
y_err : np.array
Arra... | [
"This",
"calculates",
"the",
"residual",
"and",
"chi",
"-",
"sq",
"values",
"for",
"a",
"Legendre",
"function",
"fit",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrokep.py#L2085-L2130 | [
"def",
"_legendre_dtr",
"(",
"x",
",",
"y",
",",
"y_err",
",",
"legendredeg",
"=",
"10",
")",
":",
"try",
":",
"p",
"=",
"Legendre",
".",
"fit",
"(",
"x",
",",
"y",
",",
"legendredeg",
")",
"fit_y",
"=",
"p",
"(",
"x",
")",
"except",
"Exception",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | timebinlc | This bins the given light curve file in time using the specified bin size.
Parameters
----------
lcfile : str
The file name to process.
binsizesec : float
The time bin-size in seconds.
outdir : str or None
If this is a str, the output LC will be written to `outdir`. If th... | astrobase/lcproc/lcbin.py | def timebinlc(lcfile,
binsizesec,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
magcols=None,
errcols=None,
minbinelems=7):
'''This bins the given light curve file in time using the s... | def timebinlc(lcfile,
binsizesec,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
magcols=None,
errcols=None,
minbinelems=7):
'''This bins the given light curve file in time using the s... | [
"This",
"bins",
"the",
"given",
"light",
"curve",
"file",
"in",
"time",
"using",
"the",
"specified",
"bin",
"size",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcbin.py#L87-L249 | [
"def",
"timebinlc",
"(",
"lcfile",
",",
"binsizesec",
",",
"outdir",
"=",
"None",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"minbinelem... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | timebinlc_worker | This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form::
task[0] = lcfile
task[1] = binsizesec
task[3] = {'outdir','lcformat','lcformatdir',
'timecols','magcols','errcols','minbinelems'}
... | astrobase/lcproc/lcbin.py | def timebinlc_worker(task):
'''
This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form::
task[0] = lcfile
task[1] = binsizesec
task[3] = {'outdir','lcformat','lcformatdir',
'timeco... | def timebinlc_worker(task):
'''
This is a parallel worker for the function below.
Parameters
----------
task : tuple
This is of the form::
task[0] = lcfile
task[1] = binsizesec
task[3] = {'outdir','lcformat','lcformatdir',
'timeco... | [
"This",
"is",
"a",
"parallel",
"worker",
"for",
"the",
"function",
"below",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcbin.py#L253-L286 | [
"def",
"timebinlc_worker",
"(",
"task",
")",
":",
"lcfile",
",",
"binsizesec",
",",
"kwargs",
"=",
"task",
"try",
":",
"binnedlc",
"=",
"timebinlc",
"(",
"lcfile",
",",
"binsizesec",
",",
"*",
"*",
"kwargs",
")",
"LOGINFO",
"(",
"'%s binned using %s sec -> %... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_timebin | This time-bins all the LCs in the list using the specified bin size.
Parameters
----------
lclist : list of str
The input LCs to process.
binsizesec : float
The time bin size to use in seconds.
maxobjects : int or None
If provided, LC processing will stop at `lclist[maxob... | astrobase/lcproc/lcbin.py | def parallel_timebin(lclist,
binsizesec,
maxobjects=None,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
magcols=None,
errcols=None,
... | def parallel_timebin(lclist,
binsizesec,
maxobjects=None,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
magcols=None,
errcols=None,
... | [
"This",
"time",
"-",
"bins",
"all",
"the",
"LCs",
"in",
"the",
"list",
"using",
"the",
"specified",
"bin",
"size",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcbin.py#L290-L379 | [
"def",
"parallel_timebin",
"(",
"lclist",
",",
"binsizesec",
",",
"maxobjects",
"=",
"None",
",",
"outdir",
"=",
"None",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_timebin_lcdir | This time bins all the light curves in the specified directory.
Parameters
----------
lcdir : list of str
Directory containing the input LCs to process.
binsizesec : float
The time bin size to use in seconds.
maxobjects : int or None
If provided, LC processing will stop a... | astrobase/lcproc/lcbin.py | def parallel_timebin_lcdir(lcdir,
binsizesec,
maxobjects=None,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
ma... | def parallel_timebin_lcdir(lcdir,
binsizesec,
maxobjects=None,
outdir=None,
lcformat='hat-sql',
lcformatdir=None,
timecols=None,
ma... | [
"This",
"time",
"bins",
"all",
"the",
"light",
"curves",
"in",
"the",
"specified",
"directory",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcbin.py#L383-L477 | [
"def",
"parallel_timebin_lcdir",
"(",
"lcdir",
",",
"binsizesec",
",",
"maxobjects",
"=",
"None",
",",
"outdir",
"=",
"None",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
","... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | get_varfeatures | This runs :py:func:`astrobase.varclass.varfeatures.all_nonperiodic_features`
on a single LC file.
Parameters
----------
lcfile : str
The input light curve to process.
outfile : str
The filename of the output variable features pickle that will be
generated.
timecols : ... | astrobase/lcproc/lcvfeatures.py | def get_varfeatures(lcfile,
outdir,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
lcformatdir=None):
'''This runs :py:func:`astrobase.varclass.var... | def get_varfeatures(lcfile,
outdir,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
lcformatdir=None):
'''This runs :py:func:`astrobase.varclass.var... | [
"This",
"runs",
":",
"py",
":",
"func",
":",
"astrobase",
".",
"varclass",
".",
"varfeatures",
".",
"all_nonperiodic_features",
"on",
"a",
"single",
"LC",
"file",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcvfeatures.py#L96-L279 | [
"def",
"get_varfeatures",
"(",
"lcfile",
",",
"outdir",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"mindet",
"=",
"1000",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
")",
":",
"t... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _varfeatures_worker | This wraps varfeatures. | astrobase/lcproc/lcvfeatures.py | def _varfeatures_worker(task):
'''
This wraps varfeatures.
'''
try:
(lcfile, outdir, timecols, magcols, errcols,
mindet, lcformat, lcformatdir) = task
return get_varfeatures(lcfile, outdir,
timecols=timecols,
magcol... | def _varfeatures_worker(task):
'''
This wraps varfeatures.
'''
try:
(lcfile, outdir, timecols, magcols, errcols,
mindet, lcformat, lcformatdir) = task
return get_varfeatures(lcfile, outdir,
timecols=timecols,
magcol... | [
"This",
"wraps",
"varfeatures",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcvfeatures.py#L283-L301 | [
"def",
"_varfeatures_worker",
"(",
"task",
")",
":",
"try",
":",
"(",
"lcfile",
",",
"outdir",
",",
"timecols",
",",
"magcols",
",",
"errcols",
",",
"mindet",
",",
"lcformat",
",",
"lcformatdir",
")",
"=",
"task",
"return",
"get_varfeatures",
"(",
"lcfile"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | serial_varfeatures | This runs variability feature extraction for a list of LCs.
Parameters
----------
lclist : list of str
The list of light curve file names to process.
outdir : str
The directory where the output varfeatures pickle files will be written.
maxobjects : int
The number of LCs t... | astrobase/lcproc/lcvfeatures.py | def serial_varfeatures(lclist,
outdir,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
lcfo... | def serial_varfeatures(lclist,
outdir,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
lcfo... | [
"This",
"runs",
"variability",
"feature",
"extraction",
"for",
"a",
"list",
"of",
"LCs",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcvfeatures.py#L304-L372 | [
"def",
"serial_varfeatures",
"(",
"lclist",
",",
"outdir",
",",
"maxobjects",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"mindet",
"=",
"1000",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcform... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_varfeatures | This runs variable feature extraction in parallel for all LCs in `lclist`.
Parameters
----------
lclist : list of str
The list of light curve file names to process.
outdir : str
The directory where the output varfeatures pickle files will be written.
maxobjects : int
The ... | astrobase/lcproc/lcvfeatures.py | def parallel_varfeatures(lclist,
outdir,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
... | def parallel_varfeatures(lclist,
outdir,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
mindet=1000,
lcformat='hat-sql',
... | [
"This",
"runs",
"variable",
"feature",
"extraction",
"in",
"parallel",
"for",
"all",
"LCs",
"in",
"lclist",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcvfeatures.py#L376-L454 | [
"def",
"parallel_varfeatures",
"(",
"lclist",
",",
"outdir",
",",
"maxobjects",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"mindet",
"=",
"1000",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcfo... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_varfeatures_lcdir | This runs parallel variable feature extraction for a directory of LCs.
Parameters
----------
lcdir : str
The directory of light curve files to process.
outdir : str
The directory where the output varfeatures pickle files will be written.
fileglob : str or None
The file gl... | astrobase/lcproc/lcvfeatures.py | def parallel_varfeatures_lcdir(lcdir,
outdir,
fileglob=None,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
... | def parallel_varfeatures_lcdir(lcdir,
outdir,
fileglob=None,
maxobjects=None,
timecols=None,
magcols=None,
errcols=None,
... | [
"This",
"runs",
"parallel",
"variable",
"feature",
"extraction",
"for",
"a",
"directory",
"of",
"LCs",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/lcvfeatures.py#L458-L598 | [
"def",
"parallel_varfeatures_lcdir",
"(",
"lcdir",
",",
"outdir",
",",
"fileglob",
"=",
"None",
",",
"maxobjects",
"=",
"None",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"m... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | checkplot_pickle_to_png | This reads the checkplot pickle or dict provided, and writes out a PNG.
The output PNG contains most of the information in the input checkplot
pickle/dict, and can be used to quickly glance through the highlights
instead of having to review the checkplot with the `checkplotserver`
webapp. This is usefu... | astrobase/checkplot/pkl_png.py | def checkplot_pickle_to_png(
checkplotin,
outfile,
extrarows=None
):
'''This reads the checkplot pickle or dict provided, and writes out a PNG.
The output PNG contains most of the information in the input checkplot
pickle/dict, and can be used to quickly glance through the highlight... | def checkplot_pickle_to_png(
checkplotin,
outfile,
extrarows=None
):
'''This reads the checkplot pickle or dict provided, and writes out a PNG.
The output PNG contains most of the information in the input checkplot
pickle/dict, and can be used to quickly glance through the highlight... | [
"This",
"reads",
"the",
"checkplot",
"pickle",
"or",
"dict",
"provided",
"and",
"writes",
"out",
"a",
"PNG",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_png.py#L75-L1129 | [
"def",
"checkplot_pickle_to_png",
"(",
"checkplotin",
",",
"outfile",
",",
"extrarows",
"=",
"None",
")",
":",
"# figure out if the checkplotpickle is a filename",
"# python 3",
"if",
"sys",
".",
"version_info",
"[",
":",
"2",
"]",
">",
"(",
"3",
",",
"2",
")",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | cp2png | This is just a shortened form of the function above for convenience.
This only handles pickle files as input.
Parameters
----------
checkplotin : str
File name of a checkplot pickle file to convert to a PNG.
extrarows : list of tuples
This is a list of 4-element tuples containing... | astrobase/checkplot/pkl_png.py | def cp2png(checkplotin, extrarows=None):
'''This is just a shortened form of the function above for convenience.
This only handles pickle files as input.
Parameters
----------
checkplotin : str
File name of a checkplot pickle file to convert to a PNG.
extrarows : list of tuples
... | def cp2png(checkplotin, extrarows=None):
'''This is just a shortened form of the function above for convenience.
This only handles pickle files as input.
Parameters
----------
checkplotin : str
File name of a checkplot pickle file to convert to a PNG.
extrarows : list of tuples
... | [
"This",
"is",
"just",
"a",
"shortened",
"form",
"of",
"the",
"function",
"above",
"for",
"convenience",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_png.py#L1133-L1199 | [
"def",
"cp2png",
"(",
"checkplotin",
",",
"extrarows",
"=",
"None",
")",
":",
"if",
"checkplotin",
".",
"endswith",
"(",
"'.gz'",
")",
":",
"outfile",
"=",
"checkplotin",
".",
"replace",
"(",
"'.pkl.gz'",
",",
"'.png'",
")",
"else",
":",
"outfile",
"=",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | flare_model | This is a flare model function, similar to Kowalski+ 2011.
From the paper by Pitkin+ 2014:
http://adsabs.harvard.edu/abs/2014MNRAS.445.2268P
Parameters
----------
flareparams : list of float
This defines the flare model::
[amplitude,
flare_peak_time,
... | astrobase/lcmodels/flares.py | def flare_model(flareparams, times, mags, errs):
'''This is a flare model function, similar to Kowalski+ 2011.
From the paper by Pitkin+ 2014:
http://adsabs.harvard.edu/abs/2014MNRAS.445.2268P
Parameters
----------
flareparams : list of float
This defines the flare model::
... | def flare_model(flareparams, times, mags, errs):
'''This is a flare model function, similar to Kowalski+ 2011.
From the paper by Pitkin+ 2014:
http://adsabs.harvard.edu/abs/2014MNRAS.445.2268P
Parameters
----------
flareparams : list of float
This defines the flare model::
... | [
"This",
"is",
"a",
"flare",
"model",
"function",
"similar",
"to",
"Kowalski",
"+",
"2011",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmodels/flares.py#L18-L90 | [
"def",
"flare_model",
"(",
"flareparams",
",",
"times",
",",
"mags",
",",
"errs",
")",
":",
"(",
"amplitude",
",",
"flare_peak_time",
",",
"rise_gaussian_stdev",
",",
"decay_time_constant",
")",
"=",
"flareparams",
"zerolevel",
"=",
"np",
".",
"median",
"(",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | flare_model_residual | This returns the residual between model mags and the actual mags.
Parameters
----------
flareparams : list of float
This defines the flare model::
[amplitude,
flare_peak_time,
rise_gaussian_stdev,
decay_time_constant]
where:
`am... | astrobase/lcmodels/flares.py | def flare_model_residual(flareparams, times, mags, errs):
'''
This returns the residual between model mags and the actual mags.
Parameters
----------
flareparams : list of float
This defines the flare model::
[amplitude,
flare_peak_time,
rise_gaussian... | def flare_model_residual(flareparams, times, mags, errs):
'''
This returns the residual between model mags and the actual mags.
Parameters
----------
flareparams : list of float
This defines the flare model::
[amplitude,
flare_peak_time,
rise_gaussian... | [
"This",
"returns",
"the",
"residual",
"between",
"model",
"mags",
"and",
"the",
"actual",
"mags",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmodels/flares.py#L94-L138 | [
"def",
"flare_model_residual",
"(",
"flareparams",
",",
"times",
",",
"mags",
",",
"errs",
")",
":",
"modelmags",
",",
"_",
",",
"_",
",",
"_",
"=",
"flare_model",
"(",
"flareparams",
",",
"times",
",",
"mags",
",",
"errs",
")",
"return",
"(",
"mags",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | cache_clean_handler | This periodically cleans up the ~/.astrobase cache to save us from
disk-space doom.
Parameters
----------
min_age_hours : int
Files older than this number of hours from the current time will be
deleted.
Returns
-------
Nothing. | astrobase/lcproc/awsrun.py | def cache_clean_handler(min_age_hours=1):
"""This periodically cleans up the ~/.astrobase cache to save us from
disk-space doom.
Parameters
----------
min_age_hours : int
Files older than this number of hours from the current time will be
deleted.
Returns
-------
Noth... | def cache_clean_handler(min_age_hours=1):
"""This periodically cleans up the ~/.astrobase cache to save us from
disk-space doom.
Parameters
----------
min_age_hours : int
Files older than this number of hours from the current time will be
deleted.
Returns
-------
Noth... | [
"This",
"periodically",
"cleans",
"up",
"the",
"~",
"/",
".",
"astrobase",
"cache",
"to",
"save",
"us",
"from",
"disk",
"-",
"space",
"doom",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L194-L225 | [
"def",
"cache_clean_handler",
"(",
"min_age_hours",
"=",
"1",
")",
":",
"# find the files to delete",
"cmd",
"=",
"(",
"\"find ~ec2-user/.astrobase -type f -mmin +{mmin} -exec rm -v '{{}}' \\;\"",
")",
"mmin",
"=",
"'%.1f'",
"%",
"(",
"min_age_hours",
"*",
"60.0",
")",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | shutdown_check_handler | This checks the AWS instance data URL to see if there's a pending
shutdown for the instance.
This is useful for AWS spot instances. If there is a pending shutdown posted
to the instance data URL, we'll use the result of this function break out of
the processing loop and shut everything down ASAP before... | astrobase/lcproc/awsrun.py | def shutdown_check_handler():
"""This checks the AWS instance data URL to see if there's a pending
shutdown for the instance.
This is useful for AWS spot instances. If there is a pending shutdown posted
to the instance data URL, we'll use the result of this function break out of
the processing loop... | def shutdown_check_handler():
"""This checks the AWS instance data URL to see if there's a pending
shutdown for the instance.
This is useful for AWS spot instances. If there is a pending shutdown posted
to the instance data URL, we'll use the result of this function break out of
the processing loop... | [
"This",
"checks",
"the",
"AWS",
"instance",
"data",
"URL",
"to",
"see",
"if",
"there",
"s",
"a",
"pending",
"shutdown",
"for",
"the",
"instance",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L229-L272 | [
"def",
"shutdown_check_handler",
"(",
")",
":",
"url",
"=",
"'http://169.254.169.254/latest/meta-data/spot/instance-action'",
"try",
":",
"resp",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"timeout",
"=",
"1.0",
")",
"resp",
".",
"raise_for_status",
"(",
")",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runcp_producer_loop | This sends checkplot making tasks to the input queue and monitors the
result queue for task completion.
Parameters
----------
lightcurve_list : str or list of str
This is either a string pointing to a file containing a list of light
curves filenames to process or the list itself. The n... | astrobase/lcproc/awsrun.py | def runcp_producer_loop(
lightcurve_list,
input_queue,
input_bucket,
result_queue,
result_bucket,
pfresult_list=None,
runcp_kwargs=None,
process_list_slice=None,
purge_queues_when_done=False,
delete_queues_when_done=False,
download_... | def runcp_producer_loop(
lightcurve_list,
input_queue,
input_bucket,
result_queue,
result_bucket,
pfresult_list=None,
runcp_kwargs=None,
process_list_slice=None,
purge_queues_when_done=False,
delete_queues_when_done=False,
download_... | [
"This",
"sends",
"checkplot",
"making",
"tasks",
"to",
"the",
"input",
"queue",
"and",
"monitors",
"the",
"result",
"queue",
"for",
"task",
"completion",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L280-L564 | [
"def",
"runcp_producer_loop",
"(",
"lightcurve_list",
",",
"input_queue",
",",
"input_bucket",
",",
"result_queue",
",",
"result_bucket",
",",
"pfresult_list",
"=",
"None",
",",
"runcp_kwargs",
"=",
"None",
",",
"process_list_slice",
"=",
"None",
",",
"purge_queues_... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runcp_producer_loop_savedstate | This wraps the function above to allow for loading previous state from a
file.
Parameters
----------
use_saved_state : str or None
This is the path to the saved state pickle file produced by a previous
run of `runcp_producer_loop`. Will get all of the arguments to run
another i... | astrobase/lcproc/awsrun.py | def runcp_producer_loop_savedstate(
use_saved_state=None,
lightcurve_list=None,
input_queue=None,
input_bucket=None,
result_queue=None,
result_bucket=None,
pfresult_list=None,
runcp_kwargs=None,
process_list_slice=None,
download_when_done=T... | def runcp_producer_loop_savedstate(
use_saved_state=None,
lightcurve_list=None,
input_queue=None,
input_bucket=None,
result_queue=None,
result_bucket=None,
pfresult_list=None,
runcp_kwargs=None,
process_list_slice=None,
download_when_done=T... | [
"This",
"wraps",
"the",
"function",
"above",
"to",
"allow",
"for",
"loading",
"previous",
"state",
"from",
"a",
"file",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L568-L722 | [
"def",
"runcp_producer_loop_savedstate",
"(",
"use_saved_state",
"=",
"None",
",",
"lightcurve_list",
"=",
"None",
",",
"input_queue",
"=",
"None",
",",
"input_bucket",
"=",
"None",
",",
"result_queue",
"=",
"None",
",",
"result_bucket",
"=",
"None",
",",
"pfres... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runcp_consumer_loop | This runs checkplot pickle making in a loop until interrupted.
Consumes work task items from an input queue set up by `runcp_producer_loop`
above. For the moment, we don't generate neighbor light curves since this
would require a lot more S3 calls.
Parameters
----------
in_queue_url : str
... | astrobase/lcproc/awsrun.py | def runcp_consumer_loop(
in_queue_url,
workdir,
lclist_pkl_s3url,
lc_altexts=('',),
wait_time_seconds=5,
cache_clean_timer_seconds=3600.0,
shutdown_check_timer_seconds=60.0,
sqs_client=None,
s3_client=None
):
"""This runs checkplot pickle maki... | def runcp_consumer_loop(
in_queue_url,
workdir,
lclist_pkl_s3url,
lc_altexts=('',),
wait_time_seconds=5,
cache_clean_timer_seconds=3600.0,
shutdown_check_timer_seconds=60.0,
sqs_client=None,
s3_client=None
):
"""This runs checkplot pickle maki... | [
"This",
"runs",
"checkplot",
"pickle",
"making",
"in",
"a",
"loop",
"until",
"interrupted",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L726-L1153 | [
"def",
"runcp_consumer_loop",
"(",
"in_queue_url",
",",
"workdir",
",",
"lclist_pkl_s3url",
",",
"lc_altexts",
"=",
"(",
"''",
",",
")",
",",
"wait_time_seconds",
"=",
"5",
",",
"cache_clean_timer_seconds",
"=",
"3600.0",
",",
"shutdown_check_timer_seconds",
"=",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runpf_consumer_loop | This runs period-finding in a loop until interrupted.
Consumes work task items from an input queue set up by `runpf_producer_loop`
above.
Parameters
----------
in_queue_url : str
The SQS URL of the input queue to listen to for work assignment
messages. The task orders will include... | astrobase/lcproc/awsrun.py | def runpf_consumer_loop(
in_queue_url,
workdir,
lc_altexts=('',),
wait_time_seconds=5,
shutdown_check_timer_seconds=60.0,
sqs_client=None,
s3_client=None
):
"""This runs period-finding in a loop until interrupted.
Consumes work task items from an input qu... | def runpf_consumer_loop(
in_queue_url,
workdir,
lc_altexts=('',),
wait_time_seconds=5,
shutdown_check_timer_seconds=60.0,
sqs_client=None,
s3_client=None
):
"""This runs period-finding in a loop until interrupted.
Consumes work task items from an input qu... | [
"This",
"runs",
"period",
"-",
"finding",
"in",
"a",
"loop",
"until",
"interrupted",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/awsrun.py#L1454-L1821 | [
"def",
"runpf_consumer_loop",
"(",
"in_queue_url",
",",
"workdir",
",",
"lc_altexts",
"=",
"(",
"''",
",",
")",
",",
"wait_time_seconds",
"=",
"5",
",",
"shutdown_check_timer_seconds",
"=",
"60.0",
",",
"sqs_client",
"=",
"None",
",",
"s3_client",
"=",
"None",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | gaussianeb_fit_magseries | This fits a double inverted gaussian EB model to a magnitude time series.
Parameters
----------
times,mags,errs : np.array
The input mag/flux time-series to fit the EB model to.
period : float
The period to use for EB fit.
ebparams : list of float
This is a list containin... | astrobase/lcfit/eclipses.py | def gaussianeb_fit_magseries(times, mags, errs,
ebparams,
sigclip=10.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''This fits a double inverted gaussian EB model... | def gaussianeb_fit_magseries(times, mags, errs,
ebparams,
sigclip=10.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''This fits a double inverted gaussian EB model... | [
"This",
"fits",
"a",
"double",
"inverted",
"gaussian",
"EB",
"model",
"to",
"a",
"magnitude",
"time",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/eclipses.py#L63-L382 | [
"def",
"gaussianeb_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"ebparams",
",",
"sigclip",
"=",
"10.0",
",",
"plotfit",
"=",
"False",
",",
"magsarefluxes",
"=",
"False",
",",
"verbose",
"=",
"True",
")",
":",
"stimes",
",",
"smags",
",",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | spline_fit_magseries | This fits a univariate cubic spline to the phased light curve.
This fit may be better than the Fourier fit for sharply variable objects,
like EBs, so can be used to distinguish them from other types of variables.
Parameters
----------
times,mags,errs : np.array
The input mag/flux time-ser... | astrobase/lcfit/nonphysical.py | def spline_fit_magseries(times, mags, errs, period,
knotfraction=0.01,
maxknots=30,
sigclip=30.0,
plotfit=False,
ignoreinitfail=False,
magsarefluxes=False,
... | def spline_fit_magseries(times, mags, errs, period,
knotfraction=0.01,
maxknots=30,
sigclip=30.0,
plotfit=False,
ignoreinitfail=False,
magsarefluxes=False,
... | [
"This",
"fits",
"a",
"univariate",
"cubic",
"spline",
"to",
"the",
"phased",
"light",
"curve",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/nonphysical.py#L72-L263 | [
"def",
"spline_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"period",
",",
"knotfraction",
"=",
"0.01",
",",
"maxknots",
"=",
"30",
",",
"sigclip",
"=",
"30.0",
",",
"plotfit",
"=",
"False",
",",
"ignoreinitfail",
"=",
"False",
",",
"mags... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | savgol_fit_magseries | Fit a Savitzky-Golay filter to the magnitude/flux time series.
SG fits successive sub-sets (windows) of adjacent data points with a
low-order polynomial via least squares. At each point (magnitude), it
returns the value of the polynomial at that magnitude's time. This is made
significantly cheaper tha... | astrobase/lcfit/nonphysical.py | def savgol_fit_magseries(times, mags, errs, period,
windowlength=None,
polydeg=2,
sigclip=30.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''Fit a Savitzky-... | def savgol_fit_magseries(times, mags, errs, period,
windowlength=None,
polydeg=2,
sigclip=30.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''Fit a Savitzky-... | [
"Fit",
"a",
"Savitzky",
"-",
"Golay",
"filter",
"to",
"the",
"magnitude",
"/",
"flux",
"time",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/nonphysical.py#L271-L484 | [
"def",
"savgol_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"period",
",",
"windowlength",
"=",
"None",
",",
"polydeg",
"=",
"2",
",",
"sigclip",
"=",
"30.0",
",",
"plotfit",
"=",
"False",
",",
"magsarefluxes",
"=",
"False",
",",
"verbose... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | legendre_fit_magseries | Fit an arbitrary-order Legendre series, via least squares, to the
magnitude/flux time series.
This is a series of the form::
p(x) = c_0*L_0(x) + c_1*L_1(x) + c_2*L_2(x) + ... + c_n*L_n(x)
where L_i's are Legendre polynomials (also called "Legendre functions of the
first kind") and c_i's are t... | astrobase/lcfit/nonphysical.py | def legendre_fit_magseries(times, mags, errs, period,
legendredeg=10,
sigclip=30.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''Fit an arbitrary-order Legendre series, vi... | def legendre_fit_magseries(times, mags, errs, period,
legendredeg=10,
sigclip=30.0,
plotfit=False,
magsarefluxes=False,
verbose=True):
'''Fit an arbitrary-order Legendre series, vi... | [
"Fit",
"an",
"arbitrary",
"-",
"order",
"Legendre",
"series",
"via",
"least",
"squares",
"to",
"the",
"magnitude",
"/",
"flux",
"time",
"series",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcfit/nonphysical.py#L491-L676 | [
"def",
"legendre_fit_magseries",
"(",
"times",
",",
"mags",
",",
"errs",
",",
"period",
",",
"legendredeg",
"=",
"10",
",",
"sigclip",
"=",
"30.0",
",",
"plotfit",
"=",
"False",
",",
"magsarefluxes",
"=",
"False",
",",
"verbose",
"=",
"True",
")",
":",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | update_checkplotdict_nbrlcs | For all neighbors in a checkplotdict, make LCs and phased LCs.
Parameters
----------
checkplotdict : dict
This is the checkplot to process. The light curves for the neighbors to
the object here will be extracted from the stored file paths, and this
function will make plots of these... | astrobase/lcproc/checkplotgen.py | def update_checkplotdict_nbrlcs(
checkplotdict,
timecol, magcol, errcol,
lcformat='hat-sql',
lcformatdir=None,
verbose=True,
):
'''For all neighbors in a checkplotdict, make LCs and phased LCs.
Parameters
----------
checkplotdict : dict
This is the chec... | def update_checkplotdict_nbrlcs(
checkplotdict,
timecol, magcol, errcol,
lcformat='hat-sql',
lcformatdir=None,
verbose=True,
):
'''For all neighbors in a checkplotdict, make LCs and phased LCs.
Parameters
----------
checkplotdict : dict
This is the chec... | [
"For",
"all",
"neighbors",
"in",
"a",
"checkplotdict",
"make",
"LCs",
"and",
"phased",
"LCs",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/checkplotgen.py#L102-L394 | [
"def",
"update_checkplotdict_nbrlcs",
"(",
"checkplotdict",
",",
"timecol",
",",
"magcol",
",",
"errcol",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
",",
"verbose",
"=",
"True",
",",
")",
":",
"try",
":",
"formatinfo",
"=",
"get_lcfo... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runcp | This makes a checkplot pickle for the given period-finding result pickle
produced by `lcproc.periodfinding.runpf`.
Parameters
----------
pfpickle : str or None
This is the filename of the period-finding result pickle file created by
`lcproc.periodfinding.runpf`. If this is None, the ch... | astrobase/lcproc/checkplotgen.py | def runcp(
pfpickle,
outdir,
lcbasedir,
lcfname=None,
cprenorm=False,
lclistpkl=None,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
makeneighborlcs=True,
fast_mode=False,
gaia_max_timeout=60.0,
gaia_mirror=None,
xmatchinf... | def runcp(
pfpickle,
outdir,
lcbasedir,
lcfname=None,
cprenorm=False,
lclistpkl=None,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
makeneighborlcs=True,
fast_mode=False,
gaia_max_timeout=60.0,
gaia_mirror=None,
xmatchinf... | [
"This",
"makes",
"a",
"checkplot",
"pickle",
"for",
"the",
"given",
"period",
"-",
"finding",
"result",
"pickle",
"produced",
"by",
"lcproc",
".",
"periodfinding",
".",
"runpf",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/checkplotgen.py#L402-L906 | [
"def",
"runcp",
"(",
"pfpickle",
",",
"outdir",
",",
"lcbasedir",
",",
"lcfname",
"=",
"None",
",",
"cprenorm",
"=",
"False",
",",
"lclistpkl",
"=",
"None",
",",
"nbrradiusarcsec",
"=",
"60.0",
",",
"maxnumneighbors",
"=",
"5",
",",
"makeneighborlcs",
"=",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runcp_worker | This is the worker for running checkplots.
Parameters
----------
task : tuple
This is of the form: (pfpickle, outdir, lcbasedir, kwargs).
Returns
-------
list of str
The list of checkplot pickles returned by the `runcp` function. | astrobase/lcproc/checkplotgen.py | def runcp_worker(task):
'''
This is the worker for running checkplots.
Parameters
----------
task : tuple
This is of the form: (pfpickle, outdir, lcbasedir, kwargs).
Returns
-------
list of str
The list of checkplot pickles returned by the `runcp` function.
'''
... | def runcp_worker(task):
'''
This is the worker for running checkplots.
Parameters
----------
task : tuple
This is of the form: (pfpickle, outdir, lcbasedir, kwargs).
Returns
-------
list of str
The list of checkplot pickles returned by the `runcp` function.
'''
... | [
"This",
"is",
"the",
"worker",
"for",
"running",
"checkplots",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/checkplotgen.py#L910-L937 | [
"def",
"runcp_worker",
"(",
"task",
")",
":",
"pfpickle",
",",
"outdir",
",",
"lcbasedir",
",",
"kwargs",
"=",
"task",
"try",
":",
"return",
"runcp",
"(",
"pfpickle",
",",
"outdir",
",",
"lcbasedir",
",",
"*",
"*",
"kwargs",
")",
"except",
"Exception",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_cp | This drives the parallel execution of `runcp` for a list of periodfinding
result pickles.
Parameters
----------
pfpicklelist : list of str or list of Nones
This is the list of the filenames of the period-finding result pickles
to process. To make checkplots using the light curves direc... | astrobase/lcproc/checkplotgen.py | def parallel_cp(
pfpicklelist,
outdir,
lcbasedir,
fast_mode=False,
lcfnamelist=None,
cprenorm=False,
lclistpkl=None,
gaia_max_timeout=60.0,
gaia_mirror=None,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
makeneighborlcs=True,
... | def parallel_cp(
pfpicklelist,
outdir,
lcbasedir,
fast_mode=False,
lcfnamelist=None,
cprenorm=False,
lclistpkl=None,
gaia_max_timeout=60.0,
gaia_mirror=None,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
makeneighborlcs=True,
... | [
"This",
"drives",
"the",
"parallel",
"execution",
"of",
"runcp",
"for",
"a",
"list",
"of",
"periodfinding",
"result",
"pickles",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/checkplotgen.py#L941-L1235 | [
"def",
"parallel_cp",
"(",
"pfpicklelist",
",",
"outdir",
",",
"lcbasedir",
",",
"fast_mode",
"=",
"False",
",",
"lcfnamelist",
"=",
"None",
",",
"cprenorm",
"=",
"False",
",",
"lclistpkl",
"=",
"None",
",",
"gaia_max_timeout",
"=",
"60.0",
",",
"gaia_mirror... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | parallel_cp_pfdir | This drives the parallel execution of `runcp` for a directory of
periodfinding pickles.
Parameters
----------
pfpickledir : str
This is the directory containing all of the period-finding pickles to
process.
outdir : str
The directory the checkplot pickles will be written t... | astrobase/lcproc/checkplotgen.py | def parallel_cp_pfdir(pfpickledir,
outdir,
lcbasedir,
pfpickleglob='periodfinding-*.pkl*',
lclistpkl=None,
cprenorm=False,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
... | def parallel_cp_pfdir(pfpickledir,
outdir,
lcbasedir,
pfpickleglob='periodfinding-*.pkl*',
lclistpkl=None,
cprenorm=False,
nbrradiusarcsec=60.0,
maxnumneighbors=5,
... | [
"This",
"drives",
"the",
"parallel",
"execution",
"of",
"runcp",
"for",
"a",
"directory",
"of",
"periodfinding",
"pickles",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/checkplotgen.py#L1239-L1483 | [
"def",
"parallel_cp_pfdir",
"(",
"pfpickledir",
",",
"outdir",
",",
"lcbasedir",
",",
"pfpickleglob",
"=",
"'periodfinding-*.pkl*'",
",",
"lclistpkl",
"=",
"None",
",",
"cprenorm",
"=",
"False",
",",
"nbrradiusarcsec",
"=",
"60.0",
",",
"maxnumneighbors",
"=",
"... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | runpf | This runs the period-finding for a single LC.
Parameters
----------
lcfile : str
The light curve file to run period-finding on.
outdir : str
The output directory where the result pickle will go.
timecols : list of str or None
The timecol keys to use from the lcdict in cal... | astrobase/lcproc/periodsearch.py | def runpf(lcfile,
outdir,
timecols=None,
magcols=None,
errcols=None,
lcformat='hat-sql',
lcformatdir=None,
pfmethods=('gls','pdm','mav','win'),
pfkwargs=({},{},{},{}),
sigclip=10.0,
getblssnr=False,
nworkers=NC... | def runpf(lcfile,
outdir,
timecols=None,
magcols=None,
errcols=None,
lcformat='hat-sql',
lcformatdir=None,
pfmethods=('gls','pdm','mav','win'),
pfkwargs=({},{},{},{}),
sigclip=10.0,
getblssnr=False,
nworkers=NC... | [
"This",
"runs",
"the",
"period",
"-",
"finding",
"for",
"a",
"single",
"LC",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/periodsearch.py#L108-L457 | [
"def",
"runpf",
"(",
"lcfile",
",",
"outdir",
",",
"timecols",
"=",
"None",
",",
"magcols",
"=",
"None",
",",
"errcols",
"=",
"None",
",",
"lcformat",
"=",
"'hat-sql'",
",",
"lcformatdir",
"=",
"None",
",",
"pfmethods",
"=",
"(",
"'gls'",
",",
"'pdm'",... | 2922a14619d183fb28005fa7d02027ac436f2265 |
valid | _runpf_worker | This runs the runpf function. | astrobase/lcproc/periodsearch.py | def _runpf_worker(task):
'''
This runs the runpf function.
'''
(lcfile, outdir, timecols, magcols, errcols, lcformat, lcformatdir,
pfmethods, pfkwargs, getblssnr, sigclip, nworkers, minobservations,
excludeprocessed) = task
if os.path.exists(lcfile):
pfresult = runpf(lcfile,
... | def _runpf_worker(task):
'''
This runs the runpf function.
'''
(lcfile, outdir, timecols, magcols, errcols, lcformat, lcformatdir,
pfmethods, pfkwargs, getblssnr, sigclip, nworkers, minobservations,
excludeprocessed) = task
if os.path.exists(lcfile):
pfresult = runpf(lcfile,
... | [
"This",
"runs",
"the",
"runpf",
"function",
"."
] | waqasbhatti/astrobase | python | https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/periodsearch.py#L461-L489 | [
"def",
"_runpf_worker",
"(",
"task",
")",
":",
"(",
"lcfile",
",",
"outdir",
",",
"timecols",
",",
"magcols",
",",
"errcols",
",",
"lcformat",
",",
"lcformatdir",
",",
"pfmethods",
",",
"pfkwargs",
",",
"getblssnr",
",",
"sigclip",
",",
"nworkers",
",",
... | 2922a14619d183fb28005fa7d02027ac436f2265 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.