IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2005, 7:42:24 AM (21 years ago)
Author:
eugene
Message:

removed download from CVS tree, added libfits, libohana summary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/doc/www/html/developer/libohana.htm

    r3902 r4812  
    1 <meta name=file  content=libohana>
    2 <meta name=title content=libohana>
    3 <meta name=page  content=libohana>
    4 
    5 Sorry!  The page you requested is not yet available.
     1<meta name=title content=libohana API reference>
     2<meta name=page  content=libohana API reference>
     3
     4<h2> generic ohana functions </h2>
     5
     6<h3> basic macros </h3>
     7
     8<pre>
     9TRUE
     10FALSE
     11SIGN(X) 
     12ROUND(X)
     13SQR(X)   
     14SQ(X)   
     15MIN(X,Y)
     16MAX(X,Y)
     17SWAP(X,Y)
     18whitespace (char c)
     19</pre>
     20
     21<h3> ohana memory management functions </h3>
     22
     23<pre>
     24ALLOCATE (void *ptr, type, int Nalloc);
     25REALLOCATE (void *ptr, type, int Nalloc);
     26CHECK_REALLOCATE (void *ptr, type, int Nalloc, int Nused, int Ndelta);
     27free (void *ptr);
     28
     29void  ohana_memregister (void *ptr);
     30void  ohana_memdump (int mode);
     31void  ohana_memcheck (int mode);
     32</pre>
     33
     34<h3> string manipulation functions (string.c) </h3>
     35
     36<pre>
     37int   get_argument (int argc, char **argv, char *arg);
     38int   remove_argument (int Narg, int *argc, char **argv);
     39char *strcreate (char *string);
     40char *strncreate (char *string, int Nbytes);
     41int   strnumcmp (char *str1, char *str2);
     42int   stripwhite (char *string);
     43int   scan_line (FILE *f, char *line);
     44int   dparse (double *value, int Nentry, char *line);
     45int   fparse (double *value, int Nentry, char *line);
     46char *_parse_nextword (char *string);
     47</pre>
     48
     49<pre> int get_argument (int argc, char **argv, char *arg); </pre>
     50
     51search argv, argc list (starting at argv[1]) for desired argument.
     52returns entry number if found, 0 otherwise.
     53<hr>
     54
     55<pre> int remove_argument (int Narg, int *argc, char **argv); </pre>
     56
     57remove the given entry Narg from the argv list, adjusting argc
     58appropriately.
     59<hr>
     60
     61<pre> int stripwhite (char *string); </pre>
     62
     63strip whitespace (space or tab) from start and end of string.
     64<hr>
     65
     66<pre> int strnumcmp (char *str1, char *str2); </pre>
     67
     68compare str1 and str2 as strings, or as numbers if both are pure
     69numeric values (base 10 only).  returns TRUE / FALSE.
     70<hr>
     71
     72<h3> file system functions (findexec.c) </h3>
     73
     74<pre>
     75char *pathname (char *file);
     76char *filerootname (char *file);
     77char *fileextname (char *file);
     78char *filebasename (char *file);
     79char *findexec (int argc, char **argv);
     80int   mkdirhier (char *path);
     81char *getcwd_cfht (char *path, int size);
     82void  make_backup (char *filename);
     83int   Fseek (FILE *f, long offset, int whence);
     84</pre>
     85
     86<h3> lockfile functions (glockfile.c) </h3>
     87
     88<pre>
     89FILE *fsetlockfile (char *filename, double timeout, int type, int *state);
     90int   fclearlockfile (char *filename, FILE *f, int type, int *state);
     91</pre>
     92
     93associated constants:
     94
     95<pre>
     96LCK_SOFT - block writing
     97LCK_XCLD - block reading and writing
     98LCK_HARD - block reading and writing, persistent
     99
     100LCK_UNLOCK   - file is unlocked
     101LCK_ACCESS   - can't get access to file
     102LCK_TIMEOUT  - timeout setting lock
     103LCK_HARDLCK  - error setting hard lockfile
     104LCK_HUNLOCK  - error clearing hard lockfile
     105           
     106LCK_EMPTY    - locked file is empty
     107LCK_FULL     - locked file is not empty
     108LCK_UNKNOWN  - can't stat file to get size
     109</pre>
     110
     111<h3> time / radec manipulation functions (time.c) </h3>
     112
     113<pre>
     114int    dms_to_ddd (double *Value, char *string);
     115int    str_to_radec (double *ra, double *dec, char *str1, char *str2);
     116int    chk_time (char *line);
     117int    str_to_time (char *line, time_t *second);
     118int    str_to_dtime (char *line, double *second);
     119double sec_to_jd (time_t second);
     120time_t jd_to_sec (double jd);
     121double sec_to_mjd (time_t second);
     122time_t mjd_to_sec (double mjd);
     123char  *sec_to_date (time_t second);
     124time_t date_to_sec (char *date);
     125time_t short_date_to_sec (char *date);
     126int    hstgsc_hms_to_deg (double *h0, double *h1, double *d0, double *d1, char *string);
     127</pre>
     128
     129<h3> functions in config.c </h3>
     130
     131<pre>
     132char *SelectConfigFile (int *argc, char **argv, char *progname);
     133char *LoadConfigFile (char *filename);
     134char *ScanConfig (char *config, char *field, char *mode, int Nentry, ...);
     135char *expandline (char *line, char *config);
     136char *LoadRawConfigFile (char *filename, int options);
     137</pre>
     138
     139<h3> miscellaneous functions </h3>
     140
     141<pre> char *ohana_version (); </pre>
     142
     143<h2> DVO data structures and catalog I/O functions </h2>
     144
     145<h3> read/write (Fread.c) </h3>
     146
     147<pre>
     148int Fread (char ptr, int size, int nitems, FILE *f, char *type);
     149int Fwrite (char ptr, int size, int nitems, FILE *f, char *type);
     150int ByteSwap (char *ptr, int size, int nitems, char *type);
     151int ConvertStruct (char *buffer, int size, int nitems, char *type);
     152</pre>
     153
     154Several of these functions are used to perform byte-swapping for
     155structures in the pre-autocode days.  They should be deprecated and
     156dropped, but the autocoding must superceed the hard-wired structure
     157first.
     158
     159<h3> coordinate structure manipulations (coordops.c) </h3>
     160
     161<pre>
     162int XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
     163int RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
     164int fXY_to_RD (float *ra, float *dec, float x,  float y,   Coords *coords);
     165int fRD_to_XY (float *x,  float *y,   float ra, float dec, Coords *coords);
     166int GetCoords (Coords *coords, Header *header);
     167int coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
     168</pre>
     169
     170<h3> photcode manipulations (LoadPhotcodes.c) </h3>
     171
     172<pre>
     173int     LoadPhotcodes (char *filename, PhotCodeData *photcodes);
     174int     FreePhotcodes (PhotCodeData *photcodes);
     175
     176PhotCode *GetPhotcodebyName (char *name);
     177PhotCode *GetPhotcodeEquivbyName (char *name);
     178PhotCode *GetPhotcodebyCode (int code);
     179PhotCode *GetPhotcodeEquivbyCode (int code);
     180PhotCode *GetPhotcodebyNsec (int Nsec);
     181char     *GetPhotcodeNamebyCode (int code);
     182
     183int     GetPhotcodeCodebyName (char *name);
     184int     GetPhotcodeEquivCodebyName (char *name);
     185int     GetPhotcodeEquivCodebyCode (int code);
     186int     GetPhotcodeNsec (int code);
     187int     GetPhotcodeNsecfilt ();
     188int      *GetPhotcodeEquivList (int code, int *nlist);
     189
     190void    SetZeroPoint (double ZP);
     191void    ParseColorTerms (char *terms, float *X, int *N);
     192
     193int       PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color);
     194short   iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     195
     196double  PhotInst (Measure *measure);
     197double  PhotCat (Measure *measure);
     198double  PhotSys (Measure *measure, Average *average, SecFilt *secfilt);
     199double  PhotRel (Measure *measure, Average *average, SecFilt *secfilt);
     200double  PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     201double  PhotAve (PhotCode *code, Average *average, SecFilt *secfilt);
     202double  PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure);
     203double  PhotdM (PhotCode *code, Average *average, SecFilt *secfilt);
     204double  PhotXm (PhotCode *code, Average *average, SecFilt *secfilt);
     205
     206short   iPhotInst (Measure *measure);
     207short   iPhotCat (Measure *measure);
     208short   iPhotSys (Measure *measure, Average *average, SecFilt *secfilt);
     209short   iPhotRel (Measure *measure, Average *average, SecFilt *secfilt);
     210short   iPhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     211short   iPhotAve (PhotCode *code, Average *average, SecFilt *secfilt);
     212short   iPhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure);
     213short   iPhotdM (PhotCode *code, Average *average, SecFilt *secfilt);
     214short   iPhotXm (PhotCode *code, Average *average, SecFilt *secfilt);
     215</pre>
     216
     217<h3> photometry catalog I/O functions (phot_catalog.c) </h3>
     218
     219<pre>
     220int lock_catalog (Catalog *catalog, int lockmode);
     221int unlock_catalog (Catalog *catalog);
     222int load_catalog (Catalog *catalog, char mode, int VERBOSE);
     223int save_catalog (Catalog *catalog, char VERBOSE);
     224</pre>
     225
     226<h3> DVO format conversions (dvo_convert.c) </h3>
     227
     228<pre>
     229Measure *FixOldMeasure (OldMeasure *in, int Nvalues);
     230Average *FixOldAverage (OldAverage *in, int Nvalues);
     231SecFilt *FixOldSecFilt (OldSecFilt *in, int Nvalues);
     232</pre>
     233
     234<h3> image type / mode lookups (imreg_datatypes.c) </h3>
     235
     236<pre>
     237int   get_image_type (char *name);
     238char *get_type_name (int type);
     239int   get_image_mode (char *name);
     240char *get_mode_name (int mode);
     241</pre>
     242
     243<h3> mosaic astrometry functions (mosaic_astrom.c) </h3>
     244
     245<pre>
     246int FindMosaicForImage (Image *images, int Nimages, int entry);
     247int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);
     248int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);
     249int BuildChipMatch (Image *images, int Nimages);
     250</pre>
     251
     252<h3> FITS DB I/O functions (fits_db.c) </h3>
     253
     254<pre>
     255int fits_db_init (FITS_DB *db);
     256int fits_db_create (FITS_DB *db);
     257int fits_db_lock (FITS_DB *db, char *filename);
     258int fits_db_load (FITS_DB *db);
     259int fits_db_save (FITS_DB *db);
     260int fits_db_update (FITS_DB *db, VTable *vtable);
     261int fits_db_free (FITS_DB *db);
     262int fits_db_close (FITS_DB *db);
     263</pre>
     264
     265<h3> functions in photfits.c </h3>
     266
     267<pre>
     268short int putMi (double value);
     269double getMi (short int value);
     270void returnMcal (Image *image, double *c);
     271void assignMcal (Image *image, double *c, int order);
     272double applyMcal (Image *image, double x, double y);
     273double findscatter (double *X, double *Y, double *M, double *dM, int N, double *c, int order);
     274</pre>
     275
     276These functions manipulate the high-order polynomial fit of magnitude
     277offset as a function of image position for the Image structure.
     278
Note: See TracChangeset for help on using the changeset viewer.