mzechmeister / GLS

Generalised Lomb-Scargle periodogram
MIT License
35 stars 5 forks source link

Format of file for JavaScript version ? #13

Closed PideaLtd closed 4 years ago

PideaLtd commented 4 years ago

Hi, I'm trying to use the online version to see if this will do what I want and I cannot get my test data to import.

I've got a text file with two columns (time and date) separated by a comma with a newline character at the end of each line like this:

1140666.655017,635

When I've loaded the file I just get my time values in the t column but y and yerr show NaN. Adding a third column with a value for yerr results in the same output.

Presumably my format is wrong but there's no example to work from. Could an example be added ?

mzechmeister commented 4 years ago

Hi,

Thanks for this report. It should work with columns separated with blanks. This is indeed very misleading, because it is not documented and the code uses names labelled with csv in several places.

As a quick hack to get it working with commas, you could modify line L44 with the regex /,/:

https://github.com/mzechmeister/GLS/blob/c5edfaf276d30c8ec83d16d1cb19cd17fa34c0b1/javascript/gls.html#L41-L47

I will try to find a flexible solution which can handle several separators.

PS: On githack, I see now a number of content blocking errors. But this is working: http://www.astro.physik.uni-goettingen.de/~zechmeister/GLS/gls.html

PideaLtd commented 4 years ago

Ah, I didn't think to try spaces - doh ! I did try commas and tabs though.

Thanks for the clarification