The Origin Forum
File Exchange
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Binning of size-frequency data

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
OtmarGeiss Posted - 06/10/2019 : 08:10:50 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 06/11/2019 : 11:02:20 AM
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);
OtmarGeiss Posted - 06/11/2019 : 02:55:39 AM
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
YimingChen Posted - 06/10/2019 : 10:08:59 AM
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

The Origin Forum © 2008 Originlab Corporation Go To Top Of Page
Snitz Forums 2000