Changeset 9684 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Oct 20, 2006, 2:38:16 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r9423 r9684 125 125 ); 126 126 127 /** weatherRow data structure128 *129 * Structure for representing a single row of weather table data.130 */131 132 typedef struct {133 psF32 temp01;134 psF32 humi01;135 psF32 temp02;136 psF32 humi02;137 psF32 temp03;138 psF32 humi03;139 psF32 pressure;140 } weatherRow;141 142 /** Creates a new weatherRow object143 *144 * @return A new weatherRow object or NULL on failure.145 */146 147 weatherRow *weatherRowAlloc(148 psF32 temp01,149 psF32 humi01,150 psF32 temp02,151 psF32 humi02,152 psF32 temp03,153 psF32 humi03,154 psF32 pressure155 );156 157 /** Creates a new weather table158 *159 * @return true on success160 */161 162 bool weatherCreateTable(163 psDB *dbh ///< Database handle164 );165 166 /** Deletes a weather table167 *168 * @return true on success169 */170 171 bool weatherDropTable(172 psDB *dbh ///< Database handle173 );174 175 /** Insert a single row into a table176 *177 * This function constructs and inserts a single row based on it's parameters.178 *179 * @return true on success180 */181 182 bool weatherInsert(183 psDB *dbh, ///< Database handle184 psF32 temp01,185 psF32 humi01,186 psF32 temp02,187 psF32 humi02,188 psF32 temp03,189 psF32 humi03,190 psF32 pressure191 );192 193 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.194 *195 * @return A The number of rows removed or a negative value on error196 */197 198 long long weatherDelete(199 psDB *dbh, ///< Database handle200 const psMetadata *where, ///< Row match criteria201 unsigned long long limit ///< Maximum number of elements to delete202 );203 204 /** Insert a single weatherRow object into a table205 *206 * This function constructs and inserts a single row based on it's parameters.207 *208 * @return true on success209 */210 211 bool weatherInsertObject(212 psDB *dbh, ///< Database handle213 weatherRow *object ///< weatherRow object214 );215 216 /** Insert an array of weatherRow object into a table217 *218 * This function constructs and inserts multiple rows based on it's parameters.219 *220 * @return true on success221 */222 223 bool weatherInsertObjects(224 psDB *dbh, ///< Database handle225 psArray *objects ///< array of weatherRow objects226 );227 228 /** Insert data from a binary FITS table weatherRow into the database229 *230 * This function expects a psFits object with a FITS table as the first231 * extension. The table must have at least one row of data in it, that is of232 * the appropriate format (number of columns and their type). All other233 * extensions are ignored.234 *235 * @return true on success236 */237 238 bool weatherInsertFits(239 psDB *dbh, ///< Database handle240 const psFits *fits ///< psFits object241 );242 243 /** Selects up to limit from the database and returns them in a binary FITS table244 *245 * This function assumes an empty psFits object and will create a FITS table246 * as the first extension.247 *248 * See psDBSelectRows() for documentation on the format of where.249 *250 * @return true on success251 */252 253 bool weatherSelectRowsFits(254 psDB *dbh, ///< Database handle255 psFits *fits, ///< psFits object256 const psMetadata *where, ///< Row match criteria257 unsigned long long limit ///< Maximum number of elements to return258 );259 260 /** Convert a weatherRow into an equivalent psMetadata261 *262 * @return A psMetadata pointer or NULL on error263 */264 265 psMetadata *weatherMetadataFromObject(266 const weatherRow *object ///< fooRow to convert into a psMetadata267 );268 269 /** Convert a psMetadata into an equivalent fooRow270 *271 * @return A weatherRow pointer or NULL on error272 */273 274 weatherRow *weatherObjectFromMetadata(275 psMetadata *md ///< psMetadata to convert into a fooRow276 );277 /** Selects up to limit rows from the database and returns as weatherRow objects in a psArray278 *279 * See psDBSelectRows() for documentation on the format of where.280 *281 * @return A psArray pointer or NULL on error282 */283 284 psArray *weatherSelectRowObjects(285 psDB *dbh, ///< Database handle286 const psMetadata *where, ///< Row match criteria287 unsigned long long limit ///< Maximum number of elements to return288 );289 /** Deletes a row from the database coresponding to an weather290 *291 * Note that a 'where' search psMetadata is constructed from each object and292 * used to find rows to delete.293 *294 * @return A The number of rows removed or a negative value on error295 */296 297 bool weatherDeleteObject(298 psDB *dbh, ///< Database handle299 const weatherRow *object ///< Object to delete300 );301 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.302 *303 * Note that a 'where' search psMetadata is constructed from each object and304 * used to find rows to delete.305 *306 * @return A The number of rows removed or a negative value on error307 */308 309 long long weatherDeleteRowObjects(310 psDB *dbh, ///< Database handle311 const psArray *objects, ///< Array of objects to delete312 unsigned long long limit ///< Maximum number of elements to delete313 );314 /** Formats and prints an array of weatherRow objects315 *316 * When mdcf is set the formated output is in psMetadataConfig317 * format, otherwise it is in a simple tabular format.318 *319 * @return true on success320 */321 322 bool weatherPrintObjects(323 FILE *stream, ///< a stream324 psArray *objects, ///< An array of weatherRow objects325 bool mdcf ///< format as mdconfig or simple326 );327 /** skyp_transparencyRow data structure328 *329 * Structure for representing a single row of skyp_transparency table data.330 */331 332 typedef struct {333 char *filter;334 psF64 trans;335 psS32 nstars;336 psF64 ra;337 psF64 decl;338 psF32 exptime;339 psF64 sky_bright;340 } skyp_transparencyRow;341 342 /** Creates a new skyp_transparencyRow object343 *344 * @return A new skyp_transparencyRow object or NULL on failure.345 */346 347 skyp_transparencyRow *skyp_transparencyRowAlloc(348 const char *filter,349 psF64 trans,350 psS32 nstars,351 psF64 ra,352 psF64 decl,353 psF32 exptime,354 psF64 sky_bright355 );356 357 /** Creates a new skyp_transparency table358 *359 * @return true on success360 */361 362 bool skyp_transparencyCreateTable(363 psDB *dbh ///< Database handle364 );365 366 /** Deletes a skyp_transparency table367 *368 * @return true on success369 */370 371 bool skyp_transparencyDropTable(372 psDB *dbh ///< Database handle373 );374 375 /** Insert a single row into a table376 *377 * This function constructs and inserts a single row based on it's parameters.378 *379 * @return true on success380 */381 382 bool skyp_transparencyInsert(383 psDB *dbh, ///< Database handle384 const char *filter,385 psF64 trans,386 psS32 nstars,387 psF64 ra,388 psF64 decl,389 psF32 exptime,390 psF64 sky_bright391 );392 393 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.394 *395 * @return A The number of rows removed or a negative value on error396 */397 398 long long skyp_transparencyDelete(399 psDB *dbh, ///< Database handle400 const psMetadata *where, ///< Row match criteria401 unsigned long long limit ///< Maximum number of elements to delete402 );403 404 /** Insert a single skyp_transparencyRow object into a table405 *406 * This function constructs and inserts a single row based on it's parameters.407 *408 * @return true on success409 */410 411 bool skyp_transparencyInsertObject(412 psDB *dbh, ///< Database handle413 skyp_transparencyRow *object ///< skyp_transparencyRow object414 );415 416 /** Insert an array of skyp_transparencyRow object into a table417 *418 * This function constructs and inserts multiple rows based on it's parameters.419 *420 * @return true on success421 */422 423 bool skyp_transparencyInsertObjects(424 psDB *dbh, ///< Database handle425 psArray *objects ///< array of skyp_transparencyRow objects426 );427 428 /** Insert data from a binary FITS table skyp_transparencyRow into the database429 *430 * This function expects a psFits object with a FITS table as the first431 * extension. The table must have at least one row of data in it, that is of432 * the appropriate format (number of columns and their type). All other433 * extensions are ignored.434 *435 * @return true on success436 */437 438 bool skyp_transparencyInsertFits(439 psDB *dbh, ///< Database handle440 const psFits *fits ///< psFits object441 );442 443 /** Selects up to limit from the database and returns them in a binary FITS table444 *445 * This function assumes an empty psFits object and will create a FITS table446 * as the first extension.447 *448 * See psDBSelectRows() for documentation on the format of where.449 *450 * @return true on success451 */452 453 bool skyp_transparencySelectRowsFits(454 psDB *dbh, ///< Database handle455 psFits *fits, ///< psFits object456 const psMetadata *where, ///< Row match criteria457 unsigned long long limit ///< Maximum number of elements to return458 );459 460 /** Convert a skyp_transparencyRow into an equivalent psMetadata461 *462 * @return A psMetadata pointer or NULL on error463 */464 465 psMetadata *skyp_transparencyMetadataFromObject(466 const skyp_transparencyRow *object ///< fooRow to convert into a psMetadata467 );468 469 /** Convert a psMetadata into an equivalent fooRow470 *471 * @return A skyp_transparencyRow pointer or NULL on error472 */473 474 skyp_transparencyRow *skyp_transparencyObjectFromMetadata(475 psMetadata *md ///< psMetadata to convert into a fooRow476 );477 /** Selects up to limit rows from the database and returns as skyp_transparencyRow objects in a psArray478 *479 * See psDBSelectRows() for documentation on the format of where.480 *481 * @return A psArray pointer or NULL on error482 */483 484 psArray *skyp_transparencySelectRowObjects(485 psDB *dbh, ///< Database handle486 const psMetadata *where, ///< Row match criteria487 unsigned long long limit ///< Maximum number of elements to return488 );489 /** Deletes a row from the database coresponding to an skyp_transparency490 *491 * Note that a 'where' search psMetadata is constructed from each object and492 * used to find rows to delete.493 *494 * @return A The number of rows removed or a negative value on error495 */496 497 bool skyp_transparencyDeleteObject(498 psDB *dbh, ///< Database handle499 const skyp_transparencyRow *object ///< Object to delete500 );501 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.502 *503 * Note that a 'where' search psMetadata is constructed from each object and504 * used to find rows to delete.505 *506 * @return A The number of rows removed or a negative value on error507 */508 509 long long skyp_transparencyDeleteRowObjects(510 psDB *dbh, ///< Database handle511 const psArray *objects, ///< Array of objects to delete512 unsigned long long limit ///< Maximum number of elements to delete513 );514 /** Formats and prints an array of skyp_transparencyRow objects515 *516 * When mdcf is set the formated output is in psMetadataConfig517 * format, otherwise it is in a simple tabular format.518 *519 * @return true on success520 */521 522 bool skyp_transparencyPrintObjects(523 FILE *stream, ///< a stream524 psArray *objects, ///< An array of skyp_transparencyRow objects525 bool mdcf ///< format as mdconfig or simple526 );527 /** skyp_absorptionRow data structure528 *529 * Structure for representing a single row of skyp_absorption table data.530 */531 532 typedef struct {533 char *disperser_id;534 psF32 atmcomp1;535 psF32 atmcomp2;536 psF32 atmcomp3;537 psS32 nstars;538 psF64 ra;539 psF64 decl;540 psF32 exptime;541 psF64 sky_bright;542 } skyp_absorptionRow;543 544 /** Creates a new skyp_absorptionRow object545 *546 * @return A new skyp_absorptionRow object or NULL on failure.547 */548 549 skyp_absorptionRow *skyp_absorptionRowAlloc(550 const char *disperser_id,551 psF32 atmcomp1,552 psF32 atmcomp2,553 psF32 atmcomp3,554 psS32 nstars,555 psF64 ra,556 psF64 decl,557 psF32 exptime,558 psF64 sky_bright559 );560 561 /** Creates a new skyp_absorption table562 *563 * @return true on success564 */565 566 bool skyp_absorptionCreateTable(567 psDB *dbh ///< Database handle568 );569 570 /** Deletes a skyp_absorption table571 *572 * @return true on success573 */574 575 bool skyp_absorptionDropTable(576 psDB *dbh ///< Database handle577 );578 579 /** Insert a single row into a table580 *581 * This function constructs and inserts a single row based on it's parameters.582 *583 * @return true on success584 */585 586 bool skyp_absorptionInsert(587 psDB *dbh, ///< Database handle588 const char *disperser_id,589 psF32 atmcomp1,590 psF32 atmcomp2,591 psF32 atmcomp3,592 psS32 nstars,593 psF64 ra,594 psF64 decl,595 psF32 exptime,596 psF64 sky_bright597 );598 599 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.600 *601 * @return A The number of rows removed or a negative value on error602 */603 604 long long skyp_absorptionDelete(605 psDB *dbh, ///< Database handle606 const psMetadata *where, ///< Row match criteria607 unsigned long long limit ///< Maximum number of elements to delete608 );609 610 /** Insert a single skyp_absorptionRow object into a table611 *612 * This function constructs and inserts a single row based on it's parameters.613 *614 * @return true on success615 */616 617 bool skyp_absorptionInsertObject(618 psDB *dbh, ///< Database handle619 skyp_absorptionRow *object ///< skyp_absorptionRow object620 );621 622 /** Insert an array of skyp_absorptionRow object into a table623 *624 * This function constructs and inserts multiple rows based on it's parameters.625 *626 * @return true on success627 */628 629 bool skyp_absorptionInsertObjects(630 psDB *dbh, ///< Database handle631 psArray *objects ///< array of skyp_absorptionRow objects632 );633 634 /** Insert data from a binary FITS table skyp_absorptionRow into the database635 *636 * This function expects a psFits object with a FITS table as the first637 * extension. The table must have at least one row of data in it, that is of638 * the appropriate format (number of columns and their type). All other639 * extensions are ignored.640 *641 * @return true on success642 */643 644 bool skyp_absorptionInsertFits(645 psDB *dbh, ///< Database handle646 const psFits *fits ///< psFits object647 );648 649 /** Selects up to limit from the database and returns them in a binary FITS table650 *651 * This function assumes an empty psFits object and will create a FITS table652 * as the first extension.653 *654 * See psDBSelectRows() for documentation on the format of where.655 *656 * @return true on success657 */658 659 bool skyp_absorptionSelectRowsFits(660 psDB *dbh, ///< Database handle661 psFits *fits, ///< psFits object662 const psMetadata *where, ///< Row match criteria663 unsigned long long limit ///< Maximum number of elements to return664 );665 666 /** Convert a skyp_absorptionRow into an equivalent psMetadata667 *668 * @return A psMetadata pointer or NULL on error669 */670 671 psMetadata *skyp_absorptionMetadataFromObject(672 const skyp_absorptionRow *object ///< fooRow to convert into a psMetadata673 );674 675 /** Convert a psMetadata into an equivalent fooRow676 *677 * @return A skyp_absorptionRow pointer or NULL on error678 */679 680 skyp_absorptionRow *skyp_absorptionObjectFromMetadata(681 psMetadata *md ///< psMetadata to convert into a fooRow682 );683 /** Selects up to limit rows from the database and returns as skyp_absorptionRow objects in a psArray684 *685 * See psDBSelectRows() for documentation on the format of where.686 *687 * @return A psArray pointer or NULL on error688 */689 690 psArray *skyp_absorptionSelectRowObjects(691 psDB *dbh, ///< Database handle692 const psMetadata *where, ///< Row match criteria693 unsigned long long limit ///< Maximum number of elements to return694 );695 /** Deletes a row from the database coresponding to an skyp_absorption696 *697 * Note that a 'where' search psMetadata is constructed from each object and698 * used to find rows to delete.699 *700 * @return A The number of rows removed or a negative value on error701 */702 703 bool skyp_absorptionDeleteObject(704 psDB *dbh, ///< Database handle705 const skyp_absorptionRow *object ///< Object to delete706 );707 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.708 *709 * Note that a 'where' search psMetadata is constructed from each object and710 * used to find rows to delete.711 *712 * @return A The number of rows removed or a negative value on error713 */714 715 long long skyp_absorptionDeleteRowObjects(716 psDB *dbh, ///< Database handle717 const psArray *objects, ///< Array of objects to delete718 unsigned long long limit ///< Maximum number of elements to delete719 );720 /** Formats and prints an array of skyp_absorptionRow objects721 *722 * When mdcf is set the formated output is in psMetadataConfig723 * format, otherwise it is in a simple tabular format.724 *725 * @return true on success726 */727 728 bool skyp_absorptionPrintObjects(729 FILE *stream, ///< a stream730 psArray *objects, ///< An array of skyp_absorptionRow objects731 bool mdcf ///< format as mdconfig or simple732 );733 /** skyp_emissionRow data structure734 *735 * Structure for representing a single row of skyp_emission table data.736 */737 738 typedef struct {739 char *disperser_id;740 psF32 atmcomp1;741 psF32 atmcomp2;742 psF32 atmcomp3;743 psF32 continuum;744 psF32 exptime;745 } skyp_emissionRow;746 747 /** Creates a new skyp_emissionRow object748 *749 * @return A new skyp_emissionRow object or NULL on failure.750 */751 752 skyp_emissionRow *skyp_emissionRowAlloc(753 const char *disperser_id,754 psF32 atmcomp1,755 psF32 atmcomp2,756 psF32 atmcomp3,757 psF32 continuum,758 psF32 exptime759 );760 761 /** Creates a new skyp_emission table762 *763 * @return true on success764 */765 766 bool skyp_emissionCreateTable(767 psDB *dbh ///< Database handle768 );769 770 /** Deletes a skyp_emission table771 *772 * @return true on success773 */774 775 bool skyp_emissionDropTable(776 psDB *dbh ///< Database handle777 );778 779 /** Insert a single row into a table780 *781 * This function constructs and inserts a single row based on it's parameters.782 *783 * @return true on success784 */785 786 bool skyp_emissionInsert(787 psDB *dbh, ///< Database handle788 const char *disperser_id,789 psF32 atmcomp1,790 psF32 atmcomp2,791 psF32 atmcomp3,792 psF32 continuum,793 psF32 exptime794 );795 796 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.797 *798 * @return A The number of rows removed or a negative value on error799 */800 801 long long skyp_emissionDelete(802 psDB *dbh, ///< Database handle803 const psMetadata *where, ///< Row match criteria804 unsigned long long limit ///< Maximum number of elements to delete805 );806 807 /** Insert a single skyp_emissionRow object into a table808 *809 * This function constructs and inserts a single row based on it's parameters.810 *811 * @return true on success812 */813 814 bool skyp_emissionInsertObject(815 psDB *dbh, ///< Database handle816 skyp_emissionRow *object ///< skyp_emissionRow object817 );818 819 /** Insert an array of skyp_emissionRow object into a table820 *821 * This function constructs and inserts multiple rows based on it's parameters.822 *823 * @return true on success824 */825 826 bool skyp_emissionInsertObjects(827 psDB *dbh, ///< Database handle828 psArray *objects ///< array of skyp_emissionRow objects829 );830 831 /** Insert data from a binary FITS table skyp_emissionRow into the database832 *833 * This function expects a psFits object with a FITS table as the first834 * extension. The table must have at least one row of data in it, that is of835 * the appropriate format (number of columns and their type). All other836 * extensions are ignored.837 *838 * @return true on success839 */840 841 bool skyp_emissionInsertFits(842 psDB *dbh, ///< Database handle843 const psFits *fits ///< psFits object844 );845 846 /** Selects up to limit from the database and returns them in a binary FITS table847 *848 * This function assumes an empty psFits object and will create a FITS table849 * as the first extension.850 *851 * See psDBSelectRows() for documentation on the format of where.852 *853 * @return true on success854 */855 856 bool skyp_emissionSelectRowsFits(857 psDB *dbh, ///< Database handle858 psFits *fits, ///< psFits object859 const psMetadata *where, ///< Row match criteria860 unsigned long long limit ///< Maximum number of elements to return861 );862 863 /** Convert a skyp_emissionRow into an equivalent psMetadata864 *865 * @return A psMetadata pointer or NULL on error866 */867 868 psMetadata *skyp_emissionMetadataFromObject(869 const skyp_emissionRow *object ///< fooRow to convert into a psMetadata870 );871 872 /** Convert a psMetadata into an equivalent fooRow873 *874 * @return A skyp_emissionRow pointer or NULL on error875 */876 877 skyp_emissionRow *skyp_emissionObjectFromMetadata(878 psMetadata *md ///< psMetadata to convert into a fooRow879 );880 /** Selects up to limit rows from the database and returns as skyp_emissionRow objects in a psArray881 *882 * See psDBSelectRows() for documentation on the format of where.883 *884 * @return A psArray pointer or NULL on error885 */886 887 psArray *skyp_emissionSelectRowObjects(888 psDB *dbh, ///< Database handle889 const psMetadata *where, ///< Row match criteria890 unsigned long long limit ///< Maximum number of elements to return891 );892 /** Deletes a row from the database coresponding to an skyp_emission893 *894 * Note that a 'where' search psMetadata is constructed from each object and895 * used to find rows to delete.896 *897 * @return A The number of rows removed or a negative value on error898 */899 900 bool skyp_emissionDeleteObject(901 psDB *dbh, ///< Database handle902 const skyp_emissionRow *object ///< Object to delete903 );904 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.905 *906 * Note that a 'where' search psMetadata is constructed from each object and907 * used to find rows to delete.908 *909 * @return A The number of rows removed or a negative value on error910 */911 912 long long skyp_emissionDeleteRowObjects(913 psDB *dbh, ///< Database handle914 const psArray *objects, ///< Array of objects to delete915 unsigned long long limit ///< Maximum number of elements to delete916 );917 /** Formats and prints an array of skyp_emissionRow objects918 *919 * When mdcf is set the formated output is in psMetadataConfig920 * format, otherwise it is in a simple tabular format.921 *922 * @return true on success923 */924 925 bool skyp_emissionPrintObjects(926 FILE *stream, ///< a stream927 psArray *objects, ///< An array of skyp_emissionRow objects928 bool mdcf ///< format as mdconfig or simple929 );930 /** dimmRow data structure931 *932 * Structure for representing a single row of dimm table data.933 */934 935 typedef struct {936 psF32 sigmax;937 psF32 sigmay;938 psF32 fwhm;939 psF64 ra;940 psF64 decl;941 psF32 expttime;942 char *telescope_id;943 } dimmRow;944 945 /** Creates a new dimmRow object946 *947 * @return A new dimmRow object or NULL on failure.948 */949 950 dimmRow *dimmRowAlloc(951 psF32 sigmax,952 psF32 sigmay,953 psF32 fwhm,954 psF64 ra,955 psF64 decl,956 psF32 expttime,957 const char *telescope_id958 );959 960 /** Creates a new dimm table961 *962 * @return true on success963 */964 965 bool dimmCreateTable(966 psDB *dbh ///< Database handle967 );968 969 /** Deletes a dimm table970 *971 * @return true on success972 */973 974 bool dimmDropTable(975 psDB *dbh ///< Database handle976 );977 978 /** Insert a single row into a table979 *980 * This function constructs and inserts a single row based on it's parameters.981 *982 * @return true on success983 */984 985 bool dimmInsert(986 psDB *dbh, ///< Database handle987 psF32 sigmax,988 psF32 sigmay,989 psF32 fwhm,990 psF64 ra,991 psF64 decl,992 psF32 expttime,993 const char *telescope_id994 );995 996 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.997 *998 * @return A The number of rows removed or a negative value on error999 */1000 1001 long long dimmDelete(1002 psDB *dbh, ///< Database handle1003 const psMetadata *where, ///< Row match criteria1004 unsigned long long limit ///< Maximum number of elements to delete1005 );1006 1007 /** Insert a single dimmRow object into a table1008 *1009 * This function constructs and inserts a single row based on it's parameters.1010 *1011 * @return true on success1012 */1013 1014 bool dimmInsertObject(1015 psDB *dbh, ///< Database handle1016 dimmRow *object ///< dimmRow object1017 );1018 1019 /** Insert an array of dimmRow object into a table1020 *1021 * This function constructs and inserts multiple rows based on it's parameters.1022 *1023 * @return true on success1024 */1025 1026 bool dimmInsertObjects(1027 psDB *dbh, ///< Database handle1028 psArray *objects ///< array of dimmRow objects1029 );1030 1031 /** Insert data from a binary FITS table dimmRow into the database1032 *1033 * This function expects a psFits object with a FITS table as the first1034 * extension. The table must have at least one row of data in it, that is of1035 * the appropriate format (number of columns and their type). All other1036 * extensions are ignored.1037 *1038 * @return true on success1039 */1040 1041 bool dimmInsertFits(1042 psDB *dbh, ///< Database handle1043 const psFits *fits ///< psFits object1044 );1045 1046 /** Selects up to limit from the database and returns them in a binary FITS table1047 *1048 * This function assumes an empty psFits object and will create a FITS table1049 * as the first extension.1050 *1051 * See psDBSelectRows() for documentation on the format of where.1052 *1053 * @return true on success1054 */1055 1056 bool dimmSelectRowsFits(1057 psDB *dbh, ///< Database handle1058 psFits *fits, ///< psFits object1059 const psMetadata *where, ///< Row match criteria1060 unsigned long long limit ///< Maximum number of elements to return1061 );1062 1063 /** Convert a dimmRow into an equivalent psMetadata1064 *1065 * @return A psMetadata pointer or NULL on error1066 */1067 1068 psMetadata *dimmMetadataFromObject(1069 const dimmRow *object ///< fooRow to convert into a psMetadata1070 );1071 1072 /** Convert a psMetadata into an equivalent fooRow1073 *1074 * @return A dimmRow pointer or NULL on error1075 */1076 1077 dimmRow *dimmObjectFromMetadata(1078 psMetadata *md ///< psMetadata to convert into a fooRow1079 );1080 /** Selects up to limit rows from the database and returns as dimmRow objects in a psArray1081 *1082 * See psDBSelectRows() for documentation on the format of where.1083 *1084 * @return A psArray pointer or NULL on error1085 */1086 1087 psArray *dimmSelectRowObjects(1088 psDB *dbh, ///< Database handle1089 const psMetadata *where, ///< Row match criteria1090 unsigned long long limit ///< Maximum number of elements to return1091 );1092 /** Deletes a row from the database coresponding to an dimm1093 *1094 * Note that a 'where' search psMetadata is constructed from each object and1095 * used to find rows to delete.1096 *1097 * @return A The number of rows removed or a negative value on error1098 */1099 1100 bool dimmDeleteObject(1101 psDB *dbh, ///< Database handle1102 const dimmRow *object ///< Object to delete1103 );1104 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1105 *1106 * Note that a 'where' search psMetadata is constructed from each object and1107 * used to find rows to delete.1108 *1109 * @return A The number of rows removed or a negative value on error1110 */1111 1112 long long dimmDeleteRowObjects(1113 psDB *dbh, ///< Database handle1114 const psArray *objects, ///< Array of objects to delete1115 unsigned long long limit ///< Maximum number of elements to delete1116 );1117 /** Formats and prints an array of dimmRow objects1118 *1119 * When mdcf is set the formated output is in psMetadataConfig1120 * format, otherwise it is in a simple tabular format.1121 *1122 * @return true on success1123 */1124 1125 bool dimmPrintObjects(1126 FILE *stream, ///< a stream1127 psArray *objects, ///< An array of dimmRow objects1128 bool mdcf ///< format as mdconfig or simple1129 );1130 /** skyp_irRow data structure1131 *1132 * Structure for representing a single row of skyp_ir table data.1133 */1134 1135 typedef struct {1136 psF64 sky_bright;1137 psF64 sky_var;1138 psF64 ra;1139 psF64 decl;1140 psF32 fov_x;1141 psF32 fov_y;1142 } skyp_irRow;1143 1144 /** Creates a new skyp_irRow object1145 *1146 * @return A new skyp_irRow object or NULL on failure.1147 */1148 1149 skyp_irRow *skyp_irRowAlloc(1150 psF64 sky_bright,1151 psF64 sky_var,1152 psF64 ra,1153 psF64 decl,1154 psF32 fov_x,1155 psF32 fov_y1156 );1157 1158 /** Creates a new skyp_ir table1159 *1160 * @return true on success1161 */1162 1163 bool skyp_irCreateTable(1164 psDB *dbh ///< Database handle1165 );1166 1167 /** Deletes a skyp_ir table1168 *1169 * @return true on success1170 */1171 1172 bool skyp_irDropTable(1173 psDB *dbh ///< Database handle1174 );1175 1176 /** Insert a single row into a table1177 *1178 * This function constructs and inserts a single row based on it's parameters.1179 *1180 * @return true on success1181 */1182 1183 bool skyp_irInsert(1184 psDB *dbh, ///< Database handle1185 psF64 sky_bright,1186 psF64 sky_var,1187 psF64 ra,1188 psF64 decl,1189 psF32 fov_x,1190 psF32 fov_y1191 );1192 1193 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1194 *1195 * @return A The number of rows removed or a negative value on error1196 */1197 1198 long long skyp_irDelete(1199 psDB *dbh, ///< Database handle1200 const psMetadata *where, ///< Row match criteria1201 unsigned long long limit ///< Maximum number of elements to delete1202 );1203 1204 /** Insert a single skyp_irRow object into a table1205 *1206 * This function constructs and inserts a single row based on it's parameters.1207 *1208 * @return true on success1209 */1210 1211 bool skyp_irInsertObject(1212 psDB *dbh, ///< Database handle1213 skyp_irRow *object ///< skyp_irRow object1214 );1215 1216 /** Insert an array of skyp_irRow object into a table1217 *1218 * This function constructs and inserts multiple rows based on it's parameters.1219 *1220 * @return true on success1221 */1222 1223 bool skyp_irInsertObjects(1224 psDB *dbh, ///< Database handle1225 psArray *objects ///< array of skyp_irRow objects1226 );1227 1228 /** Insert data from a binary FITS table skyp_irRow into the database1229 *1230 * This function expects a psFits object with a FITS table as the first1231 * extension. The table must have at least one row of data in it, that is of1232 * the appropriate format (number of columns and their type). All other1233 * extensions are ignored.1234 *1235 * @return true on success1236 */1237 1238 bool skyp_irInsertFits(1239 psDB *dbh, ///< Database handle1240 const psFits *fits ///< psFits object1241 );1242 1243 /** Selects up to limit from the database and returns them in a binary FITS table1244 *1245 * This function assumes an empty psFits object and will create a FITS table1246 * as the first extension.1247 *1248 * See psDBSelectRows() for documentation on the format of where.1249 *1250 * @return true on success1251 */1252 1253 bool skyp_irSelectRowsFits(1254 psDB *dbh, ///< Database handle1255 psFits *fits, ///< psFits object1256 const psMetadata *where, ///< Row match criteria1257 unsigned long long limit ///< Maximum number of elements to return1258 );1259 1260 /** Convert a skyp_irRow into an equivalent psMetadata1261 *1262 * @return A psMetadata pointer or NULL on error1263 */1264 1265 psMetadata *skyp_irMetadataFromObject(1266 const skyp_irRow *object ///< fooRow to convert into a psMetadata1267 );1268 1269 /** Convert a psMetadata into an equivalent fooRow1270 *1271 * @return A skyp_irRow pointer or NULL on error1272 */1273 1274 skyp_irRow *skyp_irObjectFromMetadata(1275 psMetadata *md ///< psMetadata to convert into a fooRow1276 );1277 /** Selects up to limit rows from the database and returns as skyp_irRow objects in a psArray1278 *1279 * See psDBSelectRows() for documentation on the format of where.1280 *1281 * @return A psArray pointer or NULL on error1282 */1283 1284 psArray *skyp_irSelectRowObjects(1285 psDB *dbh, ///< Database handle1286 const psMetadata *where, ///< Row match criteria1287 unsigned long long limit ///< Maximum number of elements to return1288 );1289 /** Deletes a row from the database coresponding to an skyp_ir1290 *1291 * Note that a 'where' search psMetadata is constructed from each object and1292 * used to find rows to delete.1293 *1294 * @return A The number of rows removed or a negative value on error1295 */1296 1297 bool skyp_irDeleteObject(1298 psDB *dbh, ///< Database handle1299 const skyp_irRow *object ///< Object to delete1300 );1301 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1302 *1303 * Note that a 'where' search psMetadata is constructed from each object and1304 * used to find rows to delete.1305 *1306 * @return A The number of rows removed or a negative value on error1307 */1308 1309 long long skyp_irDeleteRowObjects(1310 psDB *dbh, ///< Database handle1311 const psArray *objects, ///< Array of objects to delete1312 unsigned long long limit ///< Maximum number of elements to delete1313 );1314 /** Formats and prints an array of skyp_irRow objects1315 *1316 * When mdcf is set the formated output is in psMetadataConfig1317 * format, otherwise it is in a simple tabular format.1318 *1319 * @return true on success1320 */1321 1322 bool skyp_irPrintObjects(1323 FILE *stream, ///< a stream1324 psArray *objects, ///< An array of skyp_irRow objects1325 bool mdcf ///< format as mdconfig or simple1326 );1327 /** domeRow data structure1328 *1329 * Structure for representing a single row of dome table data.1330 */1331 1332 typedef struct {1333 psF32 az;1334 bool open;1335 bool light;1336 bool track;1337 } domeRow;1338 1339 /** Creates a new domeRow object1340 *1341 * @return A new domeRow object or NULL on failure.1342 */1343 1344 domeRow *domeRowAlloc(1345 psF32 az,1346 bool open,1347 bool light,1348 bool track1349 );1350 1351 /** Creates a new dome table1352 *1353 * @return true on success1354 */1355 1356 bool domeCreateTable(1357 psDB *dbh ///< Database handle1358 );1359 1360 /** Deletes a dome table1361 *1362 * @return true on success1363 */1364 1365 bool domeDropTable(1366 psDB *dbh ///< Database handle1367 );1368 1369 /** Insert a single row into a table1370 *1371 * This function constructs and inserts a single row based on it's parameters.1372 *1373 * @return true on success1374 */1375 1376 bool domeInsert(1377 psDB *dbh, ///< Database handle1378 psF32 az,1379 bool open,1380 bool light,1381 bool track1382 );1383 1384 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1385 *1386 * @return A The number of rows removed or a negative value on error1387 */1388 1389 long long domeDelete(1390 psDB *dbh, ///< Database handle1391 const psMetadata *where, ///< Row match criteria1392 unsigned long long limit ///< Maximum number of elements to delete1393 );1394 1395 /** Insert a single domeRow object into a table1396 *1397 * This function constructs and inserts a single row based on it's parameters.1398 *1399 * @return true on success1400 */1401 1402 bool domeInsertObject(1403 psDB *dbh, ///< Database handle1404 domeRow *object ///< domeRow object1405 );1406 1407 /** Insert an array of domeRow object into a table1408 *1409 * This function constructs and inserts multiple rows based on it's parameters.1410 *1411 * @return true on success1412 */1413 1414 bool domeInsertObjects(1415 psDB *dbh, ///< Database handle1416 psArray *objects ///< array of domeRow objects1417 );1418 1419 /** Insert data from a binary FITS table domeRow into the database1420 *1421 * This function expects a psFits object with a FITS table as the first1422 * extension. The table must have at least one row of data in it, that is of1423 * the appropriate format (number of columns and their type). All other1424 * extensions are ignored.1425 *1426 * @return true on success1427 */1428 1429 bool domeInsertFits(1430 psDB *dbh, ///< Database handle1431 const psFits *fits ///< psFits object1432 );1433 1434 /** Selects up to limit from the database and returns them in a binary FITS table1435 *1436 * This function assumes an empty psFits object and will create a FITS table1437 * as the first extension.1438 *1439 * See psDBSelectRows() for documentation on the format of where.1440 *1441 * @return true on success1442 */1443 1444 bool domeSelectRowsFits(1445 psDB *dbh, ///< Database handle1446 psFits *fits, ///< psFits object1447 const psMetadata *where, ///< Row match criteria1448 unsigned long long limit ///< Maximum number of elements to return1449 );1450 1451 /** Convert a domeRow into an equivalent psMetadata1452 *1453 * @return A psMetadata pointer or NULL on error1454 */1455 1456 psMetadata *domeMetadataFromObject(1457 const domeRow *object ///< fooRow to convert into a psMetadata1458 );1459 1460 /** Convert a psMetadata into an equivalent fooRow1461 *1462 * @return A domeRow pointer or NULL on error1463 */1464 1465 domeRow *domeObjectFromMetadata(1466 psMetadata *md ///< psMetadata to convert into a fooRow1467 );1468 /** Selects up to limit rows from the database and returns as domeRow objects in a psArray1469 *1470 * See psDBSelectRows() for documentation on the format of where.1471 *1472 * @return A psArray pointer or NULL on error1473 */1474 1475 psArray *domeSelectRowObjects(1476 psDB *dbh, ///< Database handle1477 const psMetadata *where, ///< Row match criteria1478 unsigned long long limit ///< Maximum number of elements to return1479 );1480 /** Deletes a row from the database coresponding to an dome1481 *1482 * Note that a 'where' search psMetadata is constructed from each object and1483 * used to find rows to delete.1484 *1485 * @return A The number of rows removed or a negative value on error1486 */1487 1488 bool domeDeleteObject(1489 psDB *dbh, ///< Database handle1490 const domeRow *object ///< Object to delete1491 );1492 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1493 *1494 * Note that a 'where' search psMetadata is constructed from each object and1495 * used to find rows to delete.1496 *1497 * @return A The number of rows removed or a negative value on error1498 */1499 1500 long long domeDeleteRowObjects(1501 psDB *dbh, ///< Database handle1502 const psArray *objects, ///< Array of objects to delete1503 unsigned long long limit ///< Maximum number of elements to delete1504 );1505 /** Formats and prints an array of domeRow objects1506 *1507 * When mdcf is set the formated output is in psMetadataConfig1508 * format, otherwise it is in a simple tabular format.1509 *1510 * @return true on success1511 */1512 1513 bool domePrintObjects(1514 FILE *stream, ///< a stream1515 psArray *objects, ///< An array of domeRow objects1516 bool mdcf ///< format as mdconfig or simple1517 );1518 /** telescopeRow data structure1519 *1520 * Structure for representing a single row of telescope table data.1521 */1522 1523 typedef struct {1524 char *guide;1525 psF32 alt;1526 psF32 az;1527 psF64 ra;1528 psF64 decl;1529 } telescopeRow;1530 1531 /** Creates a new telescopeRow object1532 *1533 * @return A new telescopeRow object or NULL on failure.1534 */1535 1536 telescopeRow *telescopeRowAlloc(1537 const char *guide,1538 psF32 alt,1539 psF32 az,1540 psF64 ra,1541 psF64 decl1542 );1543 1544 /** Creates a new telescope table1545 *1546 * @return true on success1547 */1548 1549 bool telescopeCreateTable(1550 psDB *dbh ///< Database handle1551 );1552 1553 /** Deletes a telescope table1554 *1555 * @return true on success1556 */1557 1558 bool telescopeDropTable(1559 psDB *dbh ///< Database handle1560 );1561 1562 /** Insert a single row into a table1563 *1564 * This function constructs and inserts a single row based on it's parameters.1565 *1566 * @return true on success1567 */1568 1569 bool telescopeInsert(1570 psDB *dbh, ///< Database handle1571 const char *guide,1572 psF32 alt,1573 psF32 az,1574 psF64 ra,1575 psF64 decl1576 );1577 1578 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1579 *1580 * @return A The number of rows removed or a negative value on error1581 */1582 1583 long long telescopeDelete(1584 psDB *dbh, ///< Database handle1585 const psMetadata *where, ///< Row match criteria1586 unsigned long long limit ///< Maximum number of elements to delete1587 );1588 1589 /** Insert a single telescopeRow object into a table1590 *1591 * This function constructs and inserts a single row based on it's parameters.1592 *1593 * @return true on success1594 */1595 1596 bool telescopeInsertObject(1597 psDB *dbh, ///< Database handle1598 telescopeRow *object ///< telescopeRow object1599 );1600 1601 /** Insert an array of telescopeRow object into a table1602 *1603 * This function constructs and inserts multiple rows based on it's parameters.1604 *1605 * @return true on success1606 */1607 1608 bool telescopeInsertObjects(1609 psDB *dbh, ///< Database handle1610 psArray *objects ///< array of telescopeRow objects1611 );1612 1613 /** Insert data from a binary FITS table telescopeRow into the database1614 *1615 * This function expects a psFits object with a FITS table as the first1616 * extension. The table must have at least one row of data in it, that is of1617 * the appropriate format (number of columns and their type). All other1618 * extensions are ignored.1619 *1620 * @return true on success1621 */1622 1623 bool telescopeInsertFits(1624 psDB *dbh, ///< Database handle1625 const psFits *fits ///< psFits object1626 );1627 1628 /** Selects up to limit from the database and returns them in a binary FITS table1629 *1630 * This function assumes an empty psFits object and will create a FITS table1631 * as the first extension.1632 *1633 * See psDBSelectRows() for documentation on the format of where.1634 *1635 * @return true on success1636 */1637 1638 bool telescopeSelectRowsFits(1639 psDB *dbh, ///< Database handle1640 psFits *fits, ///< psFits object1641 const psMetadata *where, ///< Row match criteria1642 unsigned long long limit ///< Maximum number of elements to return1643 );1644 1645 /** Convert a telescopeRow into an equivalent psMetadata1646 *1647 * @return A psMetadata pointer or NULL on error1648 */1649 1650 psMetadata *telescopeMetadataFromObject(1651 const telescopeRow *object ///< fooRow to convert into a psMetadata1652 );1653 1654 /** Convert a psMetadata into an equivalent fooRow1655 *1656 * @return A telescopeRow pointer or NULL on error1657 */1658 1659 telescopeRow *telescopeObjectFromMetadata(1660 psMetadata *md ///< psMetadata to convert into a fooRow1661 );1662 /** Selects up to limit rows from the database and returns as telescopeRow objects in a psArray1663 *1664 * See psDBSelectRows() for documentation on the format of where.1665 *1666 * @return A psArray pointer or NULL on error1667 */1668 1669 psArray *telescopeSelectRowObjects(1670 psDB *dbh, ///< Database handle1671 const psMetadata *where, ///< Row match criteria1672 unsigned long long limit ///< Maximum number of elements to return1673 );1674 /** Deletes a row from the database coresponding to an telescope1675 *1676 * Note that a 'where' search psMetadata is constructed from each object and1677 * used to find rows to delete.1678 *1679 * @return A The number of rows removed or a negative value on error1680 */1681 1682 bool telescopeDeleteObject(1683 psDB *dbh, ///< Database handle1684 const telescopeRow *object ///< Object to delete1685 );1686 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.1687 *1688 * Note that a 'where' search psMetadata is constructed from each object and1689 * used to find rows to delete.1690 *1691 * @return A The number of rows removed or a negative value on error1692 */1693 1694 long long telescopeDeleteRowObjects(1695 psDB *dbh, ///< Database handle1696 const psArray *objects, ///< Array of objects to delete1697 unsigned long long limit ///< Maximum number of elements to delete1698 );1699 /** Formats and prints an array of telescopeRow objects1700 *1701 * When mdcf is set the formated output is in psMetadataConfig1702 * format, otherwise it is in a simple tabular format.1703 *1704 * @return true on success1705 */1706 1707 bool telescopePrintObjects(1708 FILE *stream, ///< a stream1709 psArray *objects, ///< An array of telescopeRow objects1710 bool mdcf ///< format as mdconfig or simple1711 );1712 127 /** summitExpRow data structure 1713 128 * … … 2713 1128 psF64 posang; 2714 1129 char *object; 1130 psTime* dateobs; 2715 1131 } rawDetrendExpRow; 2716 1132 … … 2738 1154 psF32 ccd_temp, 2739 1155 psF64 posang, 2740 const char *object 1156 const char *object, 1157 psTime* dateobs 2741 1158 ); 2742 1159 … … 2785 1202 psF32 ccd_temp, 2786 1203 psF64 posang, 2787 const char *object 1204 const char *object, 1205 psTime* dateobs 2788 1206 ); 2789 1207 … … 2946 1364 psF64 posang; 2947 1365 char *object; 1366 psTime* dateobs; 2948 1367 } rawScienceExpRow; 2949 1368 … … 2971 1390 psF32 ccd_temp, 2972 1391 psF64 posang, 2973 const char *object 1392 const char *object, 1393 psTime* dateobs 2974 1394 ); 2975 1395 … … 3018 1438 psF32 ccd_temp, 3019 1439 psF64 posang, 3020 const char *object 1440 const char *object, 1441 psTime* dateobs 3021 1442 ); 3022 1443 … … 3179 1600 psF64 posang; 3180 1601 char *object; 1602 psTime* dateobs; 3181 1603 } rawImfileRow; 3182 1604 … … 3204 1626 psF32 ccd_temp, 3205 1627 psF64 posang, 3206 const char *object 1628 const char *object, 1629 psTime* dateobs 3207 1630 ); 3208 1631 … … 3251 1674 psF32 ccd_temp, 3252 1675 psF64 posang, 3253 const char *object 1676 const char *object, 1677 psTime* dateobs 3254 1678 ); 3255 1679
Note:
See TracChangeset
for help on using the changeset viewer.
