Skip to content

Commit

Permalink
Merge pull request #1018 from igmhub/sdss-data-fix
Browse files Browse the repository at this point in the history
SDSS fix
  • Loading branch information
iprafols authored Jun 23, 2023
2 parents 7ec4114 + 7a58eb1 commit 6c407ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions py/picca/delta_extraction/data_catalogues/sdss_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,14 @@ def read_from_spec(self, catalogue):
continue
self.logger.progress(f"Read {filename}")

log_lambda = np.array(hdul[1]["loglam"][:], dtype=np.float64)
flux = np.array(hdul[1]["flux"][:], dtype=np.float64)
ivar = (np.array(hdul[1]["ivar"][:], dtype=np.float64) *
hdul[1]["and_mask"][:] == 0)
try:
log_lambda = np.array(hdul[1]["loglam"][:], dtype=np.float64)
flux = np.array(hdul[1]["flux"][:], dtype=np.float64)
ivar = (np.array(hdul[1]["ivar"][:], dtype=np.float64) *
hdul[1]["and_mask"][:] == 0)
except OSError:
self.logger.warning(f"Error reading HDU for {filename}. Ignoring file")
continue

if self.analysis_type == "BAO 3D":
forest = SdssForest(
Expand Down

0 comments on commit 6c407ca

Please sign in to comment.