{"id":1562,"date":"2016-08-30T10:06:23","date_gmt":"2016-08-30T17:06:23","guid":{"rendered":"https:\/\/live-optics-wp.pantheonsite.io\/milster\/?page_id=1562"},"modified":"2016-08-30T15:51:04","modified_gmt":"2016-08-30T22:51:04","slug":"custom-variable-configuration","status":"publish","type":"page","link":"https:\/\/wp.optics.arizona.edu\/milster\/resources\/optiscan-simulation-program\/optiscan-help-desk\/index\/custom-variable-configuration\/","title":{"rendered":"Custom Variable Configuration"},"content":{"rendered":"<h3>Introduction :<\/h3>\n<p>The <em>Gooey Delta Object<\/em> can be used to create custom user variables that work with their custom <em>MOP<\/em> functions. The advantage of using the<em> Gooey Delta Object<\/em> is that the custom MOP function <em>itself<\/em> doesn&#8217;t have to be modified.<\/p>\n<p>An example <em>Optiscan<\/em> system configuration is shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1045\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/delat_mop_system.gif\" alt=\"delat_mop_system\" width=\"144\" height=\"50\" data-id=\"1045\" \/><\/p>\n<p>The MOP function uses five custom variables:<\/p>\n<ul>\n<li><em>width<\/em> &#8211; Width of Target (custom scaler)<\/li>\n<li><em>length<\/em> &#8211; Length of Target (custom scaler)<\/li>\n<li><em>num_samples<\/em> &#8211; Number of Sample Points (custom scaler)<\/li>\n<li><em>output_filename<\/em> &#8211; The name of the output filename (custom string)<\/li>\n<li><em>show_plot<\/em> &#8211; Should a plot of the result be shown (custom choice)<\/li>\n<\/ul>\n<p>The <em>Gooey Delta Variable<\/em> list looks like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1049\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/variable_list.gif\" alt=\"variable_list\" width=\"159\" height=\"166\" data-id=\"1049\" \/><\/p>\n<p>These <em>Gooey Delta Variables<\/em> are accessed in a custom MOP function using:<\/p>\n<blockquote><p>function [mop, curlink, simdata, errmsg] = custommop(action, mop, curlink, simdata)<br \/>\n%currently, there is no detected error, so there is no error message:<\/p>\n<p>&nbsp;<\/p>\n<p>errmsg = &#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>%retrieve the delta variable structure with our variables:<\/p>\n<p>&nbsp;<\/p>\n<p>delta_variables = get_deltavariables(mop)<\/p>\n<p>&nbsp;<\/p>\n<p>%unmarshall the arguments with the &#8220;eval&#8221; statement.<br \/>\n%the second argument to &#8220;eval&#8221; is returned if the first<br \/>\n%argument does not &#8220;exist&#8221; (i.e. not set with the delta object):<\/p>\n<p>&nbsp;<\/p>\n<p>width = eval(&#8216;delta_variables.width&#8217;, &#8217;10e-6&#8242;);<br \/>\nlength = eval(&#8216;delta_variables.length&#8217;, &#8217;10e-6&#8242;);<br \/>\noutput_filename = eval(&#8216;delta_variables.output_filename&#8217;, &#8216;result.mat&#8217;);<\/p>\n<p>&nbsp;<\/p>\n<p>%1==show plot; 2==dont show<\/p>\n<p>&nbsp;<\/p>\n<p>plot<\/p>\n<p>show_plot = eval(&#8216;delta_variables.show_plot&#8217;, &#8216;1&#8217;)<\/p>\n<p>&nbsp;<\/p>\n<p>%perform the calculations<\/p><\/blockquote>\n<hr \/>\n<h3>Adding a MOP Variable :<\/h3>\n<p><strong>Step 1<\/strong> -click the <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1795\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/add_button-2.gif\" alt=\"add_button\" width=\"88\" height=\"35\" data-id=\"1795\" \/>\u00a0button on the <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1050\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/variable_tool_tab.gif\" alt=\"variable_tool_tab\" width=\"98\" height=\"30\" data-id=\"1050\" \/>.<\/p>\n<p><strong>Step 2<\/strong> &#8211; click the &#8220;<em>MOP Custom Variable<\/em>&#8221; variable from the variable pick list:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1047\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/select_custom_variable.gif\" alt=\"select_custom_variable\" width=\"195\" height=\"162\" data-id=\"1047\" \/><\/p>\n<p><strong>Step 3<\/strong> &#8211; choose the type of the custom variable, and then configure (more) it as desired :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1046\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/scaler_configuration.gif\" alt=\"scaler_configuration\" width=\"520\" height=\"259\" data-id=\"1046\" \/><\/p>\n<p>The most important thing to configure is the variable&#8217;s name. This variable will be accessed using:<\/p>\n<p>delta_variables.width in the custom MOP function.<\/p>\n<p><strong>Step 4<\/strong> &#8211; click the <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1044\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/create_button.gif\" alt=\"create_button\" width=\"89\" height=\"34\" data-id=\"1044\" \/>\u00a0button.<\/p>\n<p>Configuring MOP Variables (scaler | string | choice):<\/p>\n<p><strong>Custom Scaler Configuration :<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1046\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/scaler_configuration.gif\" alt=\"scaler_configuration\" width=\"520\" height=\"259\" data-id=\"1046\" \/><\/p>\n<p><em>Type<\/em> &#8211; is the variable real or complex variables.<\/p>\n<ul>\n<li><em>Min<\/em> &#8211; the minimum value for the variable.<\/li>\n<li><em>Max<\/em> &#8211; the maximum value for the variable.<\/li>\n<\/ul>\n<p><strong>Custom String Configuration :<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1048\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/string_configuration.gif\" alt=\"string_configuration\" width=\"520\" height=\"259\" data-id=\"1048\" \/><\/p>\n<p><strong>Custom Chioce Configuration :<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1041\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/choice_configuration.gif\" alt=\"choice_configuration\" width=\"520\" height=\"259\" data-id=\"1041\" \/><\/p>\n<p><em>Descriptions<\/em> &#8211; a semicolon separated list of descriptions. There should be a description for each choice. The description for &#8220;Yes&#8221; as shown in the <em>Gooey Delta Variable Tool<\/em>\u00a0tab:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1042\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/choice_desc.gif\" alt=\"choice_desc\" width=\"384\" height=\"55\" data-id=\"1042\" \/><br \/>\n<em>Choices<\/em> &#8211; the choices as shown in the <em>Gooey Delta Variable Tool<\/em>\u00a0tab:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1043\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/choice_list.gif\" alt=\"choice_list\" width=\"384\" height=\"99\" data-id=\"1043\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction : The Gooey Delta Object can be used to create custom user variables that work with their custom MOP functions. The advantage of using the Gooey Delta Object is that the custom MOP function itself doesn&#8217;t have to be modified. An example Optiscan system configuration is shown below: The MOP function uses five custom variables: width &#8211; Width of<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":894,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1562","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/comments?post=1562"}],"version-history":[{"count":11,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1562\/revisions"}],"predecessor-version":[{"id":1888,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1562\/revisions\/1888"}],"up":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/894"}],"wp:attachment":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/media?parent=1562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}