78 size_t bt = strlen(fits_file) *
sizeof(*fits_file)+1;
98 cpl_table_delete(pindex->
cache[i]);
100 cpl_free(pindex->
cache);
133 cpl_table* pindex = 0;
134 check(pindex = cpl_table_load(fits_file,1,0));
193 const char* curr_star_name = 0;
195 if (strcmp(curr_star_name, starname) == 0)
210 cpl_table_delete(pindex->
cache[cache_index]);
211 pindex->
cache[cache_index] = 0;
222 cpl_table* pnew_index = 0;
231 nrows = cpl_table_get_nrow(pnew_index);
232 for (i = 0; i < nrows; i++)
236 check(cpl_table_save(pnew_index, NULL, NULL, fits_file, CPL_IO_CREATE));
237 cpl_table_delete(pnew_index);
246 cpl_table* ptable = 0;
247 if (i < pindex->index_size - pindex->
cache_size)
255 check(cpl_table_save(ptable, NULL, NULL, fits_file, CPL_IO_EXTEND));
256 cpl_table_delete(ptable);
277 if ((ext_id > 0) && (fabs(curr_ra - RA) < RA_EPS) && (fabs(curr_dec - DEC) < DEC_EPS))
291 if (pret && pstar_name)
static const char * COL_NAME_DEC
int star_index_add(star_index *pindex, double RA, double DEC, const char *star_name, cpl_table *ptable)
void star_index_dump(star_index *pindex, FILE *pfile)
void star_index_delete(star_index *pindex)
static const char * COL_NAME_RA
static const char * COL_NAME_EXTID
star_index * star_index_create(void)
static star_index * star_index_construct(const char *fits_file)
star_index * star_index_load(const char *fits_file)
int star_index_remove_by_name(star_index *pindex, const char *starname)
int star_index_save(star_index *pindex, const char *fits_file)
static void star_index_destruct(star_index *pindex)
cpl_table * star_index_get(star_index *pindex, double RA, double DEC, double RA_EPS, double DEC_EPS, const char **pstar_name)
static const char * COL_NAME_NAME
int start_index_get_size(star_index *pindex)