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
 Peak analysis zero peak handling
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zknauss

USA
72 Posts

Posted - 07/18/2022 :  1:41:44 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1
9.9.5.171 (Academic)

I'm using Peak analysis Pro w/peak fit to batch process cellular waveform data which can at times have zero detectable peaks (meaning the cell is inactive). The file structure is set up so that each column is a different cell however when zero peaks are detected the cell has no output result meaning you could go from cell 168 to 170 skipping an output for cell 169. I need to find a way to have cells with zero peaks listed in the report sheet while maintaining the initial cell reference number.

ZTK

YimingChen

1643 Posts

Posted - 07/18/2022 :  5:04:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Origin doesn't have such an option for now. I have reported to the developer to improve. The reference report id is ORG-25519.

James
Go to Top of Page

zknauss

USA
72 Posts

Posted - 07/22/2022 :  09:14:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So I am stuck in my analysis unless I can find a workaround for this is it likely to be something that will be updated soon or will I need to work on finding an alternative solution? Thanks!

ZTK
Go to Top of Page

YimingChen

1643 Posts

Posted - 07/22/2022 :  10:50:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It may not be implemented soon. Here is another thought, you may use the Script Before Each Process in the Batch Peak Analysis dialog to skip the dataset with 0 peak. Please check this tutorial, but change the script to the one below:
https://www.originlab.com/doc/Tutorials/BatchPA-Script-Before


dataset dr;
fft_filters iy:=_ry filter:=high oy:=dr; // Perform high-pass fft filter to obtain noise
stats dr;
double nSD = stats.sd; // Calculate SD of noise
stats _ry;
double sSD = stats.sd; // Calculate SD of raw data

if(nSD^2/sSD^2>0.3) // Set noise identification criteria
 {
        _skip=1;	
		int nn = [Summary]1!wks.col1.nrows;		
		[Summary]1!wks.col1.nrows = nn + 1;
		[Summary]1!Cell(nn+1, 1)$ = %(_ry);
		[Summary]1!Cell(nn+1, 2) = 0;
}		
else
         _skip=0;


Then I got the final summary sheet:



James

Edited by - YimingChen on 07/22/2022 10:51:43 AM
Go to Top of Page

zknauss

USA
72 Posts

Posted - 07/22/2022 :  3:13:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That looks perfect but I'm having an issue with it wanting to send the results to a results summary sheet where my script is supposed to add results to a new sheet ow:=[NCONT2Pres]<new name:="Unsorted" located in a different folder. Since no sheet has been created prior to the before script on the first iteration this fails and I'm struggling to figure out how to create the new sheet so that it works properly. I tried to manually put a sheet named "Unsorted" in and skip the creat new but that also failed.

ZTK
Go to Top of Page

YimingChen

1643 Posts

Posted - 07/22/2022 :  3:31:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can get the summary sheet by its index. The summary sheet index should be equal to the number of sheets in workbook NCONT2Pres. You may use the code like below to set values:

int num = NCONT2Pres!page.nlayers;
[NCONT2Pres]$(num)!Cell(nn+1, 1)$ = %(_ry);
[NCONT2Pres]$(num)!Cell(nn+1, 2) = 0;


See if it works.

James

Edited by - YimingChen on 07/22/2022 3:32:50 PM
Go to Top of Page

zknauss

USA
72 Posts

Posted - 07/25/2022 :  09:29:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That worked perfectly

ZTK
Go to Top of Page

zknauss

USA
72 Posts

Posted - 08/15/2022 :  3:28:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hello, I need to adjust the above scripts so that the data set ID is set as the long name from the source page. I believe this is set by [NCONT1ROI]1!Cell(nn+1, 1)$ = %(_ry); but I'm not sure what to change the %(_ry) to get the long name

ZTK
Go to Top of Page

YimingChen

1643 Posts

Posted - 08/16/2022 :  10:17:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you parse the range _ry to get the workbook name? Try the line below to set dataset ID.
[Summary]1!Cell(nn+1, 1)$ = Between(%(_ry), "[", "]")$;

James
Go to Top of Page

zknauss

USA
72 Posts

Posted - 08/17/2022 :  08:29:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So if I'm correct in my understanding that will pull the sheet name for the data ID I'd like the data ID to be pulled from the long name of the column from which the original data was pulled.

ZTK
Go to Top of Page

YimingChen

1643 Posts

Posted - 08/17/2022 :  09:17:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Then please use this script:
[Summary]1!Cell(nn+1, 1)$ = _ry.lname$;
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