Skip to content

Commit

Permalink
obtain survey/program from headers if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Dec 10, 2024
1 parent 59be658 commit 1d55bc9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion py/specprodDB/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,9 @@ def convert(cls, data, survey=None, program=None, row_index=None):
if check_columns[column] is None:
if column.upper() in data.colnames:
log.info("Obtaining '%s' from input data file.", column)
elif column.upper() in data.meta:
log.info("Obtaining '%s' from input data header.", column)
default_columns[column] = data.meta[column.upper()]
else:
msg = "Could not obtain '%s' from input data file."
log.critical(msg, column)
Expand Down Expand Up @@ -1218,7 +1221,10 @@ def convert(cls, data, survey=None, program=None, tileid=None, night=None,
for column in check_columns:
if check_columns[column] is None:
if column.upper() in data.colnames:
log.info("Obtaining '%s' from input data file.", column)
log.info("Obtaining '%s' from input data table.", column)
elif column.upper() in data.meta:
log.info("Obtaining '%s' from input data header.", column)
default_columns[column] = data.meta[column.upper()]
else:
msg = "Could not obtain '%s' from input data file."
log.critical(msg, column)
Expand Down

0 comments on commit 1d55bc9

Please sign in to comment.