Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.2K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Problem with data in table

Posted 10 years ago

Hi,

I have a certain trouble with working with data I have in the table and after few days of thinking I cannot find a solution which would work fast.

The data (map of spectra) I need to work with is imported from the file as a table with following columns:

{position x, position y, spectrum parameter (x1), spectrum intensity (y1)}

Now, I need to substract background and fit a gauss curve for each of the spectra. I tried using EstimatedBackground[] on the whole column with intensities, however, it is far from elegant and leads to mistakes in the background substraction near the beginnings and ends of spectra.

So how to reference spectra in each of the points separately? How to create a tables of spectra with background substracted and tables of fitting parameters in each point (fitting itself is not a problem, I'm doing that currently by selecting each position manually and deleting rows with different x and y, however it takes few hours to compute map with about 1000 points)?

could you please help me? thanks in advance

POSTED BY: Igor Wlasny
4 Replies

Alright, I got it to work! Thank you kindly for help!!!

POSTED BY: Igor Wlasny
Posted 10 years ago

Hi Igor, I attach a notebook which may help. I have used the GatherBy function to separate the data into a list of lists, where the inner lists are the data associated with a unique coordinate pair. Then we look at this data by extracting the appropriate parts. I only plotted the data but, once separated, anything could be done with it.

Kind regards, David

Edit: Attached file replaced with corrected version

Attachments:
POSTED BY: David Keith

Thanx for answer. To make the data format more clear: The data is a map of spectra. So we have a grid/matrix of spatial points (lets take 2x2 grid as an example). Now in each of the points the spectrum is taken (in example range will be 100-300, with 3 points). So that the simplified table, as imported into mathematica looks like following:

{{1,1,100,1},{1,1,200,4},{1,1,300,2},{1,2,100,2},{1,2,200,4},{1,2,300,1},{2,1,100,1},{2,1,200,4},{2,1,300,2},{2,2,100,1},{2,1,200,2},{2,2,300,1}}

So, first two columns are the position in the grid of the map, and third and fourth columns are the spectra. (i'm also attaching real data file with more points if it helps)

Now, when I remove background from the fourth column it will generate errors near the ends, since mathematica thinks this is just one long string of data. Instead, I'm trying to find a way to access each of the spectra in point separately in order to remove the background for spectrum, fit the curve and then generate a tables of the fitted parameters for each of the points of map.

Attachments:
POSTED BY: Igor Wlasny
Posted 10 years ago

Hi Igor,

I am not sure what you mean. Is it that there are data for 2 spectra. One data set is given by the columns headed "position x" and "spectrum parameter (x1)" and the other by the columns headed "position y" and "spectrum intensity (y1)" ? If so, why is a different name -- parameter or intensity -- used for the 2 data sets?

And you wish to fit each separately to a Gaussian with a background noise removed? And you want the fitting parameters for each? And also to generate a corrected table?

Perhaps you could provide some more information, and also attach some data.

Best regards, David

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard