In [1]:
import simlibs.Simlib as sl

Examples on simlib files I have written out


In [2]:
s = sl.simlib('test_out.simlib')

In [3]:
s.fieldIDs


Out[3]:
[744, 2786, 1427, 2412, 290]

In [4]:
len(s.simlibData(744).data)


Out[4]:
1824

In [5]:
s.simlibdicts[744].meta


Out[5]:
{'DECL': -0.794553,
 'LIBID': 744,
 'MWEBV': 0.01,
 'NOBS': 1824,
 'PIXSIZE': 0.2,
 'RA': 0.0}

Examples on SIMLIB COADDs written out by SNANA


In [7]:
d = sl.simlib('test_out.simlib.COADD')

In [8]:
d.fieldIDs


Out[8]:
[744, 2786, 1427, 2412, 290]

In [9]:
data = d.simlibData(744).data

In [10]:
data.head()


Out[10]:
MJD IDEXPT FLT GAIN NOISE SKYSIG PSF1 PSF2 PSFRatio ZPTAVG ZPTERR MAG
0 49534.363 142365 r 1 1.12 31.23 2.06 0 0 35.01 0.005 -99
1 49534.371 142385 g 1 0.79 22.55 2.26 0 0 34.25 0.005 -99
2 49534.379 142395 i 1 1.12 38.58 2.21 0 0 34.81 0.005 -99
3 49534.391 142415 z 1 1.27 44.64 2.03 0 0 34.54 0.005 -99
4 49534.402 142441 Y 1 1.12 41.99 2.22 0 0 32.77 0.005 -99

Obtaining the Number of observations coadded to get this


In [11]:
data.NOISE.apply(lambda x: round((x/0.25)**2.)).sum()


Out[11]:
1824.0