IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 31, 2005, 2:21:54 PM (21 years ago)
Author:
eugene
Message:

fleshing out p2search, added p2admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/p2tools/src/p2search.c

    r5868 r5869  
    11# include "p2search.h"
    2 
    3 typedef enum {
    4     P2_MODE_NONE,                       // grab from raw, output for ppImage
    5     P2_MODE_QUICK,                      // grab from raw, output for ppImage
    6     P2_MODE_DEFINE,                     // grab from raw, create pending
    7     P2_MODE_PENDING,                    // grab from pending, output for ppImage
    8     P2_MODE_UPDATE,                     // set the current state
    9 } p2Mode;
    10 
    11 typedef struct {
    12     p2Mode mode;
    13     psTime start;
    14     psTime stop;
    15     psSphere r1;
    16     psSphere r2;
    17     char *camera;
    18     char *filter;
    19 } p2Config;
    20 
    21 // this structure should be defined using the mddb api tools
    22 typedef struct {
    23     char expID[32];                     // free-form exposure ID string
    24     char class;                         // class of file: fpa (0), chip (1), cell (2), readout (3)?
    25     int Nclass;                         // number of files of this class
    26     char camera[32];                    // free-form camera ID string
    27     char filter[32];                    // free-form filter ID string
    28     psTime time_start;                  // exposure start time
    29     psTime time_stop;                   // exposure stop time
    30     psTime exptime;                     // exposure duration (seconds)
    31     char exptype;                       // type of exposure: object (0), bias (1), dark (2), flat (3), etc
    32     float sky;                          // measure sky brightness
    33     float seeing;                       // measured image quality
    34     float dettemp;                      // temperature of detector
    35 } p2RawExposure;
    36 
    37 // this structure should be defined using the mddb api tools
    38 typedef struct {
    39     char expID[32];                     // free-form exposure ID string
    40     char class;                         // class of file: fpa (0), chip (1), cell (2), readout (3)?
    41     char classID[32];                   // identifier for class (chip00, cell00, etc)
    42     char url[128];                      // locator for file (neb / file)
    43     char state;                         // current load state
    44 } p2RawImage;
    45 
    46 typedef struct {
    47     p2RawExposure *exposure;
    48     psArray *images;
    49 } p2RawSet;
    502
    513int main (int argc, char **argv) {
    524
    53     p2SearchConfig (&config, argc, argv);
     5    psArray *rawFrames;
     6    psArray *doneFrames;
     7    psArray *pendingFrames;
    548
    55     if ((config->mode == P2_MODE_QUICK) || (config->mode == P2_MODE_DEFINE)) {
    56         rawSet = p2SearchRawImages (config);
     9    p2searchConfig (&config, argc, argv);
     10
     11    if (config->mode == P2_MODE_QUICK) {
     12        rawFrames = p2searchRawFrames (config);
     13        pendingFrames = p2rawToPending (config, rawFrames);
     14        p2writePendingFrames (config, pendingFrames);
     15    }   
     16
     17    if (config->mode == P2_MODE_DEFINE) {
     18        rawFrames = p2searchRawFrames (config);
     19        p2insertPendingFrames (config, rawFrames);
    5720    }
    5821
    59     if (config->mode == P2_MODE_DEFINE) {
    60         p2InsertRawSet (config, rawSet);
    61     }
    62 
    63     if ((config->mode == P2_MODE_PENDING) || (config->mode == P2_MODE_UPDATE)) {
    64         pendingSet = p2SearchPendingImages (config);
    65     }
    66 
    67     if (config->mode == P2_MODE_QUICK) {
    68         pendingSet = p2RawToPending (config, rawSet);
    69     }
    70 
    71     if ((config->mode == P2_MODE_QUICK) || (config->mode == P2_MODE_PENDING)) {
    72         p2WritePending (config, pendingSet);
     22    if (config->mode == P2_MODE_PENDING) {
     23        pendingFrames = p2searchPendingFrames (config, FALSE);
     24        p2writePendingImages (config, pendingFrames);
    7325    }
    7426
    7527    if (config->mode == P2_MODE_UPDATE) {
    76         p2UpdatePending (config, pendingSet);
     28        p2updatePendingFrames (config, pendingFrames);
     29    }
     30
     31    if (config->mode == P2_MODE_DONE) {
     32        pendingFrames = p2searchPendingFrames (config, TRUE);
     33        doneFrames = p2pendingToDone (config);
     34        p2insertDoneFrames (config, doneFrames);
    7735    }
    7836
Note: See TracChangeset for help on using the changeset viewer.