read headers to build index of CCDs