git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@90861 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9de369762e
commit
7e8b730858
|
@ -71,7 +71,7 @@ public class SpectrogramCustom extends FunctionGraphCustom
|
|||
protected double spectra_max = 0.;
|
||||
protected double spectra_min = 0.;
|
||||
protected double deltaF = 0.; // distance in Hz between two spectrum samples
|
||||
protected int spectra_indexmax = 0; // index in each spectrum corresponding to FREQ_MAX
|
||||
public int spectra_indexmax = 0; // index in each spectrum corresponding to FREQ_MAX
|
||||
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ public class SpectrogramCustom extends FunctionGraphCustom
|
|||
if (rect_height < 2) rect_height = 2;
|
||||
for (int i=0; i<spectra_indexmax; i++) {
|
||||
int color;
|
||||
if (Double.isNaN(spectrum[i]) || spectrum[i] < spectra_max - DYNAMIC_RANGE) {
|
||||
if (spectrum.length<=i || Double.isNaN(spectrum[i]) || spectrum[i] < spectra_max - DYNAMIC_RANGE) {
|
||||
color = 255; // white
|
||||
} else {
|
||||
color = (int) (255 * (spectra_max-spectrum[i])/DYNAMIC_RANGE);
|
||||
|
|
Loading…
Reference in New Issue