Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Header in Phot Currently - Create Defaults? #1

Open
RobFirth opened this issue Jan 4, 2017 · 0 comments
Open

Need Header in Phot Currently - Create Defaults? #1

RobFirth opened this issue Jan 4, 2017 · 0 comments
Assignees

Comments

@RobFirth
Copy link
Owner

RobFirth commented Jan 4, 2017

need to fix bug with needing a header line for some load operations.

If no header, get the following:

>>>P_new = pcc.load('/Users/berto/Code/CoCo/data/lc/SN2011dh.dat')
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-2ef8fe586f28> in <module>()
----> 1 P_new = pcc.load('/Users/berto/Code/CoCo/data/lc/SN2011dh.dat')

/Users/berto/Code/verbose-enigma/pycoco/__init__.py in load(path, format, verbose)
    956 def load(path, format = "ascii", verbose = True):
    957     pc = PhotometryClass()
--> 958     pc.phot = load_formatted_phot(path, format = "ascii", verbose = verbose)
    959     pc.unpack(verbose = verbose)
    960     return pc

/Users/berto/Code/verbose-enigma/pycoco/__init__.py in load_formatted_phot(path, format, verbose)
    947     phot_table.meta = {"filename" : path}
    948 
--> 949     phot_table["MJD"].unit = u.day
    950     phot_table["flux"].unit = u.cgs.erg / u.si.angstrom / u.si.cm ** 2 / u.si.s
    951     phot_table["flux_err"].unit =  phot_table["flux"].unit

/Users/berto/anaconda2/lib/python2.7/site-packages/astropy/table/table.pyc in __getitem__(self, item)
   1157     def __getitem__(self, item):
   1158         if isinstance(item, six.string_types):
-> 1159             return self.columns[item]
   1160         elif isinstance(item, (int, np.integer)):
   1161             return self.Row(self, item)

/Users/berto/anaconda2/lib/python2.7/site-packages/astropy/table/table.pyc in __getitem__(self, item)
     96         """
     97         if isinstance(item, six.string_types):
---> 98             return OrderedDict.__getitem__(self, item)
     99         elif isinstance(item, (int, np.integer)):
    100             return self.values()[item]

KeyError: 'MJD'
@RobFirth RobFirth self-assigned this Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant