I have a spectrometer which is generating time-series data every 100ms. I'd like to analyze/plot this data in Mathematica, but I'm not certain the best way to do it.
It's in this form:
| 300 | 301 | ... | 700|
0 | y0 | y1 | ... | yn |
100| ... | ... | ... | ...|
I can import the data and extract it just fine
data = Import["testingdata.txt","TSV"];
wavelength = data[[30,3;;]];
unixtime = data[[31;;,2]];
absorbance = data[[31;;,3;;]];
Where the file headers take up rows 1;;29.
Naively using ListPlot
to plot absorbance
does provide a time series result, but I was wondering if there's a way to create a TimeSeries
object to store this multidimensional data (TimeSeries Documentation). Looking at the Docs, it looks like I would have to create a TimeSeries
object for each wavelength in my spectrum, which is not ideal. Is there a better way to do this? I see that the TemporalData
function is a more generalized version of TimeSeries
but it doesn't seem to have support for {t_i,v_i1,v_i2...}
data.
Edit 1: Per @Domen's comment, TimeSeries
does support arrays:
ts = TimeSeries[Transpose[{unixtime,absorbance}]]
Edit 2: I created a 3D plot showing essentially how I'd like to visualize the data, but I want to condense it down to 2D.
TimeSeries
object.ts = TimeSeries[Transpose[{unixtime, absorbance}]]
$\endgroup$Table
, but I'd like to visualize the data in a ListPlot where the x axis is wavelength, and all of the absorbance traces are coplotted and colored according to their timestamp. $\endgroup$