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.

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_in Input frameset where the product is registered
set_raw Set of ASCII catalogs
recipe_name Recipe name
pro_cat PRO.CATG
pro_type PRO.TYPE
package_name Usually PACKAGE "/" PACKAGE_VERSION
ins_name Instrument name
convert_ascii_table Conversion 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:
filename Name of the FITS catalog
ext_name Name 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:
catal Table 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:
cat the catalog
ra RA pos
dec DEC pos
dist the 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:
cat the catalog
mag_colname the 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:
cat the catalog
ra RA pos
dec DEC 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:
catfile the catalog file name
ra RA pos where to search
dec DEC pos where to search
band the band name
catname the searched catalog name
mag the computed magnitude (output)
name the star name (output)
type the star type (output)
star_ra the star RA from the catalog (output)
star_dec the star DEC from the catalog (output)
dist_am the 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:
spec the extracted spectrum
dit the DIT (in sec)
surface the surface of the miror (in sq cm)
gain the gain of the instrument (ISAAC=4.5, SINFONI=2.42)
mag the 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:
sed the SED in angstroms / ergs/s/cm^2/Angstrom
waves the wavelengths in angstroms
cent_wl the 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_file the table file name
sptype the 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.

Generated on Mon Feb 17 15:01:45 2014 for NACO Pipeline Reference Manual by  doxygen 1.6.3