Skip to content

Commit

Permalink
Merge pull request #3 from LSSTDESC/dev_20200721
Browse files Browse the repository at this point in the history
bug correction in the reading of old simulation files (alt_sched) - new sn_tools version
  • Loading branch information
pgris authored Jul 21, 2020
2 parents 54dc9d5 + 929c45e commit 713388f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions sn_tools/sn_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,8 @@ def __call__(self, pixels, observations, ip):
for val in ['healpixID', 'pixRA', 'pixDec']:
dataPixels[val] = selpix[val].unique().tolist()*len(dataPixels)
# time_ref = time.time()
dataPixels['iproc']=[self.num]*len(dataPixels)

dataPixels['iproc'] = [self.num]*len(dataPixels)

self.runMetrics(dataPixels)
# print('pixel processed',ipixel,time.time()-time_ref)
Expand Down Expand Up @@ -2640,8 +2640,11 @@ def getFields(observations, fieldType='WFD', fieldIds=None,
#print(res, np.argmax(res['Nobs']), propId_WFD)
#a = observations['note']
df = pd.DataFrame(np.copy(observations))
idx = df['note'].str.contains('DD')
return df[~idx].to_records(index=False)
if 'note' in df.columns:
idx = df['note'].str.contains('DD')
return df[~idx].to_records(index=False)
else:
return df.to_records(index=False)
# return observations[observations[pName] == propId_WFD]
if fieldType == 'DD':
# could be tricky here depending on the database structure
Expand Down
2 changes: 1 addition & 1 deletion sn_tools/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = 'v1.0.1'
__version__ = 'v1.0.2'
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = 'v1.0.1'
__version__ = 'v1.0.2'

0 comments on commit 713388f

Please sign in to comment.