| | 1 | |
| | 2 | |
| | 3 | == Data Integrity Tests and What We Expect == |
| | 4 | |
| | 5 | This was started using conrad's stuff here: http://ps1wiki.ifa.hawaii.edu/trac/wiki/PSPSODMTestQueries on SA9, until I abandoned it (I will explain) |
| | 6 | |
| | 7 | * Data integrity test of the whole SAS will fail, I am not going to try it. We expect it to fail: |
| | 8 | * 1 OB and 1 P2 batch failed to load due to ra/dec range on PSPS loading |
| | 9 | * there are a dozen ST batches that failed to even get created (the quality of the skycell is bad) |
| | 10 | * there are OB batches that fail to be created due to ra/dec ranges on ipptopsps. detections for those areas are in the PSPS survey, because they are filtered based on the center of the exposure. |
| | 11 | |
| | 12 | * What about data integrity on a subset of data? Lets look at ra between 333 and 335 and dec between -1 and 1. What do we expect for good data? |
| | 13 | * P2 has 0 items that are not in OB, and all P2 should be in OB (p2 detections should all have objects) |
| | 14 | * ST has 0 items that are not in OB, and all ST should be in OB (st detections should all have objects) |
| | 15 | * We don't care much about the intersections of P2 and ST. Why: |
| | 16 | * P2 can have items that should not show up in the stacks |
| | 17 | * real things like comets only exist on 1 exposure therefore not in stacks |
| | 18 | * imaginary things like false detections and camera gunk should only exist at a given ra/dec for 1 exposure, therefore not in stacks |
| | 19 | * ST can have items that do not show up in P2 because it goes fainter |
| | 20 | * ST batches can be missing (causing piles of ST items to be gone) for legitimate reasons: |
| | 21 | * not enough exposures to stack |
| | 22 | * bad quality flags in the stacks - we do not want these in there anyways |
| | 23 | |
| | 24 | |
| | 25 | == PSPS Integrity Checks == |
| | 26 | |
| | 27 | Step 1. Make mydbs of distinct ippobjid for each of st, ob, p2 for that ra/dec range: |
| | 28 | |
| | 29 | Objects: note that we want to avoid the -999 objects that come from stacks and detections but aren't filled by the object batches (they are placeholders of a sort, but they aren't useful for this, and that's another thing to investigate. i want objects filled by object batches). however I do both because I'm curious |
| | 30 | |
| | 31 | {{{ |
| | 32 | SELECT distinct ippobjid INTO mydb.SAS9ob FROM object WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) and ndetections > -999 |
| | 33 | }}} |
| | 34 | {{{ |
| | 35 | SELECT distinct ippobjid INTO mydb.SAS9ob2 FROM object WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) |
| | 36 | }}} |
| | 37 | |
| | 38 | detections and stacks are straightforward |
| | 39 | {{{ |
| | 40 | SELECT distinct ippobjid INTO mydb.SAS9st FROM stackdetectionfull WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) |
| | 41 | }}} |
| | 42 | |
| | 43 | {{{ |
| | 44 | SELECT distinct ippobjid INTO mydb.SAS9p2 FROM detectionfull WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) |
| | 45 | }}} |
| | 46 | |
| | 47 | Step 2. Count things. I basically only care that all P2s are in OB and all STs are in OB. To find them, do these queries on the fast queue: |
| | 48 | |
| | 49 | Find STs not in OB: |
| | 50 | |
| | 51 | {{{ |
| | 52 | SELECT count(*) from sas9ob right join sas9st on sas9ob.ippobjid=sas9st.ippobjid where sas9ob.ippobjid is null |
| | 53 | }}} |
| | 54 | |
| | 55 | Find P2s not in OB: |
| | 56 | |
| | 57 | {{{ |
| | 58 | SELECT count(*) from sas9ob right join sas9p2 on sas9ob.ippobjid=sas9st.ippobjid where sas9ob.ippobjid is null |
| | 59 | }}} |
| | 60 | |
| | 61 | Find STs in OB: |
| | 62 | {{{ |
| | 63 | SELECT count(*) from sas9ob inner join sas9st on sas9ob2.ippobjid=sas9p2.ippobjid |
| | 64 | }}} |
| | 65 | |
| | 66 | Find P2s in OB: |
| | 67 | {{{ |
| | 68 | SELECT count(*) from sas9ob inner join sas9p2 on sas9ob2.ippobjid=sas9p2.ippobjid |
| | 69 | }}} |
| | 70 | |
| | 71 | Verify OBs don't have multiple things with same ippobjid, these 2 queries should give the same answer |
| | 72 | {{{ |
| | 73 | SELECT count(distinct ippobjid) FROM object WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) and ndetections > -999 |
| | 74 | |
| | 75 | SELECT count(ippobjid) FROM object WHERE (ra >= 333 and ra <= 335 and dec >= -1 and dec <=1) and ndetections > -999 |
| | 76 | }}} |
| | 77 | |
| | 78 | == Results == |
| | 79 | |
| | 80 | For my area of sky I picked (ra between 333 and 335, dec between -1 and 1), these are the results. |
| | 81 | |
| | 82 | {{{ |
| | 83 | total number of OB vs distinct OB: both give 763575 |
| | 84 | |
| | 85 | count of sas9OB: 763575 |
| | 86 | count of sas9P2: 651695 |
| | 87 | count of sas9ST: 209218 |
| | 88 | }}} |
| | 89 | |
| | 90 | Now for who's in both ST and OB and P2 and OB |
| | 91 | |
| | 92 | {{{ |
| | 93 | count of sas9P2 in sas9OB : 651651 |
| | 94 | count of sas9ST in sas9OB : 209163 |
| | 95 | }}} |
| | 96 | '''count of sas9P2 in sas9OB should be 651695 and count of sas9ST in sas9OB should be 209218''' |
| | 97 | |
| | 98 | '''The following are the problem children (should be investigated separately)''' |
| | 99 | {{{ |
| | 100 | sas9P2 not in sas9OB: 44 |
| | 101 | sas9ST not in sas9OB: 55 |
| | 102 | }}} |
| | 103 | |
| | 104 | |
| | 105 | '''There are 763575 objects and 99 that I think should be objects (they have p2 or st detections)''' |
| | 106 | |
| | 107 | |
| | 108 | |