-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add resistance reclass and reclass file option #231
Comments
Hi Sean, sorry for the late response here. AKAIK, the reclass option is not supported in Circuitscape.jl. It is something that was used in the old Python version only. @ranjanan can verify. Ranjan, the only place I saw it in the code was in config.jl here and in some test .ini files -- it doesn't appear to be used or referenced anywhere else in the code. We should probably get rid of that option (remove from defaults and from any documentation). I did not see mention of it in old Circuitscape docs though. |
Yes, this is something I haven't ported from the old Circuitscape because nobody asked for it. Honestly, I don't understand reclass files and what they do, or how to make one. @vlandau do you understand this piece of code? Happy to just put that in here blindly if that will just help @sean-streich |
I'm pretty sure it's basically equivalent to a bunch of |
That is what a reclass does for sure -- but I meant that would be an equivalent way to implement it in Julia. |
Makes sense to use if you have only a few (i.e. less than 100) different values in the resistance surface. |
Ah I see. That makes sense, because practitioners tend to use only a few values and would simply like 1 value to be replaced by another. Is there a huge convenience to do this in Circuitscape? Don't GIS softwares have this feature? Users export their grids from GIS softwares anyway, don't they? |
GIS programs certainly have this. The point being made by the OP is that this would require creating many large files instead of just computing and storing them in memory during computation. |
Thanks Vlandau, |
Okay -- we will keep that in mind. I believe there are goals to improve and develop documentation specific to Circuitscape.jl, but for now, the manual related to .ini file development can be found here: https://circuitscape.org/docs/ (that's presumably the one you already saw). It is specific to Circuitscape in Python, but nearly all of the .ini options are identical for Circuitscape.jl @ranjanan, will of course leave the decision about whether to implement the reclass stuff to you. |
I added a reclass feature for Omniscape and it didn't take much code. Something similar can probably be just as easily done for Circuitscape, so someone should feel free to do a PR and use my code. |
@ranjanan I think that code might actually be erroneous (unless I'm missing something, I'm not well-versed in Python), because of the way it's iteratively applied in a for loop to the object that is being reclassified. It might change 1's to 2's, then in the next loop, change 2's to 3's, which would incorrectly change the 1's that were changed to 2's to 3's as well. I tried something similar in my first pass in Omniscape and realized it's updating values that had already been updated once (I hadn't looked at the CS.py code). You'll see what I did to handle this in the links to my code above. |
That code may be from @tanmaykm from a very long time ago, if he can remember. |
FWIW, I personally don't remember the reclass option in the code. So, I'd go with your understanding of it and reproducing the feature in Circuitscape.jl. |
Hello,
I am just starting to use Ciruitscape and have had success running my data. I am experimenting with different resistance vales in my raster and will eventually be testing dozens of different large maps. Would the reclass option allow me to use a single raster and adjust resistance values through different reclass files instead of the extensive work of making many large resistance files.
If so is there a guide or example I could follow to make a correct reclass file. I have not come across one in the examples given.
Thanks,
Sean
The text was updated successfully, but these errors were encountered: