All command line options can be accessed through members. More...
#include <poet.h>
Public Member Functions | |
CommandLineOptions (int argc, char **argv) | |
Parse the command line. More... | |
double | get_real_value (InCol::InputColumns quantity) const |
Returns the value of the quantity, if it is not overwritten by the input list. More... | |
std::istream & | input () |
The stream to read the parameters of the planet-star systems for which to calculate evolution. More... | |
std::string | input_filename () const |
The name of the file to read in the various evolution scenarios. More... | |
std::string | output_filename () const |
The name of the file to output the solution to. More... | |
const char * | serialized_stellar_evolution () const |
The name of the file to read/write a serialized stellar evolution from/to. More... | |
const char * | eccentricity_expansion () const |
The name of the file to read eccentricity expansion coefficients from. More... | |
bool | start_locked () const |
Whether the planet should start locked to the star. More... | |
bool | use_YREC () const |
Whether to used the YREC tracks instead of the MESA ones. More... | |
bool | input_from_list () const |
Are any quantities to be read from a list file? More... | |
const std::vector< InCol::InputColumns > & | input_file_format () const |
List of the columns expected in the input file. More... | |
const std::vector< OutCol::OutputColumns > & | output_file_format () const |
The columns to output. More... | |
const std::list< double > & | required_ages () const |
Ages at which the evolution should definitely step. More... | |
const std::string | custom_stellar_evolution () const |
const std::vector< CustomStellarEvolution::Columns > & | custom_track_format () const |
A list of the columns in the custom stellar evolution track. More... | |
double | custom_track_smoothing (CustomStellarEvolution::Columns column) const |
The smoothing to apply to the given column from the custom stellar evolution track. More... | |
int | custom_track_nodes (CustomStellarEvolution::Columns column) const |
The nodes to use for the given column from the custom stellar evolution track. More... | |
bool | need_orbit () const |
operator bool () | |
Did parsing the command line succeed. More... | |
~CommandLineOptions () | |
Closes the input filename if it was opened. More... | |
Private Member Functions | |
char * | cstr_copy (const std::ostringstream &stream) |
Returns a copy of the c-string content of the stream. More... | |
char * | cstr_copy (const std::string &str) |
Returns a copy of the c-string content of the stream. More... | |
void | define_options () |
Defines the command line options. More... | |
void | set_defaults () |
Sets default values to the appropriate options. More... | |
template<typename COL_ID_TYPE > | |
void | parse_column_list (const char *columns_str, const std::vector< std::string > column_names, int num_column_names, std::vector< COL_ID_TYPE > &columns, bool allow_noname=false) |
Parses a comma separated list of column names. More... | |
void | postprocess () |
Updates some command line options after parsing and parses column lists. More... | |
void | cleanup () |
Free all manually allocated memory and close open streams. More... | |
void | init_input_column_names () |
Fills in the names of the input columns in __input_column_names. More... | |
void | init_output_column_descriptions () |
Fills is the descriptions of the output columns in __output_column_descr. More... | |
void | init_track_column_descriptions_and_units () |
Fills is the descriptions of the columns in a custom stellar evolution track in __track_column_descr. More... | |
void | init_defaults () |
Fills in default values for all possible real valued input quantities and the smoothing parameters for custom stellar evolution. More... | |
void | setup () |
Fills in all the static members. More... | |
void | verify_custom_stellar_evolution () |
Private Attributes | |
std::vector< std::string > | __input_column_names |
The names to use for the input columns in the –input-columns option. More... | |
std::vector< std::string > | __output_column_descr |
Description of the output columns. More... | |
std::vector< std::string > | __track_column_descr |
Description of the columns in the input stellar evolution track. More... | |
std::vector< std::string > | __track_column_units |
Descriptions of the units expected of the stellar evolution track quantities. More... | |
std::vector< double > | __defaults |
The default values for the quantities defining the evolution to calculate. More... | |
std::vector< double > | __default_track_smoothing |
Default smoothing to apply to custom stellar evolution track quantities. More... | |
std::vector< int > | __default_track_nodes |
Default numbef or spline nodes for custom stellar evolution track quantities. More... | |
std::vector< arg_dbl * > | __direct_value_options |
The command line options which directly specify a value. More... | |
std::vector< arg_dbl * > | __custom_track_smoothing |
The command line options which specify the smoothing for custom stellar evolution tracks. More... | |
std::vector< arg_int * > | __custom_track_nodes |
The command line options which specify the number of nodes to use if a custom track quantity is to be smoothed. More... | |
arg_str * | __input_file_columns |
The columns in the input file. More... | |
arg_str * | __output_file_columns |
The columns to write to the output file. More... | |
arg_str * | __required_ages_option |
The comma separated list of ages to include in the tabulated evolution. More... | |
arg_str * | __custom_stellar_evolution_format |
arg_lit * | __start_locked |
arg_lit * | __use_YREC |
Wether we should use the YREC tracks instead of the MESA. More... | |
arg_file * | __input_fname |
The name of the file to read the evolution scenarios from. More... | |
arg_file * | __output_fname |
The name of the file to output the solution to. More... | |
arg_file * | __serialized_stellar_evolution |
The name of the file to read pre-serialized stellar evolution from. More... | |
arg_file * | __custom_stellar_evolution |
The filename of the custom stellar evolution track. More... | |
arg_file * | __eccentricity_expansion |
The name of the file to read eccentricity expansion coefficients from. More... | |
void * | __argtable [InCol::NUM_INPUT_QUANTITIES+2 *CustomStellarEvolution::AGE+10] |
std::vector< InCol::InputColumns > | __input_file_format |
A list of the columns in the input file. More... | |
std::vector< OutCol::OutputColumns > | __output_file_format |
A list of the columns in the output file. More... | |
std::vector< CustomStellarEvolution::Columns > | __track_format |
A list of the columns in the custom stellar evolution track. More... | |
std::ifstream | __input_stream |
The stream to the input filename if stdin is not being used. More... | |
std::list< char * > | __option_help_copies |
The copies of the option help strings made when creating the options. More... | |
std::list< double > | __required_ages |
The sorted list of ages to make sure are included in the tabulated evolution. More... | |
bool | __parsed_ok |
Did parsing the command line succeed. More... | |
bool | __opened_stream |
Set to true only if and when the __input_stream is opened. More... | |
bool | __need_orbit |
Static Private Attributes | |
static const std::string | __default_outfname |
The default output filename. More... | |
static const std::string | __default_serialized_evol |
The default filename to read the serialized stellar evoliton from. More... | |
static const std::string | __default_output_columns |
The default output columns. More... | |
static const std::string | __default_track_columns |
The default columns in a custom stellar evolution track. More... | |
static const std::string | __default_eccentricity_expansion |
CommandLineOptions::CommandLineOptions | ( | int | argc, |
char ** | argv | ||
) |
Parse the command line.
|
inline |
|
private |
Free all manually allocated memory and close open streams.
|
inlineprivate |
|
private |
Returns a copy of the c-string content of the stream.
|
inline |
|
inline |
int CommandLineOptions::custom_track_nodes | ( | CustomStellarEvolution::Columns | column | ) | const |
The nodes to use for the given column from the custom stellar evolution track.
double CommandLineOptions::custom_track_smoothing | ( | CustomStellarEvolution::Columns | column | ) | const |
The smoothing to apply to the given column from the custom stellar evolution track.
|
private |
Defines the command line options.
|
inline |
double CommandLineOptions::get_real_value | ( | InCol::InputColumns | quantity | ) | const |
Returns the value of the quantity, if it is not overwritten by the input list.
|
private |
Fills in default values for all possible real valued input quantities and the smoothing parameters for custom stellar evolution.
|
private |
Fills in the names of the input columns in __input_column_names.
|
private |
Fills is the descriptions of the output columns in __output_column_descr.
|
private |
Fills is the descriptions of the columns in a custom stellar evolution track in __track_column_descr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Parses a comma separated list of column names.
columns_str | The comma separated list of column names. |
column_names | The allowed column names |
num_column_names | The number of allowed column names |
columns | This is updated to contain the columns in the correct order. |
allow_noname | Whether to allow zero length column names. |
|
private |
Updates some command line options after parsing and parses column lists.
Opens the input file if it is being used.
Converts the precision required from number of significant figures to an actual value.
Calculates values of options which were specified using an alternative.
|
inline |
|
inline |
|
private |
Sets default values to the appropriate options.
|
private |
Fills in all the static members.
|
inline |
|
inline |
|
private |
Applies common sense checks that all custom stellar evolution options.
Throws an exception if something is wrong.
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Set to true only if and when the __input_stream is opened.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |