MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / fourierArray

Method fourierArray

ij/src/main/java/ij/macro/Functions.java:6399–6426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6397 }
6398
6399 Variable[] fourierArray() {
6400 interp.getLeftParen();
6401 Variable[] a = getArray();
6402 int windowType = FHT.NO_WINDOW;
6403 if (interp.nextToken()==',') {
6404 interp.getComma();
6405 String windowS = getString().toLowerCase();
6406 if (windowS.equals("hamming"))
6407 windowType = FHT.HAMMING;
6408 else if (windowS.startsWith("hann")) //sometimes also called 'Hanning'
6409 windowType = FHT.HANN;
6410 else if (windowS.startsWith("flat"))
6411 windowType = FHT.FLATTOP;
6412 else if (!windowS.startsWith("no"))
6413 interp.error("Invalid Fourier window '"+windowType+"'");
6414 }
6415 interp.getRightParen();
6416 int n = a.length;
6417 float[] data = new float[n];
6418 for (int i=0; i<n; i++)
6419 data[i] = (float)a[i].getValue();
6420 float[] result = new FHT().fourier1D(data, windowType);
6421 int n2 = result.length;
6422 Variable[] a2 = new Variable[n2];
6423 for (int i=0; i<n2; i++)
6424 a2[i] = new Variable(result[i]);
6425 return a2;
6426 }
6427
6428 Variable[] printArray() {
6429 String prefix = null;

Callers 1

doArrayMethod · 0.95

Calls 11

getArrayMethod · 0.95
getStringMethod · 0.95
getLeftParenMethod · 0.80
getCommaMethod · 0.80
startsWithMethod · 0.80
getRightParenMethod · 0.80
fourier1DMethod · 0.80
nextTokenMethod · 0.45
equalsMethod · 0.45
errorMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected