VincyaneBadouard / TreeData_broken

Harmonization and correction forest data tool.
https://vincyanebadouard.github.io/TreeData/
0 stars 1 forks source link

DiameterCorrections improvements #46

Closed ValentineHerr closed 1 year ago

ValentineHerr commented 2 years ago

Opening this issue for discussion and for a to-do list for both myself and @VincyaneBadouard.

gabrielareto commented 2 years ago

Taper correction should have its own function or routine, and work with datasets with just one census. Other corrections or flags (for extreme growth etc.) should happen, probably, after taper correction. A great change in POM should not be seen as a great change in DBH.

ValentineHerr commented 1 year ago
VincyaneBadouard commented 1 year ago

Why do you want to delete MaxDBH? Data entry errors are the most common, and you don't want an impossibly high tree.

I didn't understand what you were talking about when you said multiple censuses for the taper correction. The taper correction just didn't need to be processed tree by tree as it just transforms from initial diameter. It can be put in the DiameterCorrection() function before calling DiameterCorrectionByTree() but you wanted to put it aside Camille (and you it seems to me) I think you should check with Camille

ValentineHerr commented 1 year ago

Why do you want to delete MaxDBH? Data entry errors are the most common, and you don't want an impossibly high tree.

I find that there are often one or two giant trees in a plot, trees that have much larger diameters than the rest of the population. So, I feel that removing diameter measurements > MaxDBH will either remove a true large measurement or not do anything to remove a false large measurement of a small tree. I think that your Diameter corrections should be enough to detect issues (using growth threshold etc..)

ValentineHerr commented 1 year ago

I am still working on getting familiar with the DiameterCorrection function.

Within this loop which I understand is supposed to be dealing with POM change, this line of code also detects abnormal growth. To me, detecting abnormal growth should be done separately from detecting POM change but there may be an important reason to do it here. @VincyaneBadouard do you remember why that part is within that loop?

Here is an outline of actions I am thinking would be appropriate, but @VincyaneBadouard and @cpiponiot let me know if that is too simplified:

  1. adjust Diameter when there is a change in height of measurement
    • If there is HOM --> taper correction (and ignore POM)
    • If there is no HOM but there is POM --> IndividualDiameterShiftCorrection OR PhylogeneticHierarchicalCorrection OR RegressionInterpolation
    • If no HOM and no POM --> can't do anything
  2. correct diameter where growth is abdormal (>pos threshold or < neg threshold)
    • correct with IndividualDiameterShiftCorrection OR PhylogeneticHierarchicalCorrection OR RegressionInterpolation
VincyaneBadouard commented 1 year ago

yes it's important to put NA at the abnormal growth at this step too because the correction prorposed at pom change is based on the other diameter values of the individual in the case of individual correction, and the last right value in the case of phylogenic correction.

"If there is HOM --> taper correction (and ignore POM)" : for me it's a user choice

RegressionInterpolation is only for punctual error If no HOM and no POM --> IndividualDiameterShiftCorrection OR PhylogeneticHierarchicalCorrection if shift error RegressionInterpolation if punctual error (see my end-of-contract document)

Why do you want to change the design we proposed? @cpiponiot

ValentineHerr commented 1 year ago

yes it's important to put NA

oh right, that make sense now

HOM is more precise than POM. Do you see a disadvantage of using POM only if HOM is missing?

Sorry, I don't mean to change the design, ignore my outline. I am trying to avoid having the function loop through every stem to improve speed, so I need to dig in and understand the code to be able to rewrite that part. Not having been involved with the design, I need to understand the choices that were made. Your end-of-contract document is very helpful, but it does not explain some of the decisions like: Why not also propose RegressionInterpolation for POM change?