Search is not available for this dataset
text
stringlengths
75
104k
def bls_parallel_pfind( times, mags, errs, magsarefluxes=False, startp=0.1, # by default, search from 0.1 d to... endp=100.0, # ... 100.0 d -- don't search full timebase stepsize=1.0e-4, mintransitduration=0.01, # minimum transit length in phase maxtransitdurat...
def _parse_csv_header(header): '''This parses a CSV header from a K2 CSV LC. 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 = [x.lstrip('# ') ...
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 ...
def get_starfeatures(lcfile, outdir, kdtree, objlist, lcflist, neighbor_radius_arcsec, deredden=True, custom_bandpasses=None, lcformat='hat-sql', ...
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, ...
def serial_starfeatures(lclist, outdir, lc_catalog_pickle, neighbor_radius_arcsec, maxobjects=None, deredden=True, custom_bandpasses=None, lcformat='hat...
def parallel_starfeatures(lclist, outdir, lc_catalog_pickle, neighbor_radius_arcsec, maxobjects=None, deredden=True, custom_bandpasses=None, ...
def parallel_starfeatures_lcdir(lcdir, outdir, lc_catalog_pickle, neighbor_radius_arcsec, fileglob=None, maxobjects=None, deredd...
def checkplot_dict( lspinfolist, times, mags, errs, fast_mode=False, magsarefluxes=False, nperiodstouse=3, objectinfo=None, deredden_object=True, custom_bandpasses=None, gaia_submit_timeout=10.0, gaia_submit_tries=3, ...
def checkplot_pickle( lspinfolist, times, mags, errs, fast_mode=False, magsarefluxes=False, nperiodstouse=3, objectinfo=None, deredden_object=True, custom_bandpasses=None, gaia_submit_timeout=10.0, gaia_submit_tries=3, ...
def checkplot_pickle_update( currentcp, updatedcp, outfile=None, outgzip=False, pickleprotocol=None, verbose=True ): '''This updates the current checkplotdict with updated values provided. Parameters ---------- currentcp : dict or str This is ei...
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 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_...
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...
def pdw_period_find(times, mags, errs, autofreq=True, init_p=None, end_p=None, f_step=1.0e-4, phasebinsize=None, sigclip=10.0, nworkers=None...
def townsend_lombscargle_value(times, mags, omega): ''' This calculates the periodogram value for each omega (= 2*pi*f). Mags must be normalized to zero with variance scaled to unity. ''' cos_omegat = npcos(omega*times) sin_omegat = npsin(omega*times) xc = npsum(mags*cos_omegat) xs = n...
def parallel_townsend_lsp(times, mags, startp, endp, stepsize=1.0e-4, nworkers=4): ''' This calculates the Lomb-Scargle periodogram for the frequencies corresponding to the period interval (startp, endp) using a frequency step size of stepsize cycles/d...
def scipylsp_parallel(times, mags, errs, # ignored but for consistent API startp, endp, nbestpeaks=5, periodepsilon=0.1, # 0.1 stepsize=1.0e-4, ...
def get_periodicfeatures( pfpickle, lcbasedir, outdir, 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), pdiff_threshold=1.0e...
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, ...
def serial_periodicfeatures(pfpkl_list, lcbasedir, outdir, starfeaturesdir=None, fourierorder=5, # these are depth, duration, ingress duration transitpa...
def parallel_periodicfeatures(pfpkl_list, lcbasedir, outdir, starfeaturesdir=None, fourierorder=5, # these are depth, duration, ingress duration ...
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...
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...
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 ...
def xmatch_external_catalogs(checkplotdict, xmatchinfo, xmatchradiusarcsec=2.0, returndirect=False, updatexmatch=True, savepickle=None): '''This matches the current object...
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 ...
def decimal_to_dms(decimal_value): '''Converts from decimal degrees (for declination coords) to DD:MM:SS. Parameters ---------- decimal_value : float A decimal value to convert to degrees, minutes, seconds sexagesimal format. Returns ------- tuple A four element t...
def decimal_to_hms(decimal_value): '''Converts from decimal degrees (for RA coords) to HH:MM:SS. Parameters ---------- decimal_value : float A decimal value to convert to hours, minutes, seconds. Negative values will be wrapped around 360.0. Returns ------- tuple ...
def hms_str_to_tuple(hms_string): '''Converts a string of the form HH:MM:SS or HH MM SS to a tuple of the form (HH, MM, SS). Parameters ---------- hms_string : str A RA coordinate string of the form 'HH:MM:SS.sss' or 'HH MM SS.sss'. Returns ------- tuple A three eleme...
def dms_str_to_tuple(dms_string): '''Converts a string of the form [+-]DD:MM:SS or [+-]DD MM SS to a tuple of the form (sign, DD, MM, SS). Parameters ---------- dms_string : str A declination coordinate string of the form '[+-]DD:MM:SS.sss' or '[+-]DD MM SS.sss'. The sign in front ...
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...
def dms_to_decimal(sign, degrees, minutes, seconds): '''Converts from DD:MM:SS to a decimal value. Parameters ---------- sign : {'+', '-', ''} The sign part of a Dec coordinate. degrees : int The DD part of a Dec coordinate. minutes : int The MM part of a Dec coordina...
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 ...
def xmatch_basic(ra1, dec1, ra2, dec2, match_radius=5.0): '''Finds the closest object in (`ra2`, `dec2`) to scalar coordinate pair (`ra1`, `dec1`) and returns the distance in arcseconds. This is a quick matcher that uses the `great_circle_dist` function to find the closest object in (`ra2`, `dec2`) wit...
def xmatch_neighbors(ra1, dec1, ra2, dec2, match_radius=60.0, includeself=False, sortresults=True): '''Finds the closest objects in (`ra2`, `dec2`) to scalar coordinate pair (`ra1`, `dec1`) and returns the indices of the objects...
def make_kdtree(ra, decl): '''This makes a `scipy.spatial.CKDTree` on (`ra`, `decl`). Parameters ---------- ra,decl : array-like The right ascension and declination coordinate pairs in decimal degrees. Returns ------- `scipy.spatial.CKDTree` The cKDTRee object generated b...
def conesearch_kdtree(kdtree, racenter, declcenter, searchradiusdeg, conesearchworkers=1): '''This does a cone-search around (`racenter`, `declcenter`) in `kdtree`. Parameters ---------- kdtree : scipy.spatial.CKDT...
def xmatch_kdtree(kdtree, extra, extdecl, xmatchdistdeg, closestonly=True): '''This cross-matches between `kdtree` and (`extra`, `extdecl`) arrays. Returns the indices of the kdtree and the indices of extra, extdecl that xmatch successfully. Parame...
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...
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. ...
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...
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...
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...
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...
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...
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...
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 ...
def make_fakelc(lcfile, outdir, magrms=None, randomizemags=True, randomizecoords=False, lcformat='hat-sql', lcformatdir=None, timecols=None, magcols=None, errcols=None): ''...
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...
def make_fakelc_collection(lclist, simbasedir, magrmsfrom, magrms_interpolate='quadratic', magrms_fillvalue='extrapolate', maxlcs=25000, maxvars=2000, ...
def add_fakelc_variability(fakelcfile, vartype, override_paramdists=None, magsarefluxes=False, overwrite=False): '''This adds variability of the specified type to the fake LC. The procedure is (for each ...
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...
def add_flare_model(flareparams, times, mags, errs): '''This adds a flare model function to the input magnitude/flux time-series. Parameters ---------- flareparams : list of float This defines the flare model:: [amplitude...
def simple_flare_find(times, mags, errs, smoothbinsize=97, flare_minsigma=4.0, flare_maxcadencediff=1, flare_mincadencepoints=3, magsarefluxes=False, savgol_polyorder=2, ...
def _smooth_acf(acf, windowfwhm=7, windowsize=21): '''This returns a smoothed version of the ACF. Convolves the ACF with a Gaussian of given `windowsize` and `windowfwhm`. Parameters ---------- acf : np.array The auto-correlation function array to smooth. windowfwhm : int The...
def _smooth_acf_savgol(acf, windowsize=21, polyorder=2): ''' This returns a smoothed version of the ACF. This version uses the Savitsky-Golay smoothing filter. Parameters ---------- acf : np.array The auto-correlation function array to smooth. windowsize : int The number ...
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:: ...
def plot_acf_results(acfp, outfile, maxlags=5000, yrange=(-0.4,0.4)): ''' This plots the unsmoothed/smoothed ACF vs lag. Parameters ---------- acfp : dict This is the dict returned from `macf_period_find` below. outfile : str The output file the plot will be written to. m...
def macf_period_find( times, mags, errs, fillgaps=0.0, filterwindow=11, forcetimebin=None, maxlags=None, maxacfpeaks=10, smoothacf=21, # set for Kepler-type LCs, see details below smoothfunc=_smooth_acf_savgol, smoothfunckwargs=Non...
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...
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...
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...
def autocorr_magseries(times, mags, errs, maxlags=1000, func=_autocorr_func3, fillgaps=0.0, filterwindow=11, forcetimebin=None, sigclip=3.0, magsarefluxes=Fals...
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...
def _aovhm_theta_worker(task): ''' This is a parallel worker for the function below. Parameters ---------- tasks : tuple This is of the form below:: task[0] = times task[1] = mags task[2] = errs task[3] = frequency task[4] = nhar...
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...
def open_default(self): ''' This opens the database connection using the default database parameters given in the ~/.astrobase/astrobase.conf file. ''' if HAVECONF: self.open(DBDATA, DBUSER, DBPASS, DBHOST) else: LOGERROR("no default DB connectio...
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...
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 ...
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...
def commit(self): ''' This just calls the connection's commit method. ''' if not self.connection.closed: self.connection.commit() else: raise AttributeError('postgres connection to %s is closed' % self.database)
def rollback(self): ''' This just calls the connection's commit method. ''' if not self.connection.closed: self.connection.rollback() else: raise AttributeError('postgres connection to %s is closed' % self.database)
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)
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...
def trapezoid_transit_residual(transitparams, times, mags, errs): ''' This returns the residual between the modelmags and the actual mags. Parameters ---------- transitparams : list of float This contains the transiting planet trapezoid model:: transitparams = [transitperiod (...
def tap_query(querystr, simbad_mirror='simbad', returnformat='csv', forcefetch=False, cachedir='~/.astrobase/simbad-cache', verbose=True, timeout=10.0, refresh=2.0, maxtimeout=90.0, maxtries=3, ...
def objectnames_conesearch(racenter, declcenter, searchradiusarcsec, simbad_mirror='simbad', returnformat='csv', forcefetch=False, cachedir='~/.astrobase/simb...
def xmatch_cplist_external_catalogs(cplist, xmatchpkl, xmatchradiusarcsec=2.0, updateexisting=True, resultstodir=None): '''This xmatches external catalogs to a collection o...
def xmatch_cpdir_external_catalogs(cpdir, xmatchpkl, cpfileglob='checkplot-*.pkl*', xmatchradiusarcsec=2.0, updateexisting=True, resultstodir=Non...
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...
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...
def add_cmd_to_checkplot( cpx, cmdpkl, require_cmd_magcolor=True, save_cmd_pngs=False ): '''This adds CMD figures to a checkplot dict or pickle. Looks up the CMDs in `cmdpkl`, adds the object from `cpx` as a gold(-ish) star in the plot, and then saves the figure to a base64 ...
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...
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...
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...
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, ...
def parallel_update_objectinfo_cpdir(cpdir, cpglob='checkplot-*.pkl*', liststartindex=None, maxobjects=None, nworkers=NCPUS, fast_mode=...
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...
def main(): '''This is the main function of this script. The current script args are shown below :: Usage: checkplotlist [-h] [--search SEARCH] [--sortby SORTBY] [--filterby FILTERBY] [--splitout SPLITOUT] [--outprefix OUTPREFIX] [--maxkeyworke...
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...
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...
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 ...
def invgauss_eclipses_residual(ebparams, times, mags, errs): '''This returns the residual between the modelmags and the actual mags. Parameters ---------- ebparams : list of float This contains the parameters for the eclipsing binary:: ebparams = [period (time), ...
def convert_constants(jmag, hmag, kmag, cjhk, cjh, cjk, chk, cj, ch, ck): '''This converts between JHK and BVRI/SDSS mags. Not meant to be used directly. See the functions below for more sensible interface. This function does the grunt work ...
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...
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,...
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...
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...
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...