-
Notifications
You must be signed in to change notification settings - Fork 13
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
Error in calc_edges() #18
Comments
Dear Hunter, my guess is that there is a catchment comprising of two seperated parts that result in two lines in the tables but with the same stream id. Cheers, Mira |
Hi Mira,
Thank for you help with this. I think you are likely correct about the two separate reaches with the same netID causing issues. The code looped 'calcCatchmArea_assignNetID' over many of the parts before failing, I wasn't able to identify anything strange about streamID it eventually failed on viewed in GRASS, but maybe it will be more obvious to you what the issue is. I have attached a Dropbox link to the DEM that is causing the error, do let me know if you have any issues accessing it.
https://www.dropbox.com/s/bk0y79if2xwg1pm/parsnip_3005.tif?dl=0
The DEM corresponds to the Parsnip watershed in British Columbia, Canada.
I'll continue to see if I can find the catchment comprising of two separated parts.
Thanks,
Hunter
…________________________________
From: MiKatt <notifications@github.com>
Sent: Tuesday, January 26, 2021 2:47:50 AM
To: MiKatt/openSTARS
Cc: Gleason, Hunter FLNR:EX; Author
Subject: Re: [MiKatt/openSTARS] Error in calc_edges() (#18)
[EXTERNAL] This email came from an external source. Only open attachments or links that you are expecting from a known sender.
Dear Hunter,
my guess is that there is a catchment comprising of two seperated parts that result in two lines in the tables but with the same stream id.
When testing, I never had that case but it would be good to catch such events.
Would it be possible to send me your dem?
Cheers,
Mira
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#18 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKCKPC72DTUHXYMHGU2SXFTS32FUNANCNFSM4WNIEJGA>.
|
Dear Hunter |
Hello @MiKatt, I am working with @HunterGleason on this project. Thanks for creating and maintaining the openSTARS package! The call for derive_streams we were using is below...
I never saw the warning: Cheers, Bryce |
Hello Mira, Bryce,
Thanks Mira, the 'derive_streams' settings Bryce provided are correct, I did however recall seeing that error. However, when I viewed the resulting stream network in GRASS it appeared to represent the know streams well, I would not have considered the network to dense. Not sure what makes a stream network 'to dense' for GRASS. Sounds like that could be an issue though, perhaps it would successfully run with a larger 'accum_threshold' then?
Hunter
…________________________________
From: oconnorbryce <notifications@github.com>
Sent: Sunday, January 31, 2021 12:53:40 PM
To: MiKatt/openSTARS
Cc: Gleason, Hunter FLNR:EX; Mention
Subject: Re: [MiKatt/openSTARS] Error in calc_edges() (#18)
[EXTERNAL] This email came from an external source. Only open attachments or links that you are expecting from a known sender.
Hello @MiKatt<https://github.com/MiKatt>,
I am working with @HunterGleason<https://github.com/HunterGleason> on this project. Thanks for creating and maintaining the openSTARS package! The call for derive_streams we were using is below...
derive_streams(burn = 2, accum_threshold = 1200, min_stream_length = 0, condition = TRUE, clean = TRUE)
I never saw the warning: WARNING: Stream network may be too dense, just the error Hunter had described above following calc_edges()
Cheers,
Bryce
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#18 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKCKPCZPFNAVI2ZBTQVF23TS4WYMJANCNFSM4WNIEJGA>.
|
Hi Mira, Based on your response I ran the workflow with the 'accum_threshold' increased to 2500, and I did not get the
Seems to be a 'data.table' error? Hunter |
Dear Hunter,
I also get the error when running with higher accum_threshold. I am
working on that. I suppose, there is nothing wrong with `data.table` but
the streams file has somehow a different form than expected. I am
working on that.
Best, Mira
Am 01.02.2021 um 19:23 schrieb HunterGleason:
Hi Mira,
Based on your response I ran the workflow with the 'accum_threshold'
increased to 2500, and I did not get the |WARNING: Stream network may
be too dense| warning this time. However, after checking and
correcting complex junctions, calc_edges() still throws the following
error:
|Calculating reach contributing area (RCA) ... Calculating upstream
catchment areas ... Error in .prepareFastSubset(isub = isub, x = x,
enclos = parent.frame(), : RHS of == is length 2 which is not 1 or
nrow (25635). For robustness, no recycling is allowed (other than of
length 1 RHS). Consider %in% instead. In addition: Warning message: In
if (dt[stream == id, prev_str01, ] == 0) { : the condition has length
> 1 and only the first element will be used|
Seems to be a 'data.table' error?
Hunter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYLU623RNN3SG6BQPFIXBDS43WT5ANCNFSM4WNIEJGA>.
--
Dr. Mira Kattwinkel
Quantitative Landscape Ecology
Institute for Environmental Sciences
University of Koblenz-Landau
Fortstraße 7
76829 Landau
Germany
Fon: + 49 6341 280-31553
|
The problem stems from correct_complex_junctions where non-unique
streams with zero length are created. I am working on that.
On 01/02/2021 19.23, HunterGleason wrote:
Hi Mira,
Based on your response I ran the workflow with the 'accum_threshold'
increased to 2500, and I did not get the |WARNING: Stream network may
be too dense| warning this time. However, after checking and
correcting complex junctions, calc_edges() still throws the following
error:
|Calculating reach contributing area (RCA) ... Calculating upstream
catchment areas ... Error in .prepareFastSubset(isub = isub, x = x,
enclos = parent.frame(), : RHS of == is length 2 which is not 1 or
nrow (25635). For robustness, no recycling is allowed (other than of
length 1 RHS). Consider %in% instead. In addition: Warning message: In
if (dt[stream == id, prev_str01, ] == 0) { : the condition has length
> 1 and only the first element will be used|
Seems to be a 'data.table' error?
Hunter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYLU623RNN3SG6BQPFIXBDS43WT5ANCNFSM4WNIEJGA>.
--
Dr. Mira Kattwinkel
Quantitative Landscape Ecology
iES Landau, Institute for Environmental Sciences
University of Koblenz-Landau
Fortstraße 7
76829 Landau
Germany
Phone: + 49 6341 280-31553
Office: Building I, Room 2.02
|
Hi Mira, By non-unique streams you are referring to two separate stream networks with the same netID, one with length=0 ? Good catch, I can see how that would cause problems. Would a temporary solution be to make the min_stream_length parameter > 0 ? Thanks for your help with this, was trying to identify what the issue may have been in calc_edges() but was not having much success. Hunter |
Dear Hunter,
each stream segment has an id ('stream'). This should be unique but for
some reason, correct_complex_confluences cuts some segments into two
pieces, one having a small or zero length. This did not happen when I
tested to code. Unfortunately, min_stream_length > 0 does not help,
because the error happens later.
A quick work around would only be to set very large to get a coarse
network and hopefully no complex confluences. I tested a value of 20000
and the problem still persists.
I will let you know when I fixed it.
Cheers, Mira
…On 02/02/2021 18.14, HunterGleason wrote:
Hi Mira,
By non-unique streams you are referring to two separate stream
networks with the same netID, one with length=0 ? Good catch, I can
see how that would cause problems. Would a temporary solution be to
make the min_stream_length parameter > 0 ? Thanks for your help with
this, was trying to identify what the issue may have been in
calc_edges() but was not having much success.
Hunter
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYLU6YUK6LG5EC7WD2ETUTS5AXH5ANCNFSM4WNIEJGA>.
|
I hope to have fixed the problem. |
Hi Mira,
Appreciate all of the help with this issue. I will try running our workflow with the update code. I will let you know how things go and try and fix any issues if they come up.
Thanks,
Hunter
From: MiKatt <notifications@github.com>
Sent: February 2, 2021 2:16 PM
To: MiKatt/openSTARS <openSTARS@noreply.github.com>
Cc: Gleason, Hunter FLNR:EX <Hunter.Gleason@gov.bc.ca>; Mention <mention@noreply.github.com>
Subject: Re: [MiKatt/openSTARS] Error in calc_edges() (#18)
[EXTERNAL] This email came from an external source. Only open attachments or links that you are expecting from a known sender.
I hope to have fixed the problem.
Please install openSTARS from the dev repository (devtools::install_github("MiKatt/openSTARS", ref = "dev")) and check if it works now. See NEWS for a short description.
Please note that I have not done any excessive testing yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#18 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKCKPC3WLITZPUTGVSPSRIDS5B2QPANCNFSM4WNIEJGA>.
|
Hi Mira, I tested the updated openSTARS wiht the DEM I provided you, deriving streams with a threshold of 2000 (the only value I've tested so far) I did get calc_edges() to work. So your update seems to have fixed the issue as far as I can tell! Thanks, |
I close this issue for the time being. |
Hello,
I have come across an error that I am seeking help with in the calc_edges() function.
I have determined the function fails while looping the 'calcCatchmArea_assignNetID' method. What is strange is the code same code succeeds in a different basin. In the script I follow the correct steps including conditioning the DEM and checking for and correcting complex junctions. I've tried with different digital elevation models for the same region and get the same error.
The error I get is shown below:
Hoping to get any insight as to why I might be getting this error, could it simply be an issues with my digital elevation model, or a recent change in the data.table package?
Thanks,
Hunter
The text was updated successfully, but these errors were encountered: