UVES Pipeline Reference Manual  5.4.0
Functions
Functions for standard stars

Functions

cpl_error_code irplib_stdstar_write_catalogs (cpl_frameset *set_in, const cpl_frameset *set_raw, const char *recipe_name, const char *pro_cat, const char *pro_type, const char *package_name, const char *ins_name, cpl_table *(*convert_ascii_table)(const char *))
 Write the ASCII catalogs as FITS files.
cpl_table * irplib_stdstar_load_catalog (const char *filename, const char *ext_name)
 Load the FITS catalog in a table.
cpl_error_code irplib_stdstar_check_columns_exist (const cpl_table *catal)
 Check that the table has the relevant columns of a stdstar table.
int irplib_stdstar_select_stars_dist (cpl_table *cat, double ra, double dec, double dist)
 Select the stars that are within a given distance.
int irplib_stdstar_select_stars_mag (cpl_table *cat, const char *mag_colname)
 Select the stars that have a known magnitude.
int irplib_stdstar_find_closest (const cpl_table *cat, double ra, double dec)
 Find the closest star.
cpl_error_code irplib_stdstar_find_star (const char *catfile, double ra, double dec, const char *band, const char *catname, double *mag, char **name, char **type, char **usedcatname, double *star_ra, double *star_dec, double dist_am)
 Find the closest star to ra, dec in the catalog.
cpl_vector * irplib_stdstar_get_conversion (const cpl_bivector *spec, double dit, double surface, double gain, double mag)
 Get the conversion.
cpl_vector * irplib_stdstar_get_mag_zero (const cpl_bivector *sed, const cpl_vector *waves, double cent_wl)
 Get the 0 magnitude spectrum.
cpl_bivector * irplib_stdstar_get_sed (const char *seds_file, const char *sptype)
 Get the SED.

Detailed Description


Function Documentation

cpl_error_code irplib_stdstar_write_catalogs ( cpl_frameset *  set_in,
const cpl_frameset *  set_raw,
const char *  recipe_name,
const char *  pro_cat,
const char *  pro_type,
const char *  package_name,
const char *  ins_name,
cpl_table *(*)(const char *)  convert_ascii_table 
)

Write the ASCII catalogs as FITS files.

Parameters:
set_inInput frameset where the product is registered
set_rawSet of ASCII catalogs
recipe_nameRecipe name
pro_catPRO.CATG
pro_typePRO.TYPE
package_nameUsually PACKAGE "/" PACKAGE_VERSION
ins_nameInstrument name
convert_ascii_tableConversion function
Returns:
CPL_ERROR_NONE if ok or else the relevant CPL error code

Every catalog will be written in a different extension, where EXTNAME is the name of the catalog ASCII file name.

The conversion ascii -> cpl_table is done by convert_ascii_table() and should be defined in each instrument

Definition at line 89 of file irplib_stdstar.c.

cpl_table* irplib_stdstar_load_catalog ( const char *  filename,
const char *  ext_name 
)

Load the FITS catalog in a table.

Parameters:
filenameName of the FITS catalog
ext_nameName of the catalog or "all"
Returns:
The newly allocated table orNULL in error case.

The table is loaded from the specified extension. If "all" is specified, all extension with the same columns as the first one are loaded and put together in the returned table.

The returned table must be de allocated with cpl_table_delete().

Definition at line 195 of file irplib_stdstar.c.

Referenced by irplib_stdstar_find_star().

cpl_error_code irplib_stdstar_check_columns_exist ( const cpl_table *  catal)

Check that the table has the relevant columns of a stdstar table.

Parameters:
catalTable with the catalogue
Returns:
CPL_ERROR_NONE if the table has all the mandatory columns, a proper error code otherwise

The table is checked for the presence of the mandatory keywords

Definition at line 300 of file irplib_stdstar.c.

Referenced by irplib_stdstar_find_star().

