diff --git a/README.md b/README.md index 5157413..d45424a 100644 --- a/README.md +++ b/README.md @@ -13,30 +13,25 @@ flux,date Where the left column is the normalized flux (the precieved brightness percent) and the right column is the Julian date. The date doesn't need to be the Julian date exactly, but it does need to have 1 equal to 1 Earth day. -## Table of Contents +# Table of Contents ``` 0. exoplanet-finder (info about this project) -1. Where to get data -2. Using this library in your own project +1. Using this library in your own project a. Using parseData.h to parse data b. Creating the FindPlanet class c. Finding exoplanets! -3. Contributing +2. Contributing a. Test tools b. Issues c. Pull requests ```` -## Where to get data - -Coming soon when I have more info. - ## Using this library in your own project To use this library in your own project, you first need to load the data into a `std::unordered_map>` data type. The unordered map will have two keys: `flux` and `date`. The `flux` is the percent percieved brightness of the star, and the `date` is the Julian date (or any other date format where 1 = 1 day) of that datapoint. If your data looks like exactly like the example above, you may use the `parseData.h` file to parse the data in the format for the program. -### Using parseData.h to parse data +## Using parseData.h to parse data Using the parseData header makes it simple to get the data from a csv into the correct format, assuming that your data looks exactly like the example above with the flux to the left and the Julian date to the right. @@ -62,7 +57,7 @@ In the output, we will get this unordered map: This is the correct format for the following steps. -### Creating the FindPlanet class +## Creating the FindPlanet class To create the FindPlanet class, we need to pass in the five required input variables: `data`: The data aquired using the last step in this readme @@ -85,7 +80,7 @@ int main() } ``` -### Finding exoplanets! +## Finding exoplanets! The final step is to call a method in the `FindPlanet` class to find exoplanets. The `findPlanets()` method returns a `std::vector` where the `double` is the flux of the planet it detected. @@ -115,18 +110,45 @@ int main() } ``` -## Contributing +## Finding exoplanets more precisely + +There is a way to find exoplanets more precisely using a more sophisticated algorithm at the cost of computational time by using the `FindPlanet.findPlanetsPrecise()` method. This method is recommended if you are not processing large amounts of data. Otherwise, it functions exactly the same as `FindPlanet.findPlanets()`. + +```cpp +#include +#include +#include + +#include "include/exoplanetFinder/detect_exoplanets.h" + +int main() +{ + // This code was explained in the previous section + std::unordered_map> data = ... // define the data, read the previous section for more info + DetectExoplanets::FindPlanet planetFinder{ data, 0.9999, 0.002, 1.5, 0.4 }; + + // Get the planet fluxes + std::vector planetFluxes = planetFinder.findPlanetsPrecise(); + + // Output the planet fluxes to the console + for (auto flux : planetFluxes) { + std::cout << flux << "\n"; + } +} +``` + +# Contributing -### Test tools +## Test tools -More info on this section coming soon. I need to get test data +Section coming soon -### Issues +## Issues Suggestions are welcome in the issues section. For bugs, please state what the issue is, the data you used (if you can share it that would be great), and the code you created that has the issue. -### Pull requests +## Pull requests For minor changes, please submit a pull request and state what you changed. For major changes, please create an issue to discuss the change before creating a pull request.