Skip to content

Commit

Permalink
use FIBER_ASSIGN_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jul 18, 2024
1 parent 6c834a6 commit 13dcd39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions py/desispec/io/fibermap.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,15 +592,15 @@ def assemble_fibermap(night, expid, badamps=None, badfibers_filename=None,

#- Look for override fiberassign file in svn
if allow_svn_override:
if 'DESI_TILES' in os.environ:
if 'FIBER_ASSIGN_DIR' in os.environ:
testfile, svn_exists = findfile('fiberassignsvn', tile=tileid, readonly=True, return_exists=True)
if svn_exists:
fafile = testfile
log.info(f'Overriding raw fiberassign file {rawfafile} with svn {fafile}')
else:
log.info(f'{testfile}[.gz] not found; sticking with raw data fiberassign file')
else:
log.warning('svn override was specified but DESI_TILES was not defined; sticking with raw data fiberassign file')
log.warning('svn override was specified but FIBER_ASSIGN_DIR was not defined; sticking with raw data fiberassign file')
#- Find coordinates file in same directory
dirname, filename = os.path.split(rawfafile)
globfiles = glob.glob(dirname+'/coordinates-*.fits')
Expand Down
4 changes: 2 additions & 2 deletions py/desispec/io/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def findfile(filetype, night=None, expid=None, camera=None,
specprod_dir : overrides $DESI_SPECTRO_REDUX/$SPECPROD/
specprod : production name, or full path to production
qaprod_dir : defaults to $DESI_SPECTRO_REDUX/$SPECPROD/QA/ if not provided
tiles_dir : defaults to $DESI_TILES if not provided
tiles_dir : defaults to $FIBER_ASSIGN_DIR if not provided
download : if not found locally, try to fetch remotely
outdir : use this directory for output instead of canonical location
return_exists: if True, also return whether the file exists
Expand Down Expand Up @@ -353,7 +353,7 @@ def findfile(filetype, night=None, expid=None, camera=None,
qaprod_dir = qaprod_root(specprod_dir=specprod_dir)

if tiles_dir is None and 'tiles_dir' in required_inputs:
tiles_dir = os.environ['DESI_TILES']
tiles_dir = os.environ['FIBER_ASSIGN_DIR']

if 'specprod' in required_inputs and specprod is None and outdir is None :
specprod = os.path.basename(specprod_dir)
Expand Down
2 changes: 1 addition & 1 deletion py/desispec/io/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def gather_targetdirs(tileid, fiberassign_dir=None, verbose=False):
# desi_surveyops = os.path.join(desi_root, 'survey', 'ops', 'surveyops', 'trunk')

if fiberassign_dir is None:
fiberassign_dir = get_readonly_filepath(os.environ['DESI_TILES'])
fiberassign_dir = get_readonly_filepath(os.environ['FIBER_ASSIGN_DIR'])
# fiberassign_dir = os.path.join(desi_root, 'target', 'fiberassign', 'tiles', 'trunk')

fiberfile, svn_exists = findfile('fiberassignsvn', tiles_dir=fiberassign_dir,
Expand Down

0 comments on commit 13dcd39

Please sign in to comment.