SELECT
    warpSkyCellMap.*,
    chipProcessedImfile.uri,
    chipProcessedImfile.path_base as chip_path_base,
    camProcessedExp.path_base as cam_path_base,
    chipProcessedImfile.chip_id,
    chipRun.state,
    chipProcessedImfile.data_state,
    chipProcessedImfile.magicked,
    rawImfile.magicked AS raw_magicked
FROM warpRun
JOIN warpSkyCellMap
    USING(warp_id)
JOIN fakeRun
    USING(fake_id)
JOIN camRun
    USING(cam_id)
JOIN camProcessedExp
    USING(cam_id)
JOIN chipRun
    USING(chip_id)
JOIN chipProcessedImfile
    ON chipRun.chip_id = chipProcessedImfile.chip_id
    AND warpSkyCellMap.class_id = chipProcessedImfile.class_id
JOIN rawImfile
    ON chipRun.exp_id = rawImfile.exp_id
    AND chipProcessedImfile.class_id = rawImfile.class_id
WHERE
    1
