https://github.com/latereshko/mEPSC_scripts
Raw File
Tip revision: 4f77b23d5f94e6e8c5e1a76a059cae4f1811659a authored by latereshko on 08 December 2020, 22:49 UTC
Delete e
Tip revision: 4f77b23
MiniAnalysis_.pxp
4Misc_StartL4PlatformL¸@
¬xHHÞ@ÿîÿîRg(üHHØ(dh 'ç&ROGI'HHîÿîÿRÞ@66¾
HHHH —<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.PageFormat.PMHorizontalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMHorizontalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMOrientation</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMOrientation</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.subTicket.paper_info_ticket</key>
	<dict>
		<key>PMPPDPaperCodeName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMPPDPaperCodeName</key>
					<string>Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>PMTiogaPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMTiogaPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
					<string>US Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.ticket.APIVersion</key>
		<string>00.20</string>
		<key>com.apple.print.ticket.type</key>
		<string>com.apple.print.PaperInfoTicket</string>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PageFormatTicket</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
				<string>application/pdf</string>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
				<integer>1294</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopies</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopies</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopyCollate</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopyCollate</key>
				<true/>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMFirstPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMFirstPage</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMLastPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMLastPage</key>
				<integer>2147483647</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMPageRange</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMPageRange</key>
				<array>
					<integer>1</integer>
					<integer>2147483647</integer>
				</array>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PrintSettingsTicket</string>
</dict>
</plist>

¬xHHÞ@ÿîÿîRg(üHHØ(dh 'ç&ROGI'HHîÿîÿRÞ@66¾
HHHH —<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.PageFormat.PMHorizontalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMHorizontalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMOrientation</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMOrientation</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.subTicket.paper_info_ticket</key>
	<dict>
		<key>PMPPDPaperCodeName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMPPDPaperCodeName</key>
					<string>Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>PMTiogaPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMTiogaPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
					<string>US Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.ticket.APIVersion</key>
		<string>00.20</string>
		<key>com.apple.print.ticket.type</key>
		<string>com.apple.print.PaperInfoTicket</string>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PageFormatTicket</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
				<string>application/pdf</string>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
				<integer>1294</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopies</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopies</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopyCollate</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopyCollate</key>
				<true/>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMFirstPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMFirstPage</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMLastPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMLastPage</key>
				<integer>2147483647</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMPageRange</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMPageRange</key>
				<array>
					<integer>1</integer>
					<integer>2147483647</integer>
				</array>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PrintSettingsTicket</string>
</dict>
</plist>

¬xHHÞ@ÿîÿîRg(üHHØ(dh 'ç&ROGI'HHîÿîÿRÞ@66¾
HHHH —<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.PageFormat.PMHorizontalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMHorizontalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMOrientation</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMOrientation</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.subTicket.paper_info_ticket</key>
	<dict>
		<key>PMPPDPaperCodeName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMPPDPaperCodeName</key>
					<string>Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>PMTiogaPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMTiogaPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
					<string>US Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.ticket.APIVersion</key>
		<string>00.20</string>
		<key>com.apple.print.ticket.type</key>
		<string>com.apple.print.PaperInfoTicket</string>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PageFormatTicket</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
				<string>application/pdf</string>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
				<integer>1294</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopies</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopies</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopyCollate</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopyCollate</key>
				<true/>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMFirstPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMFirstPage</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMLastPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMLastPage</key>
				<integer>2147483647</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMPageRange</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMPageRange</key>
				<array>
					<integer>1</integer>
					<integer>2147483647</integer>
				</array>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PrintSettingsTicket</string>
</dict>
</plist>

¬x
HHÞ@ÿîÿîRg(üHHØ(dh 'ç&
ROGI'HHîÿîÿRÞ@66¾
HHHH —<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.PageFormat.PMHorizontalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMHorizontalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMOrientation</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMOrientation</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalRes</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalRes</key>
				<real>72</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PageFormat.PMVerticalScaling</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PageFormat.PMVerticalScaling</key>
				<real>1</real>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.subTicket.paper_info_ticket</key>
	<dict>
		<key>PMPPDPaperCodeName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMPPDPaperCodeName</key>
					<string>Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>PMTiogaPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>PMTiogaPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PageFormat.PMAdjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMPaperName</key>
					<string>na-letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPageRect</key>
					<array>
						<integer>0</integer>
						<integer>0</integer>
						<real>734</real>
						<real>576</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.PMUnadjustedPaperRect</key>
					<array>
						<real>-18</real>
						<real>-18</real>
						<real>774</real>
						<real>594</real>
					</array>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
		<dict>
			<key>com.apple.print.ticket.creator</key>
			<string>com.apple.jobticket</string>
			<key>com.apple.print.ticket.itemArray</key>
			<array>
				<dict>
					<key>com.apple.print.PaperInfo.ppd.PMPaperName</key>
					<string>US Letter</string>
					<key>com.apple.print.ticket.stateFlag</key>
					<integer>0</integer>
				</dict>
			</array>
		</dict>
		<key>com.apple.print.ticket.APIVersion</key>
		<string>00.20</string>
		<key>com.apple.print.ticket.type</key>
		<string>com.apple.print.PaperInfoTicket</string>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PageFormatTicket</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.DocumentTicket.PMSpoolFormat</key>
				<string>application/pdf</string>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMColorSyncProfileID</key>
				<integer>1294</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopies</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopies</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMCopyCollate</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMCopyCollate</key>
				<true/>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMFirstPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMFirstPage</key>
				<integer>1</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMLastPage</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMLastPage</key>
				<integer>2147483647</integer>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.PrintSettings.PMPageRange</key>
	<dict>
		<key>com.apple.print.ticket.creator</key>
		<string>com.apple.jobticket</string>
		<key>com.apple.print.ticket.itemArray</key>
		<array>
			<dict>
				<key>com.apple.print.PrintSettings.PMPageRange</key>
				<array>
					<integer>1</integer>
					<integer>2147483647</integer>
				</array>
				<key>com.apple.print.ticket.stateFlag</key>
				<integer>0</integer>
			</dict>
		</array>
	</dict>
	<key>com.apple.print.ticket.APIVersion</key>
	<string>00.20</string>
	<key>com.apple.print.ticket.type</key>
	<string>com.apple.print.PrintSettingsTicket</string>
</dict>
</plist>
^Graph*@@ð?ð?WDashSettings#úÿ



!0üãf’üNormalÿÿÿÿ@
ÿGenevaÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$0üãf’üNormalÿÿÿÿ@
ÿGenevaÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$4444440ü
Ò¶`üNormalÿÿÿÿ@
ÿGenevaÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$4
4
4
4
4
4
yhomeE=dœÿÿÿ´ÁªÛMacintoshHD:Applications:Igor:MacintoshHDBDÿÿÿÿIgorÿÿÿÿ
 cuApplications/:Applications:Igor/
IgorMacintoshHDApplications/Igor/ÿÿÞMiniAnalysisªXdœÿÿÿE
ÁªÛMacintoshHD:Users:lauren:Desktop:IGOR_Procs:MiniAnalysis:RMacintoshHDBDÿÿÿÿMiniAnalysisÿÿÿÿ
 cu
IGOR_Procs//:Users:lauren:Desktop:IGOR_Procs:MiniAnalysis/MiniAnalysisMacintoshHD,Users/lauren/Desktop/IGOR_Procs/MiniAnalysis/
ÿÿŒRecentWindowsXDetection ParamatersDetectMinis6_5.ipfHelp BrowsermeasureWaves6_5.ipfPanSelectWaves4Misc_EndL”XOPState_Start`LPeakFunctions2aves6_5.Data BrowserwsermeasureWaveGizmopf@®®ÅData Browser‘rootÐ'â4XOPState_EndLÁÌàŒ®ía®\N ;r
m­ö;gStart@@gEndðiø@gWavePtsˆÃ@gBox@gBoxHW@gBoxRise@gFiltWid@gMinDur@gMaxDurD@gBWidI@gBpreWid@gBasefractionš™™™™™¹?gMaxRise@gMinHWð?gMinUpdateI@gMaxUpdate@@gThresh@gMinThresh@gBThresh@gPre$@gPostD@gPkAvgà?gXstartgXendgYstartgYendgNreject @gPk_Value@nLÀgETBaseV´NW˜¼Và€H¨¨çÿ¿_r”“Us*wlisteV´NW˜¼Và€H¨¨çÿ¿_r”“Us ¥ShowTools/A arrow
¥HideTools/A
!¸+.*¼6// Platform=Macintosh, IGORVersion=6.220, architecture=Intel
Silent 101 // use | as bitwise or -- not comment.
NewPath MiniAnalysis ":::Users:lauren:Desktop:IGOR_Procs:MiniAnalysis:"



DefaultFont "Arial"
MoveWindow/P 722,275,1376,694
MoveWindow/C 20,739,914,870
PanDetectParams()
analysisParams()
OpenProc/W=(5,45,505,339)/P=MiniAnalysis "measureWaves6_5.ipf"
OpenProc/W=(435,45,1029,538)/P=MiniAnalysis "DetectMinis6_5.ipf"
PanSelectWaves()

Window PanSelectWaves() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(864,57,1457,171)
	Button butDone,pos={413,69},size={135,30},proc=ChangeWindows,title="Done"
	PopupMenu popWaveAdd,pos={0,12},size={124,20},proc=AddWave2List,title="Add a Wave"
	PopupMenu popWaveAdd,mode=1,popvalue="wTInfo",value= #"WaveList(\"*\", \";\", \"\")"
	PopupMenu popWaveRemove,pos={304,11},size={195,20},proc=RemoveWfromList,title="Remove a Wave"
	PopupMenu popWaveRemove,mode=4,popvalue="C_Cell_03_0004",value= #"wlist"
	SetVariable setWList,pos={3,45},size={547,15},title="Wave List"
	SetVariable setWList,limits={-inf,inf,0},value= wlist
	Button butcvtET,pos={217,69},size={135,30},proc=ChangeWindows,title="Convert ET File"
	Button butLoad,pos={3,69},size={186,29},proc=LoadIgorBin,title="Load Waves from folder"
EndMacro

Window analysisParams() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(857,198,1497,379) as "Wave Analysis Parameters"
	ShowTools
	SetDrawLayer UserBack
	SetDrawEnv fillfgc= (3,52428,1)
	DrawRect 183,83,180,83
	SetDrawEnv fillfgc= (0,0,65535)
	DrawRect 0,0,612,46
	DrawText 233,97,"Extract"
	SetDrawEnv fillfgc= (32768,32770,65535)
	DrawRect 612,45,0,102
	DrawRect 2,101,-3,102
	SetDrawEnv fillfgc= (16385,65535,65535)
	DrawRect 613,101,0,152
	SetDrawEnv linefgc= (1,52428,26586),linebgc= (1,52428,26586),fillfgc= (1,52428,26586)
	DrawRect 615,151,-1,182
	DrawRect 1,182,-1,182
	SetDrawEnv fstyle= 1,textrgb= (65535,65535,65535)
	DrawText 407,22,"Move Cursors"
	CheckBox chkSaveFiles,pos={6,107},size={61,14},title="Save Files"
	CheckBox chkSaveFiles,help={"If checked, wave arithmetic operations will not alter the operated waves, but rather copies of original waves."}
	CheckBox chkSaveFiles,value= 0
	SetVariable setPkWid,pos={160,48},size={109,15},title="Width (ms)"
	SetVariable setPkWid,limits={0.01,inf,0},value= gPkWid
	CheckBox chkAvg,pos={4,68},size={41,14},title="Mean"
	CheckBox chkAvg,help={"Calculates the mean of the selected waves between the cursors when wave measurement is selected. Results are stored in a wave that contains the letters \"Mn\" "}
	CheckBox chkAvg,value= 1
	CheckBox chkpeak,pos={4,49},size={38,14},title="Peak"
	CheckBox chkpeak,help={"Find + or -  peak between cursors. If width > 0 it returns the mean of the peak period (not just single point). If Use template enabled, the peak period is found only in the template wave and then the mean of the same period is returned for all other wave"}
	CheckBox chkpeak,value= 0
	CheckBox chkArea,pos={73,68},size={38,14},title="Area",value= 0
	CheckBox chkwName,pos={4,86},size={47,14},title="Names",value= 0
	CheckBox chkSlope,pos={126,68},size={42,14},title="Slope",value= 0
	SetVariable setFile,pos={236,156},size={311,15},title="Folder for results "
	SetVariable setFile,help={"This contains the name of the folder in which any new files generated by the analysis will be stored. This includes results of wave arithmetic and peak measurement."}
	SetVariable setFile,limits={-inf,inf,0},value= gResPath
	SetVariable setResName,pos={10,157},size={223,15},title="Result base Name"
	SetVariable setResName,help={"A base name used to generate names of waves containing analysis results. For concatenation this  is the name of the concatenated wave."}
	SetVariable setResName,limits={-inf,inf,0},value= gResname
	Button btnDo,pos={10,10},size={39,28},proc=doWaveOp,title="DO"
	PopupMenu popOp,pos={63,14},size={78,20}
	PopupMenu popOp,help={"Measure: get peaks, means... --purple section\rBaseline Subtract/Restore: (-)/(+) mean between cursors\rWave Arith.: using constants or waves--light blue section\rAverage: mean of waves is avgW \rConcatenate: make one big wave from a list of small ones"}
	PopupMenu popOp,mode=1,popvalue="Measure",value= #"\"Measure;Measure Multiple;Baseline Subtract;WaveArithmetic;Restore Baseline;Average;Smooth;Concatenate\""
	PopupMenu popOpList,pos={267,4},size={106,20},title="Waves in"
	PopupMenu popOpList,help={"Determines whether wave operation is performed on all waves in the top graph, or all waves in memory."}
	PopupMenu popOpList,mode=1,popvalue="Graph",value= #"\"Graph;All\""
	PopupMenu popPktype,pos={72,47},size={80,20}
	PopupMenu popPktype,mode=2,popvalue="Negative",value= #"\"Positive;Negative\""
	CheckBox chkCell,pos={408,82},size={42,14},title="Cell #",value= 0
	CheckBox chktest,pos={545,81},size={47,14},title="Test #",value= 0
	CheckBox chkwave,pos={471,82},size={51,14},title="Wave #",value= 0
	CheckBox chktime,pos={298,84},size={39,14},title="Time",value= 0
	CheckBox chkAmp,pos={354,83},size={38,14},title="Amp",value= 0
	CheckBox chkPkTemplate,pos={475,47},size={86,14},title="Use Pktemplate",value= 1
	PopupMenu popTimeUnits,pos={266,26},size={97,20},title="Time Units"
	PopupMenu popTimeUnits,help={"Data files are assumed to have X scaling either in seconds or msec. Use Browse waves in Data menu to determine which your waves are and set accordingly. This insures that times (e.g. peak width) match your data."}
	PopupMenu popTimeUnits,mode=2,popvalue="Sec",value= #"\"Msec;Sec\""
	Button btnSetFolder,pos={558,155},size={32,16},proc=setResPath,title="SET"
	PopupMenu popNotebook,pos={115,82},size={65,20},proc=setNotebook,title="Notebook"
	PopupMenu popNotebook,help={"Use this to open a new or existing notebook file or edit one already open. See Igor manual for descriptions of notebooks."}
	PopupMenu popNotebook,mode=1,popvalue="",value= #"WinList(\"*\", \";\",\"WIN:16\")+\";NONE;OPEN EXISTING;OPEN NEW\" "
	PopupMenu pop2ndWave,pos={120,109},size={150,20},title="Arithmetic Wave"
	PopupMenu pop2ndWave,help={"Use this to select the wave you wish to add, subtract, divide or multiply with the rest of the waves."}
	PopupMenu pop2ndWave,mode=1,popvalue="avgmini",value= #"\"avgmini;\"+\"NONE;\"+WaveList(\"*\", \";\", \"\")"
	PopupMenu popArithOp,pos={322,108},size={44,20}
	PopupMenu popArithOp,mode=2,popvalue="(-)",value= #"\"(+);(-);(X);(/)\""
	SetVariable setConstant,pos={382,109},size={78,15},title="K="
	SetVariable setConstant,limits={-inf,inf,0},value= K19
	CheckBox chkScale2Pk,pos={475,109},size={76,14},title="Scale to Peak",value= 1
	CheckBox chkNewWaves,pos={172,129},size={100,14},title="Create New Waves"
	CheckBox chkNewWaves,value= 0
	SetVariable setNewName,pos={334,130},size={272,15},title="New File base Name"
	SetVariable setNewName,limits={-inf,inf,0},value= gOutBase
	CheckBox chkOverwrite,pos={6,130},size={60,14},title="Overwrite",value= 0
	CheckBox chkDisplay,pos={100,130},size={49,14},title="Display",value= 0
	PopupMenu popTemplate,pos={281,48},size={145,20},title="Template Wave"
	PopupMenu popTemplate,help={"Use this to select the wave which will be used to set the window for measuring peaks."}
	PopupMenu popTemplate,mode=1,popvalue="avgmini",value= #"WaveList(\"*\", \";\",\"\")+\"avgmini;\""
	CheckBox chkRise,pos={184,68},size={35,14},title="Rise",value= 0
	SetVariable setIntvl,pos={509,26},size={91,15},title=" "
	SetVariable setIntvl,limits={0.01,inf,0},value= gMoveInc
	Button btnMoveLeft,pos={507,4},size={45,20},proc=MoveCrsr,title="<-"
	Button btnMoveRight,pos={559,3},size={45,20},proc=MoveCrsr,title="->"
	Button btnGetInc,pos={454,24},size={46,16},proc=getInc,title="Get"
	PopupMenu popNreps,pos={172,15},size={79,20},title="#",mode=1,value= #"g1to99"
EndMacro

Window PanDetectParams() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(949,402,1496,822) as "Detection Paramaters"
	SetDrawLayer UserBack
	SetDrawEnv linebgc= (0,0,0),fillfgc= (49163,65535,32768),fillbgc= (0,65535,0)
	DrawRect -3,79,280,315
	DrawRect 216,171,218,171
	SetDrawEnv fillfgc= (49151,65535,57456),fillbgc= (65535,16385,16385)
	DrawRect -3,1,280,79
	DrawRect 228,51,228,45
	SetDrawEnv fillfgc= (16385,28398,65535)
	DrawRect 547,1,280,126
	SetDrawEnv fillfgc= (13102,26214,0)
	DrawRect -3,315,280,401
	SetDrawEnv fsize= 13,fstyle= 1
	DrawText 0,347,"Update Interval:"
	SetDrawEnv fsize= 13,fstyle= 1
	DrawText 1,369,"Extract from:"
	SetDrawEnv fillfgc= (0,6405,26214)
	DrawRect 547,126,280,237
	SetDrawEnv fillfgc= (13112,0,26214)
	DrawRect 547,236,280,400
	SetDrawEnv fstyle= 1,textrgb= (65535,65535,65535)
	DrawText 401,326,"(Fraction of pk)"
	SetDrawEnv fstyle= 1,textrgb= (65535,65535,65535)
	DrawText 402,306,"SD of noise OR"
	SetDrawEnv linebgc= (65535,0,0),fillfgc= (65535,0,26214)
	DrawRect 457,353,536,399
	SetDrawEnv fstyle= 1
	DrawText 10,117,"Write"
	SetDrawEnv fstyle= 1
	DrawText 3,143,"Display"
	SetVariable setboxdetect,pos={303,65},size={216,15},title="Box width (detection; #pts)"
	SetVariable setboxdetect,limits={1,25,2},value= gBox
	PopupMenu popPolarity,pos={36,53},size={116,20},title="Polarity"
	PopupMenu popPolarity,mode=1,popvalue="Negative",value= #"\"Negative;Positive\""
	Button btnDoIt,pos={471,363},size={52,25},proc=ButDoDetectProc,title="Do it"
	CheckBox chkWriteMinis,pos={61,97},size={66,14},title="Mini Waves",value= 0
	CheckBox chkInteractive,pos={61,181},size={90,14},title="Interactive Mode"
	CheckBox chkInteractive,value= 1
	SetVariable setStart,pos={4,4},size={116,15},title="Start (ms)",format="%2.1f"
	SetVariable setStart,frame=0,limits={0,1e+06,0},value= gStart
	SetVariable setEnd,pos={126,4},size={128,15},title="End (ms)",format="%2.1f"
	SetVariable setEnd,limits={0,1e+06,0},value= gEnd
	SetVariable setPre,pos={103,351},size={59,15},title="Pre",format="%2.1f",frame=0
	SetVariable setPre,limits={0,1e+06,0},value= gPre
	SetVariable setPost,pos={163,351},size={115,15},title="to Post (ms)"
	SetVariable setPost,format="%2.1f",frame=0,limits={0,1e+06,0},value= gPost
	SetVariable setThresh,pos={411,151},size={101,15},title="Relative"
	SetVariable setThresh,format="%2.1f",limits={0,1000,0},value= gThresh
	SetVariable setBaseWidth,pos={294,249},size={193,15},title="Detection Baseline (ms)"
	SetVariable setBaseWidth,format="%2.1f",limits={0,1e+06,0},value= gBWid
	SetVariable setMinDur,pos={440,172},size={86,15},title="Min (ms)",format="%2.1f"
	SetVariable setMinDur,limits={0,1e+06,0},value= gMinDur
	SetVariable setMaxDur,pos={306,173},size={131,15},title="Duration: Max"
	SetVariable setMaxDur,format="%2.1f",limits={0,1e+06,0},value= gMaxDur
	SetVariable setBThresh,pos={303,290},size={92,15},title="Return to"
	SetVariable setBThresh,format="%2.1f",limits={-1e+06,1e+06,0},value= gBThresh
	SetVariable setfwid,pos={303,25},size={215,15},title="Filter width (pre; mS)           "
	SetVariable setfwid,format="%2.1f",limits={0,1000,0},value= gFiltWid
	SetVariable setboxPk,pos={303,45},size={215,15},title="width for pk measure (ms)    "
	SetVariable setboxPk,limits={0,25,0},value= gPkAvg
	PopupMenu popfilter,pos={328,3},size={148,20},title="Filter: "
	PopupMenu popfilter,mode=2,popvalue=" Detection only",value= #"\"None; Detection only;Detection and Output\""
	SetVariable setMinUpdate,pos={125,330},size={69,15},title="min",format="%2.1f"
	SetVariable setMinUpdate,frame=0,limits={0,1e+06,0},value= gMinUpdate
	SetVariable setMaxUpdate,pos={196,330},size={81,15},title="Max",format="%2.1f"
	SetVariable setMaxUpdate,frame=0,limits={0,1e+06,0},value= gMaxUpdate
	PopupMenu poprise,pos={148,373},size={109,20},title="Rise time"
	PopupMenu poprise,mode=2,popvalue="20-80",value= #"\"10-90;20-80;none\""
	SetVariable setMaxRise,pos={326,195},size={156,15},title="Max Rise Time (ms)"
	SetVariable setMaxRise,format="%2.1f",limits={0,1e+06,0},value= gMaxRise
	SetVariable setBaseWidth2,pos={296,269},size={212,15},title="Measurement Baseline (ms)"
	SetVariable setBaseWidth2,format="%2.1f",limits={0,1e+06,0},value= gBPreWid
	CheckBox chkWriteSource,pos={163,97},size={74,14},title="Source Wave",value= 0
	SetVariable setMinThresh,pos={308,151},size={90,15},title="absolute"
	SetVariable setMinThresh,format="%2.1f",limits={0,1000,0},value= gMinThresh
	CheckBox ChkDisplayExtracted,pos={61,124},size={66,14},title="Mini Waves"
	CheckBox ChkDisplayExtracted,value= 0
	CheckBox chkWholeWave,pos={26,25},size={106,14},title="Or, Use Whole Wave"
	CheckBox chkWholeWave,value= 0
	CheckBox chkDisplayDetected,pos={163,124},size={60,14},title="Detection"
	CheckBox chkDisplayDetected,value= 1
	CheckBox chkMeasure,pos={61,152},size={109,14},title="Measure as detected"
	CheckBox chkMeasure,value= 1
	PopupMenu popalign,pos={0,374},size={122,20},title="Align on: "
	PopupMenu popalign,mode=1,popvalue="Mid Rise",value= #"\"Mid Rise;Start;Peak\""
	SetVariable setbasefraction,pos={341,310},size={54,15},title=" ",format="%3.2f"
	SetVariable setbasefraction,limits={0,1,0.01},value= gBasefraction
	SetVariable setMinHW,pos={331,217},size={156,15},title="Min Half Width (ms)"
	SetVariable setMinHW,format="%2.1f",limits={0,1e+06,0},value= gMinHW
	SetVariable setboxHW,pos={303,85},size={216,15},title="Box width (HW, End)            "
	SetVariable setboxHW,limits={1,25,2},value= gBoxHW
	SetVariable setboxRise,pos={303,105},size={216,15},title="Box width (Rise)                 "
	SetVariable setboxRise,limits={1,25,2},value= gBoxRise
	PopupMenu popThreshMode,pos={309,129},size={146,20},title="Threshold: use"
	PopupMenu popThreshMode,mode=1,popvalue="Absolute",value= #"\"Absolute;Relative to noise;greater;lesser\""
	CheckBox chkDiagnostics,pos={61,212},size={91,14},title="Print Diagnostics"
	CheckBox chkDiagnostics,value= 1
	CheckBox ChkLooseBase,pos={284,310},size={41,14},title="Or to",value= 1
	SetVariable setMiniBase,pos={11,244},size={136,15},title="Mini Basename"
	SetVariable setMiniBase,value= gResName
	SetVariable setFile,pos={11,266},size={216,15},title="Folder",value= gResPath
	Button btnSetPath,pos={233,263},size={37,21},proc=setResPath,title="Set"
EndMacro
7K#pragma rtGlobals=1		// Use modern global access method.

Menu "Tools"
	"Rescale", Rescale()
	"Convert Waves", ConvertWaves()
	"PassiveProp", PassivePropertiesNega()
	"Mean Mini Traces", MeanMinisTrace()
	"Get Decay", GetDecay()
End

Function PProp()
	String cell_name
	String w_list
	String w_name
	String w_tmp
	String fit_name
	String dif_name
	String g_tmp
	String g_name
	String g_list
	String pprop_name
	String pprop_list
	Variable Vm				// Corresponding Vm
	Variable Rin			// Input Resistance
	Variable Ra				// Access Resistance
	Variable Cm				// Membrane Capacitance
	Variable tau				// Membrane time constante
	Variable Iholding		// Holding current
	Variable start_base		// Starting point to calculate baseline - 10ms before end point
	Variable end_base		// End point to calculate baseline
	Variable ih_base		// baseline value - will serve as Ih value
	Variable start_rin		// Starting point to calculate the plateau of the seal test for Rin
	Variable end_rin		// End point  to calculate the plateau of the seal test for Rin
	Variable rin_base		// baseline value at the end of the seal test plateau - will serve to calculate Rin
	Variable x1_fit			// x value to fit the double exponential (right after the peak of the negative part of the seal test transient
	Variable x2_fit			// value to end the exponential fit (corresponds to the point where the current trace goes back to the initial baseline for the positive peak/ the reported delta t for the negative peak
	Variable x3_fit			// x value to fit the double exponential on the positive part of the seal transient
	Variable x4_fit			// x value to end the exponential fit (same as x2 for the explanation)
	Variable delta_t			// delta t between the peak of the positive part if the seal transient and the point where the current goes back to baseline
	Variable peak_1		// V_maxloc of negative peak
	Variable peak_2		// V_maxloc of positive peak
	Variable peak_ra		//get the peak of the transient from the extrapolation of the exponential
	Variable n_ra			// Rin for the negative part of the seal test transient
	Variable p_ra			// Rin for the positive part of the seal test transient 
	Variable v_drift
	Variable V_FitError
	Variable i,n
	
	i = 0
	n = 0
	 
	w_list = SortList(WaveList("Cell*",";",""),";",16)
	cell_name = StringFromList(0,w_list,";")[0,(strsearch(StringFromList(0,w_list,";"),"_",0)-1)]
	//cell_name = StringFromList(i,w_list,";")[0,(strsearch(StringFromList(i,w_list,";"),"_",5)-1)]
	n = ItemsInList(w_list,";")
	Make/O/N=(n) Rin_wave, Cm_wave, Ih_wave, Vm_wave, Ra_wave, T_wave
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		g_tmp = "G_tmp"
		w_tmp = "tmp"
		Duplicate/O $w_name, $w_tmp
		WAVE w0 = $w_name
		Display/K=1/N=$g_tmp $w_tmp as "Tmp"
		Wavestats/Q/R=(0,1) $w_tmp
		peak_1 = V_minloc
		peak_2 = V_maxloc
		fit_name = "fit_"+w_tmp
		dif_name = w_tmp+"_dif"
		Duplicate/O $w_tmp, $dif_name
		Duplicate/O $w_tmp, $fit_name
		Differentiate $dif_name/D=$dif_name
		Differentiate $dif_name/D=$dif_name		// Differentiate will help to determine the starting and ending point for both the Ih baseling and the Rin baseline
		Wavestats/Q/R=(peak_1-0.01, peak_1) $dif_name
		end_base = V_minloc
		start_base = end_base - 0.01
		ih_base = Mean($w_name, start_base, end_base)
		Ih_wave[i] = ih_base*1e12
		Iholding = ih_base
		FindLevel/Q/R=(peak_2,peak_2+0.05) $w_tmp, ih_base
		x4_fit = V_levelX
		delta_t = V_levelX - peak_2
		Wavestats/Q/R=(peak_1, peak_1+0.01) $dif_name
		FindLevel/Q/R=(peak_1, V_minloc) $dif_name, 0
		x1_fit = V_LevelX
		//x1_fit = V_minloc
		x2_fit = peak_1 + delta_t
		Wavestats/Q/R=(peak_2-0.01, peak_2) $dif_name
		end_rin = V_maxloc
		start_rin = end_rin - 0.01
		rin_base = Mean($w_tmp,start_rin, end_rin)
		Wavestats/Q/R=(peak_2, peak_2+0.01) $dif_name
		FindLevel/Q/R=(peak_2, V_maxloc) $dif_name, 0
		x3_fit = V_LevelX
		//x3_fit = V_maxloc
		//Fitting of the negative part of the seal transient
		Cursor/A=1/W=$g_tmp A $w_tmp, x1_fit
		Cursor/A=1/W=$g_tmp B $w_tmp, x2_fit
		SetAxis/W=$g_tmp bottom, x1_fit-0.01, x2_fit+0.01
		DoUpdate 
		K0 = rin_base
		V_FitError = 0
		CurveFit/Q/X=1/H="10000"/NTHR=0 dblexp_XOffset  $w_tmp[pcsr(A), pcsr(B)]/D
		Duplicate/O $fit_name, $fit_name+"_1"
		RemoveFromGraph/W=$g_tmp $fit_name
		AppendToGraph/W=$g_tmp $fit_name+"_1"
		ModifyGraph/W=$g_tmp rgb($fit_name+"_1") = (0,0,0)
		SetAxis/W=$g_tmp left, w0(peak_1), w0(peak_2)
		DoUpdate
		WAVE w1 = $fit_name+"_1"
		peak_ra = w1(peak_1)
		Cursor/A=1/W=$g_tmp A $fit_name+"_1", peak_1
		DoUpdate
		n_ra = 2e-3/abs(peak_ra - ih_base)
		//Print "Ra for the negative part of the transient: "+num2str(n_ra)
		//Fitting of the positive part of the seal transient
		Cursor/A=1/W=$g_tmp A $w_tmp, x3_fit
		Cursor/A=1/W=$g_tmp B $w_tmp, x4_fit
		SetAxis/W=$g_tmp bottom, x3_fit-0.01,x4_fit+0.01
		DoUpdate 
		K0 = ih_base
		V_FitError = 0
		CurveFit/Q/X=1/H="10000"/NTHR=0 dblexp_XOffset  $w_tmp[pcsr(A), pcsr(B)]/D
		Duplicate/O $fit_name, $fit_name+"_2"
		RemoveFromGraph/W=$g_tmp $fit_name
		AppendToGraph/W=$g_tmp $fit_name+"_2"
		ModifyGraph/W=$g_tmp rgb($fit_name+"_2") = (0,0,0)
		DoUpdate
		SetAxis/W=$g_tmp left, w0(peak_1), w0(peak_2)
		DoUpdate
		WAVE w1 = $fit_name+"_2"
		peak_ra = w1(peak_2)
		Cursor/A=1/W=$g_tmp A $fit_name+"_2", peak_2
		DoUpdate
		p_ra = 2e-3/abs(peak_ra - rin_base)
//		//Print "Ra for the positive part of the transient: "+num2str(p_ra)
		Ra = (n_ra+p_ra)/2
		Ra_wave[i] = Ra/1e6
		Rin = abs(2e-3/(rin_base-ih_base)) - Ra
		Rin_wave[i] = Rin/1e6
		WAVE W_coef
		tau = W_coef[dimsize(W_coef,0)-1]
		Cm = (tau/Ra)
		Cm_wave[i] = Cm*1e12
		T_wave[i] = tau*1e3
		v_drift = ih_base*Rin
		if(ih_base>0)
			Vm = (-0.07-abs(v_drift))*1e3
		else
			Vm = (-0.07+abs(v_drift))*1e3
		endif
		Vm_wave[i] = Vm
		//Print "Mean Ra is: "+num2str(Rin)
		DoWindow/K $g_tmp
		KillWaves/Z $dif_name, $w_tmp, $fit_name, $fit_name+"_1", $fit_name+"_2"
	endfor
	w_list = WaveList("*_wave",";","")
	n = ItemsInList(w_list,";")
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		pprop_name = RemoveEnding(w_name,"_wave")+"_"+cell_name
		Duplicate/O $w_name, $pprop_name
		KillWaves/Z $w_name
	endfor
End

Function PassiveProp2(chan_name)		//Calculating holding current, corresponding Vm, Rac, Rin and Cm for a double exponential fit
	String chan_name
	String w_list
	String w_name
	String w_tmp
	String fit_name
	String dif_name
	String g_tmp
	String g_name
	String g_list
	Variable Vm				// Corresponding Vm
	Variable Rin			// Input Resistance
	Variable Ra				// Access Resistance
	Variable Cm				// Membrane Capacitance
	Variable tau				// Membrane time constante
	Variable Iholding		// Holding current
	Variable start_base		// Starting point to calculate baseline - 10ms before end point
	Variable end_base		// End point to calculate baseline
	Variable ih_base		// baseline value - will serve as Ih value
	Variable start_rin		// Starting point to calculate the plateau of the seal test for Rin
	Variable end_rin		// End point  to calculate the plateau of the seal test for Rin
	Variable rin_base		// baseline value at the end of the seal test plateau - will serve to calculate Rin
	Variable x1_fit			// x value to fit the double exponential (right after the peak of the negative part of the seal test transient
	Variable x2_fit			// value to end the exponential fit (corresponds to the point where the current trace goes back to the initial baseline for the positive peak/ the reported delta t for the negative peak
	Variable x3_fit			// x value to fit the double exponential on the positive part of the seal transient
	Variable x4_fit			// x value to end the exponential fit (same as x2 for the explanation)
	Variable delta_t			// delta t between the peak of the positive part if the seal transient and the point where the current goes back to baseline
	Variable peak_1		// V_maxloc of negative peak
	Variable peak_2		// V_maxloc of positive peak
	Variable peak_ra		//get the peak of the transient from the extrapolation of the exponential
	Variable n_ra			// Rin for the negative part of the seal test transient
	Variable p_ra			// Rin for the positive part of the seal test transient 
	Variable v_drift
	Variable V_FitError
	Variable i,n
	
	i = 0
	n = 0
	 
	 SetDataFolder root:Acquisition:LTPi:
	//g_name = WinName(0,1)
	w_list = SortList(WaveList(chan_name+"*_Pre_*",";",""),";",16)+SortList(WaveList(chan_name+"*_Post_*",";",""),";",16)
	n = ItemsInList(w_list,";")
	Make/O/N=(n) Rin_wave, Cm_wave, Ih_wave, Vm_wave, Ra_wave, T_wave
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		//w_name = WaveName(g_name, 0,1)
		g_tmp = "G_tmp"
		w_tmp = "tmp"
		Duplicate/O $w_name, $w_tmp
		WAVE w0 = $w_name
		Display/K=1/N=$g_tmp $w_tmp as "Tmp"
		Wavestats/Q/R=(0,1) $w_tmp
		peak_1 = V_minloc
		peak_2 = V_maxloc
		fit_name = "fit_"+w_tmp
		dif_name = w_tmp+"_dif"
		Duplicate/O $w_tmp, $dif_name
		Duplicate/O $w_tmp, $fit_name
		Differentiate $dif_name/D=$dif_name
		Differentiate $dif_name/D=$dif_name		// Differentiate will help to determine the starting and ending point for both the Ih baseling and the Rin baseline
		Wavestats/Q/R=(peak_1-0.01, peak_1) $dif_name
		end_base = V_minloc
		start_base = end_base - 0.01
		ih_base = Mean($w_name, start_base, end_base)
		Ih_wave[i] = ih_base*1e12
		Iholding = ih_base
		FindLevel/Q/R=(peak_2,peak_2+0.05) $w_tmp, ih_base
		x4_fit = V_levelX
		delta_t = V_levelX - peak_2
		Wavestats/Q/R=(peak_1, peak_1+0.01) $dif_name
		FindLevel/Q/R=(peak_1, V_minloc) $dif_name, 0
		x1_fit = V_LevelX
		//x1_fit = V_minloc
		x2_fit = peak_1 + delta_t
		Wavestats/Q/R=(peak_2-0.01, peak_2) $dif_name
		end_rin = V_maxloc
		start_rin = end_rin - 0.01
		rin_base = Mean($w_tmp,start_rin, end_rin)
		Wavestats/Q/R=(peak_2, peak_2+0.01) $dif_name
		FindLevel/Q/R=(peak_2, V_maxloc) $dif_name, 0
		x3_fit = V_LevelX
		//x3_fit = V_maxloc
		//Fitting of the negative part of the seal transient
		Cursor/A=1/W=$g_tmp A $w_tmp, x1_fit
		Cursor/A=1/W=$g_tmp B $w_tmp, x2_fit
		SetAxis/W=$g_tmp bottom, x1_fit-0.01, x2_fit+0.01
		DoUpdate 
		K0 = rin_base
		V_FitError = 0
		CurveFit/Q/X=1/H="10000"/NTHR=0 dblexp_XOffset  $w_tmp[pcsr(A), pcsr(B)]/D
		Duplicate/O $fit_name, $fit_name+"_1"
		RemoveFromGraph/W=$g_tmp $fit_name
		AppendToGraph/W=$g_tmp $fit_name+"_1"
		ModifyGraph/W=$g_tmp rgb($fit_name+"_1") = (0,0,0)
		SetAxis/W=$g_tmp left, w0(peak_1), w0(peak_2)
		DoUpdate
		WAVE w1 = $fit_name+"_1"
		peak_ra = w1(peak_1)
		Cursor/A=1/W=$g_tmp A $fit_name+"_1", peak_1
		DoUpdate
		n_ra = 5e-3/abs(peak_ra - ih_base)
		//Print "Ra for the negative part of the transient: "+num2str(n_ra)
		//Fitting of the positive part of the seal transient
		Cursor/A=1/W=$g_tmp A $w_tmp, x3_fit
		Cursor/A=1/W=$g_tmp B $w_tmp, x4_fit
		SetAxis/W=$g_tmp bottom, x3_fit-0.01,x4_fit+0.01
		DoUpdate 
		K0 = ih_base
		V_FitError = 0
		CurveFit/Q/X=1/H="10000"/NTHR=0 dblexp_XOffset  $w_tmp[pcsr(A), pcsr(B)]/D
		Duplicate/O $fit_name, $fit_name+"_2"
		RemoveFromGraph/W=$g_tmp $fit_name
		AppendToGraph/W=$g_tmp $fit_name+"_2"
		ModifyGraph/W=$g_tmp rgb($fit_name+"_2") = (0,0,0)
		DoUpdate
		SetAxis/W=$g_tmp left, w0(peak_1), w0(peak_2)
		DoUpdate
		WAVE w1 = $fit_name+"_2"
		peak_ra = w1(peak_2)
		Cursor/A=1/W=$g_tmp A $fit_name+"_2", peak_2
		DoUpdate
		p_ra = 5e-3/abs(peak_ra - rin_base)
		//Print "Ra for the positive part of the transient: "+num2str(p_ra)
		Ra = (n_ra+p_ra)/2
		Ra_wave[i] = Ra/1e6
		Rin = abs(5e-3/(rin_base-ih_base)) - Ra
		Rin_wave[i] = Rin/1e6
		WAVE W_coef
		tau = W_coef[dimsize(W_coef,0)-1]
		Cm = (tau/Ra)
		Cm_wave[i] = Cm*1e12
		T_wave[i] = tau*1e3
		v_drift = ih_base*Rin
		if(ih_base>0)
			Vm = (-0.07-abs(v_drift))*1e3
		else
			Vm = (-0.07+abs(v_drift))*1e3
		endif
		Vm_wave[i] = Vm
		//Print "Mean Ra is: "+num2str(Rin)
		DoWindow/K $g_tmp
		KillWaves/Z $dif_name, $w_tmp, $fit_name, $fit_name+"_1", $fit_name+"_2"
		//SetAxis/Z/W=$g_name/A
	endfor
	
End

Function PassivePropertiesNega()
	String chan_name
	String w_list
	String w_name
	String cell_name
	String cell_list
	String dif_name
	String fit_name
	String p_list
	String p_name
	String t_name
	Variable Vm							// Corresponding Vm
	Variable Ih							// Holding current					
	Variable rin_base					// Base for input resistance
	Variable Rin						// Input resistance
	Variable Ra							// Access resistance
	Variable Cm							// Capacitance
	Variable Tau						// Membrane time constant
	Variable start_base
	Variable end_base
	Variable start_rin
	Variable end_rin
	Variable x1_fit						// First x value for Ra fit
	Variable x2_fit						// First x value for Tau fit		
	Variable x3_fit						// Second x value for both Ra and Tau fit
	Variable peak_Ra					// Value of the extrapolated fit for Ra at the peak of the transient
	Variable x1_peak					// Neagative peak of the seal transient
	Variable x2_peak					// Positive peak of the seal transient
	Variable V_FitOptions
	Variable V_FitError
	Variable index
	Variable i,n
	Variable j,m
	
	i = 0
	n = 0
	j = 0
	m = 0
	cell_list = ""
	V_FitError= 0
	V_FitOptions = 4
	w_list = SortList(WaveList("Cell*",";",""),";",16)
	n = ItemsInList(w_list,";")
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		index = strsearch(w_name,"_",inf, 1)
		cell_name = w_name[0, index-1]
		if(stringmatch(cell_list,"*"+cell_name+"*") == 0)
			cell_list = SortList(cell_list+cell_name,";",16)
		endif
	endfor
	n = ItemsInLIst(cell_list,";")
	for(i=0;i<n;i+=1)
		cell_name = StringFromList(i,cell_list,";")
		w_list = Wavelist(cell_name+"*",";","")
		m = ItemsInList(w_list,";")
		Make/O/N=(m) w0, w1, w2, w3, w4, w5, v0				// w0 = Ih; w1 = Vm; w2 = Ra; w3 = Rin; w4 = Cm; w5 = Tau; v0 = peak Ra
		Make/O/N=(m,2) v1, v2, v3								// v1 = V_minloc & V_maxloc for seal test transient, v2 = start base & end base; v3 = start rin & end rin
		Make/O/N=(m,3) v4										// v4 = x1_fit, x2_fit and x3_fit
		for(j=0;j<m;j+=1)
			w_name = StringFromList(j,w_list,";")
			Wavestats/Q/R=(0,1) $w_name
			x1_peak = V_minloc
			x2_peak = V_maxloc
			v1[j][0] = x1_peak
			v1[j][1] = x2_peak
			Duplicate/O $w_name, tmp
			Differentiate tmp/D=tmp
			Differentiate tmp/D=tmp
			//Baseline calculation
			Wavestats/Q/R=(x1_peak-0.005, x1_peak) tmp
			end_base = V_minloc
			start_base = end_base - 0.02
			v2[j][0] = start_base
			v2[j][1] = end_base
			Ih = Mean($w_name, start_base, end_base)
			//Ih = Mean($w_name, x2pnt($w_name, start_base), x2pnt($w_name, end_base))
			w0[j] = Ih*1e12
			// Rin base calculation
			Wavestats/Q/R=(x2_peak-0.005, x2_peak) tmp
			end_rin = V_maxloc
			start_rin = end_rin - 0.02
			rin_base = Mean($w_name, start_rin, end_rin)
			//rin_base = Mean($w_name, x2pnt($w_name, start_rin), x2pnt($w_name, end_rin))
			v3[j][0] = start_rin
			v3[j][1] = end_rin
			// Ra  and Cm fitting
			Wavestats/Q/R=(x1_peak, x1_peak+0.005) tmp
			x1_fit = V_minloc
			//FindLevel/Q/R=(V_maxloc,V_maxloc+0.005) tmp, 0
			//x3_fit = V_LevelX
			x3_fit = x1_fit+(4*deltax($w_name))
			FindLevel/Q/R=(x2_peak) $w_name , Ih
			if(V_flag == 0)
				x2_fit = x1_peak+(V_LevelX-x2_peak)
			else
				x2_fit = x1_peak+0.01
			endif
			v4[j][0] = x1_fit
			v4[j][1] = x2_fit
			v4[i][2] = x3_fit
			K0 = Rin_base
			V_FitError = 0
			CurveFit/Q/H="10000"/NTHR=0 dblexp_XOffset $w_name[x2pnt($w_name,x1_fit), x2pnt($w_name,x2_fit)]/D
			WAVE W_coef, W_FitConstants
			peak_Ra = W_coef[0]+W_coef[1]*exp(-(x1_peak-W_fitConstants[0])/W_coef[2])+W_coef[3]*exp(-(x1_peak-W_fitConstants[0])/W_coef[4])
			v0[j] = peak_Ra
			Ra = (-5e-3)/(peak_Ra - Ih)
			w2[j] = Ra/1e6
		
			K0 = Rin_base
			V_FitError = 0
			CurveFit/Q/X=1/H="100"/NTHR=0 exp_XOffset  $w_name[x2pnt($w_name, x3_fit), x2pnt($w_name, x2_fit)] /D 
			WAVE W_coef
			Tau = W_coef[2]
			w5[j] = Tau *1e3
		
			Cm = Tau/Ra
			w4[j] = Cm*1e12
		
			Rin = abs(((-5e-3)/(Ih-rin_base))) - Ra
			w3[j] = abs(Rin/1e6)
			if(Ih>0)
				Vm = (-0.07-abs(Ih*Rin))
			else
				Vm = (-0.07+abs(Ih*Rin))
			endif
			w1[j] = Vm*1e3
			fit_name = "fit_"+w_name
			KillWaves/Z $fit_name, tmp, W_coef, W_FitConstants
		endfor
		Duplicate/O w0, $cell_name+"_Ih"
		Duplicate/O w1, $cell_name+"_Vm"
		Duplicate/O w2, $cell_name+"_Ra"
		Duplicate/O w3, $cell_name+"_Rin"
		Duplicate/O w4, $cell_name+"_Cm"
		Duplicate/O w5, $cell_name+"_Tau"	
		t_name = "T_"+cell_name
		DoWindow $t_name
		if(V_flag == 0)
			Edit/K=1/N=$t_name as "Passive Prop for " + cell_name
			AppendToTable/W=$t_name $cell_name+"_Ih", $cell_name+"_Vm", $cell_name+"_Ra", $cell_name+"_Rin", $cell_name+"_Cm", $cell_name+"_Tau"
		endif
		Killwaves/Z v0, v1, v2, v3, v4, w0, w1, w2, w3, w4, w5
	endfor
	
End

Function Rescale()
	String w_list
	String w_name
	Variable i,n
	
	i = 0
	n = 0
	w_list = WaveList("Cell*",";","")
	n = ItemsInList(w_list,";")
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		WAVE w0 = $w_name
		w0 /= 2.5
	endfor
End

Function ConvertWaves()
	String w_name
	String w_list
	String new_name
	Variable i,n
	
	i = 0
	n= 0
	w_list = WaveList("Cell*",";","")
	n = ItemsInList(w_list,";")
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		new_name = "C_"+w_name
		Duplicate/O $w_name, w0
		w0 *= 1e12
		Duplicate/O w0, $new_name
		KillWaves/Z w0
	endfor
End

Function GetDecay()
	String g_name
	String w_name
	String decay_name
	String w_list
	Variable start_decay
	Variable end_decay
	Variable peak
	Variable s_base
	Variable e_base
	Variable base
	Variable amp
	Variable decay
	Variable i,n
	Variable j,m
	
	
	i = 0
	n = 0
	w_list = Wavelist("Mean_Cell*",";","")
	n = ItemsInList(w_list,";")
	Make/O/T/N=(n) CellDecayName
	Make/O/N=(n) DecayValue
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		CellDecayName[i] = w_name[5,strlen(w_name)-1] 
		Display/k=1 $w_name
		g_name = WinName(0,1)
		w_name = WaveName(g_name,0,1)
		e_base = 9.5
		s_base  = e_base -5
		Wavestats/Q/R=(s_base, e_base) $w_name
		base = V_avg
		Wavestats/Q $w_name
		Wavestats/Q/R=(V_minloc-0.1,V_minloc+0.1) $w_name
		amp = abs(V_min-base)
		FindLevel/Q/R=(V_minloc) $w_name, base-(amp*0.8)
		start_decay = V_LevelX
		Print "start decay = "+num2str(start_decay)
		FindLevel/Q/R=(V_minloc) $w_name, base - (amp*0.2)
		end_decay = V_LevelX
		Print "end decay = "+num2str(end_decay)
		K0 = base
		CurveFit/Q=1/H="100"/NTHR=0 exp_XOffset  $w_name[x2pnt($w_name, start_decay), x2pnt($w_name,end_decay)] /D 
		WAVE W_coef
		decay = W_coef[2]
		DecayValue[i] = decay
		Print "Decay value for "+w_name+" is: "+num2str(decay)
		DoWindow/k $g_name
	endfor
	Edit/K=1 CellDecayName, DecayValue
End

Function MeanMinisTrace()
	String w_name
	String w_list
	String cell_list
	String cell_name
	String mean_name
	Variable i,n
	Variable j,m
	
	i = 0
	n = 0
	j = 0
	m = 0
	w_list = Wavelist("MC_Cell*",";","")
	cell_list = ""
	n = ItemsInList(w_list,";")
	for(i=0;i<n;i+=1)
		w_name = StringFromList(i,w_list,";")
		cell_name = w_name[3,9]
		if(stringmatch(cell_list,"*"+cell_name+"*") == 0)
			cell_list = SortList(cell_list+cell_name,";",16)
		endif
	endfor
	n = ItemsInList(cell_list,";")
	for(i=0;i<n;i+=1)
		cell_name = StringFromList(i,cell_list,";")
		w_list = Wavelist("MC_"+cell_name+"*",";","")
		m = ItemsInList(w_list,";")
		Duplicate/O $StringFromList(0,w_list,";"),w0
		for(j=1;j<m;j+=1)
			Duplicate/O $StringFromList(j,w_list,";"), v0
			w0 += v0
		endfor
		w0/=m
		mean_name = "Mean_"+cell_name
		Duplicate/O w0, $mean_name
	endfor
End
back to top