LOST  0.0.1
LOST: Open-source Star Tracker
pipeline-options.hpp
Go to the documentation of this file.
1 // this file uses the "X" pattern.
2 
3 // Arguments to LOST_CLI_OPTION:
4 // 1. String used as the command line option.
5 // 2. Type of the option value.
6 // 3. Property name
7 // 4. Default value
8 // 5. Code to convert optarg into the value.
9 // 6. The default value if the option is specified with no argument, or kNoDefaultArgument
10 
11 // To properly align these fields, I recommend using an editor plugin. In Vim, try `vim-lion`; in
12 // Emacs, try `evil-lion`. With your cursor inside any of the blocks, type `glip,` to aLign the
13 // Inside of the current Paragraph to comma.
14 
15 #include <string>
16 
17 #include "decimal.hpp"
18 
19 // CAMERA
20 LOST_CLI_OPTION("png" , std::string , png , "" , optarg , kNoDefaultArgument)
21 LOST_CLI_OPTION("focal-length" , decimal , focalLength , 0 , atof(optarg) , kNoDefaultArgument)
22 LOST_CLI_OPTION("pixel-size" , decimal , pixelSize , -1 , atof(optarg) , kNoDefaultArgument)
23 LOST_CLI_OPTION("fov" , decimal , fov , 20 , atof(optarg) , kNoDefaultArgument)
24 
25 // PIPELINE STAGES
26 LOST_CLI_OPTION("centroid-algo" , std::string, centroidAlgo , "" , optarg , "cog")
27 LOST_CLI_OPTION("centroid-dummy-stars" , int , centroidDummyNumStars , 5 , atoi(optarg) , kNoDefaultArgument)
28 LOST_CLI_OPTION("centroid-mag-filter" , decimal , centroidMagFilter , -1 , STR_TO_DECIMAL(optarg) , 5)
29 LOST_CLI_OPTION("centroid-filter-brightest", int , centroidFilterBrightest , -1 , atoi(optarg) , 10)
30 LOST_CLI_OPTION("database" , std::string, databasePath , "" , optarg , kNoDefaultArgument)
31 LOST_CLI_OPTION("star-id-algo" , std::string, idAlgo , "" , optarg , "pyramid")
32 LOST_CLI_OPTION("angular-tolerance" , decimal , angularTolerance , .04 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
33 LOST_CLI_OPTION("false-stars-estimate" , int , estimatedNumFalseStars , 500 , atoi(optarg) , kNoDefaultArgument)
34 LOST_CLI_OPTION("max-mismatch-probability" , decimal , maxMismatchProb , .001, STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
35 LOST_CLI_OPTION("attitude-algo" , std::string, attitudeAlgo , "" , optarg , "dqm")
36 
37 // OUTPUT COMPARISON
38 LOST_CLI_OPTION("centroid-compare-threshold", decimal , centroidCompareThreshold, 2 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
39 LOST_CLI_OPTION("attitude-compare-threshold", decimal , attitudeCompareThreshold, 1 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
40 LOST_CLI_OPTION("plot-raw-input" , std::string, plotRawInput , "", optarg , "-")
41 LOST_CLI_OPTION("plot-input" , std::string, plotInput , "", optarg , "-")
42 LOST_CLI_OPTION("plot-expected" , std::string, plotExpected , "", optarg , "-")
43 LOST_CLI_OPTION("plot-centroid-indices" , std::string, plotCentroidIndices , "", optarg , "-")
44 LOST_CLI_OPTION("plot-output" , std::string, plotOutput , "", optarg , "-")
45 LOST_CLI_OPTION("print-expected-centroids" , std::string, printExpectedCentroids , "", optarg , "-")
46 LOST_CLI_OPTION("print-input-centroids" , std::string, printInputCentroids , "", optarg , "-")
47 LOST_CLI_OPTION("print-actual-centroids" , std::string, printActualCentroids , "", optarg , "-")
48 LOST_CLI_OPTION("print-attitude" , std::string, printAttitude , "", optarg , "-")
49 LOST_CLI_OPTION("print-expected-attitude" , std::string, printExpectedAttitude , "", optarg , "-")
50 LOST_CLI_OPTION("print-speed" , std::string, printSpeed , "", optarg , "-")
51 LOST_CLI_OPTION("compare-centroids" , std::string, compareCentroids , "", optarg , "-")
52 LOST_CLI_OPTION("compare-star-ids" , std::string, compareStarIds , "", optarg , "-")
53 LOST_CLI_OPTION("compare-attitudes" , std::string, compareAttitudes , "", optarg , "-")
54 
55 // IMAGE GENERATION
56 LOST_CLI_OPTION("generate" , int , generate , 0 , atoi(optarg) , 1)
57 LOST_CLI_OPTION("generate-x-resolution" , int , generateXRes , 1024 , atoi(optarg) , kNoDefaultArgument)
58 LOST_CLI_OPTION("generate-y-resolution" , int , generateYRes , 1024 , atoi(optarg) , kNoDefaultArgument)
59 LOST_CLI_OPTION("generate-centroids-only" , bool , generateCentroidsOnly , false , atobool(optarg) , true)
60 LOST_CLI_OPTION("generate-zero-mag-photons" , decimal , generateZeroMagPhotons , 20000 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
61 LOST_CLI_OPTION("generate-saturation-photons" , decimal , generateSaturationPhotons , 150 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
62 LOST_CLI_OPTION("generate-spread-stddev" , decimal , generateSpreadStdDev , 1 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
63 LOST_CLI_OPTION("generate-shot-noise" , bool , generateShotNoise , true , atobool(optarg) , kNoDefaultArgument)
64 LOST_CLI_OPTION("generate-dark-current" , decimal , generateDarkCurrent , 0.1 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
65 LOST_CLI_OPTION("generate-read-noise-stddev" , decimal , generateReadNoiseStdDev , .05 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
66 LOST_CLI_OPTION("generate-ra" , decimal , generateRa , 88 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
67 LOST_CLI_OPTION("generate-de" , decimal , generateDe , 7 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
68 LOST_CLI_OPTION("generate-roll" , decimal , generateRoll , 0 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
69 LOST_CLI_OPTION("generate-random-attitudes" , bool , generateRandomAttitudes , false , atobool(optarg) , true)
70 LOST_CLI_OPTION("generate-blur-ra" , decimal , generateBlurRa , 0 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
71 LOST_CLI_OPTION("generate-blur-de" , decimal , generateBlurDe , 0 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
72 LOST_CLI_OPTION("generate-blur-roll" , decimal , generateBlurRoll , 0 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
73 LOST_CLI_OPTION("generate-exposure" , decimal , generateExposure , 0.2 , STR_TO_DECIMAL(optarg) , 0.1)
74 LOST_CLI_OPTION("generate-readout-time" , decimal , generateReadoutTime , 0 , STR_TO_DECIMAL(optarg) , 0.01)
75 LOST_CLI_OPTION("generate-oversampling" , int , generateOversampling , 4 , atoi(optarg) , kNoDefaultArgument)
76 LOST_CLI_OPTION("generate-false-stars" , int , generateNumFalseStars , 0 , atoi(optarg) , 50)
77 LOST_CLI_OPTION("generate-false-min-mag" , decimal , generateFalseMinMag , 8 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
78 LOST_CLI_OPTION("generate-false-max-mag" , decimal , generateFalseMaxMag , 1 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
79 LOST_CLI_OPTION("generate-perturb-centroids" , decimal , generatePerturbationStddev, 0 , STR_TO_DECIMAL(optarg) , 0.2)
80 LOST_CLI_OPTION("generate-cutoff-mag" , decimal , generateCutoffMag , 6.0 , STR_TO_DECIMAL(optarg) , kNoDefaultArgument)
81 LOST_CLI_OPTION("generate-seed" , int , generateSeed , 394859, atoi(optarg) , kNoDefaultArgument)
82 LOST_CLI_OPTION("generate-time-based-seed" , bool , timeSeed , false , atobool(optarg) , true)
double decimal
Definition: decimal.hpp:11
#define STR_TO_DECIMAL(x)
Definition: decimal.hpp:12
#define LOST_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg)
Definition: io.hpp:288
bool atobool(const char *cstr)
Convert string to boolean.
Definition: main.cpp:107
const char kNoDefaultArgument
Definition: io.hpp:32