-
Notifications
You must be signed in to change notification settings - Fork 15
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 collapseHz()
#307
base: master
Are you sure you want to change the base?
Add collapseHz()
#307
Conversation
This is a great idea, and perfect extension to the GHL foundation of ideas and methods. I'm surprised that we never included it before. From the texture class example above, it isn't clear to me how a dominant condition can be applied, when there is a (I think) full mapping of new labels to REGEX-matched patterns. Does the dominant condition come into play when an unmatched horizon label is encountered? Good call on excluding color, perhaps a reasonable place to use simulated mixtures. Or, it could be that someone is only interested in Munsell value, and in that case a wt. mean is probably fine. |
Yeah, agreed, its something I feel like we have talked a lot about but just never have implemented a generic function for.
Dominant condition is based on the thickest horizon's value within each "adjacency" group. There is no aggregation applied to an unmatched horizon label--it just passes through to the result. As currently implemented this is modifying the I need to ponder a bit on this as far as what the right ergonomics are. Probably better to have the function calculate a new horizon designation column and set it as the generalized horizon label, or horizon designation label, or both? Rather than modifying existing data--which might be important for downstream context.
Yeah, I think I want to keep the function relatively "dumb" but specific columns could be targeted with specific methods by either calling |
I must note that this concept is implemented in part as Line 275 in fcad3e8
I forgot about that function and reinvented part of the wheel here, I suppose. It is nice that
|
A note for later: one of the simplest cases is flattening on an intended horizon index, such as chkey or phiid, with a short-circut for 99% of the cases where no flattening is required. |
Here is another draft idea for a common operation people want to perform on SoilProfileCollections. This is a minimal implementation but I think several other options could greatly enhance the ways it could be used. It is likely it could be used to resolve some issues in soilDB such as ncss-tech/soilDB#120, ncss-tech/soilDB#122, ncss-tech/soilDB#135
collapseHz()
function makes it easy to aggregate adjacent horizons (collapsing them into a single horizon) using groups based on pattern matching. Numeric properties are aggregated via weighted average, and other properties are aggregated via dominant condition (i.e. the aggregate value comes from thickest horizon in each group)TODO/additional ideas
grepl()
based, likethicknessOf()
/ AddthicknessOf()
#306)GHL()
)--in lieu of specifiedpattern
and possibly change default forhzdesgn
when GHL() is set?Example behavior