IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 3, 2006, 6:18:57 PM (20 years ago)
Author:
jhoblitt
Message:

large database schema change -> add airmass, ra, decl, exp_time, & background to exps
several memory leaks
add some transactions to p0search & p2search
fix p2search -done's handling of p2Done* tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/guidetool.c

    r7038 r8120  
    1010static bool pendingMode(pxConfig *config);
    1111static bool defineMode(pxConfig *config);
    12 static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *raw);
     12static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *exp);
    1313
    1414int main(int argc, char **argv)
     
    104104}
    105105
    106 static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *raw)
     106static p1PendingExpRow *rawScienceTop1PendingExp(pxConfig *config, rawScienceExpRow *exp)
    107107{
     108    PS_ASSERT_PTR_NON_NULL(config, NULL);
     109    PS_ASSERT_PTR_NON_NULL(exp, NULL);
     110
     111    bool status = false;
     112    psString filter = psMetadataLookupStr(&status, config->args, "-filter");
     113    if (!status) {
     114        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -filter");
     115        return false;
     116    }
     117    if (!filter) {
     118        psError(PS_ERR_UNKNOWN, true, "-filter is required");
     119        return false;
     120    }
     121    psF32 airmass = psMetadataLookupF32(&status, config->args, "-airmass");
     122    if (!status) {
     123        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -airmass");
     124        return false;
     125    }
     126    if (!airmass) {
     127        psError(PS_ERR_UNKNOWN, true, "-airmass is required");
     128        return false;
     129    }
     130    psF64 ra = psMetadataLookupF64(&status, config->args, "-ra");
     131    if (!status) {
     132        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -ra");
     133        return false;
     134    }
     135    if (!ra) {
     136        psError(PS_ERR_UNKNOWN, true, "-airmass is required");
     137        return false;
     138    }
     139    psF64 dec = psMetadataLookupF64(&status, config->args, "-dec");
     140    if (!status) {
     141        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dec");
     142        return false;
     143    }
     144    if (!dec) {
     145        psError(PS_ERR_UNKNOWN, true, "-dec is required");
     146        return false;
     147    }
     148    psF32 exp_time = psMetadataLookupF32(&status, config->args, "-exp_time");
     149    if (!status) {
     150        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_time");
     151        return false;
     152    }
     153    if (!exp_time) {
     154        psError(PS_ERR_UNKNOWN, true, "-exp_time is required");
     155        return false;
     156    }
     157    psF64 background = psMetadataLookupF64(&status, config->args, "-background");
     158    if (!status) {
     159        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -background");
     160        return false;
     161    }
     162    if (!exp_time) {
     163        psError(PS_ERR_UNKNOWN, true, "-background is required");
     164        return false;
     165    }
     166
    108167    return p1PendingExpRowAlloc(
    109         raw->exp_id,
    110         raw->camera,
    111         raw->telescope,
    112         raw->exp_type,
    113 //        newExp->class,
    114         raw->imfiles,
    115         raw->filter,
    116         raw->stats,
    117         "my recipe",                    //recipe
    118         0xff                            // XXX calc version number
     168        exp->exp_id,
     169        exp->camera,
     170        exp->telescope,
     171        exp->exp_type,
     172        exp->imfiles,
     173        filter,
     174        airmass,
     175        ra,
     176        dec,
     177        exp_time,
     178        background,
     179        "my recipe",
     180        0xff // XXX calc version number
    119181    );
    120182}
Note: See TracChangeset for help on using the changeset viewer.