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

Example.ipynb error #4

Open
ejsafron opened this issue Oct 24, 2018 · 2 comments
Open

Example.ipynb error #4

ejsafron opened this issue Oct 24, 2018 · 2 comments

Comments

@ejsafron
Copy link

Hello,

Running the Example.ipynb returns an error at input [7], attempting to call two files that are not in the repository. (I know you're still in the midst of overhauling, but I figured I'd leave this here just in case it slipped by you.)

Full error message below.

Emily


OSError Traceback (most recent call last)
~/Namaste/namaste/namaste.py in getKeplerLDs(Ts, logg, FeH, how)
1427 try:
-> 1428 arr = np.genfromtxt("/Users/hosborn/Postdoc/K2/Namaste_2/namaste/KeplerLDlaws.txt",skip_header=2)
1429 except:

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py in genfromtxt(fname, dtype, comments, delimiter, skip_header, skip_footer, converters, missing_values, filling_values, usecols, names, excludelist, deletechars, replace_space, autostrip, case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise, max_rows, encoding)
1688 if isinstance(fname, basestring):
-> 1689 fhd = iter(np.lib._datasource.open(fname, 'rt', encoding=encoding))
1690 own_fhd = True

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/_datasource.py in open(path, mode, destpath, encoding, newline)
259 ds = DataSource(destpath)
--> 260 return ds.open(path, mode, encoding=encoding, newline=newline)
261

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/_datasource.py in open(self, path, mode, encoding, newline)
615 else:
--> 616 raise IOError("%s not found." % path)
617

OSError: /Users/hosborn/Postdoc/K2/Namaste_2/namaste/KeplerLDlaws.txt not found.

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
in ()
1 #We need to use Teff and Logg information to initialise Limb Darkening (default: Kepler)
----> 2 st.initLD()

~/Namaste/namaste/namaste.py in initLD(self)
475 def initLD(self):
476 if not hasattr(self,'LD1s'):
--> 477 self.EstLimbDark()
478 #Getting LD parameters for transit modelling:
479 self.LDprior={'LD1':[0,1.0,'gaussian',np.median(self.LD1s),np.std(self.LD1s)],

~/Namaste/namaste/namaste.py in EstLimbDark(self)
235 else:
236 #assume mission==Kepler
--> 237 LDs=getKeplerLDs(self.steffs,logg=self.sloggs,FeH=self.sfeh)
238
239 pctns=np.percentile(LDs[0],[15.865525393145707, 50.0, 84.13447460685429])

~/Namaste/namaste/namaste.py in getKeplerLDs(Ts, logg, FeH, how)
1428 arr = np.genfromtxt("/Users/hosborn/Postdoc/K2/Namaste_2/namaste/KeplerLDlaws.txt",skip_header=2)
1429 except:
-> 1430 arr = np.genfromtxt("/home/hosborn/Namaste/Namaste_2/namaste/KeplerLDlaws.txt",skip_header=2)
1431 FeHarr=np.unique(arr[:, 2])
1432 #Just using a single value of FeH

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py in genfromtxt(fname, dtype, comments, delimiter, skip_header, skip_footer, converters, missing_values, filling_values, usecols, names, excludelist, deletechars, replace_space, autostrip, case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise, max_rows, encoding)
1687 fname = str(fname)
1688 if isinstance(fname, basestring):
-> 1689 fhd = iter(np.lib._datasource.open(fname, 'rt', encoding=encoding))
1690 own_fhd = True
1691 else:

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/_datasource.py in open(path, mode, destpath, encoding, newline)
258
259 ds = DataSource(destpath)
--> 260 return ds.open(path, mode, encoding=encoding, newline=newline)
261
262

/opt/anaconda3/lib/python3.6/site-packages/numpy/lib/_datasource.py in open(self, path, mode, encoding, newline)
614 encoding=encoding, newline=newline)
615 else:
--> 616 raise IOError("%s not found." % path)
617
618

OSError: /home/hosborn/Namaste/Namaste_2/namaste/KeplerLDlaws.txt not found.

@hposborn
Copy link
Owner

Ah yes, that was a stupid mistake by me hard-coding a position on my machine. Thanks for calling it out, I have edited that now, so it ooints to the LDlaws file in the namaste folder.

@ejsafron
Copy link
Author

Ah yes, that was a stupid mistake by me hard-coding a position on my machine. Thanks for calling it out, I have edited that now, so it ooints to the LDlaws file in the namaste folder.

It still threw an error for me, but it worked when I changed the paths in namaste.py to call "namaste/KeplerLDlaws.txt".

Emily

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

2 participants