Skip to content

Commit

Permalink
Merge 37c3370 into ec45319
Browse files Browse the repository at this point in the history
  • Loading branch information
geordie666 committed Sep 30, 2021
2 parents ec45319 + 37c3370 commit 773e6b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 3 additions & 1 deletion doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ desitarget Change Log
1.3.1 (unreleased)
------------------

* No changes yet.
* Also use the ops/tiles-specstatus.ecsv tile file for SV [`PR #765`_].

.. _`PR #765`: https://github.com/desihub/desitarget/pull/765

1.3.0 (2021-09-20)
------------------
Expand Down
26 changes: 14 additions & 12 deletions py/desitarget/mtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ def get_ztile_file_name(survey='main'):
:class:`str`
The name of the ZTILE file.
"""
if survey[:2] == 'sv':
fn = "tiles.csv"
elif survey == 'main':
# ADM tile file name used to be different for sv and main.
if survey[:2] == 'sv' or survey == 'main':
fn = "tiles-specstatus.ecsv"
else:
msg = "Allowed 'survey' inputs are sv(X) or main, not {}".format(survey)
Expand Down Expand Up @@ -1413,12 +1412,17 @@ def tiles_to_be_processed(zcatdir, mtltilefn, obscon, survey):
"""
# ADM read in the ZTILE file.
ztilefn = get_ztile_file_name(survey=survey)
# ADM directory structure is different for SV and the Main Survey.
if survey[:2] == 'sv':
ztilefn = os.path.join(zcatdir, ztilefn)
elif survey == 'main':
opsdir = os.path.dirname(mtltilefn).replace("mtl", "ops")
# ADM directory structure used to be different for sv and main.
if survey[:2] == 'sv' or survey == 'main':

if os.path.basename(os.path.dirname(mtltilefn)) == 'mtl':
opsdir = os.path.join(os.path.dirname(os.path.dirname(mtltilefn)), 'ops')
else:
opsdir = os.path.dirname(mtltilefn)
ztilefn = os.path.join(opsdir, ztilefn)
print(mtltilefn)
print(opsdir)
print(ztilefn)
else:
msg = "Allowed 'survey' inputs are sv(X) or main, not {}".format(survey)
log.critical(msg)
Expand Down Expand Up @@ -1744,10 +1748,8 @@ def loop_ledger(obscon, survey='main', zcatdir=None, mtldir=None,

# ADM contruct the ZTILE filename, for logging purposes.
ztilefn = get_ztile_file_name(survey=survey)
# ADM directory structure is different for SV and the Main Survey.
if survey[:2] == 'sv':
ztilefn = os.path.join(zcatdir, ztilefn)
elif survey == 'main':
# ADM directory structure used to be different for sv and main.
if survey[:2] == 'sv' or survey == 'main':
opsdir = os.path.dirname(mtltilefn).replace("mtl", "ops")
ztilefn = os.path.join(opsdir, ztilefn)

Expand Down

0 comments on commit 773e6b7

Please sign in to comment.