The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Binning of size-frequency data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

OtmarGeiss

Italy
4 Posts

Posted - 06/10/2019 :  08:10:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015 b9.2.257
Operating System:Windows 7

Hello,
we haven an instrument which measures the size of particles.
The output of the instrument is size and frequency of each size.

x-axis data: size
y-axis data: frequency


The size of the particles is expressed in decimals.
Example:

Size [nm] Frequency
...
74.31 9
75.16 19
75.98 10
76.79 9
...

I would like to plot the data in 1nm bins on the x-axis. In the above example I would therefore obtain:

Size [nm] Frequency
74 9
75 29
76 9

How can I transform the decimal data into 1nm bins with automatic addition of the frequency for each bin?

I hope my question is clear enough.
Thank you very much.
Otmar

YimingChen

1618 Posts

Posted - 06/10/2019 :  10:08:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Otmar,

Please go to menu Analysis: Data manipulation: Reduce by group. then make the following settings:
Input: Your data
SubGroup Method: By X Increment
X Increment: 1
X Start: 74
X End: 100 (can change)
Merge X by: Subgroup Beginning
Merge Y by: Sum.

Thanks,
James

Edited by - YimingChen on 06/10/2019 10:10:27 AM
Go to Top of Page

OtmarGeiss

Italy
4 Posts

Posted - 06/11/2019 :  02:55:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks James for your quick reply.

My example was incomplete:
The data in the x-column is not progressively increasing by the step of 1.

Example:

Size Frequency
24.18 0
30.47 9
34.88 15
34.91 10
37.35 3
39.25 4
41.25 2
41.49 3
41.94 7

What I would like to do is to sum the number of particles which belong to the same integer size and to assign value 0 to all sized which have not been detected:


Size Frequency
24 0
25 0
26 0
27 0
28 0
29 0
30 9
31 0
32 0
33 0
34 25
35 0
36 0
37 3
38 0
39 4
40 0
41 12

Please find the original file annexed to this message.

Thank you very much in advance.
Otmar.




quote:
Originally posted by YimingChen

Hi Otmar,

Please go to menu Analysis: Data manipulation: Reduce by group. then make the following settings:
Input: Your data
SubGroup Method: By X Increment
X Increment: 1
X Start: 74
X End: 100 (can change)
Merge X by: Subgroup Beginning
Merge Y by: Sum.

Thanks,
James

https://my.originlab.com/ftp/forum_and_kbase/Images/Origin Data.opj
Go to Top of Page

YimingChen

1618 Posts

Posted - 06/11/2019 :  11:02:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Need to write script to realize this. Please start a new worksheet and put your data in col(A) and col(B). With the worksheet activated, select menu Window: Script Window.... Copy paste the following script over, select all and hit Enter to run the script.


function dataset GetIDs(dataset ds1, dataset ds2, dataset ds3)
{
	int idx1 = 1;
	dataset ds4;
	ds4.SetSize(ds3.GetSize());
	int i = 1;
	for (; i <= ds3.GetSize()-1; i++)
	{
		int count = 0;
		for (;ds1[idx1]> ds3[i] && ds1[idx1]< ds3[i+1];idx1++)
		{
			count += ds2[idx1];
		}
		ds4[i] = count;
	}
	
	ds4[i] = 0;
	
	return ds4;
}

wks.nCols = 2;
wks.nCols = 4;
range r1 = col(A);
range r2 = col(B);
range r3 = col(C);
range r4 = col(D);
r3 = data(floor(min(r1)), ceil(max(r1)));
r4 = GetIDs(r1, r2, r3);

Edited by - YimingChen on 06/11/2019 11:02:48 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000