4.5. User-Defined Parameter Sets

All preset classes have a public constructor, so user-defined parameter sets work everywhere a named preset does — including in interpolation:

// Hypothetical custom crop leaf
ProspectDPreset myLeaf = new ProspectDPreset(
    "My Crop",
    1.8,   // N
    42.0,  // Cab (µg/cm²)
    12.0,  // Car
    0.5,   // Anth
    0.0,   // Cbrown
    0.016, // Cw (cm)
    0.008  // Cm (g/cm²)
);

// Use directly
double[][] lrt = ProspectD.compute(myLeaf);

// Use in two-point interpolation with a named preset
double[][] lrt2 = ProspectD.compute(
    myLeaf, ProspectDPreset.SENESCENT, 0.5, InterpolationMode.SMOOTHSTEP);

// Use in three-point interpolation
double[][] lrt3 = ProspectD.compute(
    ProspectDPreset.YOUNG_LEAF, myLeaf, ProspectDPreset.SENESCENT,
    0.7, InterpolationMode.LINEAR);

Custom soil presets work the same way with Marmit2Preset:

Marmit2Preset mySoil = new Marmit2Preset("Sandy Loam", 3, 0.007, 0.65, 0.005);
double[][] rm = Marmit2.compute(mySoil);