publicstaticfinalintDATA_SOURCE_CORN_VEGET=1;// [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
publicstaticfinalintDATA_SOURCE_CORN_VEGET=1;// [4]/null Z-shape 4 corners vegetation, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
publicstaticfinalintDATA_SOURCE_CORN_ALPHA=2;// [4]/null Z-shape 4 corners vegetation alpha, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
publicstaticfinalintDATA_SOURCE_CORN_ALPHA=2;// [4]/null Z-shape 4 corners vegetation alpha, either >= as parameter index or -1 - (x + image_width*y) of the unmodified full index
...
@@ -98,6 +116,8 @@ public class VegetationLMA {
...
@@ -98,6 +116,8 @@ public class VegetationLMA {
privateint[][]y_src_hf;// subset of pointers that have all 4 neighbors
privateint[][]y_src_hf;// subset of pointers that have all 4 neighbors
privateint[][]y_src_scene;// [scene]{start_y_src, end_y_src+1} pointers to y_src per scene
privateint[][]y_src_scene;// [scene]{start_y_src, end_y_src+1} pointers to y_src per scene
privateint[][]y_wsrc;// [scene][windex] ysrc index for scene, windex [num_scenes][woi_length]
privateint[][]y_wsrc;// [scene][windex] ysrc index for scene, windex [num_scenes][woi_length]
privateint[][]samples_pointers;// {start,length} for each samples section, for extra 3-rd is ind_pars_*
// elevation-dependent parameters, calculated once if elevations are not adjusted or each time if they are
// elevation-dependent parameters, calculated once if elevations are not adjusted or each time if they are
privatedouble[]elev_radius;// for the future - make variable-size influence of the vegetation to mitigate far influenced pixels
privatedouble[]elev_radius;// for the future - make variable-size influence of the vegetation to mitigate far influenced pixels
privateint[][][]elev_woi4;// [scene][woi_veg][~4] indices (in woi) of 4 (or more/less) neighbors of projections (negatives)
privateint[][][]elev_woi4;// [scene][woi_veg][~4] indices (in woi) of 4 (or more/less) neighbors of projections (negatives)
...
@@ -143,7 +163,8 @@ public class VegetationLMA {
...
@@ -143,7 +163,8 @@ public class VegetationLMA {
// private double terrain_warmest = 90; // pull vegetations to warm, terrain to cold
// private double terrain_warmest = 90; // pull vegetations to warm, terrain to cold
// private double initial_split = 0.1; // pull vegetations to warm, terrain to cold
// private double initial_split = 0.1; // pull vegetations to warm, terrain to cold
// private double min_split_frac = 0.15; // minimal modality fraction to use split by temperature
// private double min_split_frac = 0.15; // minimal modality fraction to use split by temperature
privatedoubleterr_difference=100;// pull vegetation to be this warmer
privatedoubleterr_difference=100;// pull vegetation to be this warmer
@Deprecated
privatedoubleterr_pull_cold=0;// pull vegetations to warm, terrain to cold
privatedoubleterr_pull_cold=0;// pull vegetations to warm, terrain to cold
// next two just for saving?
// next two just for saving?
...
@@ -199,9 +220,13 @@ public class VegetationLMA {
...
@@ -199,9 +220,13 @@ public class VegetationLMA {
publicdoubledelta=1e-5;// 7;
publicdoubledelta=1e-5;// 7;
publicbooleanshow_extra=true;// show extra samples
// int findx = data_source[np][DATA_SOURCE_HEAD][DATA_SOURCE_HEAD_FINDEX];
// int findx = y_src[np][YSRC_FINDEX];
intfindx=par_rindex[np][1];
doubleterr_pull=terrain_average[findx];// maybe use tvao[TVAO_TERRAIN][findx] ?
if(Double.isNaN(terr_pull)){
terr_pull=0;// should not happen
}
fX[nx]+=terr_pull0*(vector[np]-terr_pull);
}
if(jt!=null){
if(jt!=null){
jt[np][nx]+=terr_lpf+terr_pull0;
jt[np][nx]+=terr_lpf;
for(inti=0;i<terr_neibs[n].length;i++){// now 4, may be increased
for(inti=0;i<terr_neibs[n].length;i++){// now 4, may be increased
intdi=terr_neibs[n][i];
intdi=terr_neibs[n][i];
if(di>=0){
if(di>=0){
...
@@ -2699,16 +2804,47 @@ public class VegetationLMA {
...
@@ -2699,16 +2804,47 @@ public class VegetationLMA {
ImageDtt.startAndJoin(threads);
ImageDtt.startAndJoin(threads);
}
}
if(fits[TVAO_VEGETATION]&&(veget_lpf>=0)){// should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)
if(samples_pointers[SAMPLES_VEGETATION_PULL][1]>0){// fits[TVAO_VEGETATION] && (veget_lpf >= 0)) { // should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)
finalintind_y_veget=ind_next;
// final int ind_y_veget = samples_pointers[SAMPLES_VEGETATION_PULL][0]; // ind_next;
doubleveget_pull=vegetation_pull[findx];// maybe use tvao[TVAO_TERRAIN][findx] ?
if(Double.isNaN(veget_pull)){
veget_pull=0;// should not happen unless too far from the vegetation
}
fX[nx]+=veget_pull0*(vector[np]-veget_pull);
}
if(jt!=null){
jt[np][nx]+=veget_pull0;
}
}
}
};
}
ImageDtt.startAndJoin(threads);
}
if(samples_pointers[SAMPLES_VEGETATION_LPF][1]>0){// fits[TVAO_VEGETATION] && (veget_lpf >= 0)) { // should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)
// final int ind_y_veget = samples_pointers[SAMPLES_VEGETATION_LPF][0]; // ind_next;
if(samples_pointers[SAMPLES_ELEVATION_PULL][1]>0){// fits[TVAO_ELEVATION] && (elevation_lpf >= 0)) { // should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)
@@ -2770,16 +2909,14 @@ public class VegetationLMA {
...
@@ -2770,16 +2909,14 @@ public class VegetationLMA {
}
}
if(fits[TVAO_ELEVATION]&&(elevation_lpf>=0)){// should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)
if(samples_pointers[SAMPLES_ELEVATION_LPF][1]>0){// fits[TVAO_ELEVATION] && (elevation_lpf >= 0)) { // should be positive for pull0 and terr_pull_cold (difference between vegetation and terrain)