_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q258700 | _parse_csv_header | validation | def _parse_csv_header(header):
'''
This parses the CSV header from the CSV HAT sqlitecurve.
Returns a dict that can be used to update an existing lcdict with the
relevant metadata info needed to form a full LC.
'''
# first, break into lines
headerlines = header.split('\n')
headerlines... | python | {
"resource": ""
} |
q258701 | _parse_csv_header_lcc_csv_v1 | validation | def _parse_csv_header_lcc_csv_v1(headerlines):
'''
This parses the header of the LCC CSV V1 LC format.
'''
# the first three lines indicate the format name, comment char, separator
commentchar = headerlines[1]
separator = headerlines[2]
headerlines = [x.lstrip('%s ' % commentchar) for x i... | python | {
"resource": ""
} |
q258702 | describe_lcc_csv | validation | def describe_lcc_csv(lcdict, returndesc=False):
'''
This describes the LCC CSV format light curve file.
Parameters
----------
lcdict : dict
The input lcdict to parse for column and metadata info.
returndesc : bool
If True, returns the description string as an str instead of ju... | python | {
"resource": ""
} |
q258703 | read_csvlc | validation | def read_csvlc(lcfile):
'''This reads a HAT data server or LCC-Server produced CSV light curve
into an lcdict.
This will automatically figure out the format of the file
provided. Currently, it can read:
- legacy HAT data server CSV LCs (e.g. from
https://hatsouth.org/planets/lightcurves.html... | python | {
"resource": ""
} |
q258704 | find_lc_timegroups | validation | def find_lc_timegroups(lctimes, mingap=4.0):
'''This finds the time gaps in the light curve, so we can figure out which
times are for consecutive observations and which represent gaps
between seasons.
Parameters
----------
lctimes : np.array
This is the input array of times, assumed to... | python | {
"resource": ""
} |
q258705 | main | validation | def main():
'''
This is called when we're executed from the commandline.
The current usage from the command-line is described below::
usage: hatlc [-h] [--describe] hatlcfile
read a HAT LC of any format and output to stdout
positional arguments:
hatlcfile path to the ... | python | {
"resource": ""
} |
q258706 | mdwarf_subtype_from_sdsscolor | validation | def mdwarf_subtype_from_sdsscolor(ri_color, iz_color):
'''This calculates the M-dwarf subtype given SDSS `r-i` and `i-z` colors.
Parameters
----------
ri_color : float
The SDSS `r-i` color of the object.
iz_color : float
The SDSS `i-z` color of the object.
Returns
-------... | python | {
"resource": ""
} |
q258707 | parallel_epd_lclist | validation | def parallel_epd_lclist(lclist,
externalparams,
timecols=None,
magcols=None,
errcols=None,
lcformat='hat-sql',
lcformatdir=None,
epdsmooth_sigclip=3.0,
... | python | {
"resource": ""
} |
q258708 | parallel_epd_lcdir | validation | def parallel_epd_lcdir(
lcdir,
externalparams,
lcfileglob=None,
timecols=None,
magcols=None,
errcols=None,
lcformat='hat-sql',
lcformatdir=None,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,... | python | {
"resource": ""
} |
q258709 | _parallel_bls_worker | validation | def _parallel_bls_worker(task):
'''
This wraps Astropy's BoxLeastSquares for use with bls_parallel_pfind below.
`task` is a tuple::
task[0] = times
task[1] = mags
task[2] = errs
task[3] = magsarefluxes
task[4] = minfreq
task[5] = nfreq
task[6] = ste... | python | {
"resource": ""
} |
q258710 | read_csv_lightcurve | validation | def read_csv_lightcurve(lcfile):
'''
This reads in a K2 lightcurve in CSV format. Transparently reads gzipped
files.
Parameters
----------
lcfile : str
The light curve file to read.
Returns
-------
dict
Returns an lcdict.
'''
# read in the file first
... | python | {
"resource": ""
} |
q258711 | _starfeatures_worker | validation | def _starfeatures_worker(task):
'''
This wraps starfeatures.
'''
try:
(lcfile, outdir, kdtree, objlist,
lcflist, neighbor_radius_arcsec,
deredden, custom_bandpasses, lcformat, lcformatdir) = task
return get_starfeatures(lcfile, outdir,
... | python | {
"resource": ""
} |
q258712 | serial_starfeatures | validation | def serial_starfeatures(lclist,
outdir,
lc_catalog_pickle,
neighbor_radius_arcsec,
maxobjects=None,
deredden=True,
custom_bandpasses=None,
lcformat='hat... | python | {
"resource": ""
} |
q258713 | parallel_starfeatures | validation | def parallel_starfeatures(lclist,
outdir,
lc_catalog_pickle,
neighbor_radius_arcsec,
maxobjects=None,
deredden=True,
custom_bandpasses=None,
... | python | {
"resource": ""
} |
q258714 | parallel_starfeatures_lcdir | validation | def parallel_starfeatures_lcdir(lcdir,
outdir,
lc_catalog_pickle,
neighbor_radius_arcsec,
fileglob=None,
maxobjects=None,
deredd... | python | {
"resource": ""
} |
q258715 | pwd_phasebin | validation | def pwd_phasebin(phases, mags, binsize=0.002, minbin=9):
'''
This bins the phased mag series using the given binsize.
'''
bins = np.arange(0.0, 1.0, binsize)
binnedphaseinds = npdigitize(phases, bins)
binnedphases, binnedmags = [], []
for x in npunique(binnedphaseinds):
thisbin_... | python | {
"resource": ""
} |
q258716 | pdw_worker | validation | def pdw_worker(task):
'''
This is the parallel worker for the function below.
task[0] = frequency for this worker
task[1] = times array
task[2] = mags array
task[3] = fold_time
task[4] = j_range
task[5] = keep_threshold_1
task[6] = keep_threshold_2
task[7] = phasebinsize
we... | python | {
"resource": ""
} |
q258717 | _periodicfeatures_worker | validation | def _periodicfeatures_worker(task):
'''
This is a parallel worker for the drivers below.
'''
pfpickle, lcbasedir, outdir, starfeatures, kwargs = task
try:
return get_periodicfeatures(pfpickle,
lcbasedir,
outdir,
... | python | {
"resource": ""
} |
q258718 | serial_periodicfeatures | validation | def serial_periodicfeatures(pfpkl_list,
lcbasedir,
outdir,
starfeaturesdir=None,
fourierorder=5,
# these are depth, duration, ingress duration
transitpa... | python | {
"resource": ""
} |
q258719 | parallel_periodicfeatures | validation | def parallel_periodicfeatures(pfpkl_list,
lcbasedir,
outdir,
starfeaturesdir=None,
fourierorder=5,
# these are depth, duration, ingress duration
... | python | {
"resource": ""
} |
q258720 | parallel_periodicfeatures_lcdir | validation | def parallel_periodicfeatures_lcdir(
pfpkl_dir,
lcbasedir,
outdir,
pfpkl_glob='periodfinding-*.pkl*',
starfeaturesdir=None,
fourierorder=5,
# these are depth, duration, ingress duration
transitparams=(-0.01,0.1,0.1),
# these are depth, duration, de... | python | {
"resource": ""
} |
q258721 | _parse_xmatch_catalog_header | validation | def _parse_xmatch_catalog_header(xc, xk):
'''
This parses the header for a catalog file and returns it as a file object.
Parameters
----------
xc : str
The file name of an xmatch catalog prepared previously.
xk : list of str
This is a list of column names to extract from the x... | python | {
"resource": ""
} |
q258722 | load_xmatch_external_catalogs | validation | def load_xmatch_external_catalogs(xmatchto, xmatchkeys, outfile=None):
'''This loads the external xmatch catalogs into a dict for use in an xmatch.
Parameters
----------
xmatchto : list of str
This is a list of paths to all the catalog text files that will be
loaded.
The text ... | python | {
"resource": ""
} |
q258723 | angle_wrap | validation | def angle_wrap(angle, radians=False):
'''Wraps the input angle to 360.0 degrees.
Parameters
----------
angle : float
The angle to wrap around 360.0 deg.
radians : bool
If True, will assume that the input is in radians. The output will then
also be in radians.
Returns
... | python | {
"resource": ""
} |
q258724 | hms_to_decimal | validation | def hms_to_decimal(hours, minutes, seconds, returndeg=True):
'''Converts from HH, MM, SS to a decimal value.
Parameters
----------
hours : int
The HH part of a RA coordinate.
minutes : int
The MM part of a RA coordinate.
seconds : float
The SS.sss part of a RA coordin... | python | {
"resource": ""
} |
q258725 | great_circle_dist | validation | def great_circle_dist(ra1, dec1, ra2, dec2):
'''Calculates the great circle angular distance between two coords.
This calculates the great circle angular distance in arcseconds between two
coordinates (ra1,dec1) and (ra2,dec2). This is basically a clone of GCIRC
from the IDL Astrolib.
Parameters
... | python | {
"resource": ""
} |
q258726 | total_proper_motion | validation | def total_proper_motion(pmra, pmdecl, decl):
'''This calculates the total proper motion of an object.
Parameters
----------
pmra : float or array-like
The proper motion(s) in right ascension, measured in mas/yr.
pmdecl : float or array-like
The proper motion(s) in declination, me... | python | {
"resource": ""
} |
q258727 | equatorial_to_galactic | validation | def equatorial_to_galactic(ra, decl, equinox='J2000'):
'''This converts from equatorial coords to galactic coords.
Parameters
----------
ra : float or array-like
Right ascension values(s) in decimal degrees.
decl : float or array-like
Declination value(s) in decimal degrees.
... | python | {
"resource": ""
} |
q258728 | galactic_to_equatorial | validation | def galactic_to_equatorial(gl, gb):
'''This converts from galactic coords to equatorial coordinates.
Parameters
----------
gl : float or array-like
Galactic longitude values(s) in decimal degrees.
gb : float or array-like
Galactic latitude value(s) in decimal degrees.
Returns... | python | {
"resource": ""
} |
q258729 | xieta_from_radecl | validation | def xieta_from_radecl(inra, indecl,
incenterra, incenterdecl,
deg=True):
'''This returns the image-plane projected xi-eta coords for inra, indecl.
Parameters
----------
inra,indecl : array-like
The equatorial coordinates to get the xi, eta coordinate... | python | {
"resource": ""
} |
q258730 | generate_transit_lightcurve | validation | def generate_transit_lightcurve(
times,
mags=None,
errs=None,
paramdists={'transitperiod':sps.uniform(loc=0.1,scale=49.9),
'transitdepth':sps.uniform(loc=1.0e-4,scale=2.0e-2),
'transitduration':sps.uniform(loc=0.01,scale=0.29)},
magsareflux... | python | {
"resource": ""
} |
q258731 | generate_eb_lightcurve | validation | def generate_eb_lightcurve(
times,
mags=None,
errs=None,
paramdists={'period':sps.uniform(loc=0.2,scale=99.8),
'pdepth':sps.uniform(loc=1.0e-4,scale=0.7),
'pduration':sps.uniform(loc=0.01,scale=0.44),
'depthratio':sps.uniform(lo... | python | {
"resource": ""
} |
q258732 | generate_flare_lightcurve | validation | def generate_flare_lightcurve(
times,
mags=None,
errs=None,
paramdists={
# flare peak amplitude from 0.01 mag to 1.0 mag above median. this
# is tuned for redder bands, flares are much stronger in bluer
# bands, so tune appropriately for your situatio... | python | {
"resource": ""
} |
q258733 | generate_sinusoidal_lightcurve | validation | def generate_sinusoidal_lightcurve(
times,
mags=None,
errs=None,
paramdists={
'period':sps.uniform(loc=0.04,scale=500.0),
'fourierorder':[2,10],
'amplitude':sps.uniform(loc=0.1,scale=0.9),
'phioffset':0.0,
},
magsarefluxes=F... | python | {
"resource": ""
} |
q258734 | generate_rrab_lightcurve | validation | def generate_rrab_lightcurve(
times,
mags=None,
errs=None,
paramdists={
'period':sps.uniform(loc=0.45,scale=0.35),
'fourierorder':[8,11],
'amplitude':sps.uniform(loc=0.4,scale=0.5),
'phioffset':np.pi,
},
magsarefluxes=False
... | python | {
"resource": ""
} |
q258735 | collection_worker | validation | def collection_worker(task):
'''
This wraps `process_fakelc` for `make_fakelc_collection` below.
Parameters
----------
task : tuple
This is of the form::
task[0] = lcfile
task[1] = outdir
task[2] = magrms
task[3] = dict with keys: {'lcformat... | python | {
"resource": ""
} |
q258736 | add_variability_to_fakelc_collection | validation | def add_variability_to_fakelc_collection(simbasedir,
override_paramdists=None,
overwrite_existingvar=False):
'''This adds variability and noise to all fake LCs in `simbasedir`.
If an object is marked as variable in the `fakelcs-i... | python | {
"resource": ""
} |
q258737 | simple_flare_find | validation | def simple_flare_find(times, mags, errs,
smoothbinsize=97,
flare_minsigma=4.0,
flare_maxcadencediff=1,
flare_mincadencepoints=3,
magsarefluxes=False,
savgol_polyorder=2,
... | python | {
"resource": ""
} |
q258738 | _get_acf_peakheights | validation | def _get_acf_peakheights(lags, acf, npeaks=20, searchinterval=1):
'''This calculates the relative peak heights for first npeaks in ACF.
Usually, the first peak or the second peak (if its peak height > first peak)
corresponds to the correct lag. When we know the correct lag, the period is
then::
... | python | {
"resource": ""
} |
q258739 | _autocorr_func1 | validation | def _autocorr_func1(mags, lag, maglen, magmed, magstd):
'''Calculates the autocorr of mag series for specific lag.
This version of the function is taken from: Kim et al. (`2011
<https://dx.doi.org/10.1088/0004-637X/735/2/68>`_)
Parameters
----------
mags : np.array
This is the magnitu... | python | {
"resource": ""
} |
q258740 | _autocorr_func2 | validation | def _autocorr_func2(mags, lag, maglen, magmed, magstd):
'''
This is an alternative function to calculate the autocorrelation.
This version is from (first definition):
https://en.wikipedia.org/wiki/Correlogram#Estimation_of_autocorrelations
Parameters
----------
mags : np.array
Th... | python | {
"resource": ""
} |
q258741 | _autocorr_func3 | validation | def _autocorr_func3(mags, lag, maglen, magmed, magstd):
'''
This is yet another alternative to calculate the autocorrelation.
Taken from: `Bayesian Methods for Hackers by Cameron Pilon <http://nbviewer.jupyter.org/github/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/blob/maste... | python | {
"resource": ""
} |
q258742 | autocorr_magseries | validation | def autocorr_magseries(times, mags, errs,
maxlags=1000,
func=_autocorr_func3,
fillgaps=0.0,
filterwindow=11,
forcetimebin=None,
sigclip=3.0,
magsarefluxes=Fals... | python | {
"resource": ""
} |
q258743 | aovhm_theta | validation | def aovhm_theta(times, mags, errs, frequency,
nharmonics, magvariance):
'''This calculates the harmonic AoV theta statistic for a frequency.
This is a mostly faithful translation of the inner loop in `aovper.f90`. See
the following for details:
- http://users.camk.edu.pl/alex/
- Sc... | python | {
"resource": ""
} |
q258744 | LCDB.open | validation | def open(self, database, user, password, host):
'''This opens a new database connection.
Parameters
----------
database : str
Name of the database to connect to.
user : str
User name of the database server user.
password : str
Passw... | python | {
"resource": ""
} |
q258745 | LCDB.autocommit | validation | def autocommit(self):
'''
This sets the database connection to autocommit. Must be called before
any cursors have been instantiated.
'''
if len(self.cursors.keys()) == 0:
self.connection.autocommit = True
else:
raise AttributeError('database curs... | python | {
"resource": ""
} |
q258746 | LCDB.cursor | validation | def cursor(self, handle, dictcursor=False):
'''This gets or creates a DB cursor for the current DB connection.
Parameters
----------
handle : str
The name of the cursor to look up in the existing list or if it
doesn't exist, the name to be used for a new cursor ... | python | {
"resource": ""
} |
q258747 | LCDB.newcursor | validation | def newcursor(self, dictcursor=False):
'''
This creates a DB cursor for the current DB connection using a
randomly generated handle. Returns a tuple with cursor and handle.
Parameters
----------
dictcursor : bool
If True, returns a cursor where each returned... | python | {
"resource": ""
} |
q258748 | LCDB.close_cursor | validation | def close_cursor(self, handle):
'''
Closes the cursor specified and removes it from the `self.cursors`
dictionary.
'''
if handle in self.cursors:
self.cursors[handle].close()
else:
raise KeyError('cursor with handle %s was not found' % handle) | python | {
"resource": ""
} |
q258749 | trapezoid_transit_func | validation | def trapezoid_transit_func(transitparams, times, mags, errs,
get_ntransitpoints=False):
'''This returns a trapezoid transit-shaped function.
Suitable for first order modeling of transit signals.
Parameters
----------
transitparams : list of float
This contains t... | python | {
"resource": ""
} |
q258750 | xmatch_cplist_external_catalogs | validation | def xmatch_cplist_external_catalogs(cplist,
xmatchpkl,
xmatchradiusarcsec=2.0,
updateexisting=True,
resultstodir=None):
'''This xmatches external catalogs to a collection o... | python | {
"resource": ""
} |
q258751 | xmatch_cpdir_external_catalogs | validation | def xmatch_cpdir_external_catalogs(cpdir,
xmatchpkl,
cpfileglob='checkplot-*.pkl*',
xmatchradiusarcsec=2.0,
updateexisting=True,
resultstodir=Non... | python | {
"resource": ""
} |
q258752 | colormagdiagram_cplist | validation | def colormagdiagram_cplist(cplist,
outpkl,
color_mag1=['gaiamag','sdssg'],
color_mag2=['kmag','kmag'],
yaxis_mag=['gaia_absmag','rpmj']):
'''This makes color-mag diagrams for all checkplot pickles in the prov... | python | {
"resource": ""
} |
q258753 | colormagdiagram_cpdir | validation | def colormagdiagram_cpdir(
cpdir,
outpkl,
cpfileglob='checkplot*.pkl*',
color_mag1=['gaiamag','sdssg'],
color_mag2=['kmag','kmag'],
yaxis_mag=['gaia_absmag','rpmj']
):
'''This makes CMDs for all checkplot pickles in the provided directory.
Can make an arbitrary n... | python | {
"resource": ""
} |
q258754 | add_cmds_cplist | validation | def add_cmds_cplist(cplist, cmdpkl,
require_cmd_magcolor=True,
save_cmd_pngs=False):
'''This adds CMDs for each object in cplist.
Parameters
----------
cplist : list of str
This is the input list of checkplot pickles to add the CMDs to.
cmdpkl : str... | python | {
"resource": ""
} |
q258755 | add_cmds_cpdir | validation | def add_cmds_cpdir(cpdir,
cmdpkl,
cpfileglob='checkplot*.pkl*',
require_cmd_magcolor=True,
save_cmd_pngs=False):
'''This adds CMDs for each object in cpdir.
Parameters
----------
cpdir : list of str
This is the directo... | python | {
"resource": ""
} |
q258756 | cp_objectinfo_worker | validation | def cp_objectinfo_worker(task):
'''This is a parallel worker for `parallel_update_cp_objectinfo`.
Parameters
----------
task : tuple
- task[0] = checkplot pickle file
- task[1] = kwargs
Returns
-------
str
The name of the checkplot file that was updated. None if t... | python | {
"resource": ""
} |
q258757 | parallel_update_objectinfo_cplist | validation | def parallel_update_objectinfo_cplist(
cplist,
liststartindex=None,
maxobjects=None,
nworkers=NCPUS,
fast_mode=False,
findercmap='gray_r',
finderconvolve=None,
deredden_object=True,
custom_bandpasses=None,
gaia_submit_timeout=10.0,
... | python | {
"resource": ""
} |
q258758 | parallel_update_objectinfo_cpdir | validation | def parallel_update_objectinfo_cpdir(cpdir,
cpglob='checkplot-*.pkl*',
liststartindex=None,
maxobjects=None,
nworkers=NCPUS,
fast_mode=... | python | {
"resource": ""
} |
q258759 | checkplot_infokey_worker | validation | def checkplot_infokey_worker(task):
'''This gets the required keys from the requested file.
Parameters
----------
task : tuple
Task is a two element tuple::
- task[0] is the dict to work on
- task[1] is a list of lists of str indicating all the key address to
extrac... | python | {
"resource": ""
} |
q258760 | _gaussian | validation | def _gaussian(x, amp, loc, std):
'''This is a simple gaussian.
Parameters
----------
x : np.array
The items at which the Gaussian is evaluated.
amp : float
The amplitude of the Gaussian.
loc : float
The central value of the Gaussian.
std : float
The stand... | python | {
"resource": ""
} |
q258761 | _double_inverted_gaussian | validation | def _double_inverted_gaussian(x,
amp1, loc1, std1,
amp2, loc2, std2):
'''This is a double inverted gaussian.
Parameters
----------
x : np.array
The items at which the Gaussian is evaluated.
amp1,amp2 : float
The amplitude... | python | {
"resource": ""
} |
q258762 | invgauss_eclipses_func | validation | def invgauss_eclipses_func(ebparams, times, mags, errs):
'''This returns a double eclipse shaped function.
Suitable for first order modeling of eclipsing binaries.
Parameters
----------
ebparams : list of float
This contains the parameters for the eclipsing binary::
ebparams ... | python | {
"resource": ""
} |
q258763 | jhk_to_bmag | validation | def jhk_to_bmag(jmag, hmag, kmag):
'''Converts given J, H, Ks mags to a B magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted B band magnitude.
'''
return convert_constants(jmag,hma... | python | {
"resource": ""
} |
q258764 | jhk_to_vmag | validation | def jhk_to_vmag(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to a V magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted V band magnitude.
'''
return convert_constants(jmag,hmag,... | python | {
"resource": ""
} |
q258765 | jhk_to_rmag | validation | def jhk_to_rmag(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an R magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted R band magnitude.
'''
return convert_constants(jmag,hmag... | python | {
"resource": ""
} |
q258766 | jhk_to_imag | validation | def jhk_to_imag(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an I magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted I band magnitude.
'''
return convert_constants(jmag,hmag... | python | {
"resource": ""
} |
q258767 | jhk_to_sdssu | validation | def jhk_to_sdssu(jmag,hmag,kmag):
'''Converts given J, H, Ks mags to an SDSS u magnitude value.
Parameters
----------
jmag,hmag,kmag : float
2MASS J, H, Ks mags of the object.
Returns
-------
float
The converted SDSS u band magnitude.
'''
return convert_constant... | python | {
"resource": ""
} |
q258768 | jhk_to_sdssg | validation | 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... | python | {
"resource": ""
} |
q258769 | jhk_to_sdssr | validation | 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... | python | {
"resource": ""
} |
q258770 | jhk_to_sdssi | validation | 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... | python | {
"resource": ""
} |
q258771 | jhk_to_sdssz | validation | 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... | python | {
"resource": ""
} |
q258772 | aov_theta | validation | 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... | python | {
"resource": ""
} |
q258773 | bootstrap_falsealarmprob | validation | def bootstrap_falsealarmprob(lspinfo,
times,
mags,
errs,
nbootstrap=250,
magsarefluxes=False,
sigclip=10.0,
npeaks=No... | python | {
"resource": ""
} |
q258774 | make_combined_periodogram | validation | 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... | python | {
"resource": ""
} |
q258775 | _get_value | validation | 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... | python | {
"resource": ""
} |
q258776 | _transit_model | validation | 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... | python | {
"resource": ""
} |
q258777 | _log_prior_transit | validation | 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... | python | {
"resource": ""
} |
q258778 | list_trilegal_filtersystems | validation | 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... | python | {
"resource": ""
} |
q258779 | query_radecl | validation | 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,
... | python | {
"resource": ""
} |
q258780 | read_model_table | validation | 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... | python | {
"resource": ""
} |
q258781 | _time_independent_equals | validation | 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... | python | {
"resource": ""
} |
q258782 | FrontendEncoder.default | validation | 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... | python | {
"resource": ""
} |
q258783 | IndexHandler.initialize | validation | 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
... | python | {
"resource": ""
} |
q258784 | IndexHandler.get | validation | 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... | python | {
"resource": ""
} |
q258785 | CheckplotListHandler.get | validation | 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 ... | python | {
"resource": ""
} |
q258786 | StandaloneHandler.initialize | validation | def initialize(self, executor, secret):
'''
This handles initial setup of the `RequestHandler`.
'''
self.executor = executor
self.secret = secret | python | {
"resource": ""
} |
q258787 | smooth_magseries_gaussfilt | validation | 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.
... | python | {
"resource": ""
} |
q258788 | smooth_magseries_savgol | validation | 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.
... | python | {
"resource": ""
} |
q258789 | _old_epd_diffmags | validation | 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.... | python | {
"resource": ""
} |
q258790 | _old_epd_magseries | validation | 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):
... | python | {
"resource": ""
} |
q258791 | _epd_function | validation | 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... | python | {
"resource": ""
} |
q258792 | _epd_residual2 | validation | 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,... | python | {
"resource": ""
} |
q258793 | epd_magseries | validation | 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... | python | {
"resource": ""
} |
q258794 | rfepd_magseries | validation | def rfepd_magseries(times, mags, errs,
externalparam_arrs,
magsarefluxes=False,
epdsmooth=True,
epdsmooth_sigclip=3.0,
epdsmooth_windowsize=21,
epdsmooth_func=smooth_magseries_savgol,
... | python | {
"resource": ""
} |
q258795 | stellingwerf_pdm_theta | validation | 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... | python | {
"resource": ""
} |
q258796 | keplermag_to_sdssr | validation | 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... | python | {
"resource": ""
} |
q258797 | kepler_lcdict_to_pkl | validation | 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
... | python | {
"resource": ""
} |
q258798 | read_kepler_pklc | validation | 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... | python | {
"resource": ""
} |
q258799 | filter_kepler_lcdict | validation | 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... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.