int irplib_stdstar_select_stars_dist ( cpl_table *  cat,
double  ra,
double  dec,
double  dist 
)

Select the stars that are within a given distance.

Parameters:
catthe catalog
raRA pos
decDEC pos
distthe distancw
Returns:
0 if ok, -1 in error case

The stars that are within not further than dist from ra,dec are selected in the table.

Definition at line 348 of file irplib_stdstar.c.

Referenced by irplib_stdstar_find_star().

int irplib_stdstar_select_stars_mag ( cpl_table *  cat,
const char *  mag_colname 
)

Select the stars that have a known magnitude.

Parameters:
catthe catalog
mag_colnamethe column name with the searched magnitude
Returns:
0 if ok, -1 in error case

The stars whose magnitude in the mag band is known are selected in the table.

Definition at line 397 of file irplib_stdstar.c.

Referenced by irplib_stdstar_find_star().

int irplib_stdstar_find_closest ( const cpl_table *  cat,
double  ra,
double  dec 
)

Find the closest star.

Parameters:
catthe catalog
raRA pos
decDEC pos
Returns:
the index of the star in the table or -1 in error case

Returns the index of the star that is closest to (ra,dec)

Definition at line 433 of file irplib_stdstar.c.

Referenced by irplib_stdstar_find_star().

cpl_error_code irplib_stdstar_find_star ( const char *  catfile,
double  ra,
double  dec,
const char *  band,
const char *  catname,
double *  mag,
char **  name,
char **  type,
char **  usedcatname,
double *  star_ra,
double *  star_dec,
double  dist_am 
)

Find the closest star to ra, dec in the catalog.

Parameters:
catfilethe catalog file name
raRA pos where to search
decDEC pos where to search
bandthe band name
catnamethe searched catalog name
magthe computed magnitude (output)
namethe star name (output)
typethe star type (output)
star_rathe star RA from the catalog (output)
star_decthe star DEC from the catalog (output)
dist_amthe distance in arc minutes
Returns:
CPL_ERROR_NONE if ok or else the relevant CPL error code

The closest star to ra, dec with defined magnitude is search in all the catalogues included in catfile. If catname is "all", all the catalogs are searched at once. The output pointers can be NULL if one is not interested in them.

Definition at line 501 of file irplib_stdstar.c.

References irplib_stdstar_check_columns_exist(), irplib_stdstar_find_closest(), irplib_stdstar_load_catalog(), irplib_stdstar_select_stars_dist(), and irplib_stdstar_select_stars_mag().

cpl_vector* irplib_stdstar_get_conversion ( const cpl_bivector *  spec,
double  dit,
double  surface,
double  gain,
double  mag 
)

Get the conversion.

Parameters:
specthe extracted spectrum
ditthe DIT (in sec)
surfacethe surface of the miror (in sq cm)
gainthe gain of the instrument (ISAAC=4.5, SINFONI=2.42)
magthe star magnitude
Returns:
the newly allocated conversion or NULL in error case

conversion(wave) = (spec * gain * 10^(mag/2.5) * h * c) / (dit * surface * dispersion * wave)

Definition at line 609 of file irplib_stdstar.c.

cpl_vector* irplib_stdstar_get_mag_zero ( const cpl_bivector *  sed,
const cpl_vector *  waves,
double  cent_wl 
)

Get the 0 magnitude spectrum.

Parameters:
sedthe SED in angstroms / ergs/s/cm^2/Angstrom
wavesthe wavelengths in angstroms
cent_wlthe central wavelength in microns
Returns:
the newly allocated spectrum or NULL in error case

Definition at line 668 of file irplib_stdstar.c.

cpl_bivector* irplib_stdstar_get_sed ( const char *  seds_file,
const char *  sptype 
)

Get the SED.

Parameters:
seds_filethe table file name
sptypethe requested spectral type
Returns:
the newly allocated SED or NULL in error case

wavelength in Angstroms SED in

Definition at line 773 of file irplib_stdstar.c.