Skip to content

Commit

Permalink
adapt make_targetdict() to datastructure in 'deep' directories (blanc…
Browse files Browse the repository at this point in the history
…/tiles)
  • Loading branch information
armengau committed Jan 6, 2021
1 parent 7a5ca41 commit 8552fd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions py/prospect/utilities.py
Expand Up @@ -310,13 +310,14 @@ def make_targetdict(tiledir, petals=[str(i) for i in range(10)], tiles=None, nig
the_nights = [ x for x in the_nights if x in nights ]
for night in the_nights :
target_dict[tile+"-"+night] = {}
# exposures
# exposures (included in dict only if 'cframe-b' files are present - which is not the case for "deep" coadds in blanc)
fns = np.sort(glob.glob(os.path.join(tiledir,tile,night,'cframe-b'+petals[0]+'-????????.fits')))
target_dict[tile+"-"+night]['exps'] = np.array([fn.replace('.','-').split('-')[-2] for fn in fns])
if len(fns)>0 :
target_dict[tile+"-"+night]['exps'] = np.array([fn.replace('.','-').split('-')[-2] for fn in fns])
# targetid, fibres
targetid,fiber,petal_list = [],[],[]
for petal in petals:
pp = glob.glob(os.path.join(tiledir,tile,night,'zbest-'+petal+'-'+tile+'-????????.fits'))
pp = glob.glob(os.path.join(tiledir,tile,night,'zbest-'+petal+'-'+tile+'-'+night+'.fits'))
if len(pp)>0 :
fn = pp[0]
fm = Table.read(fn, 'FIBERMAP')
Expand Down

0 comments on commit 8552fd8

Please sign in to comment.