Changeset 5869 for trunk/archive/p2tools/src/p2search.c
- Timestamp:
- Dec 31, 2005, 2:21:54 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/archive/p2tools/src/p2search.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/p2tools/src/p2search.c
r5868 r5869 1 1 # include "p2search.h" 2 3 typedef enum {4 P2_MODE_NONE, // grab from raw, output for ppImage5 P2_MODE_QUICK, // grab from raw, output for ppImage6 P2_MODE_DEFINE, // grab from raw, create pending7 P2_MODE_PENDING, // grab from pending, output for ppImage8 P2_MODE_UPDATE, // set the current state9 } 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 tools22 typedef struct {23 char expID[32]; // free-form exposure ID string24 char class; // class of file: fpa (0), chip (1), cell (2), readout (3)?25 int Nclass; // number of files of this class26 char camera[32]; // free-form camera ID string27 char filter[32]; // free-form filter ID string28 psTime time_start; // exposure start time29 psTime time_stop; // exposure stop time30 psTime exptime; // exposure duration (seconds)31 char exptype; // type of exposure: object (0), bias (1), dark (2), flat (3), etc32 float sky; // measure sky brightness33 float seeing; // measured image quality34 float dettemp; // temperature of detector35 } p2RawExposure;36 37 // this structure should be defined using the mddb api tools38 typedef struct {39 char expID[32]; // free-form exposure ID string40 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 state44 } p2RawImage;45 46 typedef struct {47 p2RawExposure *exposure;48 psArray *images;49 } p2RawSet;50 2 51 3 int main (int argc, char **argv) { 52 4 53 p2SearchConfig (&config, argc, argv); 5 psArray *rawFrames; 6 psArray *doneFrames; 7 psArray *pendingFrames; 54 8 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); 57 20 } 58 21 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); 73 25 } 74 26 75 27 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); 77 35 } 78 36
Note:
See TracChangeset
for help on using the changeset viewer.
