Skip to content

Commit

Permalink
Document Relationship between polygon/layer/species objects and their…
Browse files Browse the repository at this point in the history
… properties and common variables in VDYP7 Fortran.
  • Loading branch information
smithkm committed Jul 17, 2023
1 parent 829f211 commit 93a6d37
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 28 deletions.
29 changes: 20 additions & 9 deletions vdyp-fip/src/main/java/ca/bc/gov/nrs/vdyp/fip/model/FipLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ public class FipLayer {
static final String INVENTORY_TYPE_GROUP = "INVENTORY_TYPE_GROUP"; // ITGFIP
static final String BREAST_HEIGHT_AGE = "BREAST_HEIGHT_AGE"; // AGEBH

String polygonIdentifier; // POLYDESC
final Layer layer;
float ageTotal;
float height;
float siteIndex;
float crownClosure;
String siteGenus;
String siteSpecies;
float yearsToBreastHeight;
String polygonIdentifier; // FIP_P/POLYDESC
final Layer layer; // This is also represents the distinction between data stored in FIPL_1(A) and
// FIP_V(A). Where VDYP7 stores both and looks at certain values to determine if
// a layer is "present". VDYP8 stores them in a map keyed by this value
float ageTotal; // FIPL_1/AGETOT_L1 or FIPL_V/AGETOT_V1
float height; // FIPL_1/HT_L1 or FIPL_V/HT_V1
float siteIndex; // FIPL_1/SI_L1 or FIPL_V/SI_V1
float crownClosure; // FIPL_1/CC_L1 or FIP:_V/CC_V1
String siteGenus; // FIPL_1A/SITESP0_L1 or FIPL_VA/SITESP0_L1
String siteSpecies; // FIPL_1A/SITESP64_L1 or FIPL_VA/SITESP64_L1
float yearsToBreastHeight; // FIPL_1/YTBH_L1 or FIP:_V/YTBH_V1

// In VDYP7 These are read but not stored in common variables.
// Marked as Deprecated for now but I think we can just remove them.
@Deprecated
Optional<Integer> inventoryTypeGroup;
@Deprecated
Optional<Float> breastHeightAge;

Map<String, FipSpecies> species = Collections.emptyMap();
Expand Down Expand Up @@ -89,10 +96,12 @@ public float getYearsToBreastHeight() {
return yearsToBreastHeight;
}

@Deprecated
public Optional<Integer> getInventoryTypeGroup() {
return inventoryTypeGroup;
}

@Deprecated
public Optional<Float> getBreastHeightAge() {
return breastHeightAge;
}
Expand Down Expand Up @@ -129,10 +138,12 @@ public void setYearsToBreastHeight(float yearsToBreastHeight) {
this.yearsToBreastHeight = yearsToBreastHeight;
}

@Deprecated
public void setInventoryTypeGroup(Optional<Integer> inventoryTypeGroup) {
this.inventoryTypeGroup = inventoryTypeGroup;
}

@Deprecated
public void setBreastHeightAge(Optional<Float> breastHeightAge) {
this.breastHeightAge = breastHeightAge;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ public class FipLayerPrimary extends FipLayer {
static final String SITE_CURVE_NUMBER = "SITE_CURVE_NUMBER"; // SCN
static final String STOCKING_CLASS = "STOCKING_CLASS"; // STK

Optional<Integer> siteCurveNumber; // TODO Confirm if these should be required instead of optional if we know it's
// a Primary layer.
Optional<String> stockingClass;
// TODO Confirm if these should be required instead of optional if we know it's
// a Primary layer.
Optional<Integer> siteCurveNumber; // FIPL_1/SCN_L1

Optional<String> stockingClass; // FIPL_1ST/STK_L1

public FipLayerPrimary(
String polygonIdentifier, float ageTotal, float height, float siteIndex, float crownClosure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

public class FipPolygon {

String polygonIdentifier; // POLYDESC
String forestInventoryZone; // FIZ
String biogeoclimaticZone; // BEC
Optional<Float> percentAvailable; // PCTFLAND
Optional<FipMode> modeFip; // MODEfip
Optional<String> nonproductiveDescription; // NPDESC
float yieldFactor; // YLDFACT
String polygonIdentifier; // FIP_P/POLYDESC
String forestInventoryZone; // FIP_P/FIZ
String biogeoclimaticZone; // FIP_P/BEC
Optional<Float> percentAvailable; // FIP_P2/PCTFLAND
Optional<FipMode> modeFip; // FIP_P2/MODE / MODEfip
Optional<String> nonproductiveDescription; // FIP_P3/NPDESC
float yieldFactor; // FIP_P4/YLDFACT

Map<Layer, FipLayer> layers = Collections.emptyMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ public class FipSpecies {
static final String POLYGON_IDENTIFIER = "POLYGON_IDENTIFIER"; // POLYDESC
static final String LAYER = "LAYER"; // LAYER

final String polygonIdentifier; // POLYDESC
final Layer layer; // LAYER
final String genus; // SP0
final String polygonIdentifier; // FIP_P/POLYDESC
final Layer layer; // This is also represents the distinction between data stored in
// FIPL_1(A) and FIP_V(A). Where VDYP7 stores both and looks at certain values
// to determine if a layer is "present". VDYP8 stores them in a map keyed by
// this value

float percentGenus;
final String genus; // FIPSA/SP0V

// This is computed from percentGenus, but VDYP7 computes it (RFBASP0/FR) in a
// way that might lead to a slight difference so it's stored separately and can
// be modified.
float fractionGenus;
float percentGenus; // FIPS/PCTVOLV

Map<String, Float> speciesPercent;
// This is computed from percentGenus, but VDYP7 computes it in a way that might
// lead to a slight difference so it's stored separately and can be modified.
float fractionGenus; // RFBASP0/FR

Map<String, Float> speciesPercent; // Map from

public FipSpecies(
String polygonIdentifier, Layer layer, String genus, float percentGenus, Map<String, Float> speciesPercent
Expand Down

0 comments on commit 93a6d37

Please sign in to comment.