| | 1 | = PSPS to IPP = |
| | 2 | |
| | 3 | Notes on tracking data in the PSPS database back to the DVO and IPP. |
| | 4 | |
| | 5 | == Detection to single frame data == |
| | 6 | |
| | 7 | exp_id = frameID = Detection.imageID / 100 |
| | 8 | |
| | 9 | or using joins back to FrameMeta one can find frameID (exp_id) and frameName (exp_name) |
| | 10 | |
| | 11 | exp_id = frameID [ select ImageMeta.frameID from Detection join ImageMeta on Detection.imageID = ImageMeta.imageID ] |
| | 12 | |
| | 13 | exp_name = frameName [ select FrameMeta.frameName |
| | 14 | from Detection |
| | 15 | join ImageMeta on Detection.imageID = ImageMeta.imageID |
| | 16 | join FrameMeta on ImageMeta.frameID = FrameMeta.frameName ] |
| | 17 | |
| | 18 | chip, camera, and warp IDS cannot be found directly in PSPS. Need to go to gpc1 database using the frameID |
| | 19 | obtained above. |
| | 20 | |
| | 21 | Using the gpc1 database |
| | 22 | |
| | 23 | select chip_id, cam_id, warp_id from relExp join ippRelease using(rel_id) |
| | 24 | where exp_id = frameID and release_name = '3PI.PV3' |
| | 25 | |
| | 26 | From a script these data can also be obtained with the command |
| | 27 | releasetool -listrelexp -exp_id $frameID -release_name 3PI.PV3 |
| | 28 | |
| | 29 | SUGGESTION: I think we should add chip_id, warp_id, and cam_id to FrameMeta. |
| | 30 | The first two are useful for postage stamps and cam_id would be useful |
| | 31 | for tracking/debugging.) |
| | 32 | |
| | 33 | Detection to corresponding row in CMF |
| | 34 | ------------------------------------- |
| | 35 | Find cam_id as above, then find the cmf from camProcessedExp. Then in the cmf |
| | 36 | the detection is the one with |
| | 37 | |
| | 38 | [cmf].IPP_IDET = Detection.ippDetectID |
| | 39 | |
| | 40 | Detection to corresponding row in DVO |
| | 41 | ------------------------------------- |
| | 42 | |
| | 43 | mostly dvo queries to particular detections are by obsTime. |
| | 44 | |
| | 45 | Here is how the detection column values are set. |
| | 46 | |
| | 47 | objID = PSPS_OBJ_ID = [dvo ave file].EXT_ID (as defined by Jim Heasley's formula) |
| | 48 | detectID = meas.EXT_ID (as defined by Jim Heasley's formula) |
| | 49 | imageID = exp_id * 100 + ccdnum |
| | 50 | dvoRegionID = meas.CAT_ID |
| | 51 | ippDetectID = meas.DET_ID = [cmf].IPP_IDET (My old wiki page said that this was measurement.IMAGE_ID << 32 | meas.DET_ID) |
| | 52 | ippObjID = meas.CAT_ID << 32 + meas.OBJ_ID |
| | 53 | |
| | 54 | So to find the catalog file |
| | 55 | cat_id = Detection.dvoRegionID |
| | 56 | |
| | 57 | The OBJ_ID is the lower 32 bits of ippObjID |
| | 58 | OBJ_ID = ippObjID & 0xFFffFFff |
| | 59 | |
| | 60 | The "directory" for the dvo catalog is SkyTable.fits. The file is then the entry with [Images.dat].INDEX = cat_id |
| | 61 | Example if cat_id = 93255 then |
| | 62 | |
| | 63 | fileName = [SkyTable.fits[93255]].NAME = "s0000/5228.06" |
| | 64 | |
| | 65 | And the various dvo files may be found from there. |
| | 66 | |
| | 67 | ISSUE: How can we get at just the detections from the specific image? |
| | 68 | |
| | 69 | This would require going to the ipp database with two commands |
| | 70 | |
| | 71 | releasetool -listrelexp -exp_id $frameID -release_name SAS.39 |
| | 72 | chiptool -processedimfile -chip_id $chip_id -class_id "XY$ccdnum' |
| | 73 | |
| | 74 | (need to use sprintf for class_id value to make sure leading zero is |
| | 75 | there for ccdnum < 10) |
| | 76 | |
| | 77 | Then taking chip_imfile_id from the chiptool cmd results look in Images |
| | 78 | table find the row with |
| | 79 | |
| | 80 | [Images.dat].EXTERN_ID == chip_imfile_id |
| | 81 | |
| | 82 | and take the value of the column IMAGE_ID and use it to select |
| | 83 | rows in the measurements from this chip have with that IMAGE_ID |
| | 84 | |
| | 85 | |
| | 86 | FullForce Measurement to exposure |
| | 87 | --------------------------------- |
| | 88 | This was discussed last week. |
| | 89 | There is a table which is the list of imageIDs that went into a ForcedWarpMeta (fullForceRun). |
| | 90 | |
| | 91 | One can find the exposure for a given measurement using the forcedWarpID |
| | 92 | |
| | 93 | select DISTINCT ForcedWarpToImage.imageID/100 as frameID |
| | 94 | FROM ForcedWarpMeasurement |
| | 95 | JOIN ForcedWarpToImage |
| | 96 | ON ForcedWarpMeasurement.forcedWarpID = ForcedWarpToImage.forcedWarpID |
| | 97 | |
| | 98 | SUGGESTION: Better to add frameID to ForcedWarpMeta (and for postage |
| | 99 | stamps warp_id would be useful too, but if we add warp_id to FrameMeta |
| | 100 | that wouldn't be required.) |
| | 101 | |
| | 102 | Then given the exp_id, and skyCellID one can go to the IPP's gpc1 |
| | 103 | database and find the fullForceResult. (Well, one would need to know |
| | 104 | the label or the skycal_id). |
| | 105 | |
| | 106 | fftool -result -label SAS.20141118.ff8 -exp_id $frameID -tess_id $tessID -skycell_id $skyCellID |
| | 107 | |
| | 108 | |
| | 109 | Stack Tables |
| | 110 | ------------ |
| | 111 | |
| | 112 | StackObjectThin |
| | 113 | |
| | 114 | objID, ippObjID, dvoRegionID, ippObjID are the same as for a single frame detection |
| | 115 | xstackDetectID = meas.EXT_ID (corresponds to detectID computed with Jim Heasley's formula) |
| | 116 | xstackMetaID = stack_id |
| | 117 | |
| | 118 | StackObjectAttributes |
| | 119 | xiippDetectID = meas.DET_ID = [cmf].IPP_IDET |