{"id":397,"date":"2014-09-24T17:42:00","date_gmt":"2014-09-24T17:42:00","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=397"},"modified":"2015-08-29T16:07:12","modified_gmt":"2015-08-29T16:07:12","slug":"program-of-the-month-sfmax1","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2014\/09\/24\/program-of-the-month-sfmax1\/","title":{"rendered":"Program of the month: sfmax1"},"content":{"rendered":"<p><a href=\"\/RSF\/sfmax1.html\">sfmax1<\/a> finds local maxima along the first axis of the input. It takes floating-point input but outputs complex numbers, where the real part stands for the location of the local minima and the imaginary part stands for the value of the input at local minima. <\/p>\n<p>The number of minima to output is controlled by <strong>np=<\/strong> parameter. To control the range for the minima locations (in the case that it is smaller than the full range of the data), use <strong>min=<\/strong> and <strong>max=<\/strong>. The output is sorted by value so that the largest maxima appear first. Here is a quick example. Let us create some data: <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre ><code>bash$ sfmath n1=5 output=\"sin(x1)\" &gt; data.rsf \nbash$ bash$ &lt; data.rsf sfdisfil\n   0:             0       0.8415       0.9093       0.1411      -0.7568\n<\/code><\/pre><\/div>\n<p>Observing the data values, we can suspect that the local maximum is between 1 and 2.<\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre ><code>bash$ &lt; data.rsf sfmax1 np=1 | sfdisfil\n   0:      1.581,    0.9826i\n<\/code><\/pre><\/div>\n<p><strong>sfmax1<\/strong> uses local parabolic interpolation to locate the minimum at 1.581 with the value of 0.9826. <\/p>\n<p>In the following example, from <a href=\"\/RSF\/book\/tccs\/flat\/flat.html\">tccs\/flat\/flat<\/a>, <strong>sfmax1<\/strong> is used to locate the strongest-amplitude horizons for <a href=\"\/RSF\/book\/tccs\/flat\/paper_html\/\">predictive painting<\/a>. <\/p>\n<p><img decoding=\"async\" src=\"\/RSF\/book\/tccs\/flat\/flat\/Fig\/spaint.png\" alt=\"\" title=\"\" \/><\/p>\n<h3 id=\"10previousprogramsofthemonth\">10 previous programs of the month:<\/h3>\n<ul>\n<li><a href=\"\/blog\/2014\/08\/03\/program-of-the-month-sfstolt\/\">sfstolt<\/a><\/li>\n<li><a href=\"\/blog\/2014\/07\/13\/program-of-the-month-sfltft\/\">sfltft<\/a><\/li>\n<li><a href=\"\/blog\/2014\/06\/11\/program-of-the-month-sfeikonal\/\">sfeikonal<\/a><\/li>\n<li><a href=\"\/blog\/2014\/05\/13\/program-of-the-month-sfhelicon\/\">sfhelicon<\/a><\/li>\n<li><a href=\"\/blog\/2014\/04\/02\/program-of-the-month-sfcostaper\/\">sfcostaper<\/a><\/li>\n<li><a href=\"\/blog\/2014\/03\/11\/program-of-the-month-sflpad\/\">sflpad<\/a><\/li>\n<li><a href=\"\/blog\/2014\/02\/06\/program-of-the-month-sfdipfilter\/\">sfdipfilter<\/a><\/li>\n<li><a href=\"\/blog\/2014\/01\/09\/program-of-the-month-sfinttest1\/\">sfinttest1<\/a><\/li>\n<li><a href=\"\/blog\/2013\/12\/01\/program-of-the-month-sfcausint\/\">sfcausint<\/a><\/li>\n<li><a href=\"\/blog\/2013\/11\/03\/program-of-the-month-sfremap1\/\">sfremap1<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>sfmax1 finds local maxima along the first axis of the input. It takes floating-point input but outputs complex numbers, where the real part stands for the location of the local minima and the imaginary part stands for the value of the input at local minima. The number of minima to output is controlled by np= [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-programs"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":3,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":14033,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions\/14033"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}