<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Apply regression for only certain cell values in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40944#M500</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, I double checked save location and got the SetNull function to work properly with the second expression you mentioned above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I'm still receiving an error message when I use the Con function. The error message I receive with this is that the "'Raster' object is not callable".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the expression: ((Con("Results" &amp;lt; -4, -4, "Results")) (Con("Results" &amp;gt; 1, 1, "Results"))) I've tried several variations of the expression to get the calculator to accept the syntax.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2013 21:49:21 GMT</pubDate>
    <dc:creator>AimeeRoach</dc:creator>
    <dc:date>2013-04-10T21:49:21Z</dc:date>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40940#M496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much, problem solved! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have one other question, regarding the raster calculator. I'm using the raster calculator to input a regression equation that I've created from my data, using the output I created with the euclidean distance calculator as the x value for the equation. However it predicts unrealistic values outside the range of what I know is possible for the variable I'm measuring. I'm wondering if there's a way that I can limit the output of the output from the raster calculator to only predict within values I know are possible? For instance limit the prediction to within -4 to 1, rather than allowing the calculator to predict values of up to -16, etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 04:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40940#M496</guid>
      <dc:creator>AimeeRoach</dc:creator>
      <dc:date>2013-04-04T04:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40941#M497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp; For instance limit the prediction to within -4 to 1, rather than allowing the calculator to predict values of up to -16, etc.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SetNull and Con can do a lot of handy things like this with cell values. Reclassify is also useful, but Con and SetNull are more flexible and work well with float and integer rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, if this is your regression equation, go ahead and calculate all the values to a grid called "results":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;(5.0 * factor1) + 0.45&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To set all cells outside the range, to NoData you could then do this with a second Raster Calculator run:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;SetNull("results" &amp;lt; -4 or "results" &amp;gt; 1, "results")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can get fancier, for example, to "saturate" at those values and make all the areas below -4 stay at -4, you could do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;Con("results" &amp;lt; -4, -4, Con("results" &amp;gt; 1, 1, "results")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 03:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40941#M497</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-04-05T03:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40942#M498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still having some trouble getting this to work for me. I'm getting a couple of error messages when I try to run the raster calculator with SetNull. When I use both limiting values (-4 and 1), with this calculation SetNull("results" &amp;lt;-4 &amp;gt;1, "results"), I get this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: rcexec() &amp;lt;type 'exceptions.ValueError'&amp;gt;: The truth value of a raster is ambiguous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought maybe it would only take one limiting value at a time rather than the range I was trying to specify... so I limited the calculation to only limit to &amp;lt; -4 with this calculation SetNull("results" &amp;lt;-4, "results") and got this error message: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;000539: Error running expression: rcexec() &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 010240: Could not save raster dataset to &amp;lt;Save Location&amp;gt; with output format IMAGINE Image&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I am inputting the values incorrectly?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 17:51:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40942#M498</guid>
      <dc:creator>AimeeRoach</dc:creator>
      <dc:date>2013-04-10T17:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40943#M499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm still having some trouble getting this to work for me. I'm getting a couple of error messages when I try to run the raster calculator with SetNull. When I use both limiting values (-4 and 1), with this calculation SetNull("results" &amp;lt;-4 &amp;gt;1, "results"), I get this error message:&lt;BR /&gt;&lt;BR /&gt;ERROR 000539: Error running expression: rcexec() &amp;lt;type 'exceptions.ValueError'&amp;gt;: The truth value of a raster is ambiguous.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are two different ways to do this that should work (at least one anyway):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SetNull("results" &amp;lt; -4 or "results" &amp;gt; 1, "results")
SetNull("results", "results", "VALUE&amp;nbsp; &amp;lt; -4 OR VALUE &amp;gt; 1")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I limited the calculation to only limit to &amp;lt; -4 with this calculation SetNull("results" &amp;lt;-4, "results") and got this error message: &lt;BR /&gt;&lt;BR /&gt;000539: Error running expression: rcexec() &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 010240: Could not save raster dataset to &amp;lt;Save Location&amp;gt; with output format IMAGINE Image&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this second error has to do with your output path. make sure your output pathname is not the same as an existing dataset with the same name - and that the output location is a folder not a geodatabase workspace.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40943#M499</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T21:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40944#M500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, I double checked save location and got the SetNull function to work properly with the second expression you mentioned above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I'm still receiving an error message when I use the Con function. The error message I receive with this is that the "'Raster' object is not callable".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the expression: ((Con("Results" &amp;lt; -4, -4, "Results")) (Con("Results" &amp;gt; 1, 1, "Results"))) I've tried several variations of the expression to get the calculator to accept the syntax.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 21:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40944#M500</guid>
      <dc:creator>AimeeRoach</dc:creator>
      <dc:date>2013-04-10T21:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Apply regression for only certain cell values</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40945#M501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt;I'm using the expression: ((Con("Results" &amp;lt; -4, -4, "Results")) (Con("Results" &amp;gt; 1, 1, "Results"))) &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to nest the function to do what you want.&amp;nbsp; My example before required one more parenthesis, sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;Con("Results" &amp;lt; -4, -4, Con("Results" &amp;gt; 1, 1, "Results"))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 18:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/re-apply-regression-for-only-certain-cell-values/m-p/40945#M501</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-04-11T18:49:23Z</dc:date>
    </item>
  </channel>
</rss>

