![]() |
![]() |
![]() |
PHOEBE Reference Manual | ![]() |
---|---|---|---|---|
enum PHOEBE_parameter_kind; PHOEBE_parameter_options; PHOEBE_parameter_list; PHOEBE_parameter_table; PHOEBE_parameter_table_list; extern PHOEBE_parameter_table_list *PHOEBE_pt_list; extern PHOEBE_parameter_table *PHOEBE_pt; PHOEBE_parameter_table* phoebe_parameter_table_new (); PHOEBE_parameter_table* phoebe_parameter_table_duplicate (PHOEBE_parameter_table *table); int phoebe_parameter_table_activate (PHOEBE_parameter_table *table); int phoebe_parameter_table_print (PHOEBE_parameter_table *table); int phoebe_parameter_table_free (PHOEBE_parameter_table *table); PHOEBE_parameter* phoebe_parameter_new (); int phoebe_parameter_add (char *qualifier, char *description, PHOEBE_parameter_kind kind, char *dependency, double min, double max, double step, bool tba, ...); unsigned int phoebe_parameter_hash (char *qualifier); PHOEBE_parameter* phoebe_parameter_lookup (char *qualifier); int phoebe_parameter_commit (PHOEBE_parameter *par); int phoebe_parameter_add_option (PHOEBE_parameter *par, char *option); int phoebe_parameter_update_deps (PHOEBE_parameter *par, int oldval); int phoebe_parameter_free (PHOEBE_parameter *par); int phoebe_parameter_option_get_index (PHOEBE_parameter *par, char *option, int *index); bool phoebe_parameter_option_is_valid (char *qualifier, char *option); int phoebe_init_parameters (); int phoebe_free_parameters (); int phoebe_init_parameter_options (); int phoebe_qualifier_string_parse (char *input, char **qualifier, int *index); bool phoebe_qualifier_is_constrained (char *qualifier); int phoebe_parameter_get_value (PHOEBE_parameter *par, ...); int phoebe_parameter_set_value (PHOEBE_parameter *par, ...); int phoebe_parameter_get_tba (PHOEBE_parameter *par, bool *tba); int phoebe_parameter_set_tba (PHOEBE_parameter *par, bool tba); int phoebe_parameter_get_step (PHOEBE_parameter *par, double *step); int phoebe_parameter_set_step (PHOEBE_parameter *par, double step); int phoebe_parameter_get_min (PHOEBE_parameter *par, double *valmin); int phoebe_parameter_set_min (PHOEBE_parameter *par, double valmin); int phoebe_parameter_get_max (PHOEBE_parameter *par, double *valmax); int phoebe_parameter_set_max (PHOEBE_parameter *par, double valmax); int phoebe_parameter_get_limits (PHOEBE_parameter *par, double *valmin, double *valmax); int phoebe_parameter_set_limits (PHOEBE_parameter *par, double valmin, double valmax); PHOEBE_parameter_list* phoebe_parameter_list_reverse (PHOEBE_parameter_list *c, PHOEBE_parameter_list *p); PHOEBE_parameter_list* phoebe_parameter_list_get_marked_tba (); int phoebe_parameter_list_sort_marked_tba (PHOEBE_parameter_list *list); double phoebe_spots_units_to_wd_conversion_factor (); enum PHOEBE_el3_units; int phoebe_el3_units_id (PHOEBE_el3_units *el3_units); int phoebe_active_lcno_get (int *active_lcno, PHOEBE_array **active_lcindices); int phoebe_active_rvno_get (int *active_rvno, PHOEBE_array **active_rvindices); int phoebe_active_spots_get (int *active_spots_no, PHOEBE_array **active_spotindices); int phoebe_open_parameter_file (const char *filename); int phoebe_open_legacy_parameter_file (const char *filename); int phoebe_save_parameter_file (const char *filename); int phoebe_restore_default_parameters (); int phoebe_parameter_file_import_bm3 (const char *bm3file, const char *datafile);
typedef enum PHOEBE_parameter_kind { KIND_PARAMETER, KIND_MODIFIER, KIND_ADJUSTABLE, KIND_SWITCH, KIND_MENU, KIND_COMPUTED } PHOEBE_parameter_kind;
typedef struct { struct PHOEBE_parameter *par; struct PHOEBE_parameter_list *next; } PHOEBE_parameter_list;
typedef struct { PHOEBE_parameter_list *bucket[PHOEBE_PT_HASH_BUCKETS]; struct { PHOEBE_parameter_list *marked_tba; struct PHOEBE_ast_list *constraints; } lists; } PHOEBE_parameter_table;
typedef struct { PHOEBE_parameter_table *table; struct PHOEBE_parameter_table_list *next; } PHOEBE_parameter_table_list;
PHOEBE_parameter_table* phoebe_parameter_table_new ();
Initializes a new parameter table and adds it to the list of all parameter tables.
Returns : |
PHOEBE_parameter_table. |
PHOEBE_parameter_table* phoebe_parameter_table_duplicate (PHOEBE_parameter_table *table);
Makes a duplicate copy of the table table
.
|
a PHOEBE_parameter_table to duplicate. |
Returns : |
PHOEBE_parameter_table. |
int phoebe_parameter_table_activate (PHOEBE_parameter_table *table);
Sets a pointer to the currently active parameter table PHOEBE_pt
to
table
.
|
parameter table that should be activated. |
Returns : |
PHOEBE_error_code. |
int phoebe_parameter_table_print (PHOEBE_parameter_table *table);
|
|
Returns : |
int phoebe_parameter_table_free (PHOEBE_parameter_table *table);
Frees the parameter table table
and removes it from the list of all
parameter tables. Note that this does not free the parameters contained
in the table; use phoebe_parameters_free()
for that.
|
a PHOEBE_parameter_table to be freed. |
Returns : |
PHOEBE_error_code. |
int phoebe_parameter_add (char *qualifier, char *description, PHOEBE_parameter_kind kind, char *dependency, double min, double max, double step, bool tba, ...);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
unsigned int phoebe_parameter_hash (char *qualifier);
|
|
Returns : |
PHOEBE_parameter* phoebe_parameter_lookup (char *qualifier);
|
|
Returns : |
int phoebe_parameter_add_option (PHOEBE_parameter *par, char *option);
|
|
|
|
Returns : |
int phoebe_parameter_update_deps (PHOEBE_parameter *par, int oldval);
par
: PHOEBE_parameter that has been changed
oldval
: original value of the parameter par
Called whenever the dimension of parameter arrays must be changed. Typically this happens when the number of observed data curves changed, the number of spots is changed etc.
|
|
|
|
Returns : |
PHOEBE_error_code. |
int phoebe_parameter_option_get_index (PHOEBE_parameter *par, char *option, int *index);
Scans through all the options of the PHOEBE_parameter par
and returns
the index of the option
. The par
's kind must be KIND_MENU. If the
option is not found, the index
is set to -1 and
ERROR_PARAMETER_OPTION_DOES_NOT_EXIST is returned.
|
PHOEBE_parameter being queried |
|
the option to be looked up |
|
a pointer to the index to be assigned |
Returns : |
PHOEBE_error_code. |
bool phoebe_parameter_option_is_valid (char *qualifier, char *option);
|
|
|
|
Returns : |
int phoebe_free_parameters ();
Frees all parameters from the currently active parameter table pointed
to by a global variable PHOEBE_pt
.
Returns : |
PHOEBE_error_code. |
int phoebe_qualifier_string_parse (char *input, char **qualifier, int *index);
Parses the input string of the form qualifier[index]. The tokens are
assigned to the passed arguments qualifier
(which is allocated) and
index
. The allocated string needs to be freed by the calling function.
Also, this function merely parses a passed string, it does not check
for the qualifier and element validity. If the qualifier is a scalar,
index
is set to 0.
|
the string of the form "qualifier[element]" to be parsed. |
|
the newly allocated string that holds the qualifier. |
|
the qualifier index. |
Returns : |
PHOEBE_error_code. |
bool phoebe_qualifier_is_constrained (char *qualifier);
This function checks whether a passed qualifier also appears in the list of constraints. If so, it returns true; else it returns false.
|
|
Returns : |
int phoebe_parameter_get_value (PHOEBE_parameter *par, ...);
Synopsis:
phoebe_parameter_get_value (par, [index, ], &value)
Assigns the value of the passed parameter par
to the passed variable
value
. In case of strings pointers are returned, so you should never
free the variable that has been assigned.
|
PHOEBE_parameter to be queried |
|
index and a variable of the corresponding type in case of passband-dependent parameters, or a variable of the corresponding type in case of passband-independent parameters. |
Returns : |
PHOEBE_error_code |
int phoebe_parameter_set_value (PHOEBE_parameter *par, ...);
This is a public function for changing the value of the passed
parameter par
. The function also satisfies all constraints.
Synopsis:
phoebe_parameter_set_value (qualifier, [index, ] value)
|
PHOEBE_parameter to be set. |
|
an optional curve index and an PHOEBE_value value. |
Returns : |
PHOEBE_error_code. |
int phoebe_parameter_get_tba (PHOEBE_parameter *par, bool *tba);
|
|
|
|
Returns : |
int phoebe_parameter_set_tba (PHOEBE_parameter *par, bool tba);
|
|
|
|
Returns : |
int phoebe_parameter_get_step (PHOEBE_parameter *par, double *step);
|
|
|
|
Returns : |
int phoebe_parameter_set_step (PHOEBE_parameter *par, double step);
|
|
|
|
Returns : |
int phoebe_parameter_get_min (PHOEBE_parameter *par, double *valmin);
|
|
|
|
Returns : |
int phoebe_parameter_set_min (PHOEBE_parameter *par, double valmin);
|
|
|
|
Returns : |
int phoebe_parameter_get_max (PHOEBE_parameter *par, double *valmax);
|
|
|
|
Returns : |
int phoebe_parameter_set_max (PHOEBE_parameter *par, double valmax);
|
|
|
|
Returns : |
int phoebe_parameter_get_limits (PHOEBE_parameter *par, double *valmin, double *valmax);
|
|
|
|
|
|
Returns : |
int phoebe_parameter_set_limits (PHOEBE_parameter *par, double valmin, double valmax);
|
|
|
|
|
|
Returns : |
PHOEBE_parameter_list* phoebe_parameter_list_reverse (PHOEBE_parameter_list *c, PHOEBE_parameter_list *p);
|
|
|
|
Returns : |
PHOEBE_parameter_list* phoebe_parameter_list_get_marked_tba ();
Returns : |
int phoebe_parameter_list_sort_marked_tba (PHOEBE_parameter_list *list);
|
|
Returns : |
double phoebe_spots_units_to_wd_conversion_factor ();
Returns : |
typedef enum PHOEBE_el3_units { PHOEBE_EL3_UNITS_TOTAL_LIGHT, PHOEBE_EL3_UNITS_FLUX, PHOEBE_EL3_UNITS_INVALID_ENTRY } PHOEBE_el3_units;
int phoebe_active_lcno_get (int *active_lcno, PHOEBE_array **active_lcindices);
Sweeps through all defined light curves and counts the ones that are
active (i.e. their activity switch is set to 1). Active light curve
indices are stored in the passed array active_lcindices
. The array
should not be initialized or allocated by the calling function, but
it should be freed afrer use.
|
placeholder for the number of active light curves. |
|
placeholder for the array of active light curve indices |
Returns : |
PHOEBE_error_code. |
int phoebe_active_rvno_get (int *active_rvno, PHOEBE_array **active_rvindices);
Sweeps through all defined RV curves and counts the ones that are
active (i.e. their activity switch is set to 1). Active RV curve
indices are stored in the passed array active_rvindices
. The array
should not be initialized or allocated by the calling function, but
it should be freed afrer use.
|
placeholder for the number of active RV curves. |
|
placeholder for the array of active RV curve indices |
Returns : |
PHOEBE_error_code. |
int phoebe_active_spots_get (int *active_spots_no, PHOEBE_array **active_spotindices);
Sweeps through all defined spots and counts the ones that are
active (i.e. their activity switch is set to 1). Active spot
indices are stored in the passed array active_spots
. The array
should not be initialized or allocated by the calling function, but
it should be freed afrer use.
|
placeholder for the number of active light spots. |
|
|
Returns : |
PHOEBE_error_code. |
int phoebe_open_parameter_file (const char *filename);
|
|
Returns : |
int phoebe_open_legacy_parameter_file (const char *filename);
Runs the lex converter on a legacy keyword file (i.e. a file pertaining to PHOEBE versions 0.2x), creates a parameter file in the temporary directory, opens it and removes it when done.
|
legacy (0.2x) keyword file |
Returns : |
PHOEBE_error_code. |
int phoebe_save_parameter_file (const char *filename);
|
|
Returns : |
int phoebe_parameter_file_import_bm3 (const char *bm3file, const char *datafile);
Imports Dave Bradstreet's Binary Maker 3 parameter file.
|
Binary Maker 3 (bm3) filename |
|
Observed curve filename |
Returns : |
PHOEBE_error_code. |