IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of BillsPSPSToIPP


Ignore:
Timestamp:
Sep 23, 2015, 8:05:00 AM (11 years ago)
Author:
bills
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BillsPSPSToIPP

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