Send data reports to: datamaster@exoplanets.org and bug reports to: webmaster@exoplanets.org

The Filter and Query Language

Overview

The Kepler Data Explorer has been designed with two goals in mind: to make access to the Kepler Database fun and straightforward, and to enable users to quickly build customizable, powerful, and useful filters and views of the dataset. This latter, more advanced feature, is made possible through a simple query language that is built into the table and plotter components. Advanced users who would like to leverage the full flexibility of the Kepler Data Explorer should peruse this section of the documentation to familiarize themselves with the query language.

The query language is used in two distinct contexts: to construct filters and to combine and transform planet properties to create new quantities. The former is used in the Table and Plotter to select a subset of planets to view, the latter is used in the plotter to produce scatter plots and histograms of combinations of planet properties and in the table to construct custom columns.

Example Queries

Perhaps the simplest way to introduce the query language is to present some examples. If you would rather jump to a list of available operations and functions skip to below.

Example Filters

Example Custom Properties

All of the above examples combine and compare planet properties in order to ultimately produce a true or false cut on each planet in the Kepler database. This behavior is appropriate in the context of filters. The query language is also used, however, when constructing custom scatter and histogram plots in the Plotter and custom columns in the table. In this context, KOI properties can be combined mathematically in order to yield a new numerical quantity for each KOI. This quantity can then be plotted against other numerical quantities, or presented in the table. Here are some examples:

Supported Operations and Functions

The following operations and functions are supported by the query language.

Supported Mathematical Operators

SymbolOperationExample
+AdditionRA + 10
-SubractionRA - 10
*Multiplication2*A
/DivisionUPER/PER
%ModuloN_OBJ%2
^,**ExponentiationA^2 or A**2

Supported Comparison Operators

SymbolOperationExample
>Greater-thanDEC > 30
<Less-thanDEC < 50
>=Greater-than-or-equal-toN_OBJ >= 3
<=Less-than-or-equal-toN_OBJ <= 3
=,==Equal-toN_OBJ = 2 or N_OBJ == 2
!=Not-equal-toN_OBJ != 2

Supported String Comparison Operators

Note: all string comparisons are case-insensitive.
SymbolOperationExample
CONTAINSSubset matching: returns true if any part of the string on the left hand side matches the string on the right hand sizeVETTING_STATUS CONTAINS "Candidate"
==Identical matching: returns true if the left hand side and right hand side match exactlyVETTING_STATUS == "Strong Candidate"

Supported Boolean Operators

SymbolOperationExample
&&, ANDLogical andDEC > 42 && DEC < 44 or DEC > 42 AND DEC < 44
||, ORLogical orN_OBJ == 2 || N_OBJ == 3 or N_OBJ = 2 OR N_OBJ = 3
!, NOTLogical not!(RECON && ADAPTIVE) or NOT (RECON AND ADAPTIVE)

Supported Functions

SymbolOperation
abs(x)Absolute Value
asin(x)Inverse Trigonometric Sine, returns radians
acos(x)Inverse Trigonometric Cosine, returns radians
atan(x)Inverse Trigonometric Tangent, returns radians
atan2(y,x)C-like arctangent, takes two arguments and returns radians
sin(x)Trigonometric Sine, accepts radians
cos(x)Trigonometric Cosine, accepts radians
tan(x)Trigonometric Tangent, accepts radians
ceil(x)Takes the ceiling of the passed in number
floor(x)Takes the floor of the passed in number
round(x)Rounds the passed in number
exp(x)Exponential function
log(x), ln(x)Natural Logarithm (i.e. ln)
log10(x)Log base 10
sqrt(x)Square root function
max(x,y)Returns the larger of x and y
min(x,y)Returns the smaller of x and y

Support Constants

SymbolDescription
pipi = π = 3.14159....
trueThe boolean value true
falseThe boolean value false
NaNThe special not-a-number value NaN
inf, infinityInfinity

Units

The query language allows for basic unit conversions for columns that have associated units.

Physical ClassUnitUnit ID
TimeSecondss
Minutesmin
Hourshrs
Daysdays
Yearsyrs
LengthCentimeterscm
Metersm
Kilometerskm
Astronomical Units (AU)au
Light Yearsly
Parsecspc
Earth Radiirearth
Jupiter Radiirjupiter
Solar Radiirsun
MassGramsg
Kilogramskg
Earth Massmearth
Jupiter Massmjupiter
Solar Massmsun
VolumeCentimeters3cm^3
Meters3m^3
ConcentrationParts-per-millionppm
Percentagepercent
AngleDegreesdeg
Radiansrad
Hourshr
Arcsecondsarcsec
Milliarcsecondsmarcsec
TemperatureKelvinK
CelciusC
FahrenheitF