SELECT
    detNormalizedImfile.*,
    detRunSummary.data_state
FROM detRunSummary
JOIN detNormalizedImfile
    USING(det_id,iteration)
WHERE
    detRunSummary.data_state = 'goto_cleaned'
AND detNormalizedImfile.data_state = 'full'
