|
1 |
| -# IPython log file |
| 1 | +from __future__ import absolute_import, print_function, division |
2 | 2 |
|
3 | 3 | import analyzeSN as ans
|
4 | 4 | import os
|
5 | 5 | import pandas as pd
|
6 | 6 | from pandas.util.testing import assert_frame_equal
|
7 |
| -registeredBandName = tuple('mega_' + band for band in 'ugriz') |
| 7 | +registeredMegaCamBands = tuple('mega_' + band for band in 'ugriz') |
8 | 8 | def test_load():
|
9 |
| - headFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_HEAD.FITS') |
10 |
| - photFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_PHOT.FITS') |
11 |
| - sne = ans.SNANASims(headFile=headFile, photFile=photFile, coerce_inds2int=False, |
12 |
| - SNANABandNames='urgiz', registeredBandName=registeredMegaCam) |
| 9 | + headFile = os.path.join(ans.__path__[0], 'example_data', |
| 10 | + 'snana_fits_HEAD.FITS') |
| 11 | + photFile = os.path.join(ans.__path__[0], 'example_data', |
| 12 | + 'snana_fits_PHOT.FITS') |
| 13 | + sne = ans.SNANASims(headFile=headFile, photFile=photFile, |
| 14 | + coerce_inds2int=False, |
| 15 | + SNANABandNames='ugriz', |
| 16 | + registeredBandNames=registeredMegaCamBands) |
| 17 | + print(sne.bandNames) |
13 | 18 | assert sne.bandNames == 'ugriz'
|
14 | 19 | assert sne.newbandNames == ('mega_u', 'mega_g', 'mega_r', 'mega_i',
|
15 | 20 | 'mega_z')
|
16 |
| - assert len(sne.bandNameDict.keys()) == 6 |
| 21 | + assert len(sne.bandNameDict.keys()) == 5 |
17 | 22 | assert len(sne.headData) == 2
|
18 | 23 | assert len(sne.get_SNANA_photometry(snid='03d1aw').lightCurve) > 0
|
19 | 24 | assert len(sne.get_SNANA_photometry(snid='03d1ax').lightCurve) > 0
|
20 | 25 | def test_snanadatafiles():
|
21 |
| - headFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_HEAD.FITS') |
22 |
| - photFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_PHOT.FITS') |
23 |
| - #sne = ans.SNANASims(headFile=headFile, photFile=photFile, coerce_inds2int=False) |
| 26 | + headFile = os.path.join(ans.__path__[0], 'example_data', |
| 27 | + 'snana_fits_HEAD.FITS') |
| 28 | + photFile = os.path.join(ans.__path__[0], 'example_data', |
| 29 | + 'snana_fits_PHOT.FITS') |
24 | 30 | loc = os.path.join(ans.__path__[0], 'example_data')
|
25 | 31 | testheadFile = ans.SNANASims.snanadatafile(snanafileroot='snana_fits',
|
26 | 32 | filetype='head',
|
|
0 commit comments