-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] r.fuzzy.set rounds shape/converts parameter decimal value to 0 #930
Comments
The calculation of the Sshape for when the shape parameter < 0 seems to be incorrect. I haven't checked (yet) the other shape formulas Note; there is another issue I am not sure how to solve. See #930
Using code from August 22, rebuilt grass + grass-addons from main, using the blue band of BMNG https://visibleearth.nasa.gov/images/57752/blue-marble-land-surface-shallow-water-and-shaded-topography. Make it Floatr.mapcalc expression="bmngfloat=bmng.blue/100.0" Map 1r.fuzzy.set --overwrite input=bmngfloat@PERMANENT output=out1 points=0.5,0.6 side=left shape=0.5 Map 2r.fuzzy.set --overwrite input=bmngfloat@PERMANENT output=out points=0.5,0.6 side=left shape=0.1 |
Thanks, I wonder if I introduced an error in #931. I'll do some further testing. |
Hi @YannChemin, below a reproducible example. The example data used in this example is the landsat layer lsat5_1987_10@landsat from the North Carolina full dataset (https://grass.osgeo.org/download/data/). Step 1. Set the region to match the raster layer and create a floating raster layer.
Step 2. Install the r.fuzzy_set addon, if not done already.
Step 3. Run the function using as input the lsat5_1987_10 raster layer as input. Fill in the output name test01, set minimum (A) and maximum inflection points to match the minimum and maximum value of the raster layer and the side to left. Keep the default input for the other parameters. That is, shape modifier (shape) = 0 and membership height (height) = 1.
The minimum = 4.5 and maximum = 25.4. Use this to set the A (lower boundary) and B (upper boundary) inflection points.
Step 4. Repeat the above twice, changing the shape modifier (shape) to 0.1, 0.5 and 0.9.
Check if there are differences between the output maps.
The r.univar outcomes show that the maps are identical. Results correspond to what one would expect when using the shape=0 parameter. Step 5. Now, let's try with negative values for the shape parameter.
Check if there are differences between the output maps.
Results based on negative shape values differ from those based on positive shape values. But, results show that outcomes for negative shape values are all the same, corresponding to what one would expect when using the shape=-1 parameter (note that there is a unrelated error in how the values are calculated as described in #931). I am on Ubuntu 22.04, GRASS GIS 8.3.1dev (ce5a0a5694). Results are the same on Windows 10, GRASS GIS 8.3. |
The problem was the use of the |
Closing since the issue is solved with PR #931 |
@ecodiv You can link the issue from the PR using "Closes #XYZ". Merging PR with this in the commit message will close the issue automatically. You can also link them from the web interface under Development. That may save you some writing and clicks overall. This will also ensure the standard behavior: it is customary to close the issue only after the PR was merged. |
Name of the addon
r.fuzzy.set
Describe the bug
Decimal values for the shape parameter results in the same result as filling in 0. It seems decimal values are rounded to 0.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
Function
Screenshots
The screenshot shows the command, with the shape=0.1 and shape=0.5. The result is the same. As the bivariate plots show, the results are what one would be expected for shape=0.
System description (please complete the following information):
The text was updated successfully, but these errors were encountered: