Step 4.3: Threshold and display
You did a great jobs to compute the difference between the light curve and the trend hunter! But how do you see how you can quickly automate the drop detection?
Threshold test
Let’s compute at first a threshold test! In WarpScript you can re-use the MAP framework to do it! The MAP
framework have the following operator: gt
(greater than), ge
(greater or equals), eq
(equals), lt
(lower than), le
(lower or equals)… Find out the correct operator and working threshold!
How does we proceed ? The threshold test corresponds finally in the re-using the MAP
framework. If you would like to have a reminder see below or to review the lesson on MAP
: go here.
The map framework works as follow:
// MAP Framework
[
$gts // Series list or Singleton
mapper.function // Mapper function operator
0 // Pre
0 // Post
0 // Occurence
]
MAP
This time we are going to use the map framework to compute a single value operation! Does the current value below a specified threshold. We can use one of the mapper function indicated upper. Those function would expect a number parameter on top of the stack (2, 5, 10, 15, 20, 25, 30 and so on could be working value here).
The result will be the same series containing only the points that match the criteria specified with the function. For example with a mapper.le
and a threshold of 30, only the points that are equals to 30 or lower are kept in the result series.
Display things nicely
Great now you can successfully detect some exoplanet! You have well earn your badge as an exoplanet hunter! Just one more thing, how to be sure that the periods you have extracted corresponds to exoplanet ? Let’s print more nicely the result! To do so, we can convert our result into annotations in WarpScript. This can be done using boolean instead of values! And there is also a mapper to do it: mapper.toboolean.
Pro tip: mapper.toboolean
is a single value mapper and would not work correctly on bucketized series. To correct it and get the better result we recommand to use the UNBUCKETIZE
function right after the BUCKETIZE
operation. A TODO was included in the sampled code for this task.
Then you can push back on the stack the original series using a variable!
To help you achieve this step, you can complete the following skeleton. Fix each TODO directly included in the code!
Resume
At the end of this step, two sets of series are now availble on the stack. One containing all the time a specify series were below a threshold converted to boolean annotations. And the second set series contains the original series. We can the compare (when ploting both result) if our method to detect an exoplanet on Kepler-11 is efficient or not.
To be continued
Great, you’re now an experimented exoplanet hunter! I am sure you’re ready now ready to test you’re analysis on lot more of the Kepler’s start. That’s exactly what we will now accomplish.