IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2007, 5:14:51 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.h

    r12426 r12535  
    2020/*
    2121 *
    22  * This file was generated by glueforge 1.00
     22 * This file was generated by glueforge 1.01
    2323 *
    2424 * Do NOT directly edit this file.
     
    44044404    FILE            *stream,            ///< a stream
    44054405    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
     4413typedef 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
     4427warpRunRow *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
     4441bool warpRunCreateTable(
     4442    psDB            *dbh                ///< Database handle
     4443);
     4444
     4445/** Deletes a warpRun table
     4446 *
     4447 * @return true on success
     4448 */
     4449
     4450bool 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
     4461bool 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
     4476long 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
     4489bool 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
     4501bool 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
     4516bool 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
     4531bool 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
     4543psMetadata *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
     4552warpRunRow *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
     4562psArray *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
     4575bool 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
     4587long 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
     4600bool 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
     4613bool 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
     4623typedef 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
     4634warpInputExpRow *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
     4645bool warpInputExpCreateTable(
     4646    psDB            *dbh                ///< Database handle
     4647);
     4648
     4649/** Deletes a warpInputExp table
     4650 *
     4651 * @return true on success
     4652 */
     4653
     4654bool 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
     4665bool 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
     4677long 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
     4690bool 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
     4702bool 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
     4717bool 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
     4732bool 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
     4744psMetadata *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
     4753warpInputExpRow *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
     4763psArray *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
     4776bool 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
     4788long 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
     4801bool 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
     4814bool 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
     4824typedef 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
     4838warpSkyCellMapRow *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
     4852bool warpSkyCellMapCreateTable(
     4853    psDB            *dbh                ///< Database handle
     4854);
     4855
     4856/** Deletes a warpSkyCellMap table
     4857 *
     4858 * @return true on success
     4859 */
     4860
     4861bool 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
     4872bool 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
     4887long 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
     4900bool 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
     4912bool 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
     4927bool 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
     4942bool 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
     4954psMetadata *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
     4963warpSkyCellMapRow *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
     4973psArray *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
     4986bool 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
     4998long 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
     5011bool 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
     5024bool 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
     5034typedef 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
     5048warpSkyfileRow *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
     5062bool warpSkyfileCreateTable(
     5063    psDB            *dbh                ///< Database handle
     5064);
     5065
     5066/** Deletes a warpSkyfile table
     5067 *
     5068 * @return true on success
     5069 */
     5070
     5071bool 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
     5082bool 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
     5097long 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
     5110bool 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
     5122bool 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
     5137bool 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
     5152bool 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
     5164psMetadata *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
     5173warpSkyfileRow *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
     5183psArray *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
     5196bool 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
     5208long 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
     5221bool 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
     5234bool 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
     5244typedef 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
     5259diffRunRow *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
     5274bool diffRunCreateTable(
     5275    psDB            *dbh                ///< Database handle
     5276);
     5277
     5278/** Deletes a diffRun table
     5279 *
     5280 * @return true on success
     5281 */
     5282
     5283bool 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
     5294bool 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
     5310long 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
     5323bool 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
     5335bool 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
     5350bool 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
     5365bool 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
     5377psMetadata *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
     5386diffRunRow *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
     5396psArray *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
     5409bool 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
     5421long 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
     5434bool 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
     5447bool 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
     5457typedef 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
     5471diffInputSkyfileRow *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
     5485bool diffInputSkyfileCreateTable(
     5486    psDB            *dbh                ///< Database handle
     5487);
     5488
     5489/** Deletes a diffInputSkyfile table
     5490 *
     5491 * @return true on success
     5492 */
     5493
     5494bool 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
     5505bool 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
     5520long 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
     5533bool 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
     5545bool 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
     5560bool 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
     5575bool 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
     5587psMetadata *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
     5596diffInputSkyfileRow *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
     5606psArray *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
     5619bool 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
     5631long 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
     5644bool 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
     5657bool 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
     5667typedef 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
     5679diffSkyfileRow *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
     5691bool diffSkyfileCreateTable(
     5692    psDB            *dbh                ///< Database handle
     5693);
     5694
     5695/** Deletes a diffSkyfile table
     5696 *
     5697 * @return true on success
     5698 */
     5699
     5700bool 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
     5711bool 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
     5724long 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
     5737bool 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
     5749bool 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
     5764bool 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
     5779bool 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
     5791psMetadata *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
     5800diffSkyfileRow *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
     5810psArray *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
     5823bool 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
     5835long 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
     5848bool 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
     5861bool 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
     5871typedef 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
     5886stackRunRow *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
     5901bool stackRunCreateTable(
     5902    psDB            *dbh                ///< Database handle
     5903);
     5904
     5905/** Deletes a stackRun table
     5906 *
     5907 * @return true on success
     5908 */
     5909
     5910bool 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
     5921bool 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
     5937long 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
     5950bool 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
     5962bool 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
     5977bool 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
     5992bool 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
     6004psMetadata *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
     6013stackRunRow *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
     6023psArray *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
     6036bool 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
     6048long 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
     6061bool 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
     6074bool 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
     6084typedef 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
     6094stackInputSkyfileRow *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
     6104bool stackInputSkyfileCreateTable(
     6105    psDB            *dbh                ///< Database handle
     6106);
     6107
     6108/** Deletes a stackInputSkyfile table
     6109 *
     6110 * @return true on success
     6111 */
     6112
     6113bool 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
     6124bool 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
     6135long 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
     6148bool 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
     6160bool 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
     6175bool 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
     6190bool 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
     6202psMetadata *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
     6211stackInputSkyfileRow *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
     6221psArray *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
     6234bool 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
     6246long 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
     6259bool 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
     6272bool 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
     6282typedef 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
     6294stackSumSkyfileRow *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
     6306bool stackSumSkyfileCreateTable(
     6307    psDB            *dbh                ///< Database handle
     6308);
     6309
     6310/** Deletes a stackSumSkyfile table
     6311 *
     6312 * @return true on success
     6313 */
     6314
     6315bool 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
     6326bool 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
     6339long 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
     6352bool 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
     6364bool 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
     6379bool 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
     6394bool 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
     6406psMetadata *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
     6415stackSumSkyfileRow *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
     6425psArray *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
     6438bool 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
     6450long 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
     6463bool 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
     6476bool stackSumSkyfilePrintObject(
     6477    FILE            *stream,            ///< a stream
     6478    stackSumSkyfileRow *object,    ///< an stackSumSkyfileRow object
    44066479    bool            mdcf                ///< format as mdconfig or simple
    44076480);
     
    68458918    bool            mdcf                ///< format as mdconfig or simple
    68468919);
    6847 /** warpRunRow data structure
    6848  *
    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 object
    6862  *
    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*         registered
    6873 );
    6874 
    6875 /** Creates a new warpRun table
    6876  *
    6877  * @return true on success
    6878  */
    6879 
    6880 bool warpRunCreateTable(
    6881     psDB            *dbh                ///< Database handle
    6882 );
    6883 
    6884 /** Deletes a warpRun table
    6885  *
    6886  * @return true on success
    6887  */
    6888 
    6889 bool warpRunDropTable(
    6890     psDB            *dbh                ///< Database handle
    6891 );
    6892 
    6893 /** Insert a single row into a table
    6894  *
    6895  * This function constructs and inserts a single row based on it's parameters.
    6896  *
    6897  * @return true on success
    6898  */
    6899 
    6900 bool warpRunInsert(
    6901     psDB            *dbh,               ///< Database handle
    6902     psS64           warp_id,
    6903     const char      *mode,
    6904     const char      *state,
    6905     const char      *workdir,
    6906     const char      *dvodb,
    6907     psTime*         registered
    6908 );
    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 error
    6913  */
    6914 
    6915 long long warpRunDelete(
    6916     psDB            *dbh,               ///< Database handle
    6917     const psMetadata *where,            ///< Row match criteria
    6918     unsigned long long limit            ///< Maximum number of elements to delete
    6919 );
    6920 
    6921 /** Insert a single warpRunRow object into a table
    6922  *
    6923  * This function constructs and inserts a single row based on it's parameters.
    6924  *
    6925  * @return true on success
    6926  */
    6927 
    6928 bool warpRunInsertObject(
    6929     psDB            *dbh,               ///< Database handle
    6930     warpRunRow      *object             ///< warpRunRow object
    6931 );
    6932 
    6933 /** Insert an array of warpRunRow object into a table
    6934  *
    6935  * This function constructs and inserts multiple rows based on it's parameters.
    6936  *
    6937  * @return true on success
    6938  */
    6939 
    6940 bool warpRunInsertObjects(
    6941     psDB            *dbh,               ///< Database handle
    6942     psArray         *objects            ///< array of warpRunRow objects
    6943 );
    6944 
    6945 /** Insert data from a binary FITS table warpRunRow into the database
    6946  *
    6947  * This function expects a psFits object with a FITS table as the first
    6948  * extension.  The table must have at least one row of data in it, that is of
    6949  * the appropriate format (number of columns and their type).  All other
    6950  * extensions are ignored.
    6951  *
    6952  * @return true on success
    6953  */
    6954 
    6955 bool warpRunInsertFits(
    6956     psDB            *dbh,               ///< Database handle
    6957     const psFits    *fits               ///< psFits object
    6958 );
    6959 
    6960 /** Selects up to limit from the database and returns them in a binary FITS table
    6961  *
    6962  * This function assumes an empty psFits object and will create a FITS table
    6963  * as the first extension.
    6964  *
    6965  *  See psDBSelectRows() for documentation on the format of where.
    6966  *
    6967  * @return true on success
    6968  */
    6969 
    6970 bool warpRunSelectRowsFits(
    6971     psDB            *dbh,               ///< Database handle
    6972     psFits          *fits,              ///< psFits object
    6973     const psMetadata *where,            ///< Row match criteria
    6974     unsigned long long limit            ///< Maximum number of elements to return
    6975 );
    6976 
    6977 /** Convert a warpRunRow into an equivalent psMetadata
    6978  *
    6979  * @return A psMetadata pointer or NULL on error
    6980  */
    6981 
    6982 psMetadata *warpRunMetadataFromObject(
    6983     const warpRunRow *object             ///< fooRow to convert into a psMetadata
    6984 );
    6985 
    6986 /** Convert a psMetadata into an equivalent fooRow
    6987  *
    6988  * @return A warpRunRow pointer or NULL on error
    6989  */
    6990 
    6991 warpRunRow *warpRunObjectFromMetadata(
    6992     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    6993 );
    6994 /** Selects up to limit rows from the database and returns as warpRunRow objects in a psArray
    6995  *
    6996  *  See psDBSelectRows() for documentation on the format of where.
    6997  *
    6998  * @return A psArray pointer or NULL on error
    6999  */
    7000 
    7001 psArray *warpRunSelectRowObjects(
    7002     psDB            *dbh,               ///< Database handle
    7003     const psMetadata *where,            ///< Row match criteria
    7004     unsigned long long limit            ///< Maximum number of elements to return
    7005 );
    7006 /** Deletes a row from the database coresponding to an warpRun
    7007  *
    7008  *  Note that a 'where' search psMetadata is constructed from each object and
    7009  *  used to find rows to delete.
    7010  *
    7011  * @return A The number of rows removed or a negative value on error
    7012  */
    7013 
    7014 bool warpRunDeleteObject(
    7015     psDB            *dbh,               ///< Database handle
    7016     const warpRunRow *object    ///< Object to delete
    7017 );
    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 and
    7021  *  used to find rows to delete.
    7022  *
    7023  * @return A The number of rows removed or a negative value on error
    7024  */
    7025 
    7026 long long warpRunDeleteRowObjects(
    7027     psDB            *dbh,               ///< Database handle
    7028     const psArray   *objects,           ///< Array of objects to delete
    7029     unsigned long long limit            ///< Maximum number of elements to delete
    7030 );
    7031 /** Formats and prints an array of warpRunRow objects
    7032  *
    7033  * When mdcf is set the formated output is in psMetadataConfig
    7034  * format, otherwise it is in a simple tabular format.
    7035  *
    7036  * @return true on success
    7037  */
    7038 
    7039 bool warpRunPrintObjects(
    7040     FILE            *stream,            ///< a stream
    7041     psArray         *objects,           ///< An array of warpRunRow objects
    7042     bool            mdcf                ///< format as mdconfig or simple
    7043 );
    7044 /** Formats and prints an warpRunRow object
    7045  *
    7046  * When mdcf is set the formated output is in psMetadataConfig
    7047  * format, otherwise it is in a simple tabular format.
    7048  *
    7049  * @return true on success
    7050  */
    7051 
    7052 bool warpRunPrintObject(
    7053     FILE            *stream,            ///< a stream
    7054     warpRunRow *object,    ///< an warpRunRow object
    7055     bool            mdcf                ///< format as mdconfig or simple
    7056 );
    7057 /** warpInputExpRow data structure
    7058  *
    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 object
    7069  *
    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            magiced
    7077 );
    7078 
    7079 /** Creates a new warpInputExp table
    7080  *
    7081  * @return true on success
    7082  */
    7083 
    7084 bool warpInputExpCreateTable(
    7085     psDB            *dbh                ///< Database handle
    7086 );
    7087 
    7088 /** Deletes a warpInputExp table
    7089  *
    7090  * @return true on success
    7091  */
    7092 
    7093 bool warpInputExpDropTable(
    7094     psDB            *dbh                ///< Database handle
    7095 );
    7096 
    7097 /** Insert a single row into a table
    7098  *
    7099  * This function constructs and inserts a single row based on it's parameters.
    7100  *
    7101  * @return true on success
    7102  */
    7103 
    7104 bool warpInputExpInsert(
    7105     psDB            *dbh,               ///< Database handle
    7106     psS64           warp_id,
    7107     psS64           cam_id,
    7108     bool            magiced
    7109 );
    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 error
    7114  */
    7115 
    7116 long long warpInputExpDelete(
    7117     psDB            *dbh,               ///< Database handle
    7118     const psMetadata *where,            ///< Row match criteria
    7119     unsigned long long limit            ///< Maximum number of elements to delete
    7120 );
    7121 
    7122 /** Insert a single warpInputExpRow object into a table
    7123  *
    7124  * This function constructs and inserts a single row based on it's parameters.
    7125  *
    7126  * @return true on success
    7127  */
    7128 
    7129 bool warpInputExpInsertObject(
    7130     psDB            *dbh,               ///< Database handle
    7131     warpInputExpRow *object             ///< warpInputExpRow object
    7132 );
    7133 
    7134 /** Insert an array of warpInputExpRow object into a table
    7135  *
    7136  * This function constructs and inserts multiple rows based on it's parameters.
    7137  *
    7138  * @return true on success
    7139  */
    7140 
    7141 bool warpInputExpInsertObjects(
    7142     psDB            *dbh,               ///< Database handle
    7143     psArray         *objects            ///< array of warpInputExpRow objects
    7144 );
    7145 
    7146 /** Insert data from a binary FITS table warpInputExpRow into the database
    7147  *
    7148  * This function expects a psFits object with a FITS table as the first
    7149  * extension.  The table must have at least one row of data in it, that is of
    7150  * the appropriate format (number of columns and their type).  All other
    7151  * extensions are ignored.
    7152  *
    7153  * @return true on success
    7154  */
    7155 
    7156 bool warpInputExpInsertFits(
    7157     psDB            *dbh,               ///< Database handle
    7158     const psFits    *fits               ///< psFits object
    7159 );
    7160 
    7161 /** Selects up to limit from the database and returns them in a binary FITS table
    7162  *
    7163  * This function assumes an empty psFits object and will create a FITS table
    7164  * as the first extension.
    7165  *
    7166  *  See psDBSelectRows() for documentation on the format of where.
    7167  *
    7168  * @return true on success
    7169  */
    7170 
    7171 bool warpInputExpSelectRowsFits(
    7172     psDB            *dbh,               ///< Database handle
    7173     psFits          *fits,              ///< psFits object
    7174     const psMetadata *where,            ///< Row match criteria
    7175     unsigned long long limit            ///< Maximum number of elements to return
    7176 );
    7177 
    7178 /** Convert a warpInputExpRow into an equivalent psMetadata
    7179  *
    7180  * @return A psMetadata pointer or NULL on error
    7181  */
    7182 
    7183 psMetadata *warpInputExpMetadataFromObject(
    7184     const warpInputExpRow *object             ///< fooRow to convert into a psMetadata
    7185 );
    7186 
    7187 /** Convert a psMetadata into an equivalent fooRow
    7188  *
    7189  * @return A warpInputExpRow pointer or NULL on error
    7190  */
    7191 
    7192 warpInputExpRow *warpInputExpObjectFromMetadata(
    7193     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7194 );
    7195 /** Selects up to limit rows from the database and returns as warpInputExpRow objects in a psArray
    7196  *
    7197  *  See psDBSelectRows() for documentation on the format of where.
    7198  *
    7199  * @return A psArray pointer or NULL on error
    7200  */
    7201 
    7202 psArray *warpInputExpSelectRowObjects(
    7203     psDB            *dbh,               ///< Database handle
    7204     const psMetadata *where,            ///< Row match criteria
    7205     unsigned long long limit            ///< Maximum number of elements to return
    7206 );
    7207 /** Deletes a row from the database coresponding to an warpInputExp
    7208  *
    7209  *  Note that a 'where' search psMetadata is constructed from each object and
    7210  *  used to find rows to delete.
    7211  *
    7212  * @return A The number of rows removed or a negative value on error
    7213  */
    7214 
    7215 bool warpInputExpDeleteObject(
    7216     psDB            *dbh,               ///< Database handle
    7217     const warpInputExpRow *object    ///< Object to delete
    7218 );
    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 and
    7222  *  used to find rows to delete.
    7223  *
    7224  * @return A The number of rows removed or a negative value on error
    7225  */
    7226 
    7227 long long warpInputExpDeleteRowObjects(
    7228     psDB            *dbh,               ///< Database handle
    7229     const psArray   *objects,           ///< Array of objects to delete
    7230     unsigned long long limit            ///< Maximum number of elements to delete
    7231 );
    7232 /** Formats and prints an array of warpInputExpRow objects
    7233  *
    7234  * When mdcf is set the formated output is in psMetadataConfig
    7235  * format, otherwise it is in a simple tabular format.
    7236  *
    7237  * @return true on success
    7238  */
    7239 
    7240 bool warpInputExpPrintObjects(
    7241     FILE            *stream,            ///< a stream
    7242     psArray         *objects,           ///< An array of warpInputExpRow objects
    7243     bool            mdcf                ///< format as mdconfig or simple
    7244 );
    7245 /** Formats and prints an warpInputExpRow object
    7246  *
    7247  * When mdcf is set the formated output is in psMetadataConfig
    7248  * format, otherwise it is in a simple tabular format.
    7249  *
    7250  * @return true on success
    7251  */
    7252 
    7253 bool warpInputExpPrintObject(
    7254     FILE            *stream,            ///< a stream
    7255     warpInputExpRow *object,    ///< an warpInputExpRow object
    7256     bool            mdcf                ///< format as mdconfig or simple
    7257 );
    7258 /** warpSkyCellMapRow data structure
    7259  *
    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 object
    7273  *
    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           fault
    7284 );
    7285 
    7286 /** Creates a new warpSkyCellMap table
    7287  *
    7288  * @return true on success
    7289  */
    7290 
    7291 bool warpSkyCellMapCreateTable(
    7292     psDB            *dbh                ///< Database handle
    7293 );
    7294 
    7295 /** Deletes a warpSkyCellMap table
    7296  *
    7297  * @return true on success
    7298  */
    7299 
    7300 bool warpSkyCellMapDropTable(
    7301     psDB            *dbh                ///< Database handle
    7302 );
    7303 
    7304 /** Insert a single row into a table
    7305  *
    7306  * This function constructs and inserts a single row based on it's parameters.
    7307  *
    7308  * @return true on success
    7309  */
    7310 
    7311 bool warpSkyCellMapInsert(
    7312     psDB            *dbh,               ///< Database handle
    7313     psS64           warp_id,
    7314     const char      *skycell_id,
    7315     const char      *tess_id,
    7316     psS64           cam_id,
    7317     const char      *class_id,
    7318     psS16           fault
    7319 );
    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 error
    7324  */
    7325 
    7326 long long warpSkyCellMapDelete(
    7327     psDB            *dbh,               ///< Database handle
    7328     const psMetadata *where,            ///< Row match criteria
    7329     unsigned long long limit            ///< Maximum number of elements to delete
    7330 );
    7331 
    7332 /** Insert a single warpSkyCellMapRow object into a table
    7333  *
    7334  * This function constructs and inserts a single row based on it's parameters.
    7335  *
    7336  * @return true on success
    7337  */
    7338 
    7339 bool warpSkyCellMapInsertObject(
    7340     psDB            *dbh,               ///< Database handle
    7341     warpSkyCellMapRow *object             ///< warpSkyCellMapRow object
    7342 );
    7343 
    7344 /** Insert an array of warpSkyCellMapRow object into a table
    7345  *
    7346  * This function constructs and inserts multiple rows based on it's parameters.
    7347  *
    7348  * @return true on success
    7349  */
    7350 
    7351 bool warpSkyCellMapInsertObjects(
    7352     psDB            *dbh,               ///< Database handle
    7353     psArray         *objects            ///< array of warpSkyCellMapRow objects
    7354 );
    7355 
    7356 /** Insert data from a binary FITS table warpSkyCellMapRow into the database
    7357  *
    7358  * This function expects a psFits object with a FITS table as the first
    7359  * extension.  The table must have at least one row of data in it, that is of
    7360  * the appropriate format (number of columns and their type).  All other
    7361  * extensions are ignored.
    7362  *
    7363  * @return true on success
    7364  */
    7365 
    7366 bool warpSkyCellMapInsertFits(
    7367     psDB            *dbh,               ///< Database handle
    7368     const psFits    *fits               ///< psFits object
    7369 );
    7370 
    7371 /** Selects up to limit from the database and returns them in a binary FITS table
    7372  *
    7373  * This function assumes an empty psFits object and will create a FITS table
    7374  * as the first extension.
    7375  *
    7376  *  See psDBSelectRows() for documentation on the format of where.
    7377  *
    7378  * @return true on success
    7379  */
    7380 
    7381 bool warpSkyCellMapSelectRowsFits(
    7382     psDB            *dbh,               ///< Database handle
    7383     psFits          *fits,              ///< psFits object
    7384     const psMetadata *where,            ///< Row match criteria
    7385     unsigned long long limit            ///< Maximum number of elements to return
    7386 );
    7387 
    7388 /** Convert a warpSkyCellMapRow into an equivalent psMetadata
    7389  *
    7390  * @return A psMetadata pointer or NULL on error
    7391  */
    7392 
    7393 psMetadata *warpSkyCellMapMetadataFromObject(
    7394     const warpSkyCellMapRow *object             ///< fooRow to convert into a psMetadata
    7395 );
    7396 
    7397 /** Convert a psMetadata into an equivalent fooRow
    7398  *
    7399  * @return A warpSkyCellMapRow pointer or NULL on error
    7400  */
    7401 
    7402 warpSkyCellMapRow *warpSkyCellMapObjectFromMetadata(
    7403     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7404 );
    7405 /** Selects up to limit rows from the database and returns as warpSkyCellMapRow objects in a psArray
    7406  *
    7407  *  See psDBSelectRows() for documentation on the format of where.
    7408  *
    7409  * @return A psArray pointer or NULL on error
    7410  */
    7411 
    7412 psArray *warpSkyCellMapSelectRowObjects(
    7413     psDB            *dbh,               ///< Database handle
    7414     const psMetadata *where,            ///< Row match criteria
    7415     unsigned long long limit            ///< Maximum number of elements to return
    7416 );
    7417 /** Deletes a row from the database coresponding to an warpSkyCellMap
    7418  *
    7419  *  Note that a 'where' search psMetadata is constructed from each object and
    7420  *  used to find rows to delete.
    7421  *
    7422  * @return A The number of rows removed or a negative value on error
    7423  */
    7424 
    7425 bool warpSkyCellMapDeleteObject(
    7426     psDB            *dbh,               ///< Database handle
    7427     const warpSkyCellMapRow *object    ///< Object to delete
    7428 );
    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 and
    7432  *  used to find rows to delete.
    7433  *
    7434  * @return A The number of rows removed or a negative value on error
    7435  */
    7436 
    7437 long long warpSkyCellMapDeleteRowObjects(
    7438     psDB            *dbh,               ///< Database handle
    7439     const psArray   *objects,           ///< Array of objects to delete
    7440     unsigned long long limit            ///< Maximum number of elements to delete
    7441 );
    7442 /** Formats and prints an array of warpSkyCellMapRow objects
    7443  *
    7444  * When mdcf is set the formated output is in psMetadataConfig
    7445  * format, otherwise it is in a simple tabular format.
    7446  *
    7447  * @return true on success
    7448  */
    7449 
    7450 bool warpSkyCellMapPrintObjects(
    7451     FILE            *stream,            ///< a stream
    7452     psArray         *objects,           ///< An array of warpSkyCellMapRow objects
    7453     bool            mdcf                ///< format as mdconfig or simple
    7454 );
    7455 /** Formats and prints an warpSkyCellMapRow object
    7456  *
    7457  * When mdcf is set the formated output is in psMetadataConfig
    7458  * format, otherwise it is in a simple tabular format.
    7459  *
    7460  * @return true on success
    7461  */
    7462 
    7463 bool warpSkyCellMapPrintObject(
    7464     FILE            *stream,            ///< a stream
    7465     warpSkyCellMapRow *object,    ///< an warpSkyCellMapRow object
    7466     bool            mdcf                ///< format as mdconfig or simple
    7467 );
    7468 /** warpSkyfileRow data structure
    7469  *
    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 object
    7483  *
    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_stdev
    7494 );
    7495 
    7496 /** Creates a new warpSkyfile table
    7497  *
    7498  * @return true on success
    7499  */
    7500 
    7501 bool warpSkyfileCreateTable(
    7502     psDB            *dbh                ///< Database handle
    7503 );
    7504 
    7505 /** Deletes a warpSkyfile table
    7506  *
    7507  * @return true on success
    7508  */
    7509 
    7510 bool warpSkyfileDropTable(
    7511     psDB            *dbh                ///< Database handle
    7512 );
    7513 
    7514 /** Insert a single row into a table
    7515  *
    7516  * This function constructs and inserts a single row based on it's parameters.
    7517  *
    7518  * @return true on success
    7519  */
    7520 
    7521 bool warpSkyfileInsert(
    7522     psDB            *dbh,               ///< Database handle
    7523     psS64           warp_id,
    7524     const char      *skycell_id,
    7525     const char      *tess_id,
    7526     const char      *uri,
    7527     psF64           bg,
    7528     psF64           bg_stdev
    7529 );
    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 error
    7534  */
    7535 
    7536 long long warpSkyfileDelete(
    7537     psDB            *dbh,               ///< Database handle
    7538     const psMetadata *where,            ///< Row match criteria
    7539     unsigned long long limit            ///< Maximum number of elements to delete
    7540 );
    7541 
    7542 /** Insert a single warpSkyfileRow object into a table
    7543  *
    7544  * This function constructs and inserts a single row based on it's parameters.
    7545  *
    7546  * @return true on success
    7547  */
    7548 
    7549 bool warpSkyfileInsertObject(
    7550     psDB            *dbh,               ///< Database handle
    7551     warpSkyfileRow  *object             ///< warpSkyfileRow object
    7552 );
    7553 
    7554 /** Insert an array of warpSkyfileRow object into a table
    7555  *
    7556  * This function constructs and inserts multiple rows based on it's parameters.
    7557  *
    7558  * @return true on success
    7559  */
    7560 
    7561 bool warpSkyfileInsertObjects(
    7562     psDB            *dbh,               ///< Database handle
    7563     psArray         *objects            ///< array of warpSkyfileRow objects
    7564 );
    7565 
    7566 /** Insert data from a binary FITS table warpSkyfileRow into the database
    7567  *
    7568  * This function expects a psFits object with a FITS table as the first
    7569  * extension.  The table must have at least one row of data in it, that is of
    7570  * the appropriate format (number of columns and their type).  All other
    7571  * extensions are ignored.
    7572  *
    7573  * @return true on success
    7574  */
    7575 
    7576 bool warpSkyfileInsertFits(
    7577     psDB            *dbh,               ///< Database handle
    7578     const psFits    *fits               ///< psFits object
    7579 );
    7580 
    7581 /** Selects up to limit from the database and returns them in a binary FITS table
    7582  *
    7583  * This function assumes an empty psFits object and will create a FITS table
    7584  * as the first extension.
    7585  *
    7586  *  See psDBSelectRows() for documentation on the format of where.
    7587  *
    7588  * @return true on success
    7589  */
    7590 
    7591 bool warpSkyfileSelectRowsFits(
    7592     psDB            *dbh,               ///< Database handle
    7593     psFits          *fits,              ///< psFits object
    7594     const psMetadata *where,            ///< Row match criteria
    7595     unsigned long long limit            ///< Maximum number of elements to return
    7596 );
    7597 
    7598 /** Convert a warpSkyfileRow into an equivalent psMetadata
    7599  *
    7600  * @return A psMetadata pointer or NULL on error
    7601  */
    7602 
    7603 psMetadata *warpSkyfileMetadataFromObject(
    7604     const warpSkyfileRow *object             ///< fooRow to convert into a psMetadata
    7605 );
    7606 
    7607 /** Convert a psMetadata into an equivalent fooRow
    7608  *
    7609  * @return A warpSkyfileRow pointer or NULL on error
    7610  */
    7611 
    7612 warpSkyfileRow *warpSkyfileObjectFromMetadata(
    7613     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7614 );
    7615 /** Selects up to limit rows from the database and returns as warpSkyfileRow objects in a psArray
    7616  *
    7617  *  See psDBSelectRows() for documentation on the format of where.
    7618  *
    7619  * @return A psArray pointer or NULL on error
    7620  */
    7621 
    7622 psArray *warpSkyfileSelectRowObjects(
    7623     psDB            *dbh,               ///< Database handle
    7624     const psMetadata *where,            ///< Row match criteria
    7625     unsigned long long limit            ///< Maximum number of elements to return
    7626 );
    7627 /** Deletes a row from the database coresponding to an warpSkyfile
    7628  *
    7629  *  Note that a 'where' search psMetadata is constructed from each object and
    7630  *  used to find rows to delete.
    7631  *
    7632  * @return A The number of rows removed or a negative value on error
    7633  */
    7634 
    7635 bool warpSkyfileDeleteObject(
    7636     psDB            *dbh,               ///< Database handle
    7637     const warpSkyfileRow *object    ///< Object to delete
    7638 );
    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 and
    7642  *  used to find rows to delete.
    7643  *
    7644  * @return A The number of rows removed or a negative value on error
    7645  */
    7646 
    7647 long long warpSkyfileDeleteRowObjects(
    7648     psDB            *dbh,               ///< Database handle
    7649     const psArray   *objects,           ///< Array of objects to delete
    7650     unsigned long long limit            ///< Maximum number of elements to delete
    7651 );
    7652 /** Formats and prints an array of warpSkyfileRow objects
    7653  *
    7654  * When mdcf is set the formated output is in psMetadataConfig
    7655  * format, otherwise it is in a simple tabular format.
    7656  *
    7657  * @return true on success
    7658  */
    7659 
    7660 bool warpSkyfilePrintObjects(
    7661     FILE            *stream,            ///< a stream
    7662     psArray         *objects,           ///< An array of warpSkyfileRow objects
    7663     bool            mdcf                ///< format as mdconfig or simple
    7664 );
    7665 /** Formats and prints an warpSkyfileRow object
    7666  *
    7667  * When mdcf is set the formated output is in psMetadataConfig
    7668  * format, otherwise it is in a simple tabular format.
    7669  *
    7670  * @return true on success
    7671  */
    7672 
    7673 bool warpSkyfilePrintObject(
    7674     FILE            *stream,            ///< a stream
    7675     warpSkyfileRow *object,    ///< an warpSkyfileRow object
    7676     bool            mdcf                ///< format as mdconfig or simple
    7677 );
    7678 /** diffRunRow data structure
    7679  *
    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 object
    7694  *
    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_id
    7706 );
    7707 
    7708 /** Creates a new diffRun table
    7709  *
    7710  * @return true on success
    7711  */
    7712 
    7713 bool diffRunCreateTable(
    7714     psDB            *dbh                ///< Database handle
    7715 );
    7716 
    7717 /** Deletes a diffRun table
    7718  *
    7719  * @return true on success
    7720  */
    7721 
    7722 bool diffRunDropTable(
    7723     psDB            *dbh                ///< Database handle
    7724 );
    7725 
    7726 /** Insert a single row into a table
    7727  *
    7728  * This function constructs and inserts a single row based on it's parameters.
    7729  *
    7730  * @return true on success
    7731  */
    7732 
    7733 bool diffRunInsert(
    7734     psDB            *dbh,               ///< Database handle
    7735     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_id
    7742 );
    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 error
    7747  */
    7748 
    7749 long long diffRunDelete(
    7750     psDB            *dbh,               ///< Database handle
    7751     const psMetadata *where,            ///< Row match criteria
    7752     unsigned long long limit            ///< Maximum number of elements to delete
    7753 );
    7754 
    7755 /** Insert a single diffRunRow object into a table
    7756  *
    7757  * This function constructs and inserts a single row based on it's parameters.
    7758  *
    7759  * @return true on success
    7760  */
    7761 
    7762 bool diffRunInsertObject(
    7763     psDB            *dbh,               ///< Database handle
    7764     diffRunRow      *object             ///< diffRunRow object
    7765 );
    7766 
    7767 /** Insert an array of diffRunRow object into a table
    7768  *
    7769  * This function constructs and inserts multiple rows based on it's parameters.
    7770  *
    7771  * @return true on success
    7772  */
    7773 
    7774 bool diffRunInsertObjects(
    7775     psDB            *dbh,               ///< Database handle
    7776     psArray         *objects            ///< array of diffRunRow objects
    7777 );
    7778 
    7779 /** Insert data from a binary FITS table diffRunRow into the database
    7780  *
    7781  * This function expects a psFits object with a FITS table as the first
    7782  * extension.  The table must have at least one row of data in it, that is of
    7783  * the appropriate format (number of columns and their type).  All other
    7784  * extensions are ignored.
    7785  *
    7786  * @return true on success
    7787  */
    7788 
    7789 bool diffRunInsertFits(
    7790     psDB            *dbh,               ///< Database handle
    7791     const psFits    *fits               ///< psFits object
    7792 );
    7793 
    7794 /** Selects up to limit from the database and returns them in a binary FITS table
    7795  *
    7796  * This function assumes an empty psFits object and will create a FITS table
    7797  * as the first extension.
    7798  *
    7799  *  See psDBSelectRows() for documentation on the format of where.
    7800  *
    7801  * @return true on success
    7802  */
    7803 
    7804 bool diffRunSelectRowsFits(
    7805     psDB            *dbh,               ///< Database handle
    7806     psFits          *fits,              ///< psFits object
    7807     const psMetadata *where,            ///< Row match criteria
    7808     unsigned long long limit            ///< Maximum number of elements to return
    7809 );
    7810 
    7811 /** Convert a diffRunRow into an equivalent psMetadata
    7812  *
    7813  * @return A psMetadata pointer or NULL on error
    7814  */
    7815 
    7816 psMetadata *diffRunMetadataFromObject(
    7817     const diffRunRow *object             ///< fooRow to convert into a psMetadata
    7818 );
    7819 
    7820 /** Convert a psMetadata into an equivalent fooRow
    7821  *
    7822  * @return A diffRunRow pointer or NULL on error
    7823  */
    7824 
    7825 diffRunRow *diffRunObjectFromMetadata(
    7826     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7827 );
    7828 /** Selects up to limit rows from the database and returns as diffRunRow objects in a psArray
    7829  *
    7830  *  See psDBSelectRows() for documentation on the format of where.
    7831  *
    7832  * @return A psArray pointer or NULL on error
    7833  */
    7834 
    7835 psArray *diffRunSelectRowObjects(
    7836     psDB            *dbh,               ///< Database handle
    7837     const psMetadata *where,            ///< Row match criteria
    7838     unsigned long long limit            ///< Maximum number of elements to return
    7839 );
    7840 /** Deletes a row from the database coresponding to an diffRun
    7841  *
    7842  *  Note that a 'where' search psMetadata is constructed from each object and
    7843  *  used to find rows to delete.
    7844  *
    7845  * @return A The number of rows removed or a negative value on error
    7846  */
    7847 
    7848 bool diffRunDeleteObject(
    7849     psDB            *dbh,               ///< Database handle
    7850     const diffRunRow *object    ///< Object to delete
    7851 );
    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 and
    7855  *  used to find rows to delete.
    7856  *
    7857  * @return A The number of rows removed or a negative value on error
    7858  */
    7859 
    7860 long long diffRunDeleteRowObjects(
    7861     psDB            *dbh,               ///< Database handle
    7862     const psArray   *objects,           ///< Array of objects to delete
    7863     unsigned long long limit            ///< Maximum number of elements to delete
    7864 );
    7865 /** Formats and prints an array of diffRunRow objects
    7866  *
    7867  * When mdcf is set the formated output is in psMetadataConfig
    7868  * format, otherwise it is in a simple tabular format.
    7869  *
    7870  * @return true on success
    7871  */
    7872 
    7873 bool diffRunPrintObjects(
    7874     FILE            *stream,            ///< a stream
    7875     psArray         *objects,           ///< An array of diffRunRow objects
    7876     bool            mdcf                ///< format as mdconfig or simple
    7877 );
    7878 /** Formats and prints an diffRunRow object
    7879  *
    7880  * When mdcf is set the formated output is in psMetadataConfig
    7881  * format, otherwise it is in a simple tabular format.
    7882  *
    7883  * @return true on success
    7884  */
    7885 
    7886 bool diffRunPrintObject(
    7887     FILE            *stream,            ///< a stream
    7888     diffRunRow *object,    ///< an diffRunRow object
    7889     bool            mdcf                ///< format as mdconfig or simple
    7890 );
    7891 /** diffInputSkyfileRow data structure
    7892  *
    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 object
    7906  *
    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            template
    7917 );
    7918 
    7919 /** Creates a new diffInputSkyfile table
    7920  *
    7921  * @return true on success
    7922  */
    7923 
    7924 bool diffInputSkyfileCreateTable(
    7925     psDB            *dbh                ///< Database handle
    7926 );
    7927 
    7928 /** Deletes a diffInputSkyfile table
    7929  *
    7930  * @return true on success
    7931  */
    7932 
    7933 bool diffInputSkyfileDropTable(
    7934     psDB            *dbh                ///< Database handle
    7935 );
    7936 
    7937 /** Insert a single row into a table
    7938  *
    7939  * This function constructs and inserts a single row based on it's parameters.
    7940  *
    7941  * @return true on success
    7942  */
    7943 
    7944 bool diffInputSkyfileInsert(
    7945     psDB            *dbh,               ///< Database handle
    7946     psS64           diff_id,
    7947     psS64           warp_id,
    7948     const char      *skycell_id,
    7949     const char      *tess_id,
    7950     const char      *kind,
    7951     bool            template
    7952 );
    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 error
    7957  */
    7958 
    7959 long long diffInputSkyfileDelete(
    7960     psDB            *dbh,               ///< Database handle
    7961     const psMetadata *where,            ///< Row match criteria
    7962     unsigned long long limit            ///< Maximum number of elements to delete
    7963 );
    7964 
    7965 /** Insert a single diffInputSkyfileRow object into a table
    7966  *
    7967  * This function constructs and inserts a single row based on it's parameters.
    7968  *
    7969  * @return true on success
    7970  */
    7971 
    7972 bool diffInputSkyfileInsertObject(
    7973     psDB            *dbh,               ///< Database handle
    7974     diffInputSkyfileRow *object             ///< diffInputSkyfileRow object
    7975 );
    7976 
    7977 /** Insert an array of diffInputSkyfileRow object into a table
    7978  *
    7979  * This function constructs and inserts multiple rows based on it's parameters.
    7980  *
    7981  * @return true on success
    7982  */
    7983 
    7984 bool diffInputSkyfileInsertObjects(
    7985     psDB            *dbh,               ///< Database handle
    7986     psArray         *objects            ///< array of diffInputSkyfileRow objects
    7987 );
    7988 
    7989 /** Insert data from a binary FITS table diffInputSkyfileRow into the database
    7990  *
    7991  * This function expects a psFits object with a FITS table as the first
    7992  * extension.  The table must have at least one row of data in it, that is of
    7993  * the appropriate format (number of columns and their type).  All other
    7994  * extensions are ignored.
    7995  *
    7996  * @return true on success
    7997  */
    7998 
    7999 bool diffInputSkyfileInsertFits(
    8000     psDB            *dbh,               ///< Database handle
    8001     const psFits    *fits               ///< psFits object
    8002 );
    8003 
    8004 /** Selects up to limit from the database and returns them in a binary FITS table
    8005  *
    8006  * This function assumes an empty psFits object and will create a FITS table
    8007  * as the first extension.
    8008  *
    8009  *  See psDBSelectRows() for documentation on the format of where.
    8010  *
    8011  * @return true on success
    8012  */
    8013 
    8014 bool diffInputSkyfileSelectRowsFits(
    8015     psDB            *dbh,               ///< Database handle
    8016     psFits          *fits,              ///< psFits object
    8017     const psMetadata *where,            ///< Row match criteria
    8018     unsigned long long limit            ///< Maximum number of elements to return
    8019 );
    8020 
    8021 /** Convert a diffInputSkyfileRow into an equivalent psMetadata
    8022  *
    8023  * @return A psMetadata pointer or NULL on error
    8024  */
    8025 
    8026 psMetadata *diffInputSkyfileMetadataFromObject(
    8027     const diffInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
    8028 );
    8029 
    8030 /** Convert a psMetadata into an equivalent fooRow
    8031  *
    8032  * @return A diffInputSkyfileRow pointer or NULL on error
    8033  */
    8034 
    8035 diffInputSkyfileRow *diffInputSkyfileObjectFromMetadata(
    8036     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8037 );
    8038 /** Selects up to limit rows from the database and returns as diffInputSkyfileRow objects in a psArray
    8039  *
    8040  *  See psDBSelectRows() for documentation on the format of where.
    8041  *
    8042  * @return A psArray pointer or NULL on error
    8043  */
    8044 
    8045 psArray *diffInputSkyfileSelectRowObjects(
    8046     psDB            *dbh,               ///< Database handle
    8047     const psMetadata *where,            ///< Row match criteria
    8048     unsigned long long limit            ///< Maximum number of elements to return
    8049 );
    8050 /** Deletes a row from the database coresponding to an diffInputSkyfile
    8051  *
    8052  *  Note that a 'where' search psMetadata is constructed from each object and
    8053  *  used to find rows to delete.
    8054  *
    8055  * @return A The number of rows removed or a negative value on error
    8056  */
    8057 
    8058 bool diffInputSkyfileDeleteObject(
    8059     psDB            *dbh,               ///< Database handle
    8060     const diffInputSkyfileRow *object    ///< Object to delete
    8061 );
    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 and
    8065  *  used to find rows to delete.
    8066  *
    8067  * @return A The number of rows removed or a negative value on error
    8068  */
    8069 
    8070 long long diffInputSkyfileDeleteRowObjects(
    8071     psDB            *dbh,               ///< Database handle
    8072     const psArray   *objects,           ///< Array of objects to delete
    8073     unsigned long long limit            ///< Maximum number of elements to delete
    8074 );
    8075 /** Formats and prints an array of diffInputSkyfileRow objects
    8076  *
    8077  * When mdcf is set the formated output is in psMetadataConfig
    8078  * format, otherwise it is in a simple tabular format.
    8079  *
    8080  * @return true on success
    8081  */
    8082 
    8083 bool diffInputSkyfilePrintObjects(
    8084     FILE            *stream,            ///< a stream
    8085     psArray         *objects,           ///< An array of diffInputSkyfileRow objects
    8086     bool            mdcf                ///< format as mdconfig or simple
    8087 );
    8088 /** Formats and prints an diffInputSkyfileRow object
    8089  *
    8090  * When mdcf is set the formated output is in psMetadataConfig
    8091  * format, otherwise it is in a simple tabular format.
    8092  *
    8093  * @return true on success
    8094  */
    8095 
    8096 bool diffInputSkyfilePrintObject(
    8097     FILE            *stream,            ///< a stream
    8098     diffInputSkyfileRow *object,    ///< an diffInputSkyfileRow object
    8099     bool            mdcf                ///< format as mdconfig or simple
    8100 );
    8101 /** diffSkyfileRow data structure
    8102  *
    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 object
    8114  *
    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_stdev
    8123 );
    8124 
    8125 /** Creates a new diffSkyfile table
    8126  *
    8127  * @return true on success
    8128  */
    8129 
    8130 bool diffSkyfileCreateTable(
    8131     psDB            *dbh                ///< Database handle
    8132 );
    8133 
    8134 /** Deletes a diffSkyfile table
    8135  *
    8136  * @return true on success
    8137  */
    8138 
    8139 bool diffSkyfileDropTable(
    8140     psDB            *dbh                ///< Database handle
    8141 );
    8142 
    8143 /** Insert a single row into a table
    8144  *
    8145  * This function constructs and inserts a single row based on it's parameters.
    8146  *
    8147  * @return true on success
    8148  */
    8149 
    8150 bool diffSkyfileInsert(
    8151     psDB            *dbh,               ///< Database handle
    8152     psS64           diff_id,
    8153     const char      *uri,
    8154     psF64           bg,
    8155     psF64           bg_stdev
    8156 );
    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 error
    8161  */
    8162 
    8163 long long diffSkyfileDelete(
    8164     psDB            *dbh,               ///< Database handle
    8165     const psMetadata *where,            ///< Row match criteria
    8166     unsigned long long limit            ///< Maximum number of elements to delete
    8167 );
    8168 
    8169 /** Insert a single diffSkyfileRow object into a table
    8170  *
    8171  * This function constructs and inserts a single row based on it's parameters.
    8172  *
    8173  * @return true on success
    8174  */
    8175 
    8176 bool diffSkyfileInsertObject(
    8177     psDB            *dbh,               ///< Database handle
    8178     diffSkyfileRow  *object             ///< diffSkyfileRow object
    8179 );
    8180 
    8181 /** Insert an array of diffSkyfileRow object into a table
    8182  *
    8183  * This function constructs and inserts multiple rows based on it's parameters.
    8184  *
    8185  * @return true on success
    8186  */
    8187 
    8188 bool diffSkyfileInsertObjects(
    8189     psDB            *dbh,               ///< Database handle
    8190     psArray         *objects            ///< array of diffSkyfileRow objects
    8191 );
    8192 
    8193 /** Insert data from a binary FITS table diffSkyfileRow into the database
    8194  *
    8195  * This function expects a psFits object with a FITS table as the first
    8196  * extension.  The table must have at least one row of data in it, that is of
    8197  * the appropriate format (number of columns and their type).  All other
    8198  * extensions are ignored.
    8199  *
    8200  * @return true on success
    8201  */
    8202 
    8203 bool diffSkyfileInsertFits(
    8204     psDB            *dbh,               ///< Database handle
    8205     const psFits    *fits               ///< psFits object
    8206 );
    8207 
    8208 /** Selects up to limit from the database and returns them in a binary FITS table
    8209  *
    8210  * This function assumes an empty psFits object and will create a FITS table
    8211  * as the first extension.
    8212  *
    8213  *  See psDBSelectRows() for documentation on the format of where.
    8214  *
    8215  * @return true on success
    8216  */
    8217 
    8218 bool diffSkyfileSelectRowsFits(
    8219     psDB            *dbh,               ///< Database handle
    8220     psFits          *fits,              ///< psFits object
    8221     const psMetadata *where,            ///< Row match criteria
    8222     unsigned long long limit            ///< Maximum number of elements to return
    8223 );
    8224 
    8225 /** Convert a diffSkyfileRow into an equivalent psMetadata
    8226  *
    8227  * @return A psMetadata pointer or NULL on error
    8228  */
    8229 
    8230 psMetadata *diffSkyfileMetadataFromObject(
    8231     const diffSkyfileRow *object             ///< fooRow to convert into a psMetadata
    8232 );
    8233 
    8234 /** Convert a psMetadata into an equivalent fooRow
    8235  *
    8236  * @return A diffSkyfileRow pointer or NULL on error
    8237  */
    8238 
    8239 diffSkyfileRow *diffSkyfileObjectFromMetadata(
    8240     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8241 );
    8242 /** Selects up to limit rows from the database and returns as diffSkyfileRow objects in a psArray
    8243  *
    8244  *  See psDBSelectRows() for documentation on the format of where.
    8245  *
    8246  * @return A psArray pointer or NULL on error
    8247  */
    8248 
    8249 psArray *diffSkyfileSelectRowObjects(
    8250     psDB            *dbh,               ///< Database handle
    8251     const psMetadata *where,            ///< Row match criteria
    8252     unsigned long long limit            ///< Maximum number of elements to return
    8253 );
    8254 /** Deletes a row from the database coresponding to an diffSkyfile
    8255  *
    8256  *  Note that a 'where' search psMetadata is constructed from each object and
    8257  *  used to find rows to delete.
    8258  *
    8259  * @return A The number of rows removed or a negative value on error
    8260  */
    8261 
    8262 bool diffSkyfileDeleteObject(
    8263     psDB            *dbh,               ///< Database handle
    8264     const diffSkyfileRow *object    ///< Object to delete
    8265 );
    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 and
    8269  *  used to find rows to delete.
    8270  *
    8271  * @return A The number of rows removed or a negative value on error
    8272  */
    8273 
    8274 long long diffSkyfileDeleteRowObjects(
    8275     psDB            *dbh,               ///< Database handle
    8276     const psArray   *objects,           ///< Array of objects to delete
    8277     unsigned long long limit            ///< Maximum number of elements to delete
    8278 );
    8279 /** Formats and prints an array of diffSkyfileRow objects
    8280  *
    8281  * When mdcf is set the formated output is in psMetadataConfig
    8282  * format, otherwise it is in a simple tabular format.
    8283  *
    8284  * @return true on success
    8285  */
    8286 
    8287 bool diffSkyfilePrintObjects(
    8288     FILE            *stream,            ///< a stream
    8289     psArray         *objects,           ///< An array of diffSkyfileRow objects
    8290     bool            mdcf                ///< format as mdconfig or simple
    8291 );
    8292 /** Formats and prints an diffSkyfileRow object
    8293  *
    8294  * When mdcf is set the formated output is in psMetadataConfig
    8295  * format, otherwise it is in a simple tabular format.
    8296  *
    8297  * @return true on success
    8298  */
    8299 
    8300 bool diffSkyfilePrintObject(
    8301     FILE            *stream,            ///< a stream
    8302     diffSkyfileRow *object,    ///< an diffSkyfileRow object
    8303     bool            mdcf                ///< format as mdconfig or simple
    8304 );
    8305 /** stackRunRow data structure
    8306  *
    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 object
    8321  *
    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_id
    8333 );
    8334 
    8335 /** Creates a new stackRun table
    8336  *
    8337  * @return true on success
    8338  */
    8339 
    8340 bool stackRunCreateTable(
    8341     psDB            *dbh                ///< Database handle
    8342 );
    8343 
    8344 /** Deletes a stackRun table
    8345  *
    8346  * @return true on success
    8347  */
    8348 
    8349 bool stackRunDropTable(
    8350     psDB            *dbh                ///< Database handle
    8351 );
    8352 
    8353 /** Insert a single row into a table
    8354  *
    8355  * This function constructs and inserts a single row based on it's parameters.
    8356  *
    8357  * @return true on success
    8358  */
    8359 
    8360 bool stackRunInsert(
    8361     psDB            *dbh,               ///< Database handle
    8362     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_id
    8369 );
    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 error
    8374  */
    8375 
    8376 long long stackRunDelete(
    8377     psDB            *dbh,               ///< Database handle
    8378     const psMetadata *where,            ///< Row match criteria
    8379     unsigned long long limit            ///< Maximum number of elements to delete
    8380 );
    8381 
    8382 /** Insert a single stackRunRow object into a table
    8383  *
    8384  * This function constructs and inserts a single row based on it's parameters.
    8385  *
    8386  * @return true on success
    8387  */
    8388 
    8389 bool stackRunInsertObject(
    8390     psDB            *dbh,               ///< Database handle
    8391     stackRunRow     *object             ///< stackRunRow object
    8392 );
    8393 
    8394 /** Insert an array of stackRunRow object into a table
    8395  *
    8396  * This function constructs and inserts multiple rows based on it's parameters.
    8397  *
    8398  * @return true on success
    8399  */
    8400 
    8401 bool stackRunInsertObjects(
    8402     psDB            *dbh,               ///< Database handle
    8403     psArray         *objects            ///< array of stackRunRow objects
    8404 );
    8405 
    8406 /** Insert data from a binary FITS table stackRunRow into the database
    8407  *
    8408  * This function expects a psFits object with a FITS table as the first
    8409  * extension.  The table must have at least one row of data in it, that is of
    8410  * the appropriate format (number of columns and their type).  All other
    8411  * extensions are ignored.
    8412  *
    8413  * @return true on success
    8414  */
    8415 
    8416 bool stackRunInsertFits(
    8417     psDB            *dbh,               ///< Database handle
    8418     const psFits    *fits               ///< psFits object
    8419 );
    8420 
    8421 /** Selects up to limit from the database and returns them in a binary FITS table
    8422  *
    8423  * This function assumes an empty psFits object and will create a FITS table
    8424  * as the first extension.
    8425  *
    8426  *  See psDBSelectRows() for documentation on the format of where.
    8427  *
    8428  * @return true on success
    8429  */
    8430 
    8431 bool stackRunSelectRowsFits(
    8432     psDB            *dbh,               ///< Database handle
    8433     psFits          *fits,              ///< psFits object
    8434     const psMetadata *where,            ///< Row match criteria
    8435     unsigned long long limit            ///< Maximum number of elements to return
    8436 );
    8437 
    8438 /** Convert a stackRunRow into an equivalent psMetadata
    8439  *
    8440  * @return A psMetadata pointer or NULL on error
    8441  */
    8442 
    8443 psMetadata *stackRunMetadataFromObject(
    8444     const stackRunRow *object             ///< fooRow to convert into a psMetadata
    8445 );
    8446 
    8447 /** Convert a psMetadata into an equivalent fooRow
    8448  *
    8449  * @return A stackRunRow pointer or NULL on error
    8450  */
    8451 
    8452 stackRunRow *stackRunObjectFromMetadata(
    8453     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8454 );
    8455 /** Selects up to limit rows from the database and returns as stackRunRow objects in a psArray
    8456  *
    8457  *  See psDBSelectRows() for documentation on the format of where.
    8458  *
    8459  * @return A psArray pointer or NULL on error
    8460  */
    8461 
    8462 psArray *stackRunSelectRowObjects(
    8463     psDB            *dbh,               ///< Database handle
    8464     const psMetadata *where,            ///< Row match criteria
    8465     unsigned long long limit            ///< Maximum number of elements to return
    8466 );
    8467 /** Deletes a row from the database coresponding to an stackRun
    8468  *
    8469  *  Note that a 'where' search psMetadata is constructed from each object and
    8470  *  used to find rows to delete.
    8471  *
    8472  * @return A The number of rows removed or a negative value on error
    8473  */
    8474 
    8475 bool stackRunDeleteObject(
    8476     psDB            *dbh,               ///< Database handle
    8477     const stackRunRow *object    ///< Object to delete
    8478 );
    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 and
    8482  *  used to find rows to delete.
    8483  *
    8484  * @return A The number of rows removed or a negative value on error
    8485  */
    8486 
    8487 long long stackRunDeleteRowObjects(
    8488     psDB            *dbh,               ///< Database handle
    8489     const psArray   *objects,           ///< Array of objects to delete
    8490     unsigned long long limit            ///< Maximum number of elements to delete
    8491 );
    8492 /** Formats and prints an array of stackRunRow objects
    8493  *
    8494  * When mdcf is set the formated output is in psMetadataConfig
    8495  * format, otherwise it is in a simple tabular format.
    8496  *
    8497  * @return true on success
    8498  */
    8499 
    8500 bool stackRunPrintObjects(
    8501     FILE            *stream,            ///< a stream
    8502     psArray         *objects,           ///< An array of stackRunRow objects
    8503     bool            mdcf                ///< format as mdconfig or simple
    8504 );
    8505 /** Formats and prints an stackRunRow object
    8506  *
    8507  * When mdcf is set the formated output is in psMetadataConfig
    8508  * format, otherwise it is in a simple tabular format.
    8509  *
    8510  * @return true on success
    8511  */
    8512 
    8513 bool stackRunPrintObject(
    8514     FILE            *stream,            ///< a stream
    8515     stackRunRow *object,    ///< an stackRunRow object
    8516     bool            mdcf                ///< format as mdconfig or simple
    8517 );
    8518 /** stackInputSkyfileRow data structure
    8519  *
    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 object
    8529  *
    8530  *  @return A new stackInputSkyfileRow object or NULL on failure.
    8531  */
    8532 
    8533 stackInputSkyfileRow *stackInputSkyfileRowAlloc(
    8534     psS64           stack_id,
    8535     psS64           warp_id
    8536 );
    8537 
    8538 /** Creates a new stackInputSkyfile table
    8539  *
    8540  * @return true on success
    8541  */
    8542 
    8543 bool stackInputSkyfileCreateTable(
    8544     psDB            *dbh                ///< Database handle
    8545 );
    8546 
    8547 /** Deletes a stackInputSkyfile table
    8548  *
    8549  * @return true on success
    8550  */
    8551 
    8552 bool stackInputSkyfileDropTable(
    8553     psDB            *dbh                ///< Database handle
    8554 );
    8555 
    8556 /** Insert a single row into a table
    8557  *
    8558  * This function constructs and inserts a single row based on it's parameters.
    8559  *
    8560  * @return true on success
    8561  */
    8562 
    8563 bool stackInputSkyfileInsert(
    8564     psDB            *dbh,               ///< Database handle
    8565     psS64           stack_id,
    8566     psS64           warp_id
    8567 );
    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 error
    8572  */
    8573 
    8574 long long stackInputSkyfileDelete(
    8575     psDB            *dbh,               ///< Database handle
    8576     const psMetadata *where,            ///< Row match criteria
    8577     unsigned long long limit            ///< Maximum number of elements to delete
    8578 );
    8579 
    8580 /** Insert a single stackInputSkyfileRow object into a table
    8581  *
    8582  * This function constructs and inserts a single row based on it's parameters.
    8583  *
    8584  * @return true on success
    8585  */
    8586 
    8587 bool stackInputSkyfileInsertObject(
    8588     psDB            *dbh,               ///< Database handle
    8589     stackInputSkyfileRow *object             ///< stackInputSkyfileRow object
    8590 );
    8591 
    8592 /** Insert an array of stackInputSkyfileRow object into a table
    8593  *
    8594  * This function constructs and inserts multiple rows based on it's parameters.
    8595  *
    8596  * @return true on success
    8597  */
    8598 
    8599 bool stackInputSkyfileInsertObjects(
    8600     psDB            *dbh,               ///< Database handle
    8601     psArray         *objects            ///< array of stackInputSkyfileRow objects
    8602 );
    8603 
    8604 /** Insert data from a binary FITS table stackInputSkyfileRow into the database
    8605  *
    8606  * This function expects a psFits object with a FITS table as the first
    8607  * extension.  The table must have at least one row of data in it, that is of
    8608  * the appropriate format (number of columns and their type).  All other
    8609  * extensions are ignored.
    8610  *
    8611  * @return true on success
    8612  */
    8613 
    8614 bool stackInputSkyfileInsertFits(
    8615     psDB            *dbh,               ///< Database handle
    8616     const psFits    *fits               ///< psFits object
    8617 );
    8618 
    8619 /** Selects up to limit from the database and returns them in a binary FITS table
    8620  *
    8621  * This function assumes an empty psFits object and will create a FITS table
    8622  * as the first extension.
    8623  *
    8624  *  See psDBSelectRows() for documentation on the format of where.
    8625  *
    8626  * @return true on success
    8627  */
    8628 
    8629 bool stackInputSkyfileSelectRowsFits(
    8630     psDB            *dbh,               ///< Database handle
    8631     psFits          *fits,              ///< psFits object
    8632     const psMetadata *where,            ///< Row match criteria
    8633     unsigned long long limit            ///< Maximum number of elements to return
    8634 );
    8635 
    8636 /** Convert a stackInputSkyfileRow into an equivalent psMetadata
    8637  *
    8638  * @return A psMetadata pointer or NULL on error
    8639  */
    8640 
    8641 psMetadata *stackInputSkyfileMetadataFromObject(
    8642     const stackInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
    8643 );
    8644 
    8645 /** Convert a psMetadata into an equivalent fooRow
    8646  *
    8647  * @return A stackInputSkyfileRow pointer or NULL on error
    8648  */
    8649 
    8650 stackInputSkyfileRow *stackInputSkyfileObjectFromMetadata(
    8651     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8652 );
    8653 /** Selects up to limit rows from the database and returns as stackInputSkyfileRow objects in a psArray
    8654  *
    8655  *  See psDBSelectRows() for documentation on the format of where.
    8656  *
    8657  * @return A psArray pointer or NULL on error
    8658  */
    8659 
    8660 psArray *stackInputSkyfileSelectRowObjects(
    8661     psDB            *dbh,               ///< Database handle
    8662     const psMetadata *where,            ///< Row match criteria
    8663     unsigned long long limit            ///< Maximum number of elements to return
    8664 );
    8665 /** Deletes a row from the database coresponding to an stackInputSkyfile
    8666  *
    8667  *  Note that a 'where' search psMetadata is constructed from each object and
    8668  *  used to find rows to delete.
    8669  *
    8670  * @return A The number of rows removed or a negative value on error
    8671  */
    8672 
    8673 bool stackInputSkyfileDeleteObject(
    8674     psDB            *dbh,               ///< Database handle
    8675     const stackInputSkyfileRow *object    ///< Object to delete
    8676 );
    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 and
    8680  *  used to find rows to delete.
    8681  *
    8682  * @return A The number of rows removed or a negative value on error
    8683  */
    8684 
    8685 long long stackInputSkyfileDeleteRowObjects(
    8686     psDB            *dbh,               ///< Database handle
    8687     const psArray   *objects,           ///< Array of objects to delete
    8688     unsigned long long limit            ///< Maximum number of elements to delete
    8689 );
    8690 /** Formats and prints an array of stackInputSkyfileRow objects
    8691  *
    8692  * When mdcf is set the formated output is in psMetadataConfig
    8693  * format, otherwise it is in a simple tabular format.
    8694  *
    8695  * @return true on success
    8696  */
    8697 
    8698 bool stackInputSkyfilePrintObjects(
    8699     FILE            *stream,            ///< a stream
    8700     psArray         *objects,           ///< An array of stackInputSkyfileRow objects
    8701     bool            mdcf                ///< format as mdconfig or simple
    8702 );
    8703 /** Formats and prints an stackInputSkyfileRow object
    8704  *
    8705  * When mdcf is set the formated output is in psMetadataConfig
    8706  * format, otherwise it is in a simple tabular format.
    8707  *
    8708  * @return true on success
    8709  */
    8710 
    8711 bool stackInputSkyfilePrintObject(
    8712     FILE            *stream,            ///< a stream
    8713     stackInputSkyfileRow *object,    ///< an stackInputSkyfileRow object
    8714     bool            mdcf                ///< format as mdconfig or simple
    8715 );
    8716 /** stackSumSkyfileRow data structure
    8717  *
    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 object
    8729  *
    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_stdev
    8738 );
    8739 
    8740 /** Creates a new stackSumSkyfile table
    8741  *
    8742  * @return true on success
    8743  */
    8744 
    8745 bool stackSumSkyfileCreateTable(
    8746     psDB            *dbh                ///< Database handle
    8747 );
    8748 
    8749 /** Deletes a stackSumSkyfile table
    8750  *
    8751  * @return true on success
    8752  */
    8753 
    8754 bool stackSumSkyfileDropTable(
    8755     psDB            *dbh                ///< Database handle
    8756 );
    8757 
    8758 /** Insert a single row into a table
    8759  *
    8760  * This function constructs and inserts a single row based on it's parameters.
    8761  *
    8762  * @return true on success
    8763  */
    8764 
    8765 bool stackSumSkyfileInsert(
    8766     psDB            *dbh,               ///< Database handle
    8767     psS64           stack_id,
    8768     const char      *uri,
    8769     psF64           bg,
    8770     psF64           bg_stdev
    8771 );
    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 error
    8776  */
    8777 
    8778 long long stackSumSkyfileDelete(
    8779     psDB            *dbh,               ///< Database handle
    8780     const psMetadata *where,            ///< Row match criteria
    8781     unsigned long long limit            ///< Maximum number of elements to delete
    8782 );
    8783 
    8784 /** Insert a single stackSumSkyfileRow object into a table
    8785  *
    8786  * This function constructs and inserts a single row based on it's parameters.
    8787  *
    8788  * @return true on success
    8789  */
    8790 
    8791 bool stackSumSkyfileInsertObject(
    8792     psDB            *dbh,               ///< Database handle
    8793     stackSumSkyfileRow *object             ///< stackSumSkyfileRow object
    8794 );
    8795 
    8796 /** Insert an array of stackSumSkyfileRow object into a table
    8797  *
    8798  * This function constructs and inserts multiple rows based on it's parameters.
    8799  *
    8800  * @return true on success
    8801  */
    8802 
    8803 bool stackSumSkyfileInsertObjects(
    8804     psDB            *dbh,               ///< Database handle
    8805     psArray         *objects            ///< array of stackSumSkyfileRow objects
    8806 );
    8807 
    8808 /** Insert data from a binary FITS table stackSumSkyfileRow into the database
    8809  *
    8810  * This function expects a psFits object with a FITS table as the first
    8811  * extension.  The table must have at least one row of data in it, that is of
    8812  * the appropriate format (number of columns and their type).  All other
    8813  * extensions are ignored.
    8814  *
    8815  * @return true on success
    8816  */
    8817 
    8818 bool stackSumSkyfileInsertFits(
    8819     psDB            *dbh,               ///< Database handle
    8820     const psFits    *fits               ///< psFits object
    8821 );
    8822 
    8823 /** Selects up to limit from the database and returns them in a binary FITS table
    8824  *
    8825  * This function assumes an empty psFits object and will create a FITS table
    8826  * as the first extension.
    8827  *
    8828  *  See psDBSelectRows() for documentation on the format of where.
    8829  *
    8830  * @return true on success
    8831  */
    8832 
    8833 bool stackSumSkyfileSelectRowsFits(
    8834     psDB            *dbh,               ///< Database handle
    8835     psFits          *fits,              ///< psFits object
    8836     const psMetadata *where,            ///< Row match criteria
    8837     unsigned long long limit            ///< Maximum number of elements to return
    8838 );
    8839 
    8840 /** Convert a stackSumSkyfileRow into an equivalent psMetadata
    8841  *
    8842  * @return A psMetadata pointer or NULL on error
    8843  */
    8844 
    8845 psMetadata *stackSumSkyfileMetadataFromObject(
    8846     const stackSumSkyfileRow *object             ///< fooRow to convert into a psMetadata
    8847 );
    8848 
    8849 /** Convert a psMetadata into an equivalent fooRow
    8850  *
    8851  * @return A stackSumSkyfileRow pointer or NULL on error
    8852  */
    8853 
    8854 stackSumSkyfileRow *stackSumSkyfileObjectFromMetadata(
    8855     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8856 );
    8857 /** Selects up to limit rows from the database and returns as stackSumSkyfileRow objects in a psArray
    8858  *
    8859  *  See psDBSelectRows() for documentation on the format of where.
    8860  *
    8861  * @return A psArray pointer or NULL on error
    8862  */
    8863 
    8864 psArray *stackSumSkyfileSelectRowObjects(
    8865     psDB            *dbh,               ///< Database handle
    8866     const psMetadata *where,            ///< Row match criteria
    8867     unsigned long long limit            ///< Maximum number of elements to return
    8868 );
    8869 /** Deletes a row from the database coresponding to an stackSumSkyfile
    8870  *
    8871  *  Note that a 'where' search psMetadata is constructed from each object and
    8872  *  used to find rows to delete.
    8873  *
    8874  * @return A The number of rows removed or a negative value on error
    8875  */
    8876 
    8877 bool stackSumSkyfileDeleteObject(
    8878     psDB            *dbh,               ///< Database handle
    8879     const stackSumSkyfileRow *object    ///< Object to delete
    8880 );
    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 and
    8884  *  used to find rows to delete.
    8885  *
    8886  * @return A The number of rows removed or a negative value on error
    8887  */
    8888 
    8889 long long stackSumSkyfileDeleteRowObjects(
    8890     psDB            *dbh,               ///< Database handle
    8891     const psArray   *objects,           ///< Array of objects to delete
    8892     unsigned long long limit            ///< Maximum number of elements to delete
    8893 );
    8894 /** Formats and prints an array of stackSumSkyfileRow objects
    8895  *
    8896  * When mdcf is set the formated output is in psMetadataConfig
    8897  * format, otherwise it is in a simple tabular format.
    8898  *
    8899  * @return true on success
    8900  */
    8901 
    8902 bool stackSumSkyfilePrintObjects(
    8903     FILE            *stream,            ///< a stream
    8904     psArray         *objects,           ///< An array of stackSumSkyfileRow objects
    8905     bool            mdcf                ///< format as mdconfig or simple
    8906 );
    8907 /** Formats and prints an stackSumSkyfileRow object
    8908  *
    8909  * When mdcf is set the formated output is in psMetadataConfig
    8910  * format, otherwise it is in a simple tabular format.
    8911  *
    8912  * @return true on success
    8913  */
    8914 
    8915 bool stackSumSkyfilePrintObject(
    8916     FILE            *stream,            ///< a stream
    8917     stackSumSkyfileRow *object,    ///< an stackSumSkyfileRow object
    8918     bool            mdcf                ///< format as mdconfig or simple
    8919 );
    89208920
    89218921/// @}
     
    89258925#endif
    89268926
    8927 #endif // STACKSUMSKYFILE_DB_H
     8927#endif // DETRUNSUMMARY_DB_H
Note: See TracChangeset for help on using the changeset viewer.