In [1]:
import simlibs.simlib as sl
import os
import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
print sl.__file__


/Users/rbiswas/.local/lib/python2.7/site-packages/OpSimSummary-0.0.1.dev0-py2.7.egg/simlibs/simlib.pyc

In [2]:
loc = '/Users/rbiswas/data/SNDATA/INTERNAL/LSST/simlibs/2_168'

In [38]:
import simlibs.summarize_opsim as so

In [39]:
opsimout = '/Users/rbiswas/data/LSST/OpSimData/opsim2_168_sqlite.db'

In [41]:
opsimSummary = os.SummaryOpsim.fromOpSimDB(opsimout,


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-41-155d3073250a> in <module>()
----> 1 opsimSummary = os.SummaryOpsim.fromOpSimDB(opSimDB=opsimout)

TypeError: fromOpSimDB() takes exactly 3 arguments (2 given)

In [9]:
basicSimlib = 'opsim2_168.SIMLIB'

In [10]:
oldsimlib = sl.Simlib.fromSimlibFile(basicSimlib)

In [12]:
len(oldsimlib.fieldIDs)


Out[12]:
3636

In [17]:
newSimlib = sl.Simlib.fromSimlibFile('opsim_2168.SIMLIB.DEEP.FULL')

In [19]:
newSimlib.fieldIDs


Out[19]:
[2082, 519, 2731, 2412, 2786, 526, 1427, 311, 2712, 764]

In [33]:
newvals = set(newSimlib.simlibData(2082).IDEXPT)
# print newvals.size

In [3]:
snanaDeepFileName = os.path.join(loc,'output_opsim2_168.SIMLIB.COADD.DEEP')
snanaDeep =  sl.Simlaib.fromSimlibFile(snanaDeepFileName)

In [32]:
oldvals = set(oldsimlib.simlibData(2082).IDEXPT)
# print oldvals.size

In [35]:
newinnew = list(newvals - oldvals)

In [36]:
newinold = list(oldvals - newvals)

In [37]:
newinnew


Out[37]:
[39447760,
 39187937,
 41533445,
 41541505,
 38835547,
 40631995,
 39187938,
 40894074,
 39474527,
 38759093,
 39510913,
 39116670,
 38746031,
 38835553,
 40140335,
 39474530,
 39187939,
 39474531,
 38759097,
 39474532,
 41541507,
 39856826,
 39474533,
 40970939,
 39474534,
 39856828,
 39474535,
 39187940,
 39856829,
 40512742,
 39856830,
 39474537,
 41541508,
 39856831,
 39510915,
 39474538,
 39856832,
 39474539,
 39856833,
 39474540,
 41533463,
 39856834,
 39474541,
 39856835,
 39474542,
 41541509,
 39905988,
 41325935,
 39813277,
 39813279,
 39813280,
 39813281,
 39813282,
 39813283,
 39813284,
 39813285,
 39813286,
 39813287,
 39813288,
 39813289,
 39813290,
 39813291,
 39813292,
 39813293,
 39813294,
 39813295,
 39813296,
 39813297,
 39813298,
 39813299,
 39813300,
 39813301,
 39813302,
 39813303,
 39813304,
 39813305,
 39813306,
 39813307,
 39813308,
 39856842,
 39813310,
 39813311,
 39813312,
 39813313,
 39813314,
 39813315,
 39813316,
 39813317,
 39813318,
 39813319,
 39813320,
 39813321,
 39813322,
 39813323,
 39813324,
 39813325,
 39813326,
 39813327,
 39813328,
 41325944,
 39813331,
 39813332,
 39856846,
 39813334,
 39813335,
 39813336,
 39878873,
 39878874,
 39878875,
 39878876,
 39878877,
 39878878,
 39878879,
 39878880,
 39878881,
 39878882,
 39878883,
 39878884,
 39878885,
 39878886,
 39813351,
 39878888,
 39878889,
 39813354,
 39878891,
 39878892,
 39856850,
 39813358,
 39813359,
 39813360,
 39813361,
 39813362,
 39813363,
 41517300,
 41517301,
 41517302,
 41517303,
 41517304,
 41517305,
 41517306,
 41517307,
 41517308,
 41517309,
 41517310,
 41517311,
 41517312,
 41517313,
 41517314,
 41517315,
 41517316,
 41517317,
 41517318,
 41517319,
 41517320,
 41517321,
 41517322,
 41517323,
 41517324,
 41517325,
 41517326,
 41517327,
 41517328,
 41517329,
 41517330,
 41517331,
 41517332,
 41517333,
 41517334,
 41517335,
 41517336,
 41517337,
 41517338,
 41517339,
 41517340,
 41517341,
 41517342,
 41517343,
 41517344,
 41517345,
 41517346,
 41517347,
 41517348,
 41517349,
 41517350,
 41517351,
 41517352,
 40970972,
 41517354,
 41571719,
 38764844,
 41517357,
 38764846,
 38764847,
 38764848,
 38764849,
 38764850,
 38764851,
 38764852,
 38764853,
 38764854,
 38764855,
 38764856,
 38764857,
 38764858,
 41517371,
 38764860,
 38764861,
 38764862,
 38764863,
 38764864,
 41517377,
 41517378,
 39474571,
 41517380,
 41517381,
 41517382,
 41517383,
 41517384,
 41517385,
 41517386,
 41517387,
 41517388,
 41517389,
 41517390,
 41517391,
 41517392,
 41517393,
 41517394,
 41517395,
 41539333,
 39474574,
 40890574,
 40970980,
 39474575,
 39187948,
 40970981,
 39474576,
 38742758,
 39474577,
 38742759,
 39510923,
 39474578,
 38742760,
 41539334,
 39474579,
 40924970,
 38742761,
 39474580,
 40272250,
 40272251,
 40272252,
 40272253,
 40272254,
 40272255,
 40272256,
 40272257,
 40272258,
 40272259,
 40272260,
 40272261,
 40272262,
 40272263,
 40272264,
 40272265,
 40272266,
 40272267,
 40272268,
 40272269,
 40272270,
 40272271,
 40272272,
 40272273,
 40272274,
 40272275,
 40272276,
 40272277,
 40272278,
 40272279,
 40272280,
 40272281,
 40272282,
 40272283,
 40272284,
 40272285,
 40272286,
 40599967,
 40599968,
 40599969,
 40599970,
 40599971,
 40599972,
 40599973,
 40599974,
 40599975,
 40599976,
 40272297,
 40272298,
 40599979,
 40599980,
 40599981,
 40599982,
 40599983,
 40599984,
 40599985,
 40599986,
 40599987,
 40599988,
 40599989,
 40599990,
 40599991,
 40599992,
 40599993,
 40599994,
 40599995,
 40599996,
 40927677,
 40927678,
 40927679,
 40927680,
 40927681,
 40927682,
 40272323,
 40272324,
 40600005,
 40272326,
 40272327,
 40272328,
 40272329,
 40272330,
 40272331,
 40272332,
 40272333,
 40272334,
 40272335,
 40272336,
 40272337,
 40272338,
 40272339,
 40272340,
 40272341,
 40272342,
 40272343,
 40272344,
 40272345,
 40600026,
 40600027,
 40600028,
 40600029,
 40600030,
 40600031,
 40600032,
 40600033,
 40600034,
 40600035,
 40600036,
 40600037,
 40600038,
 40600039,
 40600040,
 40600041,
 40600042,
 41571751,
 39856893,
 41571752,
 39844667,
 38742772,
 41571753,
 38742783,
 39474602,
 41541521,
 38742784,
 39510928,
 39474603,
 38742785,
 39454482,
 40971010,
 41571757,
 38742773,
 39474606,
 40971012,
 39474607,
 39856901,
 39510929,
 39474608,
 40971014,
 39474609,
 40971015,
 38794626,
 39474610,
 40971016,
 39474611,
 40971017,
 39474612,
 41541523,
 40971018,
 39510930,
 39474613,
 40971019,
 39474614,
 40971020,
 40149183,
 39474615,
 40971021,
 39474616,
 40973045,
 40971022,
 39474617,
 41558982,
 40971023,
 39510931,
 39474618,
 38742800,
 41748839,
 40971025,
 39474620,
 38742776,
 38858292,
 39474621,
 41246106,
 38742803,
 40654270,
 40971028,
 39510932,
 41571775,
 40971029,
 40654272,
 40971030,
 40654273,
 38742777,
 41735618,
 40971032,
 41735619,
 40971033,
 39510933,
 41571780,
 39450921,
 40654277,
 40654278,
 40654279,
 41571784,
 40583283,
 40943303,
 40654281,
 41768192,
 40654282,
 39861187,
 41735627,
 39213056,
 40654284,
 41571790,
 40654285,
 40654286,
 41539346,
 41190107,
 41190108,
 41190109,
 41190110,
 41190111,
 41190112,
 41190113,
 41190114,
 41190115,
 41190116,
 41190117,
 41190118,
 41190119,
 41190120,
 41190121,
 41190122,
 41190123,
 41190124,
 41190125,
 41190126,
 40654291,
 39450924,
 41539347,
 40654292,
 39447761,
 40654293,
 39187962,
 38794614,
 40654294,
 39133567,
 40654295,
 41539348,
 40964035,
 38742782,
 40583305,
 39813337,
 39184632,
 39450927,
 41539350,
 39187942,
 38732631,
 38732632,
 38732633,
 38732634,
 38732635,
 38732636,
 38732637,
 38732638,
 38732639,
 38732640,
 38732641,
 38732642,
 38732643,
 38732644,
 38732645,
 38732646,
 38732647,
 38732648,
 38732649,
 38732650,
 38732651,
 40567660,
 40567661,
 40567662,
 40567663,
 40567664,
 40567665,
 40567666,
 40567667,
 40567668,
 40567669,
 40567670,
 40567671,
 40567672,
 40567673,
 40567674,
 40567675,
 40567676,
 40567677,
 40567678,
 40567679,
 40567680,
 40567681,
 40567682,
 40567683,
 40567684,
 40567685,
 40567686,
 40567687,
 40567688,
 40567689,
 40567690,
 40567691,
 40567692,
 40567693,
 40567694,
 40567695,
 40567696,
 40567697,
 41747346,
 41747347,
 41747348,
 41747349,
 41747350,
 41747351,
 41747352,
 41747353,
 41747354,
 41747355,
 41747356,
 41747357,
 41747358,
 41747359,
 41747360,
 41747361,
 41747362,
 41747363,
 41747364,
 41747365,
 41747366,
 41747367,
 41747368,
 41747369,
 41747370,
 41747371,
 41747372,
 41747373,
 41747374,
 41747375,
 41747376,
 41747377,
 41747378,
 41747379,
 41747380,
 41747381,
 41747382,
 41747383,
 41747384,
 41747385,
 41747386,
 40567739,
 40567740,
 40567741,
 40567742,
 40567743,
 41747392,
 41747393,
 40273643,
 38742788,
 40174553,
 40174554,
 40174555,
 40174556,
 40174557,
 40174558,
 40174559,
 40174560,
 40174561,
 40174562,
 40174563,
 40174564,
 40174565,
 40174566,
 40174567,
 40174568,
 40174569,
 40174570,
 40174571,
 40174572,
 39116671,
 39551983,
 39551985,
 39551986,
 39551987,
 39551988,
 39551989,
 39551990,
 39551991,
 39551992,
 39551993,
 39551994,
 39551995,
 39551996,
 39551997,
 39551998,
 39551999,
 39552000,
 39552001,
 39552002,
 39552003,
 39552004,
 39450933,
 39552006,
 39552007,
 39552008,
 39552009,
 39552010,
 39552011,
 39552012,
 39552013,
 39552014,
 39552015,
 39898046,
 39552017,
 39552018,
 39552019,
 39552020,
 39552021,
 39552022,
 39552023,
 39552024,
 39552025,
 39552026,
 39552027,
 39552028,
 39552029,
 39552030,
 39552031,
 39552032,
 39552033,
 39552034,
 39552035,
 39552036,
 39552037,
 39552038,
 39552039,
 39552040,
 39552041,
 39552042,
 39552043,
 39552044,
 39552045,
 39552046,
 39552047,
 39552048,
 39552049,
 39552050,
 39552051,
 39552052,
 39552053,
 39552054,
 39552055,
 39552056,
 39552057,
 39552058,
 39552059,
 39552060,
 39552061,
 39552062,
 40273647,
 39552064,
 39552065,
 39552066,
 39552067,
 39552068,
 39552069,
 39552070,
 39552071,
 39552072,
 39552073,
 39552074,
 40207435,
 40502348,
 40502349,
 40502350,
 40502351,
 40502352,
 40502353,
 40502354,
 40502355,
 40502356,
 40502357,
 40502358,
 40502359,
 40502360,
 40502361,
 40502362,
 40502363,
 40502364,
 40207453,
 40207454,
 40502367,
 40502368,
 40502369,
 40502370,
 40502371,
 40502372,
 40502373,
 40502374,
 40502375,
 40502376,
 40502377,
 40502378,
 40502379,
 40502380,
 40502381,
 40502382,
 40502383,
 40502384,
 40502385,
 40502386,
 40502387,
 40502388,
 40502389,
 40502390,
 40502391,
 40502392,
 40502393,
 40502394,
 40502395,
 40502396,
 40502397,
 40502398,
 40502399,
 40502400,
 40502401,
 40502402,
 40502403,
 40502404,
 40502405,
 40502406,
 40502407,
 40502408,
 40502409,
 38742794,
 40512749,
 40502412,
 40502413,
 40502414,
 40502415,
 39856838,
 40949272,
 40502418,
 40502419,
 40502420,
 40502421,
 40502422,
 40949273,
 40502424,
 40502425,
 40502426,
 40502427,
 40502428,
 40502429,
 40502430,
 40502431,
 40502432,
 40502433,
 40502434,
 40502435,
 40502436,
 40502437,
 40502438,
 40502439,
 38742795,
 40502441,
 40502442,
 40502443,
 39856839,
 40949277,
 41186095,
 40137403,
 39450939,
 41723626,
 40234243,
 40142018,
 40142019,
 40142020,
 40142021,
 40142022,
 40142023,
 40142024,
 40142025,
 40142026,
 40142027,
 40142028,
 40142029,
 40142030,
 38798543,
 40142032,
 38798545,
 38798546,
 38798547,
 38798548,
 38798549,
 38798550,
 38798551,
 38798552,
 38798553,
 38798554,
 38798555,
 38798556,
 38798557,
 38798558,
 38798559,
 38798560,
 38798561,
 38798562,
 38798563,
 38798564,
 38798566,
 38798567,
 38798568,
 38798569,
 38798570,
 38798571,
 38798572,
 38798573,
 38798574,
 38798575,
 38864112,
 38798577,
 38798578,
 38798579,
 38798580,
 38798581,
 38798582,
 38798583,
 38798584,
 38798585,
 38798586,
 38798587,
 38798588,
 38798589,
 38798590,
 38798591,
 38798592,
 38798593,
 38798594,
 38798595,
 41223428,
 41223429,
 41223430,
 41223431,
 41223432,
 41223433,
 41223434,
 41223435,
 41223436,
 41223437,
 41223438,
 41223439,
 41223440,
 38798609,
 38798610,
 38798611,
 38798612,
 38798613,
 38798614,
 38798615,
 38798616,
 38798617,
 38798618,
 38798619,
 38798620,
 38798621,
 38798622,
 38798623,
 38798624,
 38798625,
 38798626,
 38798627,
 38798628,
 38798629,
 38798630,
 38798631,
 38798632,
 38798633,
 38798634,
 38798635,
 38798636,
 38798637,
 38798638,
 39813341,
 38798640,
 38798641,
 39813342,
 41515527,
 39813343,
 39813344,
 39856844,
 41216961,
 38831430,
 39813345,
 38831432,
 38831433,
 38831434,
 38831435,
 38831436,
 38831437,
 38831438,
 38831439,
 38831440,
 38831441,
 38831442,
 38831443,
 38831444,
 38831445,
 38831446,
 38831447,
 38831448,
 38831449,
 38831450,
 38831451,
 38831453,
 38831454,
 38831455,
 38831456,
 38831457,
 38831458,
 38831459,
 38831460,
 38831461,
 38831462,
 38831464,
 38831465,
 38831466,
 38831467,
 38831468,
 38831469,
 38831470,
 38831471,
 38831472,
 38831473,
 38831474,
 38831475,
 38831476,
 38831477,
 38831478,
 38831479,
 38831480,
 38831481,
 38831482,
 38831483,
 38831484,
 38831485,
 38831486,
 38831487,
 38831488,
 38831489,
 38831490,
 38831491,
 38831492,
 38831493,
 38831494,
 38831495,
 38831496,
 ...]

In [4]:
snanaDeep.meta['COMMENTS']


Out[4]:
"COMMENT: LSST output_opsim2_168 year 01\nCOMMENT: deep fields\nCOMMENT: This SIMLIB created with command\nCOMMENT:   ' simlib_coadd.exe output_opsim2_168.SIMLIB '\nCOMMENT: Process input  SIMLIB file : output_opsim2_168.SIMLIB\nCOMMENT: Create  ouptut SIMLIB file : output_opsim2_168.SIMLIB.COADD\nCOMMENT: Select  MJD   between  20000.00 and  80000.00\nCOMMENT: Select  LIBID between 0 and 5000\nCOMMENT: Reject LIBID with < 3 exposures\nCOMMENT: Combine consecutive exposures within 0.400 days\nCOMMENT: Multiple exposures are 'SUMMED'"

In [5]:
snanaDeep.fieldIDs


Out[5]:
[2786, 519, 2731, 2412, 2082, 526, 1427, 311, 2712, 764]

In [6]:
snanaDeep.simlibDict[2786].meta['RA']


Out[6]:
150.361542

In [8]:
fieldIds = opsimSimlib.fieldIDs

In [14]:
lst = []
for fieldID in fieldIds:
    # My Calculations from OpSim
    opsimNobs = opsimSimlib.simlibData(fieldID).MJD.size
    # From the SNANA simlibs
    snanaData = snanaDeep.simlibData(fieldID)
    print snanaData.MJD.min(), snanaData.MJD.max()
    snanaData = snanaData[snanaData['MJD'] < 49561]
    print snanaData.MJD.min(), snanaData.MJD.max()
    snanaNobs = int(snanaData.NOISE.apply(lambda x: round((x / 0.25)**2.)).sum())
    # print fieldID, opsimNobs, snanaNobs,  float(opsimNobs) / float(snanaNobs)
    lst.append([fieldID, opsimNobs, snanaNobs,  float(opsimNobs) / float(snanaNobs)])


49400.27 52825.082
49400.27 49560.988
49354.066 52993.172
49354.066 49416.082
49498.406 52958.098
49498.406 49556.305
49530.441 52987.121
49530.441 49559.359
49365.324 52758.0
49365.324 49484.984
49471.418 52951.195
49471.418 49559.184
49354.035 52991.344
49354.035 49411.051
49501.43 52937.051
49501.43 49555.156
49530.43 52984.23
49530.43 49559.332
49495.402 52992.074
49495.402 49552.277

In [15]:
df = pd.DataFrame(np.array(lst), columns=['fieldID', 'OpSimVisits', 'SNANAVisits', 'frac'])
df


Out[15]:
fieldID OpSimVisits SNANAVisits frac
0 2082 1995 2225 0.896629
1 519 2111 298 7.083893
2 2731 1095 357 3.067227
3 2412 1762 16 110.125000
4 2786 1709 1820 0.939011
5 526 1859 406 4.578818
6 1427 1762 33 53.393939
7 311 1781 591 3.013536
8 2712 2062 12 171.833333
9 764 2779 351 7.917379

In [16]:
opsimSimlib.simlibData(2082).MJD


Out[16]:
0       49400.276
1       49400.276
2       49400.277
3       49400.277
4       49400.278
5       49400.278
6       49400.278
7       49400.279
8       49400.279
9       49400.280
10      49403.244
11      49403.245
12      49403.245
13      49403.246
14      49403.246
15      49403.247
16      49403.247
17      49403.247
18      49403.248
19      49403.248
20      49406.235
21      49406.235
22      49406.235
23      49406.236
24      49406.236
25      49406.237
26      49406.237
27      49406.238
28      49406.238
29      49406.238
          ...    
1965    49534.124
1966    49534.125
1967    49534.125
1968    49534.125
1969    49558.007
1970    49558.008
1971    49558.008
1972    49558.009
1973    49558.009
1974    49558.010
1975    49558.010
1976    49558.010
1977    49558.011
1978    49558.011
1979    49558.012
1980    49558.012
1981    49558.012
1982    49558.013
1983    49558.013
1984    49558.014
1985    49558.014
1986    49558.015
1987    49558.015
1988    49558.015
1989    49558.016
1990    49558.016
1991    49558.017
1992    49558.017
1993    49558.017
1994    49558.018
Name: MJD, dtype: float64

In [18]:
snanaDeep.simlibData(fieldID).MJD.max()


Out[18]:
52992.074000000001

In [19]:
snanaData.MJD.max()


Out[19]:
49552.277000000002

Example Calculation to demonstrate Estimating the number of exposures in CoAdds


In [21]:
d = snanaDeep.simlibData(2082)
d['numCoadded'] = d['NOISE'].apply(lambda x: round((x / 0.25)**2.))
d = d[d['MJD'] < 49561]
d


Out[21]:
MJD IDEXPT FLT GAIN NOISE SKYSIG PSF1 PSF2 PSFRatio ZPTAVG ZPTERR MAG numCoadded
0 49400.281 3602082 g 1 0.90 71.72 1.72 0 0 34.50 0.005 -99 13
1 49400.270 3602082 r 1 1.15 123.29 1.68 0 0 35.04 0.005 -99 21
2 49400.293 3602082 i 1 1.27 197.76 1.69 0 0 35.09 0.005 -99 26
3 49400.297 3602082 z 1 1.27 199.13 1.68 0 0 34.54 0.005 -99 26
4 49400.309 3602082 Y 1 1.12 169.88 1.68 0 0 32.77 0.005 -99 20
5 49403.246 3602082 g 1 0.79 63.98 1.49 0 0 34.16 0.005 -99 10
6 49403.238 3602082 r 1 1.15 126.78 1.49 0 0 35.02 0.005 -99 21
7 49403.258 3602082 i 1 1.20 191.78 1.47 0 0 34.94 0.005 -99 23
8 49403.266 3602082 z 1 1.30 208.19 1.49 0 0 34.57 0.005 -99 27
9 49403.277 3602082 Y 1 1.15 178.04 1.49 0 0 32.83 0.005 -99 21
10 49406.238 3602082 g 1 0.79 174.40 2.00 0 0 34.12 0.005 -99 10
11 49406.230 3602082 r 1 1.12 224.81 2.00 0 0 34.94 0.005 -99 20
12 49406.246 3602082 i 1 1.17 243.83 2.04 0 0 34.88 0.005 -99 22
13 49406.258 3602082 z 1 1.35 249.12 2.05 0 0 34.64 0.005 -99 29
14 49406.266 3602082 Y 1 1.15 178.99 1.99 0 0 32.82 0.005 -99 21
15 49407.281 3612082 Y 1 0.35 54.50 1.90 0 0 30.27 0.005 -99 2
16 49416.406 3602082 g 1 0.25 107.20 2.00 0 0 31.69 0.005 -99 1
17 49416.402 3602082 r 1 1.12 515.13 2.00 0 0 34.98 0.005 -99 20
18 49419.387 3602082 g 1 0.83 76.29 2.21 0 0 34.33 0.005 -99 11
19 49419.379 3602082 r 1 1.15 121.98 2.20 0 0 35.06 0.005 -99 21
20 49419.395 3602082 i 1 1.15 177.60 2.20 0 0 34.86 0.005 -99 21
21 49419.406 3602082 z 1 0.94 467.19 2.20 0 0 33.85 0.005 -99 14
22 49421.375 3602082 u 1 1.20 24.16 1.68 0 0 33.28 0.005 -99 23
23 49432.242 3602082 g 1 0.90 70.30 1.85 0 0 34.55 0.005 -99 13
24 49432.230 3602082 r 1 1.15 118.57 1.85 0 0 35.07 0.005 -99 21
25 49432.258 3602082 i 1 1.27 192.34 1.83 0 0 35.11 0.005 -99 26
26 49432.258 3602082 z 1 1.27 193.30 1.85 0 0 34.55 0.005 -99 26
27 49432.266 3602082 Y 1 1.12 165.93 1.85 0 0 32.78 0.005 -99 20
28 49435.160 3602082 g 1 0.79 176.63 2.11 0 0 34.13 0.005 -99 10
29 49435.152 3602082 r 1 1.12 230.92 2.11 0 0 34.94 0.005 -99 20
... ... ... ... ... ... ... ... ... ... ... ... ... ...
89 49504.977 3602082 r 1 1.15 123.59 2.40 0 0 35.02 0.005 -99 21
90 49504.996 3602082 i 1 1.20 187.30 2.36 0 0 34.95 0.005 -99 23
91 49505.004 3602082 z 1 1.27 199.71 2.40 0 0 34.53 0.005 -99 26
92 49505.016 3602082 Y 1 1.12 170.21 2.40 0 0 32.77 0.005 -99 20
93 49507.988 3602082 g 1 0.90 71.41 2.06 0 0 34.49 0.005 -99 13
94 49507.977 3602082 r 1 1.15 122.71 2.05 0 0 35.04 0.005 -99 21
95 49507.996 3602082 i 1 1.20 185.93 2.04 0 0 34.96 0.005 -99 23
96 49508.004 3602082 z 1 1.27 198.40 2.05 0 0 34.54 0.005 -99 26
97 49508.016 3602082 Y 1 1.12 169.29 2.05 0 0 32.77 0.005 -99 20
98 49509.980 3602082 u 1 1.22 23.62 2.78 0 0 33.17 0.005 -99 24
99 49511.977 3602082 u 1 1.20 23.30 2.53 0 0 33.15 0.005 -99 23
100 49526.164 3612082 z 1 0.35 95.98 1.44 0 0 31.70 0.005 -99 2
101 49531.004 3602082 r 1 0.61 65.05 2.20 0 0 33.71 0.005 -99 6
102 49534.105 3602082 g 1 0.90 71.85 2.29 0 0 34.46 0.005 -99 13
103 49534.094 3602082 r 1 1.15 121.49 2.19 0 0 35.05 0.005 -99 21
104 49534.113 3602082 i 1 1.20 191.13 2.22 0 0 34.93 0.005 -99 23
105 49534.121 3602082 z 1 1.27 208.28 2.19 0 0 34.51 0.005 -99 26
106 49534.133 3602082 Y 1 1.12 182.16 2.19 0 0 32.73 0.005 -99 20
107 49540.980 3602082 u 1 1.20 24.21 1.73 0 0 33.35 0.005 -99 23
108 49542.980 3602082 u 1 1.20 24.57 1.42 0 0 33.39 0.005 -99 23
109 49547.031 3612082 z 1 0.56 95.25 1.57 0 0 32.75 0.005 -99 5
110 49551.090 3612082 Y 1 0.35 58.96 1.76 0 0 30.23 0.005 -99 2
111 49552.980 3612082 z 1 0.43 147.85 1.52 0 0 32.20 0.005 -99 3
112 49557.023 3612082 z 1 0.50 94.51 1.59 0 0 32.50 0.005 -99 4
113 49557.992 3602082 g 1 0.83 64.64 2.38 0 0 34.35 0.005 -99 11
114 49557.988 3602082 r 1 1.15 117.79 2.37 0 0 35.07 0.005 -99 21
115 49558.004 3602082 i 1 1.20 186.40 2.37 0 0 34.96 0.005 -99 23
116 49558.012 3602082 z 1 1.27 198.39 2.37 0 0 34.53 0.005 -99 26
117 49558.023 3602082 Y 1 1.12 172.64 2.37 0 0 32.76 0.005 -99 20
118 49560.988 3602082 r 1 0.56 58.00 1.82 0 0 33.51 0.005 -99 5

119 rows × 13 columns


In [22]:
0.25 * np.sqrt(13.)


Out[22]:
0.90138781886599728

In [23]:
d.numCoadded.sum()


Out[23]:
2225.0

In [26]:
d = snanaDeep.simlibData(519)
d['numCoadded'] = d['NOISE'].apply(lambda x: round((x / 0.25)**2.))
d = d[d['MJD'] < 49561]
d


Out[26]:
MJD IDEXPT FLT GAIN NOISE SKYSIG PSF1 PSF2 PSFRatio ZPTAVG ZPTERR MAG numCoadded
0 49354.070 3600519 g 1 0.83 65.00 1.79 0 0 34.35 0.005 -99 11
1 49354.066 3600519 r 1 1.15 119.05 1.78 0 0 35.07 0.005 -99 21
2 49354.098 3600519 i 1 1.35 211.92 1.82 0 0 35.21 0.005 -99 29
3 49354.090 3600519 z 1 1.27 195.51 1.78 0 0 34.55 0.005 -99 26
4 49354.102 3600519 Y 1 1.12 168.15 1.78 0 0 32.78 0.005 -99 20
5 49355.211 3610519 Y 1 0.79 125.56 1.63 0 0 32.00 0.005 -99 10
6 49356.199 3610519 Y 1 0.61 95.94 1.76 0 0 31.46 0.005 -99 6
7 49363.070 3600519 u 1 1.30 26.45 1.50 0 0 33.50 0.005 -99 27
8 49365.066 3600519 u 1 1.20 24.38 1.51 0 0 33.33 0.005 -99 23
9 49375.070 3600519 g 1 0.79 152.61 2.18 0 0 34.23 0.005 -99 10
10 49375.062 3600519 r 1 1.12 197.59 2.18 0 0 35.00 0.005 -99 20
11 49375.078 3600519 i 1 1.17 231.20 2.17 0 0 34.92 0.005 -99 22
12 49375.090 3600519 z 1 1.41 256.76 2.14 0 0 34.76 0.005 -99 32
13 49375.098 3600519 Y 1 1.15 174.93 2.17 0 0 32.83 0.005 -99 21
14 49377.188 3610519 z 1 0.43 89.46 2.51 0 0 32.15 0.005 -99 3
15 49382.055 3610519 z 1 0.43 137.86 2.14 0 0 32.19 0.005 -99 3
16 49411.117 3610519 Y 1 0.35 59.28 1.54 0 0 30.23 0.005 -99 2
17 49412.070 3610519 Y 1 0.79 126.16 2.09 0 0 32.00 0.005 -99 10
18 49416.082 3610519 r 1 0.35 38.93 2.03 0 0 32.45 0.005 -99 2

In [27]:
fig, ax = plt.subplots()
f1 = opsimSimlib.simlibData(519).hist(column='MJD', by='FLT', histtype='step', ax=ax, lw=2.0, sharex=True)


/usr/local/manual/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.py:3227: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
  "is being cleared", UserWarning)

In [28]:
d.hist(column='MJD', by='FLT', histtype='step', lw=2.0, ls='dashed', color='r')


Out[28]:
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x10af66250>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x109d0e110>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x109df5a90>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x109d52a90>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x109dce8d0>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x10b23a710>]], dtype=object)

In [ ]:


In [ ]: