phoebe_ld

phoebe_ld

Synopsis

                    LD_table;
extern              LD_table *PHOEBE_ld_table;
enum                LD_model;
PHOEBE_ld*          phoebe_ld_new                       ();
PHOEBE_ld*          phoebe_ld_new_from_file             (const char *filename);
int                 phoebe_ld_alloc                     (PHOEBE_ld *table,
                                                         int dim);
int                 phoebe_ld_realloc                   (PHOEBE_ld *table,
                                                         int dim);
int                 phoebe_ld_attach                    (PHOEBE_ld *table);
int                 phoebe_ld_attach_all                (char *dir);
int                 phoebe_ld_free                      (PHOEBE_ld *table);
LD_table*           phoebe_ld_table_intern_load         (char *model_list);
LD_table*           phoebe_ld_table_vh1993_load         (char *dir);
int                 phoebe_ld_table_free                (LD_table *LD);
int                 phoebe_ld_get_coefficients          (LD_model ldlaw,
                                                         PHOEBE_passband *passband,
                                                         double M,
                                                         double T,
                                                         double lg,
                                                         double *x,
                                                         double *y);
LD_model            phoebe_ld_model_type                (const char *ldlaw);
char*               phoebe_ld_get_vh1993_passband_name  (PHOEBE_passband *passband);

Description

Details

LD_table

typedef struct {
	PHOEBE_array *Mnodes;
	PHOEBE_array *Tnodes;
	PHOEBE_array *lgnodes;
	struct {
		char *fn;
		long int pos;
	} ***table;
} LD_table;


PHOEBE_ld_table

extern LD_table *PHOEBE_ld_table;


enum LD_model

typedef enum LD_model {
	LD_LAW_LINEAR = 1,
	LD_LAW_LOG,
	LD_LAW_SQRT,
	LD_LAW_INVALID
} LD_model;

LD_LAW_LINEAR

Linear cosine model

LD_LAW_LOG

Logarithmic model

LD_LAW_SQRT

Square root model

LD_LAW_INVALID

Invalid model or not set

phoebe_ld_new ()

PHOEBE_ld*          phoebe_ld_new                       ();

Initializes a new limb darkening (LD) table.

Returns :

a pointer to the new PHOEBE_ld structure.

phoebe_ld_new_from_file ()

PHOEBE_ld*          phoebe_ld_new_from_file             (const char *filename);

Reads in limb darkening coefficients. The table must have 5 columns: linear cosine coefficient, log coefficients, and sqrt coefficients. The filename can either be absolute or relative; if relative, its location is presumed to be one of the following:

1) current working directory, 2) limb darkening directory (as stored in the global PHOEBE_LD_DIR variable).

filename :

input file

Returns :

PHOEBE_error_code.

phoebe_ld_alloc ()

int                 phoebe_ld_alloc                     (PHOEBE_ld *table,
                                                         int dim);

Allocates memory for the limb darkening table.

table :

initialized limb darkening table

dim :

table dimension

Returns :

PHOEBE_error_code.

phoebe_ld_realloc ()

int                 phoebe_ld_realloc                   (PHOEBE_ld *table,
                                                         int dim);

Reallocates memory for the limb darkening table.

table :

initialized or already allocated limb darkening table

dim :

table dimension

Returns :

PHOEBE_error_code.

phoebe_ld_attach ()

int                 phoebe_ld_attach                    (PHOEBE_ld *table);

Attaches the passed limb darkening table to its respective passband. The passband is determined from the limb darkening table keywords PASS_SET and PASSBAND -- these have to match passband definitions exactly. See PHOEBE_passband and PHOEBE_ld structures for more information on identifying passbands.

table :

populated limb darkening table

Returns :

PHOEBE_error_code.

phoebe_ld_attach_all ()

int                 phoebe_ld_attach_all                (char *dir);

Opens the directory dir, scans all files in that directory and reads in all found LD tables. It attaches these tables to their respective passbands.

This function must be called after phoebe_read_in_passbands(), otherwise attaching will fail.

dir :

directory where limb darkening coefficients are stored

Returns :

PHOEBE_error_code.

phoebe_ld_free ()

int                 phoebe_ld_free                      (PHOEBE_ld *table);

Frees memory of the limb darkening table.

table :

limb darkening table to be freed

Returns :

PHOEBE_error_code.

phoebe_ld_table_intern_load ()

LD_table*           phoebe_ld_table_intern_load         (char *model_list);

Loads the reference table for the internal PHOEBE database of limb darkening coefficients. The table must contain 3 columns: temperature, gravity and metallicity of the nodes. All values in the table must be integers, where gravity and metallicity are multiplied by 10. I.e., the entry for log(g)=4.5 is 45, the entry for [M/H]=-0.5 is -05.

The reference table contains three PHOEBE_array's: Mnodes, Tnodes and lgnodes. These arrays contain all nodes, in addition to -1001 for the first and last element of the array, which simplifies the bounds check of the lookup function phoebe_ld_get_coefficients().

The table itself is a 3D matrix with dimensions of the three PHOEBE_arrays mentioned above. The 'pos' fields are padded with -1 if the node is not in the database, or the consecutive entry number in the reference table if it is. Since the LD tables are read to memory (in contrast to Van Hamme LD tables), the 'fn' field is always set to NULL.

model_list :

filename of the reference table

Returns :

LD_table.

phoebe_ld_table_vh1993_load ()

LD_table*           phoebe_ld_table_vh1993_load         (char *dir);

Scans all files in the passed directory dir and extracts LD triplets (T, log g, M/H) from table headers. It then creates a 3D matrix what holds all of these elements so that LD[M][T][lg] is structured by indices and all non-existing nodes padded with nans. For optimized lookup this matrix has a border of nans in all three directions - so that the lookup function does not have to check for matrix boundaries.

dir :

directory that contains Van Hamme (1993) LD tables

Returns :

PHOEBE_error_code.

phoebe_ld_table_free ()

int                 phoebe_ld_table_free                (LD_table *LD);

Frees the contents of the limb darkening table LD. It is safe to call this function on the unallocated table, so there is no need to check for LD presence.

LD :

limb darkening table

Returns :

PHOEBE_error_code.

phoebe_ld_get_coefficients ()

int                 phoebe_ld_get_coefficients          (LD_model ldlaw,
                                                         PHOEBE_passband *passband,
                                                         double M,
                                                         double T,
                                                         double lg,
                                                         double *x,
                                                         double *y);

ldlaw :

passband :

M :

T :

lg :

x :

y :

Returns :


phoebe_ld_model_type ()

LD_model            phoebe_ld_model_type                (const char *ldlaw);

Converts common name of the limb darkening model to the LD enumerator. See LD_model enumerator for a list of choices.

ldlaw :

name of the limb darkening model

Returns :

enumerated LD_model value.

phoebe_ld_get_vh1993_passband_name ()

char*               phoebe_ld_get_vh1993_passband_name  (PHOEBE_passband *passband);

passband :

Returns :