예제 #1
0
def snobj():
   import snpy
   snobj = snpy.get_sn('SN2006ax.txt')
   return snobj
예제 #2
0
파일: test_snpy.py 프로젝트: obscode/snpy
def test_sn_inequality(snobj):
   from snpy import get_sn
   sn2 = get_sn('SN2006ax.txt')
   sn2.B.MJD[0] += 0.1
   assert sn2 != snobj
예제 #3
0
 def test_loadTxt(self):
    s = snpy.get_sn(os.path.join(self.data, 'SN2006ax.txt'))
    self.assertEqual(s.name, "SN2006ax")
예제 #4
0
파일: test_snpy.py 프로젝트: obscode/snpy
def test_save_load(snobj):
   import snpy
   snobj.save('temp.snpy')
   t = snpy.get_sn('temp.snpy')
   assert snobj == t
예제 #5
0
파일: test_snpy.py 프로젝트: obscode/snpy
def test_object_equality(snobj):
   from snpy import get_sn
   sn2 = get_sn('SN2006ax.txt')
   assert sn2 == snobj
예제 #6
0
def snobj():
   import snpy
   snobj = snpy.get_sn('SN2006ax.txt')
   for f in snobj.data:
      snobj.data[f].template(method='spline2')
   return snobj
예제 #7
0
파일: test_snpy.py 프로젝트: obscode/snpy
def snobj():
   import snpy
   return snpy.get_sn('SN2006ax.txt')
예제 #8
0
def test_sn_inequality(snobj):
    from snpy import get_sn
    sn2 = get_sn('SN2006ax.txt')
    sn2.B.MJD[0] += 0.1
    assert sn2 != snobj
예제 #9
0
파일: doTesting.py 프로젝트: obscode/snpy
 def test_loadTxt(self):
     s = snpy.get_sn(os.path.join(self.data, "SN2006ax.txt"))
     self.assertEqual(s.name, "SN2006ax")
예제 #10
0
def test_save_load(snobj):
    import snpy
    snobj.save('temp.snpy')
    t = snpy.get_sn('temp.snpy')
    assert snobj == t
예제 #11
0
def test_object_equality(snobj):
    from snpy import get_sn
    sn2 = get_sn('SN2006ax.txt')
    assert sn2 == snobj
예제 #12
0
		'J_K':  J-band for Swope at LCO
		'H_K':  H-band for Swope at LCO
		'K_K':  K-band for Swope at LCO
	stritzinger
		'Us':  Kron-Cousins U filter based on Stritzinger et al. 2005
		'Bs':  Kron-Cousins B filter based on Stritzinger et al. 2005
		'Vs':  Kron-Cousins B filter based on Stritzinger et al. 2005
		'Rs':  Kron-Cousins R filter based on Stritzinger et al. 2005
		'Is':  Kron-Cousins I filter based on Stritzinger et al. 2005
'''

datpath = '/data1/SN2019ein/work/lc_v2/'
datpath = '/data7/cschoi/sngal/NGC3367/phot/cut/fitting/'
# open new terminal and type 'snpy' starting with new environmnet, to avoid sql connetion error

s = get_sn('SN2018kp_snpy.txt', sql=None)
​
# 2nd try
model = 'EBV_model'
s.choose_model(model, stype='dm15')
​
s.restbands['BANDI']  = 'Bi'
s.restbands['VANDI']  = 'Vi'
s.restbands['RANDI']  = 'Ri'
s.restbands['IANDI']  = 'Ii'
s.restbands['WFCAMJ'] = 'WFCAMJ'
s.restbands['WFCAMH'] = 'WFCAMH'
s.restbands['WFCAMK'] = 'WFCAMK'
​
#s.fit( mangle=True, kcorr=True, k_stretch=True) # 20201009 -> success!
#DM = 33.003  +/-  0.012  +/- 0.121 (sys)
예제 #13
0
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
from snpy import get_sn
from snpy.utils import fit1dcurve
from snpy.version import __version__

# Test the loading of the objects, interpolating the light-curves, and
# computing k-corrections.

s = get_sn('SN2006ax.txt')
for f in s.data:
   s.data[f].template()
s.kcorr()
s.save('SN2006ax_kcorr.snpy')
s.save('old_saves/SN2006ax_kcorr-%s.snpy' % __version__)

methods = fit1dcurve.functions.keys()

for method in methods:
   s.B.template(method=method)
   s.B.plot()

예제 #14
0
from os import listdir
from os.path import isfile, join

########## Customer set ##################################################

figfolder = "/Users/yanxiaomeng/Dropbox/project/snoopy/pipeline/Figs/ThirdReleaseData/004kcorr/"  # Figure output path
mypath = "/Users/yanxiaomeng/Dropbox/project/snoopy/pipeline/Data/ThirdReleaseData/FormateBVRI/"  # Read in path
ksfolder = "/Users/yanxiaomeng/Dropbox/project/snoopy/pipeline/Data/ThirdReleaseData/kCorrected/"  # File output path
###########################################################################

onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]

f = 17
print f
filepath = mypath + onlyfiles[f]
s = snpy.get_sn(filepath)
s.restbands['B'] = 'Bs'
s.restbands['r'] = 'Rs'
s.restbands['i'] = 'Is'
s.restbands['V0'] = 'V'
s.restbands['V'] = 'V'
s.fit()
figpath = figfolder + onlyfiles[f] + "lc.png"
s.plot()
matplotlib.pyplot.savefig(figpath)

# for f in range(0, len(onlyfiles)):
#     f = 17
#     try:
#         print f
#         filepath = mypath + onlyfiles[f]
예제 #15
0
파일: test_lira.py 프로젝트: ysnowland/snpy
def snobj():
    import snpy
    s = snpy.get_sn('SN2006ax.txt')
    s.choose_model('max_model', stype='st')
    s.fit(['B', 'V'])
    return s
예제 #16
0
def snobj():
    import snpy

    snobj = snpy.get_sn("SN2006ax.txt")
    return snobj
예제 #17
0
def snobj():
    import snpy
    snobj = snpy.get_sn('SN2006ax.txt')
    for f in snobj.data:
        snobj.data[f].template(method='spline2')
    return snobj
예제 #18
0
파일: test_lira.py 프로젝트: obscode/snpy
def snobj():
   import snpy
   s = snpy.get_sn('SN2006ax.txt')
   s.choose_model('max_model', stype='st')
   s.fit(['B','V'])
   return s