Exo-TiC / ExoTiC-ISM

This is a repository for the reduction pipeline detailed in Wakeford, et al., 2016, ApJ. The method implements marginalization across a series of models to represent stochastic models for observatory and instrument systematics. This is primarily for HST WFC3, however, may be extended to STIS in the future.
MIT License
8 stars 6 forks source link

changing loadtxt to use comments as # not as skiprows #123

Closed lili-alderson closed 3 years ago

lili-alderson commented 3 years ago

light curve fitting previously loaded in lc and wavelength txt files uses skiprows to avoid headers - this required the user's files to have the exact right number of lines as a header or data would also be skipped. np.loadtxt now uses comments="#" to make this robust for all python headers no matter the number of lines

hrwakeford commented 3 years ago

I ran ExoTiC-ISM from develop to get a comparison file, and then tried to run it with this change and it cannot read in the test files properly, with the following error:

WORKING ON EXOPLANET W17

Traceback (most recent call last):
  File "marginalisation.py", line 738, in <module>
    x, y, err, sh = np.loadtxt(os.path.join(dataDir, get_timeseries), comments="#", unpack=True)
  File "/Users/iz19726/miniconda3/envs/exoticism/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1159, in loadtxt
    for x in read_data(_loadtxt_chunksize):
  File "/Users/iz19726/miniconda3/envs/exoticism/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1087, in read_data
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/Users/iz19726/miniconda3/envs/exoticism/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1087, in <listcomp>
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/Users/iz19726/miniconda3/envs/exoticism/lib/python3.7/site-packages/numpy/lib/npyio.py", line 794, in floatconv
    return float(x)
ValueError: could not convert string to float: 'WASP-17b'
hrwakeford commented 3 years ago

This appears to be because the test files do not have comments using # this will need to be updated in the files and documented clearly in a commit

hrwakeford commented 3 years ago

Could you also please add in a comment in the file stating the need for comment lines in the data files using #

lili-alderson commented 3 years ago

Could you also please add in a comment in the file stating the need for comment lines in the data files using #

This will work best in the README.md, I will leave it to you to decide on how best to fold in new wording

hrwakeford commented 3 years ago

detail has been added to the readme file to state that headers should start with #