SELECT
    detProcessedImfile.*,
    rawExp.camera
FROM detRunSummary
JOIN detProcessedImfile
    USING(det_id)
JOIN detInputExp
     USING(det_id,iteration,exp_id)
JOIN rawExp
     USING(exp_id)
WHERE
     (detProcessedImfile.data_state = 'goto_cleaned'
     OR detProcessedImfile.data_state = 'goto_scrubbed'
     OR detProcessedImfile.data_state = 'goto_purged')

