Skip to content

Commit

Permalink
fix path issue for ref file in bd_calstis
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Ely committed Jun 5, 2016
1 parent 43b0f3a commit 1cee008
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 6 additions & 3 deletions refstis/functions.py
Expand Up @@ -997,10 +997,9 @@ def bias_subtract_data(filename, biasfile):
name, ext = os.path.splitext(name)
trailerfile = os.path.join(path, name + '_bias_subtract_log.txt')

#biasfile = make_path_safe(biasfile)
biasfile = os.path.relpath(biasfile)
biasfile = make_path_safe(biasfile)

pyfits.setval(filename, 'BIASFILE', value=biasfile)
pyfits.setval(filename, 'BIASFILE', ext=0, value=biasfile)
status = basic2d(filename,
dqicorr='perform',
blevcorr='perform',
Expand Down Expand Up @@ -1034,8 +1033,12 @@ def make_path_safe(filename):
return filename

path, filename = os.path.split(filename)
#-- Calstis wants the '/' at the end
if not path.endswith('/'):
path += '/'

os.environ['refdir'] = path

filename = 'refdir$'+filename

return filename
Expand Down
5 changes: 1 addition & 4 deletions refstis/pipeline.py
Expand Up @@ -877,10 +877,7 @@ def run(config_file='config.yaml'):
raise KeyError("oref environment must be set to run the pipeline.")
else:
os.environ['oref'] = data['oref']

# -- used when files are too long for calstis to process
os.environ[data['tmp_env']] = data['tmp_path']


pop_db.main()

all_folders = get_new_periods(data['products_directory'], data)
Expand Down

0 comments on commit 1cee008

Please sign in to comment.