Changeset 12535 for trunk/ippdb/src/ippdb.h
- Timestamp:
- Mar 21, 2007, 5:14:51 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.h
r12426 r12535 20 20 /* 21 21 * 22 * This file was generated by glueforge 1.0 022 * This file was generated by glueforge 1.01 23 23 * 24 24 * Do NOT directly edit this file. … … 4404 4404 FILE *stream, ///< a stream 4405 4405 camMaskRow *object, ///< an camMaskRow object 4406 bool mdcf ///< format as mdconfig or simple 4407 ); 4408 /** warpRunRow data structure 4409 * 4410 * Structure for representing a single row of warpRun table data. 4411 */ 4412 4413 typedef struct { 4414 psS64 warp_id; 4415 char *mode; 4416 char *state; 4417 char *workdir; 4418 char *dvodb; 4419 psTime* registered; 4420 } warpRunRow; 4421 4422 /** Creates a new warpRunRow object 4423 * 4424 * @return A new warpRunRow object or NULL on failure. 4425 */ 4426 4427 warpRunRow *warpRunRowAlloc( 4428 psS64 warp_id, 4429 const char *mode, 4430 const char *state, 4431 const char *workdir, 4432 const char *dvodb, 4433 psTime* registered 4434 ); 4435 4436 /** Creates a new warpRun table 4437 * 4438 * @return true on success 4439 */ 4440 4441 bool warpRunCreateTable( 4442 psDB *dbh ///< Database handle 4443 ); 4444 4445 /** Deletes a warpRun table 4446 * 4447 * @return true on success 4448 */ 4449 4450 bool warpRunDropTable( 4451 psDB *dbh ///< Database handle 4452 ); 4453 4454 /** Insert a single row into a table 4455 * 4456 * This function constructs and inserts a single row based on it's parameters. 4457 * 4458 * @return true on success 4459 */ 4460 4461 bool warpRunInsert( 4462 psDB *dbh, ///< Database handle 4463 psS64 warp_id, 4464 const char *mode, 4465 const char *state, 4466 const char *workdir, 4467 const char *dvodb, 4468 psTime* registered 4469 ); 4470 4471 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4472 * 4473 * @return A The number of rows removed or a negative value on error 4474 */ 4475 4476 long long warpRunDelete( 4477 psDB *dbh, ///< Database handle 4478 const psMetadata *where, ///< Row match criteria 4479 unsigned long long limit ///< Maximum number of elements to delete 4480 ); 4481 4482 /** Insert a single warpRunRow object into a table 4483 * 4484 * This function constructs and inserts a single row based on it's parameters. 4485 * 4486 * @return true on success 4487 */ 4488 4489 bool warpRunInsertObject( 4490 psDB *dbh, ///< Database handle 4491 warpRunRow *object ///< warpRunRow object 4492 ); 4493 4494 /** Insert an array of warpRunRow object into a table 4495 * 4496 * This function constructs and inserts multiple rows based on it's parameters. 4497 * 4498 * @return true on success 4499 */ 4500 4501 bool warpRunInsertObjects( 4502 psDB *dbh, ///< Database handle 4503 psArray *objects ///< array of warpRunRow objects 4504 ); 4505 4506 /** Insert data from a binary FITS table warpRunRow into the database 4507 * 4508 * This function expects a psFits object with a FITS table as the first 4509 * extension. The table must have at least one row of data in it, that is of 4510 * the appropriate format (number of columns and their type). All other 4511 * extensions are ignored. 4512 * 4513 * @return true on success 4514 */ 4515 4516 bool warpRunInsertFits( 4517 psDB *dbh, ///< Database handle 4518 const psFits *fits ///< psFits object 4519 ); 4520 4521 /** Selects up to limit from the database and returns them in a binary FITS table 4522 * 4523 * This function assumes an empty psFits object and will create a FITS table 4524 * as the first extension. 4525 * 4526 * See psDBSelectRows() for documentation on the format of where. 4527 * 4528 * @return true on success 4529 */ 4530 4531 bool warpRunSelectRowsFits( 4532 psDB *dbh, ///< Database handle 4533 psFits *fits, ///< psFits object 4534 const psMetadata *where, ///< Row match criteria 4535 unsigned long long limit ///< Maximum number of elements to return 4536 ); 4537 4538 /** Convert a warpRunRow into an equivalent psMetadata 4539 * 4540 * @return A psMetadata pointer or NULL on error 4541 */ 4542 4543 psMetadata *warpRunMetadataFromObject( 4544 const warpRunRow *object ///< fooRow to convert into a psMetadata 4545 ); 4546 4547 /** Convert a psMetadata into an equivalent fooRow 4548 * 4549 * @return A warpRunRow pointer or NULL on error 4550 */ 4551 4552 warpRunRow *warpRunObjectFromMetadata( 4553 psMetadata *md ///< psMetadata to convert into a fooRow 4554 ); 4555 /** Selects up to limit rows from the database and returns as warpRunRow objects in a psArray 4556 * 4557 * See psDBSelectRows() for documentation on the format of where. 4558 * 4559 * @return A psArray pointer or NULL on error 4560 */ 4561 4562 psArray *warpRunSelectRowObjects( 4563 psDB *dbh, ///< Database handle 4564 const psMetadata *where, ///< Row match criteria 4565 unsigned long long limit ///< Maximum number of elements to return 4566 ); 4567 /** Deletes a row from the database coresponding to an warpRun 4568 * 4569 * Note that a 'where' search psMetadata is constructed from each object and 4570 * used to find rows to delete. 4571 * 4572 * @return A The number of rows removed or a negative value on error 4573 */ 4574 4575 bool warpRunDeleteObject( 4576 psDB *dbh, ///< Database handle 4577 const warpRunRow *object ///< Object to delete 4578 ); 4579 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4580 * 4581 * Note that a 'where' search psMetadata is constructed from each object and 4582 * used to find rows to delete. 4583 * 4584 * @return A The number of rows removed or a negative value on error 4585 */ 4586 4587 long long warpRunDeleteRowObjects( 4588 psDB *dbh, ///< Database handle 4589 const psArray *objects, ///< Array of objects to delete 4590 unsigned long long limit ///< Maximum number of elements to delete 4591 ); 4592 /** Formats and prints an array of warpRunRow objects 4593 * 4594 * When mdcf is set the formated output is in psMetadataConfig 4595 * format, otherwise it is in a simple tabular format. 4596 * 4597 * @return true on success 4598 */ 4599 4600 bool warpRunPrintObjects( 4601 FILE *stream, ///< a stream 4602 psArray *objects, ///< An array of warpRunRow objects 4603 bool mdcf ///< format as mdconfig or simple 4604 ); 4605 /** Formats and prints an warpRunRow object 4606 * 4607 * When mdcf is set the formated output is in psMetadataConfig 4608 * format, otherwise it is in a simple tabular format. 4609 * 4610 * @return true on success 4611 */ 4612 4613 bool warpRunPrintObject( 4614 FILE *stream, ///< a stream 4615 warpRunRow *object, ///< an warpRunRow object 4616 bool mdcf ///< format as mdconfig or simple 4617 ); 4618 /** warpInputExpRow data structure 4619 * 4620 * Structure for representing a single row of warpInputExp table data. 4621 */ 4622 4623 typedef struct { 4624 psS64 warp_id; 4625 psS64 cam_id; 4626 bool magiced; 4627 } warpInputExpRow; 4628 4629 /** Creates a new warpInputExpRow object 4630 * 4631 * @return A new warpInputExpRow object or NULL on failure. 4632 */ 4633 4634 warpInputExpRow *warpInputExpRowAlloc( 4635 psS64 warp_id, 4636 psS64 cam_id, 4637 bool magiced 4638 ); 4639 4640 /** Creates a new warpInputExp table 4641 * 4642 * @return true on success 4643 */ 4644 4645 bool warpInputExpCreateTable( 4646 psDB *dbh ///< Database handle 4647 ); 4648 4649 /** Deletes a warpInputExp table 4650 * 4651 * @return true on success 4652 */ 4653 4654 bool warpInputExpDropTable( 4655 psDB *dbh ///< Database handle 4656 ); 4657 4658 /** Insert a single row into a table 4659 * 4660 * This function constructs and inserts a single row based on it's parameters. 4661 * 4662 * @return true on success 4663 */ 4664 4665 bool warpInputExpInsert( 4666 psDB *dbh, ///< Database handle 4667 psS64 warp_id, 4668 psS64 cam_id, 4669 bool magiced 4670 ); 4671 4672 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4673 * 4674 * @return A The number of rows removed or a negative value on error 4675 */ 4676 4677 long long warpInputExpDelete( 4678 psDB *dbh, ///< Database handle 4679 const psMetadata *where, ///< Row match criteria 4680 unsigned long long limit ///< Maximum number of elements to delete 4681 ); 4682 4683 /** Insert a single warpInputExpRow object into a table 4684 * 4685 * This function constructs and inserts a single row based on it's parameters. 4686 * 4687 * @return true on success 4688 */ 4689 4690 bool warpInputExpInsertObject( 4691 psDB *dbh, ///< Database handle 4692 warpInputExpRow *object ///< warpInputExpRow object 4693 ); 4694 4695 /** Insert an array of warpInputExpRow object into a table 4696 * 4697 * This function constructs and inserts multiple rows based on it's parameters. 4698 * 4699 * @return true on success 4700 */ 4701 4702 bool warpInputExpInsertObjects( 4703 psDB *dbh, ///< Database handle 4704 psArray *objects ///< array of warpInputExpRow objects 4705 ); 4706 4707 /** Insert data from a binary FITS table warpInputExpRow into the database 4708 * 4709 * This function expects a psFits object with a FITS table as the first 4710 * extension. The table must have at least one row of data in it, that is of 4711 * the appropriate format (number of columns and their type). All other 4712 * extensions are ignored. 4713 * 4714 * @return true on success 4715 */ 4716 4717 bool warpInputExpInsertFits( 4718 psDB *dbh, ///< Database handle 4719 const psFits *fits ///< psFits object 4720 ); 4721 4722 /** Selects up to limit from the database and returns them in a binary FITS table 4723 * 4724 * This function assumes an empty psFits object and will create a FITS table 4725 * as the first extension. 4726 * 4727 * See psDBSelectRows() for documentation on the format of where. 4728 * 4729 * @return true on success 4730 */ 4731 4732 bool warpInputExpSelectRowsFits( 4733 psDB *dbh, ///< Database handle 4734 psFits *fits, ///< psFits object 4735 const psMetadata *where, ///< Row match criteria 4736 unsigned long long limit ///< Maximum number of elements to return 4737 ); 4738 4739 /** Convert a warpInputExpRow into an equivalent psMetadata 4740 * 4741 * @return A psMetadata pointer or NULL on error 4742 */ 4743 4744 psMetadata *warpInputExpMetadataFromObject( 4745 const warpInputExpRow *object ///< fooRow to convert into a psMetadata 4746 ); 4747 4748 /** Convert a psMetadata into an equivalent fooRow 4749 * 4750 * @return A warpInputExpRow pointer or NULL on error 4751 */ 4752 4753 warpInputExpRow *warpInputExpObjectFromMetadata( 4754 psMetadata *md ///< psMetadata to convert into a fooRow 4755 ); 4756 /** Selects up to limit rows from the database and returns as warpInputExpRow objects in a psArray 4757 * 4758 * See psDBSelectRows() for documentation on the format of where. 4759 * 4760 * @return A psArray pointer or NULL on error 4761 */ 4762 4763 psArray *warpInputExpSelectRowObjects( 4764 psDB *dbh, ///< Database handle 4765 const psMetadata *where, ///< Row match criteria 4766 unsigned long long limit ///< Maximum number of elements to return 4767 ); 4768 /** Deletes a row from the database coresponding to an warpInputExp 4769 * 4770 * Note that a 'where' search psMetadata is constructed from each object and 4771 * used to find rows to delete. 4772 * 4773 * @return A The number of rows removed or a negative value on error 4774 */ 4775 4776 bool warpInputExpDeleteObject( 4777 psDB *dbh, ///< Database handle 4778 const warpInputExpRow *object ///< Object to delete 4779 ); 4780 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4781 * 4782 * Note that a 'where' search psMetadata is constructed from each object and 4783 * used to find rows to delete. 4784 * 4785 * @return A The number of rows removed or a negative value on error 4786 */ 4787 4788 long long warpInputExpDeleteRowObjects( 4789 psDB *dbh, ///< Database handle 4790 const psArray *objects, ///< Array of objects to delete 4791 unsigned long long limit ///< Maximum number of elements to delete 4792 ); 4793 /** Formats and prints an array of warpInputExpRow objects 4794 * 4795 * When mdcf is set the formated output is in psMetadataConfig 4796 * format, otherwise it is in a simple tabular format. 4797 * 4798 * @return true on success 4799 */ 4800 4801 bool warpInputExpPrintObjects( 4802 FILE *stream, ///< a stream 4803 psArray *objects, ///< An array of warpInputExpRow objects 4804 bool mdcf ///< format as mdconfig or simple 4805 ); 4806 /** Formats and prints an warpInputExpRow object 4807 * 4808 * When mdcf is set the formated output is in psMetadataConfig 4809 * format, otherwise it is in a simple tabular format. 4810 * 4811 * @return true on success 4812 */ 4813 4814 bool warpInputExpPrintObject( 4815 FILE *stream, ///< a stream 4816 warpInputExpRow *object, ///< an warpInputExpRow object 4817 bool mdcf ///< format as mdconfig or simple 4818 ); 4819 /** warpSkyCellMapRow data structure 4820 * 4821 * Structure for representing a single row of warpSkyCellMap table data. 4822 */ 4823 4824 typedef struct { 4825 psS64 warp_id; 4826 char *skycell_id; 4827 char *tess_id; 4828 psS64 cam_id; 4829 char *class_id; 4830 psS16 fault; 4831 } warpSkyCellMapRow; 4832 4833 /** Creates a new warpSkyCellMapRow object 4834 * 4835 * @return A new warpSkyCellMapRow object or NULL on failure. 4836 */ 4837 4838 warpSkyCellMapRow *warpSkyCellMapRowAlloc( 4839 psS64 warp_id, 4840 const char *skycell_id, 4841 const char *tess_id, 4842 psS64 cam_id, 4843 const char *class_id, 4844 psS16 fault 4845 ); 4846 4847 /** Creates a new warpSkyCellMap table 4848 * 4849 * @return true on success 4850 */ 4851 4852 bool warpSkyCellMapCreateTable( 4853 psDB *dbh ///< Database handle 4854 ); 4855 4856 /** Deletes a warpSkyCellMap table 4857 * 4858 * @return true on success 4859 */ 4860 4861 bool warpSkyCellMapDropTable( 4862 psDB *dbh ///< Database handle 4863 ); 4864 4865 /** Insert a single row into a table 4866 * 4867 * This function constructs and inserts a single row based on it's parameters. 4868 * 4869 * @return true on success 4870 */ 4871 4872 bool warpSkyCellMapInsert( 4873 psDB *dbh, ///< Database handle 4874 psS64 warp_id, 4875 const char *skycell_id, 4876 const char *tess_id, 4877 psS64 cam_id, 4878 const char *class_id, 4879 psS16 fault 4880 ); 4881 4882 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4883 * 4884 * @return A The number of rows removed or a negative value on error 4885 */ 4886 4887 long long warpSkyCellMapDelete( 4888 psDB *dbh, ///< Database handle 4889 const psMetadata *where, ///< Row match criteria 4890 unsigned long long limit ///< Maximum number of elements to delete 4891 ); 4892 4893 /** Insert a single warpSkyCellMapRow object into a table 4894 * 4895 * This function constructs and inserts a single row based on it's parameters. 4896 * 4897 * @return true on success 4898 */ 4899 4900 bool warpSkyCellMapInsertObject( 4901 psDB *dbh, ///< Database handle 4902 warpSkyCellMapRow *object ///< warpSkyCellMapRow object 4903 ); 4904 4905 /** Insert an array of warpSkyCellMapRow object into a table 4906 * 4907 * This function constructs and inserts multiple rows based on it's parameters. 4908 * 4909 * @return true on success 4910 */ 4911 4912 bool warpSkyCellMapInsertObjects( 4913 psDB *dbh, ///< Database handle 4914 psArray *objects ///< array of warpSkyCellMapRow objects 4915 ); 4916 4917 /** Insert data from a binary FITS table warpSkyCellMapRow into the database 4918 * 4919 * This function expects a psFits object with a FITS table as the first 4920 * extension. The table must have at least one row of data in it, that is of 4921 * the appropriate format (number of columns and their type). All other 4922 * extensions are ignored. 4923 * 4924 * @return true on success 4925 */ 4926 4927 bool warpSkyCellMapInsertFits( 4928 psDB *dbh, ///< Database handle 4929 const psFits *fits ///< psFits object 4930 ); 4931 4932 /** Selects up to limit from the database and returns them in a binary FITS table 4933 * 4934 * This function assumes an empty psFits object and will create a FITS table 4935 * as the first extension. 4936 * 4937 * See psDBSelectRows() for documentation on the format of where. 4938 * 4939 * @return true on success 4940 */ 4941 4942 bool warpSkyCellMapSelectRowsFits( 4943 psDB *dbh, ///< Database handle 4944 psFits *fits, ///< psFits object 4945 const psMetadata *where, ///< Row match criteria 4946 unsigned long long limit ///< Maximum number of elements to return 4947 ); 4948 4949 /** Convert a warpSkyCellMapRow into an equivalent psMetadata 4950 * 4951 * @return A psMetadata pointer or NULL on error 4952 */ 4953 4954 psMetadata *warpSkyCellMapMetadataFromObject( 4955 const warpSkyCellMapRow *object ///< fooRow to convert into a psMetadata 4956 ); 4957 4958 /** Convert a psMetadata into an equivalent fooRow 4959 * 4960 * @return A warpSkyCellMapRow pointer or NULL on error 4961 */ 4962 4963 warpSkyCellMapRow *warpSkyCellMapObjectFromMetadata( 4964 psMetadata *md ///< psMetadata to convert into a fooRow 4965 ); 4966 /** Selects up to limit rows from the database and returns as warpSkyCellMapRow objects in a psArray 4967 * 4968 * See psDBSelectRows() for documentation on the format of where. 4969 * 4970 * @return A psArray pointer or NULL on error 4971 */ 4972 4973 psArray *warpSkyCellMapSelectRowObjects( 4974 psDB *dbh, ///< Database handle 4975 const psMetadata *where, ///< Row match criteria 4976 unsigned long long limit ///< Maximum number of elements to return 4977 ); 4978 /** Deletes a row from the database coresponding to an warpSkyCellMap 4979 * 4980 * Note that a 'where' search psMetadata is constructed from each object and 4981 * used to find rows to delete. 4982 * 4983 * @return A The number of rows removed or a negative value on error 4984 */ 4985 4986 bool warpSkyCellMapDeleteObject( 4987 psDB *dbh, ///< Database handle 4988 const warpSkyCellMapRow *object ///< Object to delete 4989 ); 4990 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 4991 * 4992 * Note that a 'where' search psMetadata is constructed from each object and 4993 * used to find rows to delete. 4994 * 4995 * @return A The number of rows removed or a negative value on error 4996 */ 4997 4998 long long warpSkyCellMapDeleteRowObjects( 4999 psDB *dbh, ///< Database handle 5000 const psArray *objects, ///< Array of objects to delete 5001 unsigned long long limit ///< Maximum number of elements to delete 5002 ); 5003 /** Formats and prints an array of warpSkyCellMapRow objects 5004 * 5005 * When mdcf is set the formated output is in psMetadataConfig 5006 * format, otherwise it is in a simple tabular format. 5007 * 5008 * @return true on success 5009 */ 5010 5011 bool warpSkyCellMapPrintObjects( 5012 FILE *stream, ///< a stream 5013 psArray *objects, ///< An array of warpSkyCellMapRow objects 5014 bool mdcf ///< format as mdconfig or simple 5015 ); 5016 /** Formats and prints an warpSkyCellMapRow object 5017 * 5018 * When mdcf is set the formated output is in psMetadataConfig 5019 * format, otherwise it is in a simple tabular format. 5020 * 5021 * @return true on success 5022 */ 5023 5024 bool warpSkyCellMapPrintObject( 5025 FILE *stream, ///< a stream 5026 warpSkyCellMapRow *object, ///< an warpSkyCellMapRow object 5027 bool mdcf ///< format as mdconfig or simple 5028 ); 5029 /** warpSkyfileRow data structure 5030 * 5031 * Structure for representing a single row of warpSkyfile table data. 5032 */ 5033 5034 typedef struct { 5035 psS64 warp_id; 5036 char *skycell_id; 5037 char *tess_id; 5038 char *uri; 5039 psF64 bg; 5040 psF64 bg_stdev; 5041 } warpSkyfileRow; 5042 5043 /** Creates a new warpSkyfileRow object 5044 * 5045 * @return A new warpSkyfileRow object or NULL on failure. 5046 */ 5047 5048 warpSkyfileRow *warpSkyfileRowAlloc( 5049 psS64 warp_id, 5050 const char *skycell_id, 5051 const char *tess_id, 5052 const char *uri, 5053 psF64 bg, 5054 psF64 bg_stdev 5055 ); 5056 5057 /** Creates a new warpSkyfile table 5058 * 5059 * @return true on success 5060 */ 5061 5062 bool warpSkyfileCreateTable( 5063 psDB *dbh ///< Database handle 5064 ); 5065 5066 /** Deletes a warpSkyfile table 5067 * 5068 * @return true on success 5069 */ 5070 5071 bool warpSkyfileDropTable( 5072 psDB *dbh ///< Database handle 5073 ); 5074 5075 /** Insert a single row into a table 5076 * 5077 * This function constructs and inserts a single row based on it's parameters. 5078 * 5079 * @return true on success 5080 */ 5081 5082 bool warpSkyfileInsert( 5083 psDB *dbh, ///< Database handle 5084 psS64 warp_id, 5085 const char *skycell_id, 5086 const char *tess_id, 5087 const char *uri, 5088 psF64 bg, 5089 psF64 bg_stdev 5090 ); 5091 5092 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5093 * 5094 * @return A The number of rows removed or a negative value on error 5095 */ 5096 5097 long long warpSkyfileDelete( 5098 psDB *dbh, ///< Database handle 5099 const psMetadata *where, ///< Row match criteria 5100 unsigned long long limit ///< Maximum number of elements to delete 5101 ); 5102 5103 /** Insert a single warpSkyfileRow object into a table 5104 * 5105 * This function constructs and inserts a single row based on it's parameters. 5106 * 5107 * @return true on success 5108 */ 5109 5110 bool warpSkyfileInsertObject( 5111 psDB *dbh, ///< Database handle 5112 warpSkyfileRow *object ///< warpSkyfileRow object 5113 ); 5114 5115 /** Insert an array of warpSkyfileRow object into a table 5116 * 5117 * This function constructs and inserts multiple rows based on it's parameters. 5118 * 5119 * @return true on success 5120 */ 5121 5122 bool warpSkyfileInsertObjects( 5123 psDB *dbh, ///< Database handle 5124 psArray *objects ///< array of warpSkyfileRow objects 5125 ); 5126 5127 /** Insert data from a binary FITS table warpSkyfileRow into the database 5128 * 5129 * This function expects a psFits object with a FITS table as the first 5130 * extension. The table must have at least one row of data in it, that is of 5131 * the appropriate format (number of columns and their type). All other 5132 * extensions are ignored. 5133 * 5134 * @return true on success 5135 */ 5136 5137 bool warpSkyfileInsertFits( 5138 psDB *dbh, ///< Database handle 5139 const psFits *fits ///< psFits object 5140 ); 5141 5142 /** Selects up to limit from the database and returns them in a binary FITS table 5143 * 5144 * This function assumes an empty psFits object and will create a FITS table 5145 * as the first extension. 5146 * 5147 * See psDBSelectRows() for documentation on the format of where. 5148 * 5149 * @return true on success 5150 */ 5151 5152 bool warpSkyfileSelectRowsFits( 5153 psDB *dbh, ///< Database handle 5154 psFits *fits, ///< psFits object 5155 const psMetadata *where, ///< Row match criteria 5156 unsigned long long limit ///< Maximum number of elements to return 5157 ); 5158 5159 /** Convert a warpSkyfileRow into an equivalent psMetadata 5160 * 5161 * @return A psMetadata pointer or NULL on error 5162 */ 5163 5164 psMetadata *warpSkyfileMetadataFromObject( 5165 const warpSkyfileRow *object ///< fooRow to convert into a psMetadata 5166 ); 5167 5168 /** Convert a psMetadata into an equivalent fooRow 5169 * 5170 * @return A warpSkyfileRow pointer or NULL on error 5171 */ 5172 5173 warpSkyfileRow *warpSkyfileObjectFromMetadata( 5174 psMetadata *md ///< psMetadata to convert into a fooRow 5175 ); 5176 /** Selects up to limit rows from the database and returns as warpSkyfileRow objects in a psArray 5177 * 5178 * See psDBSelectRows() for documentation on the format of where. 5179 * 5180 * @return A psArray pointer or NULL on error 5181 */ 5182 5183 psArray *warpSkyfileSelectRowObjects( 5184 psDB *dbh, ///< Database handle 5185 const psMetadata *where, ///< Row match criteria 5186 unsigned long long limit ///< Maximum number of elements to return 5187 ); 5188 /** Deletes a row from the database coresponding to an warpSkyfile 5189 * 5190 * Note that a 'where' search psMetadata is constructed from each object and 5191 * used to find rows to delete. 5192 * 5193 * @return A The number of rows removed or a negative value on error 5194 */ 5195 5196 bool warpSkyfileDeleteObject( 5197 psDB *dbh, ///< Database handle 5198 const warpSkyfileRow *object ///< Object to delete 5199 ); 5200 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5201 * 5202 * Note that a 'where' search psMetadata is constructed from each object and 5203 * used to find rows to delete. 5204 * 5205 * @return A The number of rows removed or a negative value on error 5206 */ 5207 5208 long long warpSkyfileDeleteRowObjects( 5209 psDB *dbh, ///< Database handle 5210 const psArray *objects, ///< Array of objects to delete 5211 unsigned long long limit ///< Maximum number of elements to delete 5212 ); 5213 /** Formats and prints an array of warpSkyfileRow objects 5214 * 5215 * When mdcf is set the formated output is in psMetadataConfig 5216 * format, otherwise it is in a simple tabular format. 5217 * 5218 * @return true on success 5219 */ 5220 5221 bool warpSkyfilePrintObjects( 5222 FILE *stream, ///< a stream 5223 psArray *objects, ///< An array of warpSkyfileRow objects 5224 bool mdcf ///< format as mdconfig or simple 5225 ); 5226 /** Formats and prints an warpSkyfileRow object 5227 * 5228 * When mdcf is set the formated output is in psMetadataConfig 5229 * format, otherwise it is in a simple tabular format. 5230 * 5231 * @return true on success 5232 */ 5233 5234 bool warpSkyfilePrintObject( 5235 FILE *stream, ///< a stream 5236 warpSkyfileRow *object, ///< an warpSkyfileRow object 5237 bool mdcf ///< format as mdconfig or simple 5238 ); 5239 /** diffRunRow data structure 5240 * 5241 * Structure for representing a single row of diffRun table data. 5242 */ 5243 5244 typedef struct { 5245 psS64 diff_id; 5246 char *state; 5247 char *workdir; 5248 char *dvodb; 5249 psTime* registered; 5250 char *skycell_id; 5251 char *tess_id; 5252 } diffRunRow; 5253 5254 /** Creates a new diffRunRow object 5255 * 5256 * @return A new diffRunRow object or NULL on failure. 5257 */ 5258 5259 diffRunRow *diffRunRowAlloc( 5260 psS64 diff_id, 5261 const char *state, 5262 const char *workdir, 5263 const char *dvodb, 5264 psTime* registered, 5265 const char *skycell_id, 5266 const char *tess_id 5267 ); 5268 5269 /** Creates a new diffRun table 5270 * 5271 * @return true on success 5272 */ 5273 5274 bool diffRunCreateTable( 5275 psDB *dbh ///< Database handle 5276 ); 5277 5278 /** Deletes a diffRun table 5279 * 5280 * @return true on success 5281 */ 5282 5283 bool diffRunDropTable( 5284 psDB *dbh ///< Database handle 5285 ); 5286 5287 /** Insert a single row into a table 5288 * 5289 * This function constructs and inserts a single row based on it's parameters. 5290 * 5291 * @return true on success 5292 */ 5293 5294 bool diffRunInsert( 5295 psDB *dbh, ///< Database handle 5296 psS64 diff_id, 5297 const char *state, 5298 const char *workdir, 5299 const char *dvodb, 5300 psTime* registered, 5301 const char *skycell_id, 5302 const char *tess_id 5303 ); 5304 5305 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5306 * 5307 * @return A The number of rows removed or a negative value on error 5308 */ 5309 5310 long long diffRunDelete( 5311 psDB *dbh, ///< Database handle 5312 const psMetadata *where, ///< Row match criteria 5313 unsigned long long limit ///< Maximum number of elements to delete 5314 ); 5315 5316 /** Insert a single diffRunRow object into a table 5317 * 5318 * This function constructs and inserts a single row based on it's parameters. 5319 * 5320 * @return true on success 5321 */ 5322 5323 bool diffRunInsertObject( 5324 psDB *dbh, ///< Database handle 5325 diffRunRow *object ///< diffRunRow object 5326 ); 5327 5328 /** Insert an array of diffRunRow object into a table 5329 * 5330 * This function constructs and inserts multiple rows based on it's parameters. 5331 * 5332 * @return true on success 5333 */ 5334 5335 bool diffRunInsertObjects( 5336 psDB *dbh, ///< Database handle 5337 psArray *objects ///< array of diffRunRow objects 5338 ); 5339 5340 /** Insert data from a binary FITS table diffRunRow into the database 5341 * 5342 * This function expects a psFits object with a FITS table as the first 5343 * extension. The table must have at least one row of data in it, that is of 5344 * the appropriate format (number of columns and their type). All other 5345 * extensions are ignored. 5346 * 5347 * @return true on success 5348 */ 5349 5350 bool diffRunInsertFits( 5351 psDB *dbh, ///< Database handle 5352 const psFits *fits ///< psFits object 5353 ); 5354 5355 /** Selects up to limit from the database and returns them in a binary FITS table 5356 * 5357 * This function assumes an empty psFits object and will create a FITS table 5358 * as the first extension. 5359 * 5360 * See psDBSelectRows() for documentation on the format of where. 5361 * 5362 * @return true on success 5363 */ 5364 5365 bool diffRunSelectRowsFits( 5366 psDB *dbh, ///< Database handle 5367 psFits *fits, ///< psFits object 5368 const psMetadata *where, ///< Row match criteria 5369 unsigned long long limit ///< Maximum number of elements to return 5370 ); 5371 5372 /** Convert a diffRunRow into an equivalent psMetadata 5373 * 5374 * @return A psMetadata pointer or NULL on error 5375 */ 5376 5377 psMetadata *diffRunMetadataFromObject( 5378 const diffRunRow *object ///< fooRow to convert into a psMetadata 5379 ); 5380 5381 /** Convert a psMetadata into an equivalent fooRow 5382 * 5383 * @return A diffRunRow pointer or NULL on error 5384 */ 5385 5386 diffRunRow *diffRunObjectFromMetadata( 5387 psMetadata *md ///< psMetadata to convert into a fooRow 5388 ); 5389 /** Selects up to limit rows from the database and returns as diffRunRow objects in a psArray 5390 * 5391 * See psDBSelectRows() for documentation on the format of where. 5392 * 5393 * @return A psArray pointer or NULL on error 5394 */ 5395 5396 psArray *diffRunSelectRowObjects( 5397 psDB *dbh, ///< Database handle 5398 const psMetadata *where, ///< Row match criteria 5399 unsigned long long limit ///< Maximum number of elements to return 5400 ); 5401 /** Deletes a row from the database coresponding to an diffRun 5402 * 5403 * Note that a 'where' search psMetadata is constructed from each object and 5404 * used to find rows to delete. 5405 * 5406 * @return A The number of rows removed or a negative value on error 5407 */ 5408 5409 bool diffRunDeleteObject( 5410 psDB *dbh, ///< Database handle 5411 const diffRunRow *object ///< Object to delete 5412 ); 5413 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5414 * 5415 * Note that a 'where' search psMetadata is constructed from each object and 5416 * used to find rows to delete. 5417 * 5418 * @return A The number of rows removed or a negative value on error 5419 */ 5420 5421 long long diffRunDeleteRowObjects( 5422 psDB *dbh, ///< Database handle 5423 const psArray *objects, ///< Array of objects to delete 5424 unsigned long long limit ///< Maximum number of elements to delete 5425 ); 5426 /** Formats and prints an array of diffRunRow objects 5427 * 5428 * When mdcf is set the formated output is in psMetadataConfig 5429 * format, otherwise it is in a simple tabular format. 5430 * 5431 * @return true on success 5432 */ 5433 5434 bool diffRunPrintObjects( 5435 FILE *stream, ///< a stream 5436 psArray *objects, ///< An array of diffRunRow objects 5437 bool mdcf ///< format as mdconfig or simple 5438 ); 5439 /** Formats and prints an diffRunRow object 5440 * 5441 * When mdcf is set the formated output is in psMetadataConfig 5442 * format, otherwise it is in a simple tabular format. 5443 * 5444 * @return true on success 5445 */ 5446 5447 bool diffRunPrintObject( 5448 FILE *stream, ///< a stream 5449 diffRunRow *object, ///< an diffRunRow object 5450 bool mdcf ///< format as mdconfig or simple 5451 ); 5452 /** diffInputSkyfileRow data structure 5453 * 5454 * Structure for representing a single row of diffInputSkyfile table data. 5455 */ 5456 5457 typedef struct { 5458 psS64 diff_id; 5459 psS64 warp_id; 5460 char *skycell_id; 5461 char *tess_id; 5462 char *kind; 5463 bool template; 5464 } diffInputSkyfileRow; 5465 5466 /** Creates a new diffInputSkyfileRow object 5467 * 5468 * @return A new diffInputSkyfileRow object or NULL on failure. 5469 */ 5470 5471 diffInputSkyfileRow *diffInputSkyfileRowAlloc( 5472 psS64 diff_id, 5473 psS64 warp_id, 5474 const char *skycell_id, 5475 const char *tess_id, 5476 const char *kind, 5477 bool template 5478 ); 5479 5480 /** Creates a new diffInputSkyfile table 5481 * 5482 * @return true on success 5483 */ 5484 5485 bool diffInputSkyfileCreateTable( 5486 psDB *dbh ///< Database handle 5487 ); 5488 5489 /** Deletes a diffInputSkyfile table 5490 * 5491 * @return true on success 5492 */ 5493 5494 bool diffInputSkyfileDropTable( 5495 psDB *dbh ///< Database handle 5496 ); 5497 5498 /** Insert a single row into a table 5499 * 5500 * This function constructs and inserts a single row based on it's parameters. 5501 * 5502 * @return true on success 5503 */ 5504 5505 bool diffInputSkyfileInsert( 5506 psDB *dbh, ///< Database handle 5507 psS64 diff_id, 5508 psS64 warp_id, 5509 const char *skycell_id, 5510 const char *tess_id, 5511 const char *kind, 5512 bool template 5513 ); 5514 5515 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5516 * 5517 * @return A The number of rows removed or a negative value on error 5518 */ 5519 5520 long long diffInputSkyfileDelete( 5521 psDB *dbh, ///< Database handle 5522 const psMetadata *where, ///< Row match criteria 5523 unsigned long long limit ///< Maximum number of elements to delete 5524 ); 5525 5526 /** Insert a single diffInputSkyfileRow object into a table 5527 * 5528 * This function constructs and inserts a single row based on it's parameters. 5529 * 5530 * @return true on success 5531 */ 5532 5533 bool diffInputSkyfileInsertObject( 5534 psDB *dbh, ///< Database handle 5535 diffInputSkyfileRow *object ///< diffInputSkyfileRow object 5536 ); 5537 5538 /** Insert an array of diffInputSkyfileRow object into a table 5539 * 5540 * This function constructs and inserts multiple rows based on it's parameters. 5541 * 5542 * @return true on success 5543 */ 5544 5545 bool diffInputSkyfileInsertObjects( 5546 psDB *dbh, ///< Database handle 5547 psArray *objects ///< array of diffInputSkyfileRow objects 5548 ); 5549 5550 /** Insert data from a binary FITS table diffInputSkyfileRow into the database 5551 * 5552 * This function expects a psFits object with a FITS table as the first 5553 * extension. The table must have at least one row of data in it, that is of 5554 * the appropriate format (number of columns and their type). All other 5555 * extensions are ignored. 5556 * 5557 * @return true on success 5558 */ 5559 5560 bool diffInputSkyfileInsertFits( 5561 psDB *dbh, ///< Database handle 5562 const psFits *fits ///< psFits object 5563 ); 5564 5565 /** Selects up to limit from the database and returns them in a binary FITS table 5566 * 5567 * This function assumes an empty psFits object and will create a FITS table 5568 * as the first extension. 5569 * 5570 * See psDBSelectRows() for documentation on the format of where. 5571 * 5572 * @return true on success 5573 */ 5574 5575 bool diffInputSkyfileSelectRowsFits( 5576 psDB *dbh, ///< Database handle 5577 psFits *fits, ///< psFits object 5578 const psMetadata *where, ///< Row match criteria 5579 unsigned long long limit ///< Maximum number of elements to return 5580 ); 5581 5582 /** Convert a diffInputSkyfileRow into an equivalent psMetadata 5583 * 5584 * @return A psMetadata pointer or NULL on error 5585 */ 5586 5587 psMetadata *diffInputSkyfileMetadataFromObject( 5588 const diffInputSkyfileRow *object ///< fooRow to convert into a psMetadata 5589 ); 5590 5591 /** Convert a psMetadata into an equivalent fooRow 5592 * 5593 * @return A diffInputSkyfileRow pointer or NULL on error 5594 */ 5595 5596 diffInputSkyfileRow *diffInputSkyfileObjectFromMetadata( 5597 psMetadata *md ///< psMetadata to convert into a fooRow 5598 ); 5599 /** Selects up to limit rows from the database and returns as diffInputSkyfileRow objects in a psArray 5600 * 5601 * See psDBSelectRows() for documentation on the format of where. 5602 * 5603 * @return A psArray pointer or NULL on error 5604 */ 5605 5606 psArray *diffInputSkyfileSelectRowObjects( 5607 psDB *dbh, ///< Database handle 5608 const psMetadata *where, ///< Row match criteria 5609 unsigned long long limit ///< Maximum number of elements to return 5610 ); 5611 /** Deletes a row from the database coresponding to an diffInputSkyfile 5612 * 5613 * Note that a 'where' search psMetadata is constructed from each object and 5614 * used to find rows to delete. 5615 * 5616 * @return A The number of rows removed or a negative value on error 5617 */ 5618 5619 bool diffInputSkyfileDeleteObject( 5620 psDB *dbh, ///< Database handle 5621 const diffInputSkyfileRow *object ///< Object to delete 5622 ); 5623 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5624 * 5625 * Note that a 'where' search psMetadata is constructed from each object and 5626 * used to find rows to delete. 5627 * 5628 * @return A The number of rows removed or a negative value on error 5629 */ 5630 5631 long long diffInputSkyfileDeleteRowObjects( 5632 psDB *dbh, ///< Database handle 5633 const psArray *objects, ///< Array of objects to delete 5634 unsigned long long limit ///< Maximum number of elements to delete 5635 ); 5636 /** Formats and prints an array of diffInputSkyfileRow objects 5637 * 5638 * When mdcf is set the formated output is in psMetadataConfig 5639 * format, otherwise it is in a simple tabular format. 5640 * 5641 * @return true on success 5642 */ 5643 5644 bool diffInputSkyfilePrintObjects( 5645 FILE *stream, ///< a stream 5646 psArray *objects, ///< An array of diffInputSkyfileRow objects 5647 bool mdcf ///< format as mdconfig or simple 5648 ); 5649 /** Formats and prints an diffInputSkyfileRow object 5650 * 5651 * When mdcf is set the formated output is in psMetadataConfig 5652 * format, otherwise it is in a simple tabular format. 5653 * 5654 * @return true on success 5655 */ 5656 5657 bool diffInputSkyfilePrintObject( 5658 FILE *stream, ///< a stream 5659 diffInputSkyfileRow *object, ///< an diffInputSkyfileRow object 5660 bool mdcf ///< format as mdconfig or simple 5661 ); 5662 /** diffSkyfileRow data structure 5663 * 5664 * Structure for representing a single row of diffSkyfile table data. 5665 */ 5666 5667 typedef struct { 5668 psS64 diff_id; 5669 char *uri; 5670 psF64 bg; 5671 psF64 bg_stdev; 5672 } diffSkyfileRow; 5673 5674 /** Creates a new diffSkyfileRow object 5675 * 5676 * @return A new diffSkyfileRow object or NULL on failure. 5677 */ 5678 5679 diffSkyfileRow *diffSkyfileRowAlloc( 5680 psS64 diff_id, 5681 const char *uri, 5682 psF64 bg, 5683 psF64 bg_stdev 5684 ); 5685 5686 /** Creates a new diffSkyfile table 5687 * 5688 * @return true on success 5689 */ 5690 5691 bool diffSkyfileCreateTable( 5692 psDB *dbh ///< Database handle 5693 ); 5694 5695 /** Deletes a diffSkyfile table 5696 * 5697 * @return true on success 5698 */ 5699 5700 bool diffSkyfileDropTable( 5701 psDB *dbh ///< Database handle 5702 ); 5703 5704 /** Insert a single row into a table 5705 * 5706 * This function constructs and inserts a single row based on it's parameters. 5707 * 5708 * @return true on success 5709 */ 5710 5711 bool diffSkyfileInsert( 5712 psDB *dbh, ///< Database handle 5713 psS64 diff_id, 5714 const char *uri, 5715 psF64 bg, 5716 psF64 bg_stdev 5717 ); 5718 5719 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5720 * 5721 * @return A The number of rows removed or a negative value on error 5722 */ 5723 5724 long long diffSkyfileDelete( 5725 psDB *dbh, ///< Database handle 5726 const psMetadata *where, ///< Row match criteria 5727 unsigned long long limit ///< Maximum number of elements to delete 5728 ); 5729 5730 /** Insert a single diffSkyfileRow object into a table 5731 * 5732 * This function constructs and inserts a single row based on it's parameters. 5733 * 5734 * @return true on success 5735 */ 5736 5737 bool diffSkyfileInsertObject( 5738 psDB *dbh, ///< Database handle 5739 diffSkyfileRow *object ///< diffSkyfileRow object 5740 ); 5741 5742 /** Insert an array of diffSkyfileRow object into a table 5743 * 5744 * This function constructs and inserts multiple rows based on it's parameters. 5745 * 5746 * @return true on success 5747 */ 5748 5749 bool diffSkyfileInsertObjects( 5750 psDB *dbh, ///< Database handle 5751 psArray *objects ///< array of diffSkyfileRow objects 5752 ); 5753 5754 /** Insert data from a binary FITS table diffSkyfileRow into the database 5755 * 5756 * This function expects a psFits object with a FITS table as the first 5757 * extension. The table must have at least one row of data in it, that is of 5758 * the appropriate format (number of columns and their type). All other 5759 * extensions are ignored. 5760 * 5761 * @return true on success 5762 */ 5763 5764 bool diffSkyfileInsertFits( 5765 psDB *dbh, ///< Database handle 5766 const psFits *fits ///< psFits object 5767 ); 5768 5769 /** Selects up to limit from the database and returns them in a binary FITS table 5770 * 5771 * This function assumes an empty psFits object and will create a FITS table 5772 * as the first extension. 5773 * 5774 * See psDBSelectRows() for documentation on the format of where. 5775 * 5776 * @return true on success 5777 */ 5778 5779 bool diffSkyfileSelectRowsFits( 5780 psDB *dbh, ///< Database handle 5781 psFits *fits, ///< psFits object 5782 const psMetadata *where, ///< Row match criteria 5783 unsigned long long limit ///< Maximum number of elements to return 5784 ); 5785 5786 /** Convert a diffSkyfileRow into an equivalent psMetadata 5787 * 5788 * @return A psMetadata pointer or NULL on error 5789 */ 5790 5791 psMetadata *diffSkyfileMetadataFromObject( 5792 const diffSkyfileRow *object ///< fooRow to convert into a psMetadata 5793 ); 5794 5795 /** Convert a psMetadata into an equivalent fooRow 5796 * 5797 * @return A diffSkyfileRow pointer or NULL on error 5798 */ 5799 5800 diffSkyfileRow *diffSkyfileObjectFromMetadata( 5801 psMetadata *md ///< psMetadata to convert into a fooRow 5802 ); 5803 /** Selects up to limit rows from the database and returns as diffSkyfileRow objects in a psArray 5804 * 5805 * See psDBSelectRows() for documentation on the format of where. 5806 * 5807 * @return A psArray pointer or NULL on error 5808 */ 5809 5810 psArray *diffSkyfileSelectRowObjects( 5811 psDB *dbh, ///< Database handle 5812 const psMetadata *where, ///< Row match criteria 5813 unsigned long long limit ///< Maximum number of elements to return 5814 ); 5815 /** Deletes a row from the database coresponding to an diffSkyfile 5816 * 5817 * Note that a 'where' search psMetadata is constructed from each object and 5818 * used to find rows to delete. 5819 * 5820 * @return A The number of rows removed or a negative value on error 5821 */ 5822 5823 bool diffSkyfileDeleteObject( 5824 psDB *dbh, ///< Database handle 5825 const diffSkyfileRow *object ///< Object to delete 5826 ); 5827 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5828 * 5829 * Note that a 'where' search psMetadata is constructed from each object and 5830 * used to find rows to delete. 5831 * 5832 * @return A The number of rows removed or a negative value on error 5833 */ 5834 5835 long long diffSkyfileDeleteRowObjects( 5836 psDB *dbh, ///< Database handle 5837 const psArray *objects, ///< Array of objects to delete 5838 unsigned long long limit ///< Maximum number of elements to delete 5839 ); 5840 /** Formats and prints an array of diffSkyfileRow objects 5841 * 5842 * When mdcf is set the formated output is in psMetadataConfig 5843 * format, otherwise it is in a simple tabular format. 5844 * 5845 * @return true on success 5846 */ 5847 5848 bool diffSkyfilePrintObjects( 5849 FILE *stream, ///< a stream 5850 psArray *objects, ///< An array of diffSkyfileRow objects 5851 bool mdcf ///< format as mdconfig or simple 5852 ); 5853 /** Formats and prints an diffSkyfileRow object 5854 * 5855 * When mdcf is set the formated output is in psMetadataConfig 5856 * format, otherwise it is in a simple tabular format. 5857 * 5858 * @return true on success 5859 */ 5860 5861 bool diffSkyfilePrintObject( 5862 FILE *stream, ///< a stream 5863 diffSkyfileRow *object, ///< an diffSkyfileRow object 5864 bool mdcf ///< format as mdconfig or simple 5865 ); 5866 /** stackRunRow data structure 5867 * 5868 * Structure for representing a single row of stackRun table data. 5869 */ 5870 5871 typedef struct { 5872 psS64 stack_id; 5873 char *state; 5874 char *workdir; 5875 char *dvodb; 5876 psTime* registered; 5877 char *skycell_id; 5878 char *tess_id; 5879 } stackRunRow; 5880 5881 /** Creates a new stackRunRow object 5882 * 5883 * @return A new stackRunRow object or NULL on failure. 5884 */ 5885 5886 stackRunRow *stackRunRowAlloc( 5887 psS64 stack_id, 5888 const char *state, 5889 const char *workdir, 5890 const char *dvodb, 5891 psTime* registered, 5892 const char *skycell_id, 5893 const char *tess_id 5894 ); 5895 5896 /** Creates a new stackRun table 5897 * 5898 * @return true on success 5899 */ 5900 5901 bool stackRunCreateTable( 5902 psDB *dbh ///< Database handle 5903 ); 5904 5905 /** Deletes a stackRun table 5906 * 5907 * @return true on success 5908 */ 5909 5910 bool stackRunDropTable( 5911 psDB *dbh ///< Database handle 5912 ); 5913 5914 /** Insert a single row into a table 5915 * 5916 * This function constructs and inserts a single row based on it's parameters. 5917 * 5918 * @return true on success 5919 */ 5920 5921 bool stackRunInsert( 5922 psDB *dbh, ///< Database handle 5923 psS64 stack_id, 5924 const char *state, 5925 const char *workdir, 5926 const char *dvodb, 5927 psTime* registered, 5928 const char *skycell_id, 5929 const char *tess_id 5930 ); 5931 5932 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 5933 * 5934 * @return A The number of rows removed or a negative value on error 5935 */ 5936 5937 long long stackRunDelete( 5938 psDB *dbh, ///< Database handle 5939 const psMetadata *where, ///< Row match criteria 5940 unsigned long long limit ///< Maximum number of elements to delete 5941 ); 5942 5943 /** Insert a single stackRunRow object into a table 5944 * 5945 * This function constructs and inserts a single row based on it's parameters. 5946 * 5947 * @return true on success 5948 */ 5949 5950 bool stackRunInsertObject( 5951 psDB *dbh, ///< Database handle 5952 stackRunRow *object ///< stackRunRow object 5953 ); 5954 5955 /** Insert an array of stackRunRow object into a table 5956 * 5957 * This function constructs and inserts multiple rows based on it's parameters. 5958 * 5959 * @return true on success 5960 */ 5961 5962 bool stackRunInsertObjects( 5963 psDB *dbh, ///< Database handle 5964 psArray *objects ///< array of stackRunRow objects 5965 ); 5966 5967 /** Insert data from a binary FITS table stackRunRow into the database 5968 * 5969 * This function expects a psFits object with a FITS table as the first 5970 * extension. The table must have at least one row of data in it, that is of 5971 * the appropriate format (number of columns and their type). All other 5972 * extensions are ignored. 5973 * 5974 * @return true on success 5975 */ 5976 5977 bool stackRunInsertFits( 5978 psDB *dbh, ///< Database handle 5979 const psFits *fits ///< psFits object 5980 ); 5981 5982 /** Selects up to limit from the database and returns them in a binary FITS table 5983 * 5984 * This function assumes an empty psFits object and will create a FITS table 5985 * as the first extension. 5986 * 5987 * See psDBSelectRows() for documentation on the format of where. 5988 * 5989 * @return true on success 5990 */ 5991 5992 bool stackRunSelectRowsFits( 5993 psDB *dbh, ///< Database handle 5994 psFits *fits, ///< psFits object 5995 const psMetadata *where, ///< Row match criteria 5996 unsigned long long limit ///< Maximum number of elements to return 5997 ); 5998 5999 /** Convert a stackRunRow into an equivalent psMetadata 6000 * 6001 * @return A psMetadata pointer or NULL on error 6002 */ 6003 6004 psMetadata *stackRunMetadataFromObject( 6005 const stackRunRow *object ///< fooRow to convert into a psMetadata 6006 ); 6007 6008 /** Convert a psMetadata into an equivalent fooRow 6009 * 6010 * @return A stackRunRow pointer or NULL on error 6011 */ 6012 6013 stackRunRow *stackRunObjectFromMetadata( 6014 psMetadata *md ///< psMetadata to convert into a fooRow 6015 ); 6016 /** Selects up to limit rows from the database and returns as stackRunRow objects in a psArray 6017 * 6018 * See psDBSelectRows() for documentation on the format of where. 6019 * 6020 * @return A psArray pointer or NULL on error 6021 */ 6022 6023 psArray *stackRunSelectRowObjects( 6024 psDB *dbh, ///< Database handle 6025 const psMetadata *where, ///< Row match criteria 6026 unsigned long long limit ///< Maximum number of elements to return 6027 ); 6028 /** Deletes a row from the database coresponding to an stackRun 6029 * 6030 * Note that a 'where' search psMetadata is constructed from each object and 6031 * used to find rows to delete. 6032 * 6033 * @return A The number of rows removed or a negative value on error 6034 */ 6035 6036 bool stackRunDeleteObject( 6037 psDB *dbh, ///< Database handle 6038 const stackRunRow *object ///< Object to delete 6039 ); 6040 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6041 * 6042 * Note that a 'where' search psMetadata is constructed from each object and 6043 * used to find rows to delete. 6044 * 6045 * @return A The number of rows removed or a negative value on error 6046 */ 6047 6048 long long stackRunDeleteRowObjects( 6049 psDB *dbh, ///< Database handle 6050 const psArray *objects, ///< Array of objects to delete 6051 unsigned long long limit ///< Maximum number of elements to delete 6052 ); 6053 /** Formats and prints an array of stackRunRow objects 6054 * 6055 * When mdcf is set the formated output is in psMetadataConfig 6056 * format, otherwise it is in a simple tabular format. 6057 * 6058 * @return true on success 6059 */ 6060 6061 bool stackRunPrintObjects( 6062 FILE *stream, ///< a stream 6063 psArray *objects, ///< An array of stackRunRow objects 6064 bool mdcf ///< format as mdconfig or simple 6065 ); 6066 /** Formats and prints an stackRunRow object 6067 * 6068 * When mdcf is set the formated output is in psMetadataConfig 6069 * format, otherwise it is in a simple tabular format. 6070 * 6071 * @return true on success 6072 */ 6073 6074 bool stackRunPrintObject( 6075 FILE *stream, ///< a stream 6076 stackRunRow *object, ///< an stackRunRow object 6077 bool mdcf ///< format as mdconfig or simple 6078 ); 6079 /** stackInputSkyfileRow data structure 6080 * 6081 * Structure for representing a single row of stackInputSkyfile table data. 6082 */ 6083 6084 typedef struct { 6085 psS64 stack_id; 6086 psS64 warp_id; 6087 } stackInputSkyfileRow; 6088 6089 /** Creates a new stackInputSkyfileRow object 6090 * 6091 * @return A new stackInputSkyfileRow object or NULL on failure. 6092 */ 6093 6094 stackInputSkyfileRow *stackInputSkyfileRowAlloc( 6095 psS64 stack_id, 6096 psS64 warp_id 6097 ); 6098 6099 /** Creates a new stackInputSkyfile table 6100 * 6101 * @return true on success 6102 */ 6103 6104 bool stackInputSkyfileCreateTable( 6105 psDB *dbh ///< Database handle 6106 ); 6107 6108 /** Deletes a stackInputSkyfile table 6109 * 6110 * @return true on success 6111 */ 6112 6113 bool stackInputSkyfileDropTable( 6114 psDB *dbh ///< Database handle 6115 ); 6116 6117 /** Insert a single row into a table 6118 * 6119 * This function constructs and inserts a single row based on it's parameters. 6120 * 6121 * @return true on success 6122 */ 6123 6124 bool stackInputSkyfileInsert( 6125 psDB *dbh, ///< Database handle 6126 psS64 stack_id, 6127 psS64 warp_id 6128 ); 6129 6130 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6131 * 6132 * @return A The number of rows removed or a negative value on error 6133 */ 6134 6135 long long stackInputSkyfileDelete( 6136 psDB *dbh, ///< Database handle 6137 const psMetadata *where, ///< Row match criteria 6138 unsigned long long limit ///< Maximum number of elements to delete 6139 ); 6140 6141 /** Insert a single stackInputSkyfileRow object into a table 6142 * 6143 * This function constructs and inserts a single row based on it's parameters. 6144 * 6145 * @return true on success 6146 */ 6147 6148 bool stackInputSkyfileInsertObject( 6149 psDB *dbh, ///< Database handle 6150 stackInputSkyfileRow *object ///< stackInputSkyfileRow object 6151 ); 6152 6153 /** Insert an array of stackInputSkyfileRow object into a table 6154 * 6155 * This function constructs and inserts multiple rows based on it's parameters. 6156 * 6157 * @return true on success 6158 */ 6159 6160 bool stackInputSkyfileInsertObjects( 6161 psDB *dbh, ///< Database handle 6162 psArray *objects ///< array of stackInputSkyfileRow objects 6163 ); 6164 6165 /** Insert data from a binary FITS table stackInputSkyfileRow into the database 6166 * 6167 * This function expects a psFits object with a FITS table as the first 6168 * extension. The table must have at least one row of data in it, that is of 6169 * the appropriate format (number of columns and their type). All other 6170 * extensions are ignored. 6171 * 6172 * @return true on success 6173 */ 6174 6175 bool stackInputSkyfileInsertFits( 6176 psDB *dbh, ///< Database handle 6177 const psFits *fits ///< psFits object 6178 ); 6179 6180 /** Selects up to limit from the database and returns them in a binary FITS table 6181 * 6182 * This function assumes an empty psFits object and will create a FITS table 6183 * as the first extension. 6184 * 6185 * See psDBSelectRows() for documentation on the format of where. 6186 * 6187 * @return true on success 6188 */ 6189 6190 bool stackInputSkyfileSelectRowsFits( 6191 psDB *dbh, ///< Database handle 6192 psFits *fits, ///< psFits object 6193 const psMetadata *where, ///< Row match criteria 6194 unsigned long long limit ///< Maximum number of elements to return 6195 ); 6196 6197 /** Convert a stackInputSkyfileRow into an equivalent psMetadata 6198 * 6199 * @return A psMetadata pointer or NULL on error 6200 */ 6201 6202 psMetadata *stackInputSkyfileMetadataFromObject( 6203 const stackInputSkyfileRow *object ///< fooRow to convert into a psMetadata 6204 ); 6205 6206 /** Convert a psMetadata into an equivalent fooRow 6207 * 6208 * @return A stackInputSkyfileRow pointer or NULL on error 6209 */ 6210 6211 stackInputSkyfileRow *stackInputSkyfileObjectFromMetadata( 6212 psMetadata *md ///< psMetadata to convert into a fooRow 6213 ); 6214 /** Selects up to limit rows from the database and returns as stackInputSkyfileRow objects in a psArray 6215 * 6216 * See psDBSelectRows() for documentation on the format of where. 6217 * 6218 * @return A psArray pointer or NULL on error 6219 */ 6220 6221 psArray *stackInputSkyfileSelectRowObjects( 6222 psDB *dbh, ///< Database handle 6223 const psMetadata *where, ///< Row match criteria 6224 unsigned long long limit ///< Maximum number of elements to return 6225 ); 6226 /** Deletes a row from the database coresponding to an stackInputSkyfile 6227 * 6228 * Note that a 'where' search psMetadata is constructed from each object and 6229 * used to find rows to delete. 6230 * 6231 * @return A The number of rows removed or a negative value on error 6232 */ 6233 6234 bool stackInputSkyfileDeleteObject( 6235 psDB *dbh, ///< Database handle 6236 const stackInputSkyfileRow *object ///< Object to delete 6237 ); 6238 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6239 * 6240 * Note that a 'where' search psMetadata is constructed from each object and 6241 * used to find rows to delete. 6242 * 6243 * @return A The number of rows removed or a negative value on error 6244 */ 6245 6246 long long stackInputSkyfileDeleteRowObjects( 6247 psDB *dbh, ///< Database handle 6248 const psArray *objects, ///< Array of objects to delete 6249 unsigned long long limit ///< Maximum number of elements to delete 6250 ); 6251 /** Formats and prints an array of stackInputSkyfileRow objects 6252 * 6253 * When mdcf is set the formated output is in psMetadataConfig 6254 * format, otherwise it is in a simple tabular format. 6255 * 6256 * @return true on success 6257 */ 6258 6259 bool stackInputSkyfilePrintObjects( 6260 FILE *stream, ///< a stream 6261 psArray *objects, ///< An array of stackInputSkyfileRow objects 6262 bool mdcf ///< format as mdconfig or simple 6263 ); 6264 /** Formats and prints an stackInputSkyfileRow object 6265 * 6266 * When mdcf is set the formated output is in psMetadataConfig 6267 * format, otherwise it is in a simple tabular format. 6268 * 6269 * @return true on success 6270 */ 6271 6272 bool stackInputSkyfilePrintObject( 6273 FILE *stream, ///< a stream 6274 stackInputSkyfileRow *object, ///< an stackInputSkyfileRow object 6275 bool mdcf ///< format as mdconfig or simple 6276 ); 6277 /** stackSumSkyfileRow data structure 6278 * 6279 * Structure for representing a single row of stackSumSkyfile table data. 6280 */ 6281 6282 typedef struct { 6283 psS64 stack_id; 6284 char *uri; 6285 psF64 bg; 6286 psF64 bg_stdev; 6287 } stackSumSkyfileRow; 6288 6289 /** Creates a new stackSumSkyfileRow object 6290 * 6291 * @return A new stackSumSkyfileRow object or NULL on failure. 6292 */ 6293 6294 stackSumSkyfileRow *stackSumSkyfileRowAlloc( 6295 psS64 stack_id, 6296 const char *uri, 6297 psF64 bg, 6298 psF64 bg_stdev 6299 ); 6300 6301 /** Creates a new stackSumSkyfile table 6302 * 6303 * @return true on success 6304 */ 6305 6306 bool stackSumSkyfileCreateTable( 6307 psDB *dbh ///< Database handle 6308 ); 6309 6310 /** Deletes a stackSumSkyfile table 6311 * 6312 * @return true on success 6313 */ 6314 6315 bool stackSumSkyfileDropTable( 6316 psDB *dbh ///< Database handle 6317 ); 6318 6319 /** Insert a single row into a table 6320 * 6321 * This function constructs and inserts a single row based on it's parameters. 6322 * 6323 * @return true on success 6324 */ 6325 6326 bool stackSumSkyfileInsert( 6327 psDB *dbh, ///< Database handle 6328 psS64 stack_id, 6329 const char *uri, 6330 psF64 bg, 6331 psF64 bg_stdev 6332 ); 6333 6334 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6335 * 6336 * @return A The number of rows removed or a negative value on error 6337 */ 6338 6339 long long stackSumSkyfileDelete( 6340 psDB *dbh, ///< Database handle 6341 const psMetadata *where, ///< Row match criteria 6342 unsigned long long limit ///< Maximum number of elements to delete 6343 ); 6344 6345 /** Insert a single stackSumSkyfileRow object into a table 6346 * 6347 * This function constructs and inserts a single row based on it's parameters. 6348 * 6349 * @return true on success 6350 */ 6351 6352 bool stackSumSkyfileInsertObject( 6353 psDB *dbh, ///< Database handle 6354 stackSumSkyfileRow *object ///< stackSumSkyfileRow object 6355 ); 6356 6357 /** Insert an array of stackSumSkyfileRow object into a table 6358 * 6359 * This function constructs and inserts multiple rows based on it's parameters. 6360 * 6361 * @return true on success 6362 */ 6363 6364 bool stackSumSkyfileInsertObjects( 6365 psDB *dbh, ///< Database handle 6366 psArray *objects ///< array of stackSumSkyfileRow objects 6367 ); 6368 6369 /** Insert data from a binary FITS table stackSumSkyfileRow into the database 6370 * 6371 * This function expects a psFits object with a FITS table as the first 6372 * extension. The table must have at least one row of data in it, that is of 6373 * the appropriate format (number of columns and their type). All other 6374 * extensions are ignored. 6375 * 6376 * @return true on success 6377 */ 6378 6379 bool stackSumSkyfileInsertFits( 6380 psDB *dbh, ///< Database handle 6381 const psFits *fits ///< psFits object 6382 ); 6383 6384 /** Selects up to limit from the database and returns them in a binary FITS table 6385 * 6386 * This function assumes an empty psFits object and will create a FITS table 6387 * as the first extension. 6388 * 6389 * See psDBSelectRows() for documentation on the format of where. 6390 * 6391 * @return true on success 6392 */ 6393 6394 bool stackSumSkyfileSelectRowsFits( 6395 psDB *dbh, ///< Database handle 6396 psFits *fits, ///< psFits object 6397 const psMetadata *where, ///< Row match criteria 6398 unsigned long long limit ///< Maximum number of elements to return 6399 ); 6400 6401 /** Convert a stackSumSkyfileRow into an equivalent psMetadata 6402 * 6403 * @return A psMetadata pointer or NULL on error 6404 */ 6405 6406 psMetadata *stackSumSkyfileMetadataFromObject( 6407 const stackSumSkyfileRow *object ///< fooRow to convert into a psMetadata 6408 ); 6409 6410 /** Convert a psMetadata into an equivalent fooRow 6411 * 6412 * @return A stackSumSkyfileRow pointer or NULL on error 6413 */ 6414 6415 stackSumSkyfileRow *stackSumSkyfileObjectFromMetadata( 6416 psMetadata *md ///< psMetadata to convert into a fooRow 6417 ); 6418 /** Selects up to limit rows from the database and returns as stackSumSkyfileRow objects in a psArray 6419 * 6420 * See psDBSelectRows() for documentation on the format of where. 6421 * 6422 * @return A psArray pointer or NULL on error 6423 */ 6424 6425 psArray *stackSumSkyfileSelectRowObjects( 6426 psDB *dbh, ///< Database handle 6427 const psMetadata *where, ///< Row match criteria 6428 unsigned long long limit ///< Maximum number of elements to return 6429 ); 6430 /** Deletes a row from the database coresponding to an stackSumSkyfile 6431 * 6432 * Note that a 'where' search psMetadata is constructed from each object and 6433 * used to find rows to delete. 6434 * 6435 * @return A The number of rows removed or a negative value on error 6436 */ 6437 6438 bool stackSumSkyfileDeleteObject( 6439 psDB *dbh, ///< Database handle 6440 const stackSumSkyfileRow *object ///< Object to delete 6441 ); 6442 /** Deletes up to limit rows from the database and returns the number of rows actually deleted. 6443 * 6444 * Note that a 'where' search psMetadata is constructed from each object and 6445 * used to find rows to delete. 6446 * 6447 * @return A The number of rows removed or a negative value on error 6448 */ 6449 6450 long long stackSumSkyfileDeleteRowObjects( 6451 psDB *dbh, ///< Database handle 6452 const psArray *objects, ///< Array of objects to delete 6453 unsigned long long limit ///< Maximum number of elements to delete 6454 ); 6455 /** Formats and prints an array of stackSumSkyfileRow objects 6456 * 6457 * When mdcf is set the formated output is in psMetadataConfig 6458 * format, otherwise it is in a simple tabular format. 6459 * 6460 * @return true on success 6461 */ 6462 6463 bool stackSumSkyfilePrintObjects( 6464 FILE *stream, ///< a stream 6465 psArray *objects, ///< An array of stackSumSkyfileRow objects 6466 bool mdcf ///< format as mdconfig or simple 6467 ); 6468 /** Formats and prints an stackSumSkyfileRow object 6469 * 6470 * When mdcf is set the formated output is in psMetadataConfig 6471 * format, otherwise it is in a simple tabular format. 6472 * 6473 * @return true on success 6474 */ 6475 6476 bool stackSumSkyfilePrintObject( 6477 FILE *stream, ///< a stream 6478 stackSumSkyfileRow *object, ///< an stackSumSkyfileRow object 4406 6479 bool mdcf ///< format as mdconfig or simple 4407 6480 ); … … 6845 8918 bool mdcf ///< format as mdconfig or simple 6846 8919 ); 6847 /** warpRunRow data structure6848 *6849 * Structure for representing a single row of warpRun table data.6850 */6851 6852 typedef struct {6853 psS64 warp_id;6854 char *mode;6855 char *state;6856 char *workdir;6857 char *dvodb;6858 psTime* registered;6859 } warpRunRow;6860 6861 /** Creates a new warpRunRow object6862 *6863 * @return A new warpRunRow object or NULL on failure.6864 */6865 6866 warpRunRow *warpRunRowAlloc(6867 psS64 warp_id,6868 const char *mode,6869 const char *state,6870 const char *workdir,6871 const char *dvodb,6872 psTime* registered6873 );6874 6875 /** Creates a new warpRun table6876 *6877 * @return true on success6878 */6879 6880 bool warpRunCreateTable(6881 psDB *dbh ///< Database handle6882 );6883 6884 /** Deletes a warpRun table6885 *6886 * @return true on success6887 */6888 6889 bool warpRunDropTable(6890 psDB *dbh ///< Database handle6891 );6892 6893 /** Insert a single row into a table6894 *6895 * This function constructs and inserts a single row based on it's parameters.6896 *6897 * @return true on success6898 */6899 6900 bool warpRunInsert(6901 psDB *dbh, ///< Database handle6902 psS64 warp_id,6903 const char *mode,6904 const char *state,6905 const char *workdir,6906 const char *dvodb,6907 psTime* registered6908 );6909 6910 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.6911 *6912 * @return A The number of rows removed or a negative value on error6913 */6914 6915 long long warpRunDelete(6916 psDB *dbh, ///< Database handle6917 const psMetadata *where, ///< Row match criteria6918 unsigned long long limit ///< Maximum number of elements to delete6919 );6920 6921 /** Insert a single warpRunRow object into a table6922 *6923 * This function constructs and inserts a single row based on it's parameters.6924 *6925 * @return true on success6926 */6927 6928 bool warpRunInsertObject(6929 psDB *dbh, ///< Database handle6930 warpRunRow *object ///< warpRunRow object6931 );6932 6933 /** Insert an array of warpRunRow object into a table6934 *6935 * This function constructs and inserts multiple rows based on it's parameters.6936 *6937 * @return true on success6938 */6939 6940 bool warpRunInsertObjects(6941 psDB *dbh, ///< Database handle6942 psArray *objects ///< array of warpRunRow objects6943 );6944 6945 /** Insert data from a binary FITS table warpRunRow into the database6946 *6947 * This function expects a psFits object with a FITS table as the first6948 * extension. The table must have at least one row of data in it, that is of6949 * the appropriate format (number of columns and their type). All other6950 * extensions are ignored.6951 *6952 * @return true on success6953 */6954 6955 bool warpRunInsertFits(6956 psDB *dbh, ///< Database handle6957 const psFits *fits ///< psFits object6958 );6959 6960 /** Selects up to limit from the database and returns them in a binary FITS table6961 *6962 * This function assumes an empty psFits object and will create a FITS table6963 * as the first extension.6964 *6965 * See psDBSelectRows() for documentation on the format of where.6966 *6967 * @return true on success6968 */6969 6970 bool warpRunSelectRowsFits(6971 psDB *dbh, ///< Database handle6972 psFits *fits, ///< psFits object6973 const psMetadata *where, ///< Row match criteria6974 unsigned long long limit ///< Maximum number of elements to return6975 );6976 6977 /** Convert a warpRunRow into an equivalent psMetadata6978 *6979 * @return A psMetadata pointer or NULL on error6980 */6981 6982 psMetadata *warpRunMetadataFromObject(6983 const warpRunRow *object ///< fooRow to convert into a psMetadata6984 );6985 6986 /** Convert a psMetadata into an equivalent fooRow6987 *6988 * @return A warpRunRow pointer or NULL on error6989 */6990 6991 warpRunRow *warpRunObjectFromMetadata(6992 psMetadata *md ///< psMetadata to convert into a fooRow6993 );6994 /** Selects up to limit rows from the database and returns as warpRunRow objects in a psArray6995 *6996 * See psDBSelectRows() for documentation on the format of where.6997 *6998 * @return A psArray pointer or NULL on error6999 */7000 7001 psArray *warpRunSelectRowObjects(7002 psDB *dbh, ///< Database handle7003 const psMetadata *where, ///< Row match criteria7004 unsigned long long limit ///< Maximum number of elements to return7005 );7006 /** Deletes a row from the database coresponding to an warpRun7007 *7008 * Note that a 'where' search psMetadata is constructed from each object and7009 * used to find rows to delete.7010 *7011 * @return A The number of rows removed or a negative value on error7012 */7013 7014 bool warpRunDeleteObject(7015 psDB *dbh, ///< Database handle7016 const warpRunRow *object ///< Object to delete7017 );7018 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7019 *7020 * Note that a 'where' search psMetadata is constructed from each object and7021 * used to find rows to delete.7022 *7023 * @return A The number of rows removed or a negative value on error7024 */7025 7026 long long warpRunDeleteRowObjects(7027 psDB *dbh, ///< Database handle7028 const psArray *objects, ///< Array of objects to delete7029 unsigned long long limit ///< Maximum number of elements to delete7030 );7031 /** Formats and prints an array of warpRunRow objects7032 *7033 * When mdcf is set the formated output is in psMetadataConfig7034 * format, otherwise it is in a simple tabular format.7035 *7036 * @return true on success7037 */7038 7039 bool warpRunPrintObjects(7040 FILE *stream, ///< a stream7041 psArray *objects, ///< An array of warpRunRow objects7042 bool mdcf ///< format as mdconfig or simple7043 );7044 /** Formats and prints an warpRunRow object7045 *7046 * When mdcf is set the formated output is in psMetadataConfig7047 * format, otherwise it is in a simple tabular format.7048 *7049 * @return true on success7050 */7051 7052 bool warpRunPrintObject(7053 FILE *stream, ///< a stream7054 warpRunRow *object, ///< an warpRunRow object7055 bool mdcf ///< format as mdconfig or simple7056 );7057 /** warpInputExpRow data structure7058 *7059 * Structure for representing a single row of warpInputExp table data.7060 */7061 7062 typedef struct {7063 psS64 warp_id;7064 psS64 cam_id;7065 bool magiced;7066 } warpInputExpRow;7067 7068 /** Creates a new warpInputExpRow object7069 *7070 * @return A new warpInputExpRow object or NULL on failure.7071 */7072 7073 warpInputExpRow *warpInputExpRowAlloc(7074 psS64 warp_id,7075 psS64 cam_id,7076 bool magiced7077 );7078 7079 /** Creates a new warpInputExp table7080 *7081 * @return true on success7082 */7083 7084 bool warpInputExpCreateTable(7085 psDB *dbh ///< Database handle7086 );7087 7088 /** Deletes a warpInputExp table7089 *7090 * @return true on success7091 */7092 7093 bool warpInputExpDropTable(7094 psDB *dbh ///< Database handle7095 );7096 7097 /** Insert a single row into a table7098 *7099 * This function constructs and inserts a single row based on it's parameters.7100 *7101 * @return true on success7102 */7103 7104 bool warpInputExpInsert(7105 psDB *dbh, ///< Database handle7106 psS64 warp_id,7107 psS64 cam_id,7108 bool magiced7109 );7110 7111 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7112 *7113 * @return A The number of rows removed or a negative value on error7114 */7115 7116 long long warpInputExpDelete(7117 psDB *dbh, ///< Database handle7118 const psMetadata *where, ///< Row match criteria7119 unsigned long long limit ///< Maximum number of elements to delete7120 );7121 7122 /** Insert a single warpInputExpRow object into a table7123 *7124 * This function constructs and inserts a single row based on it's parameters.7125 *7126 * @return true on success7127 */7128 7129 bool warpInputExpInsertObject(7130 psDB *dbh, ///< Database handle7131 warpInputExpRow *object ///< warpInputExpRow object7132 );7133 7134 /** Insert an array of warpInputExpRow object into a table7135 *7136 * This function constructs and inserts multiple rows based on it's parameters.7137 *7138 * @return true on success7139 */7140 7141 bool warpInputExpInsertObjects(7142 psDB *dbh, ///< Database handle7143 psArray *objects ///< array of warpInputExpRow objects7144 );7145 7146 /** Insert data from a binary FITS table warpInputExpRow into the database7147 *7148 * This function expects a psFits object with a FITS table as the first7149 * extension. The table must have at least one row of data in it, that is of7150 * the appropriate format (number of columns and their type). All other7151 * extensions are ignored.7152 *7153 * @return true on success7154 */7155 7156 bool warpInputExpInsertFits(7157 psDB *dbh, ///< Database handle7158 const psFits *fits ///< psFits object7159 );7160 7161 /** Selects up to limit from the database and returns them in a binary FITS table7162 *7163 * This function assumes an empty psFits object and will create a FITS table7164 * as the first extension.7165 *7166 * See psDBSelectRows() for documentation on the format of where.7167 *7168 * @return true on success7169 */7170 7171 bool warpInputExpSelectRowsFits(7172 psDB *dbh, ///< Database handle7173 psFits *fits, ///< psFits object7174 const psMetadata *where, ///< Row match criteria7175 unsigned long long limit ///< Maximum number of elements to return7176 );7177 7178 /** Convert a warpInputExpRow into an equivalent psMetadata7179 *7180 * @return A psMetadata pointer or NULL on error7181 */7182 7183 psMetadata *warpInputExpMetadataFromObject(7184 const warpInputExpRow *object ///< fooRow to convert into a psMetadata7185 );7186 7187 /** Convert a psMetadata into an equivalent fooRow7188 *7189 * @return A warpInputExpRow pointer or NULL on error7190 */7191 7192 warpInputExpRow *warpInputExpObjectFromMetadata(7193 psMetadata *md ///< psMetadata to convert into a fooRow7194 );7195 /** Selects up to limit rows from the database and returns as warpInputExpRow objects in a psArray7196 *7197 * See psDBSelectRows() for documentation on the format of where.7198 *7199 * @return A psArray pointer or NULL on error7200 */7201 7202 psArray *warpInputExpSelectRowObjects(7203 psDB *dbh, ///< Database handle7204 const psMetadata *where, ///< Row match criteria7205 unsigned long long limit ///< Maximum number of elements to return7206 );7207 /** Deletes a row from the database coresponding to an warpInputExp7208 *7209 * Note that a 'where' search psMetadata is constructed from each object and7210 * used to find rows to delete.7211 *7212 * @return A The number of rows removed or a negative value on error7213 */7214 7215 bool warpInputExpDeleteObject(7216 psDB *dbh, ///< Database handle7217 const warpInputExpRow *object ///< Object to delete7218 );7219 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7220 *7221 * Note that a 'where' search psMetadata is constructed from each object and7222 * used to find rows to delete.7223 *7224 * @return A The number of rows removed or a negative value on error7225 */7226 7227 long long warpInputExpDeleteRowObjects(7228 psDB *dbh, ///< Database handle7229 const psArray *objects, ///< Array of objects to delete7230 unsigned long long limit ///< Maximum number of elements to delete7231 );7232 /** Formats and prints an array of warpInputExpRow objects7233 *7234 * When mdcf is set the formated output is in psMetadataConfig7235 * format, otherwise it is in a simple tabular format.7236 *7237 * @return true on success7238 */7239 7240 bool warpInputExpPrintObjects(7241 FILE *stream, ///< a stream7242 psArray *objects, ///< An array of warpInputExpRow objects7243 bool mdcf ///< format as mdconfig or simple7244 );7245 /** Formats and prints an warpInputExpRow object7246 *7247 * When mdcf is set the formated output is in psMetadataConfig7248 * format, otherwise it is in a simple tabular format.7249 *7250 * @return true on success7251 */7252 7253 bool warpInputExpPrintObject(7254 FILE *stream, ///< a stream7255 warpInputExpRow *object, ///< an warpInputExpRow object7256 bool mdcf ///< format as mdconfig or simple7257 );7258 /** warpSkyCellMapRow data structure7259 *7260 * Structure for representing a single row of warpSkyCellMap table data.7261 */7262 7263 typedef struct {7264 psS64 warp_id;7265 char *skycell_id;7266 char *tess_id;7267 psS64 cam_id;7268 char *class_id;7269 psS16 fault;7270 } warpSkyCellMapRow;7271 7272 /** Creates a new warpSkyCellMapRow object7273 *7274 * @return A new warpSkyCellMapRow object or NULL on failure.7275 */7276 7277 warpSkyCellMapRow *warpSkyCellMapRowAlloc(7278 psS64 warp_id,7279 const char *skycell_id,7280 const char *tess_id,7281 psS64 cam_id,7282 const char *class_id,7283 psS16 fault7284 );7285 7286 /** Creates a new warpSkyCellMap table7287 *7288 * @return true on success7289 */7290 7291 bool warpSkyCellMapCreateTable(7292 psDB *dbh ///< Database handle7293 );7294 7295 /** Deletes a warpSkyCellMap table7296 *7297 * @return true on success7298 */7299 7300 bool warpSkyCellMapDropTable(7301 psDB *dbh ///< Database handle7302 );7303 7304 /** Insert a single row into a table7305 *7306 * This function constructs and inserts a single row based on it's parameters.7307 *7308 * @return true on success7309 */7310 7311 bool warpSkyCellMapInsert(7312 psDB *dbh, ///< Database handle7313 psS64 warp_id,7314 const char *skycell_id,7315 const char *tess_id,7316 psS64 cam_id,7317 const char *class_id,7318 psS16 fault7319 );7320 7321 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7322 *7323 * @return A The number of rows removed or a negative value on error7324 */7325 7326 long long warpSkyCellMapDelete(7327 psDB *dbh, ///< Database handle7328 const psMetadata *where, ///< Row match criteria7329 unsigned long long limit ///< Maximum number of elements to delete7330 );7331 7332 /** Insert a single warpSkyCellMapRow object into a table7333 *7334 * This function constructs and inserts a single row based on it's parameters.7335 *7336 * @return true on success7337 */7338 7339 bool warpSkyCellMapInsertObject(7340 psDB *dbh, ///< Database handle7341 warpSkyCellMapRow *object ///< warpSkyCellMapRow object7342 );7343 7344 /** Insert an array of warpSkyCellMapRow object into a table7345 *7346 * This function constructs and inserts multiple rows based on it's parameters.7347 *7348 * @return true on success7349 */7350 7351 bool warpSkyCellMapInsertObjects(7352 psDB *dbh, ///< Database handle7353 psArray *objects ///< array of warpSkyCellMapRow objects7354 );7355 7356 /** Insert data from a binary FITS table warpSkyCellMapRow into the database7357 *7358 * This function expects a psFits object with a FITS table as the first7359 * extension. The table must have at least one row of data in it, that is of7360 * the appropriate format (number of columns and their type). All other7361 * extensions are ignored.7362 *7363 * @return true on success7364 */7365 7366 bool warpSkyCellMapInsertFits(7367 psDB *dbh, ///< Database handle7368 const psFits *fits ///< psFits object7369 );7370 7371 /** Selects up to limit from the database and returns them in a binary FITS table7372 *7373 * This function assumes an empty psFits object and will create a FITS table7374 * as the first extension.7375 *7376 * See psDBSelectRows() for documentation on the format of where.7377 *7378 * @return true on success7379 */7380 7381 bool warpSkyCellMapSelectRowsFits(7382 psDB *dbh, ///< Database handle7383 psFits *fits, ///< psFits object7384 const psMetadata *where, ///< Row match criteria7385 unsigned long long limit ///< Maximum number of elements to return7386 );7387 7388 /** Convert a warpSkyCellMapRow into an equivalent psMetadata7389 *7390 * @return A psMetadata pointer or NULL on error7391 */7392 7393 psMetadata *warpSkyCellMapMetadataFromObject(7394 const warpSkyCellMapRow *object ///< fooRow to convert into a psMetadata7395 );7396 7397 /** Convert a psMetadata into an equivalent fooRow7398 *7399 * @return A warpSkyCellMapRow pointer or NULL on error7400 */7401 7402 warpSkyCellMapRow *warpSkyCellMapObjectFromMetadata(7403 psMetadata *md ///< psMetadata to convert into a fooRow7404 );7405 /** Selects up to limit rows from the database and returns as warpSkyCellMapRow objects in a psArray7406 *7407 * See psDBSelectRows() for documentation on the format of where.7408 *7409 * @return A psArray pointer or NULL on error7410 */7411 7412 psArray *warpSkyCellMapSelectRowObjects(7413 psDB *dbh, ///< Database handle7414 const psMetadata *where, ///< Row match criteria7415 unsigned long long limit ///< Maximum number of elements to return7416 );7417 /** Deletes a row from the database coresponding to an warpSkyCellMap7418 *7419 * Note that a 'where' search psMetadata is constructed from each object and7420 * used to find rows to delete.7421 *7422 * @return A The number of rows removed or a negative value on error7423 */7424 7425 bool warpSkyCellMapDeleteObject(7426 psDB *dbh, ///< Database handle7427 const warpSkyCellMapRow *object ///< Object to delete7428 );7429 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7430 *7431 * Note that a 'where' search psMetadata is constructed from each object and7432 * used to find rows to delete.7433 *7434 * @return A The number of rows removed or a negative value on error7435 */7436 7437 long long warpSkyCellMapDeleteRowObjects(7438 psDB *dbh, ///< Database handle7439 const psArray *objects, ///< Array of objects to delete7440 unsigned long long limit ///< Maximum number of elements to delete7441 );7442 /** Formats and prints an array of warpSkyCellMapRow objects7443 *7444 * When mdcf is set the formated output is in psMetadataConfig7445 * format, otherwise it is in a simple tabular format.7446 *7447 * @return true on success7448 */7449 7450 bool warpSkyCellMapPrintObjects(7451 FILE *stream, ///< a stream7452 psArray *objects, ///< An array of warpSkyCellMapRow objects7453 bool mdcf ///< format as mdconfig or simple7454 );7455 /** Formats and prints an warpSkyCellMapRow object7456 *7457 * When mdcf is set the formated output is in psMetadataConfig7458 * format, otherwise it is in a simple tabular format.7459 *7460 * @return true on success7461 */7462 7463 bool warpSkyCellMapPrintObject(7464 FILE *stream, ///< a stream7465 warpSkyCellMapRow *object, ///< an warpSkyCellMapRow object7466 bool mdcf ///< format as mdconfig or simple7467 );7468 /** warpSkyfileRow data structure7469 *7470 * Structure for representing a single row of warpSkyfile table data.7471 */7472 7473 typedef struct {7474 psS64 warp_id;7475 char *skycell_id;7476 char *tess_id;7477 char *uri;7478 psF64 bg;7479 psF64 bg_stdev;7480 } warpSkyfileRow;7481 7482 /** Creates a new warpSkyfileRow object7483 *7484 * @return A new warpSkyfileRow object or NULL on failure.7485 */7486 7487 warpSkyfileRow *warpSkyfileRowAlloc(7488 psS64 warp_id,7489 const char *skycell_id,7490 const char *tess_id,7491 const char *uri,7492 psF64 bg,7493 psF64 bg_stdev7494 );7495 7496 /** Creates a new warpSkyfile table7497 *7498 * @return true on success7499 */7500 7501 bool warpSkyfileCreateTable(7502 psDB *dbh ///< Database handle7503 );7504 7505 /** Deletes a warpSkyfile table7506 *7507 * @return true on success7508 */7509 7510 bool warpSkyfileDropTable(7511 psDB *dbh ///< Database handle7512 );7513 7514 /** Insert a single row into a table7515 *7516 * This function constructs and inserts a single row based on it's parameters.7517 *7518 * @return true on success7519 */7520 7521 bool warpSkyfileInsert(7522 psDB *dbh, ///< Database handle7523 psS64 warp_id,7524 const char *skycell_id,7525 const char *tess_id,7526 const char *uri,7527 psF64 bg,7528 psF64 bg_stdev7529 );7530 7531 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7532 *7533 * @return A The number of rows removed or a negative value on error7534 */7535 7536 long long warpSkyfileDelete(7537 psDB *dbh, ///< Database handle7538 const psMetadata *where, ///< Row match criteria7539 unsigned long long limit ///< Maximum number of elements to delete7540 );7541 7542 /** Insert a single warpSkyfileRow object into a table7543 *7544 * This function constructs and inserts a single row based on it's parameters.7545 *7546 * @return true on success7547 */7548 7549 bool warpSkyfileInsertObject(7550 psDB *dbh, ///< Database handle7551 warpSkyfileRow *object ///< warpSkyfileRow object7552 );7553 7554 /** Insert an array of warpSkyfileRow object into a table7555 *7556 * This function constructs and inserts multiple rows based on it's parameters.7557 *7558 * @return true on success7559 */7560 7561 bool warpSkyfileInsertObjects(7562 psDB *dbh, ///< Database handle7563 psArray *objects ///< array of warpSkyfileRow objects7564 );7565 7566 /** Insert data from a binary FITS table warpSkyfileRow into the database7567 *7568 * This function expects a psFits object with a FITS table as the first7569 * extension. The table must have at least one row of data in it, that is of7570 * the appropriate format (number of columns and their type). All other7571 * extensions are ignored.7572 *7573 * @return true on success7574 */7575 7576 bool warpSkyfileInsertFits(7577 psDB *dbh, ///< Database handle7578 const psFits *fits ///< psFits object7579 );7580 7581 /** Selects up to limit from the database and returns them in a binary FITS table7582 *7583 * This function assumes an empty psFits object and will create a FITS table7584 * as the first extension.7585 *7586 * See psDBSelectRows() for documentation on the format of where.7587 *7588 * @return true on success7589 */7590 7591 bool warpSkyfileSelectRowsFits(7592 psDB *dbh, ///< Database handle7593 psFits *fits, ///< psFits object7594 const psMetadata *where, ///< Row match criteria7595 unsigned long long limit ///< Maximum number of elements to return7596 );7597 7598 /** Convert a warpSkyfileRow into an equivalent psMetadata7599 *7600 * @return A psMetadata pointer or NULL on error7601 */7602 7603 psMetadata *warpSkyfileMetadataFromObject(7604 const warpSkyfileRow *object ///< fooRow to convert into a psMetadata7605 );7606 7607 /** Convert a psMetadata into an equivalent fooRow7608 *7609 * @return A warpSkyfileRow pointer or NULL on error7610 */7611 7612 warpSkyfileRow *warpSkyfileObjectFromMetadata(7613 psMetadata *md ///< psMetadata to convert into a fooRow7614 );7615 /** Selects up to limit rows from the database and returns as warpSkyfileRow objects in a psArray7616 *7617 * See psDBSelectRows() for documentation on the format of where.7618 *7619 * @return A psArray pointer or NULL on error7620 */7621 7622 psArray *warpSkyfileSelectRowObjects(7623 psDB *dbh, ///< Database handle7624 const psMetadata *where, ///< Row match criteria7625 unsigned long long limit ///< Maximum number of elements to return7626 );7627 /** Deletes a row from the database coresponding to an warpSkyfile7628 *7629 * Note that a 'where' search psMetadata is constructed from each object and7630 * used to find rows to delete.7631 *7632 * @return A The number of rows removed or a negative value on error7633 */7634 7635 bool warpSkyfileDeleteObject(7636 psDB *dbh, ///< Database handle7637 const warpSkyfileRow *object ///< Object to delete7638 );7639 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7640 *7641 * Note that a 'where' search psMetadata is constructed from each object and7642 * used to find rows to delete.7643 *7644 * @return A The number of rows removed or a negative value on error7645 */7646 7647 long long warpSkyfileDeleteRowObjects(7648 psDB *dbh, ///< Database handle7649 const psArray *objects, ///< Array of objects to delete7650 unsigned long long limit ///< Maximum number of elements to delete7651 );7652 /** Formats and prints an array of warpSkyfileRow objects7653 *7654 * When mdcf is set the formated output is in psMetadataConfig7655 * format, otherwise it is in a simple tabular format.7656 *7657 * @return true on success7658 */7659 7660 bool warpSkyfilePrintObjects(7661 FILE *stream, ///< a stream7662 psArray *objects, ///< An array of warpSkyfileRow objects7663 bool mdcf ///< format as mdconfig or simple7664 );7665 /** Formats and prints an warpSkyfileRow object7666 *7667 * When mdcf is set the formated output is in psMetadataConfig7668 * format, otherwise it is in a simple tabular format.7669 *7670 * @return true on success7671 */7672 7673 bool warpSkyfilePrintObject(7674 FILE *stream, ///< a stream7675 warpSkyfileRow *object, ///< an warpSkyfileRow object7676 bool mdcf ///< format as mdconfig or simple7677 );7678 /** diffRunRow data structure7679 *7680 * Structure for representing a single row of diffRun table data.7681 */7682 7683 typedef struct {7684 psS64 diff_id;7685 char *state;7686 char *workdir;7687 char *dvodb;7688 psTime* registered;7689 char *skycell_id;7690 char *tess_id;7691 } diffRunRow;7692 7693 /** Creates a new diffRunRow object7694 *7695 * @return A new diffRunRow object or NULL on failure.7696 */7697 7698 diffRunRow *diffRunRowAlloc(7699 psS64 diff_id,7700 const char *state,7701 const char *workdir,7702 const char *dvodb,7703 psTime* registered,7704 const char *skycell_id,7705 const char *tess_id7706 );7707 7708 /** Creates a new diffRun table7709 *7710 * @return true on success7711 */7712 7713 bool diffRunCreateTable(7714 psDB *dbh ///< Database handle7715 );7716 7717 /** Deletes a diffRun table7718 *7719 * @return true on success7720 */7721 7722 bool diffRunDropTable(7723 psDB *dbh ///< Database handle7724 );7725 7726 /** Insert a single row into a table7727 *7728 * This function constructs and inserts a single row based on it's parameters.7729 *7730 * @return true on success7731 */7732 7733 bool diffRunInsert(7734 psDB *dbh, ///< Database handle7735 psS64 diff_id,7736 const char *state,7737 const char *workdir,7738 const char *dvodb,7739 psTime* registered,7740 const char *skycell_id,7741 const char *tess_id7742 );7743 7744 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7745 *7746 * @return A The number of rows removed or a negative value on error7747 */7748 7749 long long diffRunDelete(7750 psDB *dbh, ///< Database handle7751 const psMetadata *where, ///< Row match criteria7752 unsigned long long limit ///< Maximum number of elements to delete7753 );7754 7755 /** Insert a single diffRunRow object into a table7756 *7757 * This function constructs and inserts a single row based on it's parameters.7758 *7759 * @return true on success7760 */7761 7762 bool diffRunInsertObject(7763 psDB *dbh, ///< Database handle7764 diffRunRow *object ///< diffRunRow object7765 );7766 7767 /** Insert an array of diffRunRow object into a table7768 *7769 * This function constructs and inserts multiple rows based on it's parameters.7770 *7771 * @return true on success7772 */7773 7774 bool diffRunInsertObjects(7775 psDB *dbh, ///< Database handle7776 psArray *objects ///< array of diffRunRow objects7777 );7778 7779 /** Insert data from a binary FITS table diffRunRow into the database7780 *7781 * This function expects a psFits object with a FITS table as the first7782 * extension. The table must have at least one row of data in it, that is of7783 * the appropriate format (number of columns and their type). All other7784 * extensions are ignored.7785 *7786 * @return true on success7787 */7788 7789 bool diffRunInsertFits(7790 psDB *dbh, ///< Database handle7791 const psFits *fits ///< psFits object7792 );7793 7794 /** Selects up to limit from the database and returns them in a binary FITS table7795 *7796 * This function assumes an empty psFits object and will create a FITS table7797 * as the first extension.7798 *7799 * See psDBSelectRows() for documentation on the format of where.7800 *7801 * @return true on success7802 */7803 7804 bool diffRunSelectRowsFits(7805 psDB *dbh, ///< Database handle7806 psFits *fits, ///< psFits object7807 const psMetadata *where, ///< Row match criteria7808 unsigned long long limit ///< Maximum number of elements to return7809 );7810 7811 /** Convert a diffRunRow into an equivalent psMetadata7812 *7813 * @return A psMetadata pointer or NULL on error7814 */7815 7816 psMetadata *diffRunMetadataFromObject(7817 const diffRunRow *object ///< fooRow to convert into a psMetadata7818 );7819 7820 /** Convert a psMetadata into an equivalent fooRow7821 *7822 * @return A diffRunRow pointer or NULL on error7823 */7824 7825 diffRunRow *diffRunObjectFromMetadata(7826 psMetadata *md ///< psMetadata to convert into a fooRow7827 );7828 /** Selects up to limit rows from the database and returns as diffRunRow objects in a psArray7829 *7830 * See psDBSelectRows() for documentation on the format of where.7831 *7832 * @return A psArray pointer or NULL on error7833 */7834 7835 psArray *diffRunSelectRowObjects(7836 psDB *dbh, ///< Database handle7837 const psMetadata *where, ///< Row match criteria7838 unsigned long long limit ///< Maximum number of elements to return7839 );7840 /** Deletes a row from the database coresponding to an diffRun7841 *7842 * Note that a 'where' search psMetadata is constructed from each object and7843 * used to find rows to delete.7844 *7845 * @return A The number of rows removed or a negative value on error7846 */7847 7848 bool diffRunDeleteObject(7849 psDB *dbh, ///< Database handle7850 const diffRunRow *object ///< Object to delete7851 );7852 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7853 *7854 * Note that a 'where' search psMetadata is constructed from each object and7855 * used to find rows to delete.7856 *7857 * @return A The number of rows removed or a negative value on error7858 */7859 7860 long long diffRunDeleteRowObjects(7861 psDB *dbh, ///< Database handle7862 const psArray *objects, ///< Array of objects to delete7863 unsigned long long limit ///< Maximum number of elements to delete7864 );7865 /** Formats and prints an array of diffRunRow objects7866 *7867 * When mdcf is set the formated output is in psMetadataConfig7868 * format, otherwise it is in a simple tabular format.7869 *7870 * @return true on success7871 */7872 7873 bool diffRunPrintObjects(7874 FILE *stream, ///< a stream7875 psArray *objects, ///< An array of diffRunRow objects7876 bool mdcf ///< format as mdconfig or simple7877 );7878 /** Formats and prints an diffRunRow object7879 *7880 * When mdcf is set the formated output is in psMetadataConfig7881 * format, otherwise it is in a simple tabular format.7882 *7883 * @return true on success7884 */7885 7886 bool diffRunPrintObject(7887 FILE *stream, ///< a stream7888 diffRunRow *object, ///< an diffRunRow object7889 bool mdcf ///< format as mdconfig or simple7890 );7891 /** diffInputSkyfileRow data structure7892 *7893 * Structure for representing a single row of diffInputSkyfile table data.7894 */7895 7896 typedef struct {7897 psS64 diff_id;7898 psS64 warp_id;7899 char *skycell_id;7900 char *tess_id;7901 char *kind;7902 bool template;7903 } diffInputSkyfileRow;7904 7905 /** Creates a new diffInputSkyfileRow object7906 *7907 * @return A new diffInputSkyfileRow object or NULL on failure.7908 */7909 7910 diffInputSkyfileRow *diffInputSkyfileRowAlloc(7911 psS64 diff_id,7912 psS64 warp_id,7913 const char *skycell_id,7914 const char *tess_id,7915 const char *kind,7916 bool template7917 );7918 7919 /** Creates a new diffInputSkyfile table7920 *7921 * @return true on success7922 */7923 7924 bool diffInputSkyfileCreateTable(7925 psDB *dbh ///< Database handle7926 );7927 7928 /** Deletes a diffInputSkyfile table7929 *7930 * @return true on success7931 */7932 7933 bool diffInputSkyfileDropTable(7934 psDB *dbh ///< Database handle7935 );7936 7937 /** Insert a single row into a table7938 *7939 * This function constructs and inserts a single row based on it's parameters.7940 *7941 * @return true on success7942 */7943 7944 bool diffInputSkyfileInsert(7945 psDB *dbh, ///< Database handle7946 psS64 diff_id,7947 psS64 warp_id,7948 const char *skycell_id,7949 const char *tess_id,7950 const char *kind,7951 bool template7952 );7953 7954 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.7955 *7956 * @return A The number of rows removed or a negative value on error7957 */7958 7959 long long diffInputSkyfileDelete(7960 psDB *dbh, ///< Database handle7961 const psMetadata *where, ///< Row match criteria7962 unsigned long long limit ///< Maximum number of elements to delete7963 );7964 7965 /** Insert a single diffInputSkyfileRow object into a table7966 *7967 * This function constructs and inserts a single row based on it's parameters.7968 *7969 * @return true on success7970 */7971 7972 bool diffInputSkyfileInsertObject(7973 psDB *dbh, ///< Database handle7974 diffInputSkyfileRow *object ///< diffInputSkyfileRow object7975 );7976 7977 /** Insert an array of diffInputSkyfileRow object into a table7978 *7979 * This function constructs and inserts multiple rows based on it's parameters.7980 *7981 * @return true on success7982 */7983 7984 bool diffInputSkyfileInsertObjects(7985 psDB *dbh, ///< Database handle7986 psArray *objects ///< array of diffInputSkyfileRow objects7987 );7988 7989 /** Insert data from a binary FITS table diffInputSkyfileRow into the database7990 *7991 * This function expects a psFits object with a FITS table as the first7992 * extension. The table must have at least one row of data in it, that is of7993 * the appropriate format (number of columns and their type). All other7994 * extensions are ignored.7995 *7996 * @return true on success7997 */7998 7999 bool diffInputSkyfileInsertFits(8000 psDB *dbh, ///< Database handle8001 const psFits *fits ///< psFits object8002 );8003 8004 /** Selects up to limit from the database and returns them in a binary FITS table8005 *8006 * This function assumes an empty psFits object and will create a FITS table8007 * as the first extension.8008 *8009 * See psDBSelectRows() for documentation on the format of where.8010 *8011 * @return true on success8012 */8013 8014 bool diffInputSkyfileSelectRowsFits(8015 psDB *dbh, ///< Database handle8016 psFits *fits, ///< psFits object8017 const psMetadata *where, ///< Row match criteria8018 unsigned long long limit ///< Maximum number of elements to return8019 );8020 8021 /** Convert a diffInputSkyfileRow into an equivalent psMetadata8022 *8023 * @return A psMetadata pointer or NULL on error8024 */8025 8026 psMetadata *diffInputSkyfileMetadataFromObject(8027 const diffInputSkyfileRow *object ///< fooRow to convert into a psMetadata8028 );8029 8030 /** Convert a psMetadata into an equivalent fooRow8031 *8032 * @return A diffInputSkyfileRow pointer or NULL on error8033 */8034 8035 diffInputSkyfileRow *diffInputSkyfileObjectFromMetadata(8036 psMetadata *md ///< psMetadata to convert into a fooRow8037 );8038 /** Selects up to limit rows from the database and returns as diffInputSkyfileRow objects in a psArray8039 *8040 * See psDBSelectRows() for documentation on the format of where.8041 *8042 * @return A psArray pointer or NULL on error8043 */8044 8045 psArray *diffInputSkyfileSelectRowObjects(8046 psDB *dbh, ///< Database handle8047 const psMetadata *where, ///< Row match criteria8048 unsigned long long limit ///< Maximum number of elements to return8049 );8050 /** Deletes a row from the database coresponding to an diffInputSkyfile8051 *8052 * Note that a 'where' search psMetadata is constructed from each object and8053 * used to find rows to delete.8054 *8055 * @return A The number of rows removed or a negative value on error8056 */8057 8058 bool diffInputSkyfileDeleteObject(8059 psDB *dbh, ///< Database handle8060 const diffInputSkyfileRow *object ///< Object to delete8061 );8062 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8063 *8064 * Note that a 'where' search psMetadata is constructed from each object and8065 * used to find rows to delete.8066 *8067 * @return A The number of rows removed or a negative value on error8068 */8069 8070 long long diffInputSkyfileDeleteRowObjects(8071 psDB *dbh, ///< Database handle8072 const psArray *objects, ///< Array of objects to delete8073 unsigned long long limit ///< Maximum number of elements to delete8074 );8075 /** Formats and prints an array of diffInputSkyfileRow objects8076 *8077 * When mdcf is set the formated output is in psMetadataConfig8078 * format, otherwise it is in a simple tabular format.8079 *8080 * @return true on success8081 */8082 8083 bool diffInputSkyfilePrintObjects(8084 FILE *stream, ///< a stream8085 psArray *objects, ///< An array of diffInputSkyfileRow objects8086 bool mdcf ///< format as mdconfig or simple8087 );8088 /** Formats and prints an diffInputSkyfileRow object8089 *8090 * When mdcf is set the formated output is in psMetadataConfig8091 * format, otherwise it is in a simple tabular format.8092 *8093 * @return true on success8094 */8095 8096 bool diffInputSkyfilePrintObject(8097 FILE *stream, ///< a stream8098 diffInputSkyfileRow *object, ///< an diffInputSkyfileRow object8099 bool mdcf ///< format as mdconfig or simple8100 );8101 /** diffSkyfileRow data structure8102 *8103 * Structure for representing a single row of diffSkyfile table data.8104 */8105 8106 typedef struct {8107 psS64 diff_id;8108 char *uri;8109 psF64 bg;8110 psF64 bg_stdev;8111 } diffSkyfileRow;8112 8113 /** Creates a new diffSkyfileRow object8114 *8115 * @return A new diffSkyfileRow object or NULL on failure.8116 */8117 8118 diffSkyfileRow *diffSkyfileRowAlloc(8119 psS64 diff_id,8120 const char *uri,8121 psF64 bg,8122 psF64 bg_stdev8123 );8124 8125 /** Creates a new diffSkyfile table8126 *8127 * @return true on success8128 */8129 8130 bool diffSkyfileCreateTable(8131 psDB *dbh ///< Database handle8132 );8133 8134 /** Deletes a diffSkyfile table8135 *8136 * @return true on success8137 */8138 8139 bool diffSkyfileDropTable(8140 psDB *dbh ///< Database handle8141 );8142 8143 /** Insert a single row into a table8144 *8145 * This function constructs and inserts a single row based on it's parameters.8146 *8147 * @return true on success8148 */8149 8150 bool diffSkyfileInsert(8151 psDB *dbh, ///< Database handle8152 psS64 diff_id,8153 const char *uri,8154 psF64 bg,8155 psF64 bg_stdev8156 );8157 8158 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8159 *8160 * @return A The number of rows removed or a negative value on error8161 */8162 8163 long long diffSkyfileDelete(8164 psDB *dbh, ///< Database handle8165 const psMetadata *where, ///< Row match criteria8166 unsigned long long limit ///< Maximum number of elements to delete8167 );8168 8169 /** Insert a single diffSkyfileRow object into a table8170 *8171 * This function constructs and inserts a single row based on it's parameters.8172 *8173 * @return true on success8174 */8175 8176 bool diffSkyfileInsertObject(8177 psDB *dbh, ///< Database handle8178 diffSkyfileRow *object ///< diffSkyfileRow object8179 );8180 8181 /** Insert an array of diffSkyfileRow object into a table8182 *8183 * This function constructs and inserts multiple rows based on it's parameters.8184 *8185 * @return true on success8186 */8187 8188 bool diffSkyfileInsertObjects(8189 psDB *dbh, ///< Database handle8190 psArray *objects ///< array of diffSkyfileRow objects8191 );8192 8193 /** Insert data from a binary FITS table diffSkyfileRow into the database8194 *8195 * This function expects a psFits object with a FITS table as the first8196 * extension. The table must have at least one row of data in it, that is of8197 * the appropriate format (number of columns and their type). All other8198 * extensions are ignored.8199 *8200 * @return true on success8201 */8202 8203 bool diffSkyfileInsertFits(8204 psDB *dbh, ///< Database handle8205 const psFits *fits ///< psFits object8206 );8207 8208 /** Selects up to limit from the database and returns them in a binary FITS table8209 *8210 * This function assumes an empty psFits object and will create a FITS table8211 * as the first extension.8212 *8213 * See psDBSelectRows() for documentation on the format of where.8214 *8215 * @return true on success8216 */8217 8218 bool diffSkyfileSelectRowsFits(8219 psDB *dbh, ///< Database handle8220 psFits *fits, ///< psFits object8221 const psMetadata *where, ///< Row match criteria8222 unsigned long long limit ///< Maximum number of elements to return8223 );8224 8225 /** Convert a diffSkyfileRow into an equivalent psMetadata8226 *8227 * @return A psMetadata pointer or NULL on error8228 */8229 8230 psMetadata *diffSkyfileMetadataFromObject(8231 const diffSkyfileRow *object ///< fooRow to convert into a psMetadata8232 );8233 8234 /** Convert a psMetadata into an equivalent fooRow8235 *8236 * @return A diffSkyfileRow pointer or NULL on error8237 */8238 8239 diffSkyfileRow *diffSkyfileObjectFromMetadata(8240 psMetadata *md ///< psMetadata to convert into a fooRow8241 );8242 /** Selects up to limit rows from the database and returns as diffSkyfileRow objects in a psArray8243 *8244 * See psDBSelectRows() for documentation on the format of where.8245 *8246 * @return A psArray pointer or NULL on error8247 */8248 8249 psArray *diffSkyfileSelectRowObjects(8250 psDB *dbh, ///< Database handle8251 const psMetadata *where, ///< Row match criteria8252 unsigned long long limit ///< Maximum number of elements to return8253 );8254 /** Deletes a row from the database coresponding to an diffSkyfile8255 *8256 * Note that a 'where' search psMetadata is constructed from each object and8257 * used to find rows to delete.8258 *8259 * @return A The number of rows removed or a negative value on error8260 */8261 8262 bool diffSkyfileDeleteObject(8263 psDB *dbh, ///< Database handle8264 const diffSkyfileRow *object ///< Object to delete8265 );8266 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8267 *8268 * Note that a 'where' search psMetadata is constructed from each object and8269 * used to find rows to delete.8270 *8271 * @return A The number of rows removed or a negative value on error8272 */8273 8274 long long diffSkyfileDeleteRowObjects(8275 psDB *dbh, ///< Database handle8276 const psArray *objects, ///< Array of objects to delete8277 unsigned long long limit ///< Maximum number of elements to delete8278 );8279 /** Formats and prints an array of diffSkyfileRow objects8280 *8281 * When mdcf is set the formated output is in psMetadataConfig8282 * format, otherwise it is in a simple tabular format.8283 *8284 * @return true on success8285 */8286 8287 bool diffSkyfilePrintObjects(8288 FILE *stream, ///< a stream8289 psArray *objects, ///< An array of diffSkyfileRow objects8290 bool mdcf ///< format as mdconfig or simple8291 );8292 /** Formats and prints an diffSkyfileRow object8293 *8294 * When mdcf is set the formated output is in psMetadataConfig8295 * format, otherwise it is in a simple tabular format.8296 *8297 * @return true on success8298 */8299 8300 bool diffSkyfilePrintObject(8301 FILE *stream, ///< a stream8302 diffSkyfileRow *object, ///< an diffSkyfileRow object8303 bool mdcf ///< format as mdconfig or simple8304 );8305 /** stackRunRow data structure8306 *8307 * Structure for representing a single row of stackRun table data.8308 */8309 8310 typedef struct {8311 psS64 stack_id;8312 char *state;8313 char *workdir;8314 char *dvodb;8315 psTime* registered;8316 char *skycell_id;8317 char *tess_id;8318 } stackRunRow;8319 8320 /** Creates a new stackRunRow object8321 *8322 * @return A new stackRunRow object or NULL on failure.8323 */8324 8325 stackRunRow *stackRunRowAlloc(8326 psS64 stack_id,8327 const char *state,8328 const char *workdir,8329 const char *dvodb,8330 psTime* registered,8331 const char *skycell_id,8332 const char *tess_id8333 );8334 8335 /** Creates a new stackRun table8336 *8337 * @return true on success8338 */8339 8340 bool stackRunCreateTable(8341 psDB *dbh ///< Database handle8342 );8343 8344 /** Deletes a stackRun table8345 *8346 * @return true on success8347 */8348 8349 bool stackRunDropTable(8350 psDB *dbh ///< Database handle8351 );8352 8353 /** Insert a single row into a table8354 *8355 * This function constructs and inserts a single row based on it's parameters.8356 *8357 * @return true on success8358 */8359 8360 bool stackRunInsert(8361 psDB *dbh, ///< Database handle8362 psS64 stack_id,8363 const char *state,8364 const char *workdir,8365 const char *dvodb,8366 psTime* registered,8367 const char *skycell_id,8368 const char *tess_id8369 );8370 8371 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8372 *8373 * @return A The number of rows removed or a negative value on error8374 */8375 8376 long long stackRunDelete(8377 psDB *dbh, ///< Database handle8378 const psMetadata *where, ///< Row match criteria8379 unsigned long long limit ///< Maximum number of elements to delete8380 );8381 8382 /** Insert a single stackRunRow object into a table8383 *8384 * This function constructs and inserts a single row based on it's parameters.8385 *8386 * @return true on success8387 */8388 8389 bool stackRunInsertObject(8390 psDB *dbh, ///< Database handle8391 stackRunRow *object ///< stackRunRow object8392 );8393 8394 /** Insert an array of stackRunRow object into a table8395 *8396 * This function constructs and inserts multiple rows based on it's parameters.8397 *8398 * @return true on success8399 */8400 8401 bool stackRunInsertObjects(8402 psDB *dbh, ///< Database handle8403 psArray *objects ///< array of stackRunRow objects8404 );8405 8406 /** Insert data from a binary FITS table stackRunRow into the database8407 *8408 * This function expects a psFits object with a FITS table as the first8409 * extension. The table must have at least one row of data in it, that is of8410 * the appropriate format (number of columns and their type). All other8411 * extensions are ignored.8412 *8413 * @return true on success8414 */8415 8416 bool stackRunInsertFits(8417 psDB *dbh, ///< Database handle8418 const psFits *fits ///< psFits object8419 );8420 8421 /** Selects up to limit from the database and returns them in a binary FITS table8422 *8423 * This function assumes an empty psFits object and will create a FITS table8424 * as the first extension.8425 *8426 * See psDBSelectRows() for documentation on the format of where.8427 *8428 * @return true on success8429 */8430 8431 bool stackRunSelectRowsFits(8432 psDB *dbh, ///< Database handle8433 psFits *fits, ///< psFits object8434 const psMetadata *where, ///< Row match criteria8435 unsigned long long limit ///< Maximum number of elements to return8436 );8437 8438 /** Convert a stackRunRow into an equivalent psMetadata8439 *8440 * @return A psMetadata pointer or NULL on error8441 */8442 8443 psMetadata *stackRunMetadataFromObject(8444 const stackRunRow *object ///< fooRow to convert into a psMetadata8445 );8446 8447 /** Convert a psMetadata into an equivalent fooRow8448 *8449 * @return A stackRunRow pointer or NULL on error8450 */8451 8452 stackRunRow *stackRunObjectFromMetadata(8453 psMetadata *md ///< psMetadata to convert into a fooRow8454 );8455 /** Selects up to limit rows from the database and returns as stackRunRow objects in a psArray8456 *8457 * See psDBSelectRows() for documentation on the format of where.8458 *8459 * @return A psArray pointer or NULL on error8460 */8461 8462 psArray *stackRunSelectRowObjects(8463 psDB *dbh, ///< Database handle8464 const psMetadata *where, ///< Row match criteria8465 unsigned long long limit ///< Maximum number of elements to return8466 );8467 /** Deletes a row from the database coresponding to an stackRun8468 *8469 * Note that a 'where' search psMetadata is constructed from each object and8470 * used to find rows to delete.8471 *8472 * @return A The number of rows removed or a negative value on error8473 */8474 8475 bool stackRunDeleteObject(8476 psDB *dbh, ///< Database handle8477 const stackRunRow *object ///< Object to delete8478 );8479 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8480 *8481 * Note that a 'where' search psMetadata is constructed from each object and8482 * used to find rows to delete.8483 *8484 * @return A The number of rows removed or a negative value on error8485 */8486 8487 long long stackRunDeleteRowObjects(8488 psDB *dbh, ///< Database handle8489 const psArray *objects, ///< Array of objects to delete8490 unsigned long long limit ///< Maximum number of elements to delete8491 );8492 /** Formats and prints an array of stackRunRow objects8493 *8494 * When mdcf is set the formated output is in psMetadataConfig8495 * format, otherwise it is in a simple tabular format.8496 *8497 * @return true on success8498 */8499 8500 bool stackRunPrintObjects(8501 FILE *stream, ///< a stream8502 psArray *objects, ///< An array of stackRunRow objects8503 bool mdcf ///< format as mdconfig or simple8504 );8505 /** Formats and prints an stackRunRow object8506 *8507 * When mdcf is set the formated output is in psMetadataConfig8508 * format, otherwise it is in a simple tabular format.8509 *8510 * @return true on success8511 */8512 8513 bool stackRunPrintObject(8514 FILE *stream, ///< a stream8515 stackRunRow *object, ///< an stackRunRow object8516 bool mdcf ///< format as mdconfig or simple8517 );8518 /** stackInputSkyfileRow data structure8519 *8520 * Structure for representing a single row of stackInputSkyfile table data.8521 */8522 8523 typedef struct {8524 psS64 stack_id;8525 psS64 warp_id;8526 } stackInputSkyfileRow;8527 8528 /** Creates a new stackInputSkyfileRow object8529 *8530 * @return A new stackInputSkyfileRow object or NULL on failure.8531 */8532 8533 stackInputSkyfileRow *stackInputSkyfileRowAlloc(8534 psS64 stack_id,8535 psS64 warp_id8536 );8537 8538 /** Creates a new stackInputSkyfile table8539 *8540 * @return true on success8541 */8542 8543 bool stackInputSkyfileCreateTable(8544 psDB *dbh ///< Database handle8545 );8546 8547 /** Deletes a stackInputSkyfile table8548 *8549 * @return true on success8550 */8551 8552 bool stackInputSkyfileDropTable(8553 psDB *dbh ///< Database handle8554 );8555 8556 /** Insert a single row into a table8557 *8558 * This function constructs and inserts a single row based on it's parameters.8559 *8560 * @return true on success8561 */8562 8563 bool stackInputSkyfileInsert(8564 psDB *dbh, ///< Database handle8565 psS64 stack_id,8566 psS64 warp_id8567 );8568 8569 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8570 *8571 * @return A The number of rows removed or a negative value on error8572 */8573 8574 long long stackInputSkyfileDelete(8575 psDB *dbh, ///< Database handle8576 const psMetadata *where, ///< Row match criteria8577 unsigned long long limit ///< Maximum number of elements to delete8578 );8579 8580 /** Insert a single stackInputSkyfileRow object into a table8581 *8582 * This function constructs and inserts a single row based on it's parameters.8583 *8584 * @return true on success8585 */8586 8587 bool stackInputSkyfileInsertObject(8588 psDB *dbh, ///< Database handle8589 stackInputSkyfileRow *object ///< stackInputSkyfileRow object8590 );8591 8592 /** Insert an array of stackInputSkyfileRow object into a table8593 *8594 * This function constructs and inserts multiple rows based on it's parameters.8595 *8596 * @return true on success8597 */8598 8599 bool stackInputSkyfileInsertObjects(8600 psDB *dbh, ///< Database handle8601 psArray *objects ///< array of stackInputSkyfileRow objects8602 );8603 8604 /** Insert data from a binary FITS table stackInputSkyfileRow into the database8605 *8606 * This function expects a psFits object with a FITS table as the first8607 * extension. The table must have at least one row of data in it, that is of8608 * the appropriate format (number of columns and their type). All other8609 * extensions are ignored.8610 *8611 * @return true on success8612 */8613 8614 bool stackInputSkyfileInsertFits(8615 psDB *dbh, ///< Database handle8616 const psFits *fits ///< psFits object8617 );8618 8619 /** Selects up to limit from the database and returns them in a binary FITS table8620 *8621 * This function assumes an empty psFits object and will create a FITS table8622 * as the first extension.8623 *8624 * See psDBSelectRows() for documentation on the format of where.8625 *8626 * @return true on success8627 */8628 8629 bool stackInputSkyfileSelectRowsFits(8630 psDB *dbh, ///< Database handle8631 psFits *fits, ///< psFits object8632 const psMetadata *where, ///< Row match criteria8633 unsigned long long limit ///< Maximum number of elements to return8634 );8635 8636 /** Convert a stackInputSkyfileRow into an equivalent psMetadata8637 *8638 * @return A psMetadata pointer or NULL on error8639 */8640 8641 psMetadata *stackInputSkyfileMetadataFromObject(8642 const stackInputSkyfileRow *object ///< fooRow to convert into a psMetadata8643 );8644 8645 /** Convert a psMetadata into an equivalent fooRow8646 *8647 * @return A stackInputSkyfileRow pointer or NULL on error8648 */8649 8650 stackInputSkyfileRow *stackInputSkyfileObjectFromMetadata(8651 psMetadata *md ///< psMetadata to convert into a fooRow8652 );8653 /** Selects up to limit rows from the database and returns as stackInputSkyfileRow objects in a psArray8654 *8655 * See psDBSelectRows() for documentation on the format of where.8656 *8657 * @return A psArray pointer or NULL on error8658 */8659 8660 psArray *stackInputSkyfileSelectRowObjects(8661 psDB *dbh, ///< Database handle8662 const psMetadata *where, ///< Row match criteria8663 unsigned long long limit ///< Maximum number of elements to return8664 );8665 /** Deletes a row from the database coresponding to an stackInputSkyfile8666 *8667 * Note that a 'where' search psMetadata is constructed from each object and8668 * used to find rows to delete.8669 *8670 * @return A The number of rows removed or a negative value on error8671 */8672 8673 bool stackInputSkyfileDeleteObject(8674 psDB *dbh, ///< Database handle8675 const stackInputSkyfileRow *object ///< Object to delete8676 );8677 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8678 *8679 * Note that a 'where' search psMetadata is constructed from each object and8680 * used to find rows to delete.8681 *8682 * @return A The number of rows removed or a negative value on error8683 */8684 8685 long long stackInputSkyfileDeleteRowObjects(8686 psDB *dbh, ///< Database handle8687 const psArray *objects, ///< Array of objects to delete8688 unsigned long long limit ///< Maximum number of elements to delete8689 );8690 /** Formats and prints an array of stackInputSkyfileRow objects8691 *8692 * When mdcf is set the formated output is in psMetadataConfig8693 * format, otherwise it is in a simple tabular format.8694 *8695 * @return true on success8696 */8697 8698 bool stackInputSkyfilePrintObjects(8699 FILE *stream, ///< a stream8700 psArray *objects, ///< An array of stackInputSkyfileRow objects8701 bool mdcf ///< format as mdconfig or simple8702 );8703 /** Formats and prints an stackInputSkyfileRow object8704 *8705 * When mdcf is set the formated output is in psMetadataConfig8706 * format, otherwise it is in a simple tabular format.8707 *8708 * @return true on success8709 */8710 8711 bool stackInputSkyfilePrintObject(8712 FILE *stream, ///< a stream8713 stackInputSkyfileRow *object, ///< an stackInputSkyfileRow object8714 bool mdcf ///< format as mdconfig or simple8715 );8716 /** stackSumSkyfileRow data structure8717 *8718 * Structure for representing a single row of stackSumSkyfile table data.8719 */8720 8721 typedef struct {8722 psS64 stack_id;8723 char *uri;8724 psF64 bg;8725 psF64 bg_stdev;8726 } stackSumSkyfileRow;8727 8728 /** Creates a new stackSumSkyfileRow object8729 *8730 * @return A new stackSumSkyfileRow object or NULL on failure.8731 */8732 8733 stackSumSkyfileRow *stackSumSkyfileRowAlloc(8734 psS64 stack_id,8735 const char *uri,8736 psF64 bg,8737 psF64 bg_stdev8738 );8739 8740 /** Creates a new stackSumSkyfile table8741 *8742 * @return true on success8743 */8744 8745 bool stackSumSkyfileCreateTable(8746 psDB *dbh ///< Database handle8747 );8748 8749 /** Deletes a stackSumSkyfile table8750 *8751 * @return true on success8752 */8753 8754 bool stackSumSkyfileDropTable(8755 psDB *dbh ///< Database handle8756 );8757 8758 /** Insert a single row into a table8759 *8760 * This function constructs and inserts a single row based on it's parameters.8761 *8762 * @return true on success8763 */8764 8765 bool stackSumSkyfileInsert(8766 psDB *dbh, ///< Database handle8767 psS64 stack_id,8768 const char *uri,8769 psF64 bg,8770 psF64 bg_stdev8771 );8772 8773 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8774 *8775 * @return A The number of rows removed or a negative value on error8776 */8777 8778 long long stackSumSkyfileDelete(8779 psDB *dbh, ///< Database handle8780 const psMetadata *where, ///< Row match criteria8781 unsigned long long limit ///< Maximum number of elements to delete8782 );8783 8784 /** Insert a single stackSumSkyfileRow object into a table8785 *8786 * This function constructs and inserts a single row based on it's parameters.8787 *8788 * @return true on success8789 */8790 8791 bool stackSumSkyfileInsertObject(8792 psDB *dbh, ///< Database handle8793 stackSumSkyfileRow *object ///< stackSumSkyfileRow object8794 );8795 8796 /** Insert an array of stackSumSkyfileRow object into a table8797 *8798 * This function constructs and inserts multiple rows based on it's parameters.8799 *8800 * @return true on success8801 */8802 8803 bool stackSumSkyfileInsertObjects(8804 psDB *dbh, ///< Database handle8805 psArray *objects ///< array of stackSumSkyfileRow objects8806 );8807 8808 /** Insert data from a binary FITS table stackSumSkyfileRow into the database8809 *8810 * This function expects a psFits object with a FITS table as the first8811 * extension. The table must have at least one row of data in it, that is of8812 * the appropriate format (number of columns and their type). All other8813 * extensions are ignored.8814 *8815 * @return true on success8816 */8817 8818 bool stackSumSkyfileInsertFits(8819 psDB *dbh, ///< Database handle8820 const psFits *fits ///< psFits object8821 );8822 8823 /** Selects up to limit from the database and returns them in a binary FITS table8824 *8825 * This function assumes an empty psFits object and will create a FITS table8826 * as the first extension.8827 *8828 * See psDBSelectRows() for documentation on the format of where.8829 *8830 * @return true on success8831 */8832 8833 bool stackSumSkyfileSelectRowsFits(8834 psDB *dbh, ///< Database handle8835 psFits *fits, ///< psFits object8836 const psMetadata *where, ///< Row match criteria8837 unsigned long long limit ///< Maximum number of elements to return8838 );8839 8840 /** Convert a stackSumSkyfileRow into an equivalent psMetadata8841 *8842 * @return A psMetadata pointer or NULL on error8843 */8844 8845 psMetadata *stackSumSkyfileMetadataFromObject(8846 const stackSumSkyfileRow *object ///< fooRow to convert into a psMetadata8847 );8848 8849 /** Convert a psMetadata into an equivalent fooRow8850 *8851 * @return A stackSumSkyfileRow pointer or NULL on error8852 */8853 8854 stackSumSkyfileRow *stackSumSkyfileObjectFromMetadata(8855 psMetadata *md ///< psMetadata to convert into a fooRow8856 );8857 /** Selects up to limit rows from the database and returns as stackSumSkyfileRow objects in a psArray8858 *8859 * See psDBSelectRows() for documentation on the format of where.8860 *8861 * @return A psArray pointer or NULL on error8862 */8863 8864 psArray *stackSumSkyfileSelectRowObjects(8865 psDB *dbh, ///< Database handle8866 const psMetadata *where, ///< Row match criteria8867 unsigned long long limit ///< Maximum number of elements to return8868 );8869 /** Deletes a row from the database coresponding to an stackSumSkyfile8870 *8871 * Note that a 'where' search psMetadata is constructed from each object and8872 * used to find rows to delete.8873 *8874 * @return A The number of rows removed or a negative value on error8875 */8876 8877 bool stackSumSkyfileDeleteObject(8878 psDB *dbh, ///< Database handle8879 const stackSumSkyfileRow *object ///< Object to delete8880 );8881 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.8882 *8883 * Note that a 'where' search psMetadata is constructed from each object and8884 * used to find rows to delete.8885 *8886 * @return A The number of rows removed or a negative value on error8887 */8888 8889 long long stackSumSkyfileDeleteRowObjects(8890 psDB *dbh, ///< Database handle8891 const psArray *objects, ///< Array of objects to delete8892 unsigned long long limit ///< Maximum number of elements to delete8893 );8894 /** Formats and prints an array of stackSumSkyfileRow objects8895 *8896 * When mdcf is set the formated output is in psMetadataConfig8897 * format, otherwise it is in a simple tabular format.8898 *8899 * @return true on success8900 */8901 8902 bool stackSumSkyfilePrintObjects(8903 FILE *stream, ///< a stream8904 psArray *objects, ///< An array of stackSumSkyfileRow objects8905 bool mdcf ///< format as mdconfig or simple8906 );8907 /** Formats and prints an stackSumSkyfileRow object8908 *8909 * When mdcf is set the formated output is in psMetadataConfig8910 * format, otherwise it is in a simple tabular format.8911 *8912 * @return true on success8913 */8914 8915 bool stackSumSkyfilePrintObject(8916 FILE *stream, ///< a stream8917 stackSumSkyfileRow *object, ///< an stackSumSkyfileRow object8918 bool mdcf ///< format as mdconfig or simple8919 );8920 8920 8921 8921 /// @} … … 8925 8925 #endif 8926 8926 8927 #endif // STACKSUMSKYFILE_DB_H8927 #endif // DETRUNSUMMARY_DB_H
Note:
See TracChangeset
for help on using the changeset viewer.
