问:
Fourier Transform of 2D-array containing NaNs
Introduction:

I have a 2D-array ìmg_roi that represents an image. Due to problems with my imaging system (the camera sensor is covered by a color filter), certain pixels are underexposed, yielding a checkerboard pattern. To better visualize the data, I also include a vertical cross-section where I fit a normal distribution to the relevant, i.e. bright, data points. The array data is provided at the end of this post.

In my image, the dark pixels contain no relevant information and I set them to nan using

```<code>img_roi[1::2, ::2] = np.nan
img_roi[::2, 1::2] = np.nan
</code>```

Goal:

Calculate the Fourier Transform of this array by using only the values from the bright pixels. I managed to do this in the case of fitting a Gaussian (see above), and I think there must be a way to also do a Fourier transform.

Problems:

I have looked through past posts and it seems that np.fft routines cannot handle NaNs. In essence, each unknown output propagates to every Fourier coefficient. So I exclude any pre-made routines.

Approaches:

We consider a 2x2 block of pixels. Two pixels are relevant, and two pixels are dark and hence irrelevant. We could take the two relevant pixels, get their average, and populate a new array (with dimensions reduced by x2) with averages obtained this way. This works, but obviously just circumvents the problem.

Don't use routines from np.fft, but instead write our own FT code. Here I honestly don't know where to start.

Question
I don't expect someone to provide me a custom FT algorithm. But please confirm if there are no SciPy or NumPy routines to do what I want before I embark on finding a custom solution.

Edit:
On a different note: I can mask out the nan value. Is there a way to do a FT of masked data?

Data:

```img_roi = [[ 3.10000000e+00  1.60000000e+00 -3.90000000e+00  4.10000000e+00
  -4.10000000e+00  3.10000000e+00  4.00000000e-01 -6.00000000e-01
   1.60000000e+00 -2.00000000e-01 -3.00000000e-01  3.00000000e-01
   3.00000000e-01  1.30000000e+00  9.00000000e-01  2.70000000e+00
  -1.80000000e+00 -6.00000000e-01  3.50000000e+00  2.00000000e+00
   1.30000000e+00 -7.00000000e-01  9.00000000e-01  7.10542736e-15
  -4.00000000e-01 -3.00000000e-01  3.00000000e-01  2.50000000e+00
  -2.20000000e+00  7.00000000e-01  2.40000000e+00 -9.00000000e-01
   7.00000000e-01  6.00000000e-01  2.70000000e+00  7.00000000e-01
   1.50000000e+00  1.40000000e+00  1.30000000e+00  9.00000000e-01]
 [ 7.00000000e-01  2.10000000e+00  1.30000000e+00  1.20000000e+00
   7.00000000e-01 -1.30000000e+00  3.20000000e+00 -3.90000000e+00
   2.50000000e+00 -2.40000000e+00  3.00000000e-01  1.70000000e+00
   6.00000000e-01  1.30000000e+00 -9.00000000e-01  1.00000000e-01
   1.00000000e+00  3.00000000e+00  2.00000000e-01  2.00000000e+00
   1.10000000e+00  2.00000000e-01 -1.00000000e-01  1.20000000e+00
   1.20000000e+00  6.00000000e-01  5.00000000e-01  9.00000000e-01
  -4.00000000e-01  7.00000000e-01 -1.00000000e-01 -9.00000000e-01
   3.10000000e+00  4.00000000e-01  1.10000000e+00  6.00000000e-01
   2.00000000e-01  3.00000000e-01 -1.00000000e-01  3.00000000e-01]
 [-3.30000000e+00 -3.00000000e-01 -2.00000000e-01  7.00000000e-01
   1.40000000e+00  4.00000000e-01  1.40000000e+00 -6.00000000e-01
   5.00000000e-01 -5.00000000e-01  2.20000000e+00  2.00000000e-01
   1.60000000e+00  3.00000000e-01 -2.60000000e+00  4.00000000e-01
   9.00000000e-01  3.10000000e+00 -5.00000000e-01  2.00000000e-01
   1.70000000e+00  8.00000000e-01 -1.50000000e+00  7.10542736e-15
   6.00000000e-01 -3.00000000e-01  1.70000000e+00 -1.10000000e+00
   1.10000000e+00 -1.00000000e-01  1.10000000e+00  2.00000000e-01
   2.60000000e+00  1.00000000e-01 -6.00000000e-01  3.00000000e-01
   3.50000000e+00  5.30000000e+00  4.10000000e+00  4.90000000e+00]
 [-4.00000000e-01 -2.00000000e-01  7.00000000e-01  1.40000000e+00
   8.00000000e-01  1.40000000e+00  6.00000000e-01  3.30000000e+00
  -4.00000000e-01  1.40000000e+00 -4.00000000e-01  3.20000000e+00
   1.10000000e+00  2.70000000e+00  8.00000000e-01  1.50000000e+00
   4.00000000e-01  1.50000000e+00 -4.40000000e+00  1.60000000e+00
   3.00000000e-01  3.90000000e+00 -4.00000000e-01  2.00000000e+00
  -9.00000000e-01  1.00000000e-01  2.00000000e-01  2.80000000e+00
   5.00000000e-01 -3.00000000e-01  8.00000000e-01 -3.00000000e-01
   5.20000000e+00  2.80000000e+00  5.70000000e+00  3.10000000e+00
   4.60000000e+00 -6.00000000e-01  9.60000000e+00  1.30000000e+00]
 [ 7.00000000e-01  7.00000000e-01  5.00000000e-01  2.30000000e+00
  -2.40000000e+00  7.00000000e-01  8.00000000e-01  2.00000000e-01
   3.20000000e+00  1.00000000e-01  1.00000000e-01 -2.00000000e-01
   1.40000000e+00  1.00000000e+00 -4.20000000e+00  8.00000000e-01
   4.00000000e-01  3.30000000e+00  5.00000000e-01  4.00000000e-01
  -4.00000000e-01 -4.00000000e-01 -4.00000000e-01 -3.00000000e-01
   1.00000000e+00  8.00000000e-01  3.70000000e+00  7.00000000e-01
   9.00000000e-01 -6.00000000e-01  1.20000000e+00  6.20000000e+00
   1.10000000e+00  4.70000000e+00 -1.00000000e-01  9.90000000e+00
   1.80000000e+00  1.31000000e+01 -5.00000000e-01  8.70000000e+00]
 [-6.00000000e-01  1.30000000e+00  9.00000000e-01  8.00000000e-01
   0.00000000e+00 -6.00000000e-01  1.40000000e+00  6.00000000e-01
   1.80000000e+00  1.60000000e+00  5.20000000e+00  3.70000000e+00
  -8.00000000e-01  3.00000000e-01 -3.70000000e+00 -8.00000000e-01
   5.00000000e-01  3.10000000e+00  3.00000000e-01 -2.00000000e-01
   6.00000000e-01  2.20000000e+00 -9.00000000e-01  1.00000000e+00
  -7.00000000e-01  1.20000000e+00  2.00000000e+00  2.00000000e-01
   3.60000000e+00  1.90000000e+00  8.50000000e+00 -2.00000000e-01
   7.60000000e+00  1.30000000e+00  1.48000000e+01  3.80000000e+00
   1.24000000e+01  3.00000000e-01  1.33000000e+01  2.60000000e+00]
 [ 1.00000000e-01  3.00000000e-01  1.50000000e+00  6.00000000e-01
   3.00000000e-01  5.00000000e-01  1.40000000e+00  3.20000000e+00
  -4.60000000e+00  9.00000000e-01  1.10000000e+00  4.00000000e-01
   1.60000000e+00 -1.00000000e-01  5.00000000e-01  2.20000000e+00
   6.00000000e-01  2.00000000e+00  1.10000000e+00  7.00000000e-01
   2.00000000e+00  0.00000000e+00 -2.90000000e+00 -5.00000000e-01
   7.00000000e-01  3.20000000e+00  7.00000000e-01  2.60000000e+00
  -1.70000000e+00  4.30000000e+00  1.20000000e+00  5.00000000e+00
   1.80000000e+00  9.00000000e+00  1.60000000e+00  1.36000000e+01
   8.00000000e-01  2.18000000e+01  2.50000000e+00  2.26000000e+01]
 [ 5.40000000e+00 -6.00000000e-01 -2.00000000e-01  4.00000000e-01
  -2.00000000e-01 -2.00000000e-01 -6.00000000e-01  2.00000000e+00
   1.00000000e+00  8.00000000e-01  4.00000000e-01  4.10000000e+00
  -4.00000000e-01  3.10000000e+00 -2.70000000e+00  3.00000000e+00
   1.10000000e+00  2.80000000e+00  2.40000000e+00  4.00000000e-01
   2.90000000e+00 -1.70000000e+00 -7.00000000e-01  9.00000000e-01
   1.10000000e+00  7.00000000e-01  2.30000000e+00  1.70000000e+00
   5.00000000e-01 -3.10000000e+00  7.00000000e-01  2.70000000e+00
   4.90000000e+00  2.20000000e+00  1.17000000e+01  7.00000000e+00
   1.53000000e+01  2.60000000e+00  2.80000000e+01  4.40000000e+00]
 [ 3.30000000e+00 -1.00000000e-01  5.00000000e-01 -6.00000000e-01
   2.80000000e+00  1.90000000e+00  2.10000000e+00  5.00000000e-01
   2.30000000e+00 -8.00000000e-01  3.20000000e+00  4.10000000e+00
   1.00000000e+00 -9.00000000e-01  1.50000000e+00  8.00000000e-01
   1.30000000e+00  3.20000000e+00 -6.00000000e-01  3.00000000e-01
   2.30000000e+00  1.00000000e-01  3.60000000e+00  1.20000000e+00
   1.00000000e-01 -2.00000000e-01  1.00000000e+00  8.00000000e-01
   1.60000000e+00  1.90000000e+00 -1.00000000e-01  6.70000000e+00
  -6.00000000e-01  1.37000000e+01  6.00000000e-01  1.55000000e+01
   6.80000000e+00  2.90000000e+01  4.10000000e+00  2.77000000e+01]
 [-6.00000000e-01  2.00000000e+00  3.00000000e-01  4.00000000e-01
   0.00000000e+00  6.00000000e-01  1.50000000e+00  2.80000000e+00
   1.40000000e+00  1.70000000e+00  1.00000000e-01  2.50000000e+00
  -3.00000000e-01  3.00000000e+00  2.40000000e+00  2.60000000e+00
   6.00000000e+00  1.70000000e+00  4.00000000e+00  1.00000000e+00
   1.00000000e-01  9.00000000e-01 -3.00000000e-01 -1.40000000e+00
   1.03000000e+01  3.10000000e+00  1.11000000e+01  8.00000000e-01
   8.20000000e+00  6.00000000e-01  9.20000000e+00  1.00000000e+00
   1.29000000e+01  6.00000000e-01  1.79000000e+01  4.90000000e+00
   2.35000000e+01  5.30000000e+00  2.31000000e+01  7.40000000e+00]
 [ 1.00000000e-01  2.50000000e+00  2.80000000e+00  4.10000000e+00
  -3.00000000e+00 -8.00000000e-01  2.90000000e+00 -3.00000000e-01
   2.40000000e+00 -1.00000000e-01  3.20000000e+00  2.90000000e+00
  -5.00000000e-01  7.00000000e-01 -4.00000000e-01  6.50000000e+00
  -3.00000000e-01  4.30000000e+00  1.20000000e+00  4.60000000e+00
  -6.00000000e-01  3.20000000e+00  2.50000000e+00  1.97000000e+01
   4.40000000e+00  2.58000000e+01  4.80000000e+00  3.30000000e+01
   1.00000000e-01  2.34000000e+01  0.00000000e+00  1.72000000e+01
   3.60000000e+00  2.74000000e+01 -2.00000000e-01  3.04000000e+01
   5.70000000e+00  3.94000000e+01  5.00000000e+00  3.15000000e+01]
 [ 2.60000000e+00  3.60000000e+00 -4.00000000e-01  2.60000000e+00
   5.00000000e-01  2.30000000e+00  2.30000000e+00  7.00000000e-01
   4.00000000e-01  1.20000000e+00  9.00000000e-01  0.00000000e+00
   5.20000000e+00  1.60000000e+00  5.30000000e+00  2.90000000e+00
   5.90000000e+00  5.00000000e-01  6.00000000e-01  3.50000000e+00
   8.00000000e-01  3.40000000e+00  2.31000000e+01  5.10000000e+00
   5.82000000e+01  1.01000000e+01  7.56000000e+01  7.70000000e+00
   6.34000000e+01  8.50000000e+00  4.76000000e+01  7.50000000e+00
   4.03000000e+01  6.00000000e+00  4.40000000e+01  3.90000000e+00
   4.30000000e+01  3.40000000e+00  4.10000000e+01  9.70000000e+00]
 [ 3.00000000e-01  5.00000000e-01 -4.10000000e+00  1.00000000e-01
  -6.00000000e-01  2.90000000e+00  2.10000000e+00  3.00000000e-01
   3.10000000e+00 -4.00000000e-01 -1.10000000e+00  4.50000000e+00
   1.90000000e+00  2.90000000e+00  1.70000000e+00  4.10000000e+00
  -1.00000000e-01  5.60000000e+00  1.50000000e+00  2.50000000e+00
   1.30000000e+00  2.47000000e+01  1.17000000e+01  7.51000000e+01
   1.50000000e+01  1.15200000e+02  2.28000000e+01  1.30900000e+02
   1.29000000e+01  1.09500000e+02  1.21000000e+01  7.60000000e+01
   1.13000000e+01  6.12000000e+01  6.30000000e+00  5.38000000e+01
   4.20000000e+00  4.44000000e+01  4.70000000e+00  4.59000000e+01]
 [ 9.00000000e-01  4.00000000e-01  1.80000000e+00  5.00000000e-01
   2.00000000e-01  5.00000000e-01 -3.00000000e-01  5.00000000e-01
   8.00000000e-01  2.30000000e+00  1.80000000e+00  2.80000000e+00
   1.20000000e+00  3.00000000e+00  4.90000000e+00 -1.00000000e-01
   5.20000000e+00  4.00000000e-01  1.30000000e+00  3.70000000e+00
   2.45000000e+01  1.48000000e+01  8.45000000e+01  3.01000000e+01
   1.60100000e+02  3.88000000e+01  2.24200000e+02  3.32000000e+01
   2.21900000e+02  2.77000000e+01  1.59000000e+02  2.22000000e+01
   1.14200000e+02  1.60000000e+01  8.95000000e+01  1.01000000e+01
   5.86000000e+01  1.03000000e+01  5.06000000e+01  5.00000000e+00]
 [ 3.10000000e+00  2.00000000e-01  6.00000000e-01 -1.20000000e+00
   3.50000000e+00  4.00000000e-01  2.00000000e+00  3.00000000e-01
  -3.00000000e-01  1.10000000e+00  1.50000000e+00  9.00000000e-01
   1.00000000e+00  4.40000000e+00  2.50000000e+00 -2.00000000e-01
   2.90000000e+00  2.00000000e-01  1.90000000e+00  1.76000000e+01
   1.19000000e+01  8.60000000e+01  2.25000000e+01  2.11800000e+02
   4.67000000e+01  3.03900000e+02  4.53000000e+01  3.38200000e+02
   3.98000000e+01  2.85500000e+02  2.98000000e+01  2.05900000e+02
   2.00000000e+01  1.42400000e+02  1.32000000e+01  9.68000000e+01
   1.12000000e+01  5.57000000e+01  6.40000000e+00  4.90000000e+01]
 [-4.00000000e+00  0.00000000e+00 -2.90000000e+00  3.00000000e+00
   4.00000000e-01  3.10000000e+00  1.40000000e+00  8.00000000e-01
  -1.10000000e+00  8.00000000e-01  1.30000000e+00  0.00000000e+00
   4.10000000e+00  2.10000000e+00  5.30000000e+00  2.80000000e+00
  -1.00000000e-01  1.30000000e+00  1.60000000e+01  1.42000000e+01
   7.20000000e+01  2.89000000e+01  2.05000000e+02  5.11000000e+01
   3.58600000e+02  7.71000000e+01  4.28900000e+02  7.63000000e+01
   4.32700000e+02  5.68000000e+01  3.30600000e+02  4.14000000e+01
   2.33900000e+02  3.12000000e+01  1.50400000e+02  1.80000000e+01
   8.39000000e+01  9.40000000e+00  5.02000000e+01  6.70000000e+00]
 [ 1.60000000e+00  5.00000000e-01  6.00000000e-01  5.00000000e-01
   6.00000000e-01  1.00000000e+00  2.00000000e+00  6.00000000e-01
  -6.00000000e-01  3.00000000e-01  1.20000000e+00  8.00000000e-01
   2.30000000e+00  1.00000000e-01  3.40000000e+00  6.00000000e-01
   1.90000000e+00  4.60000000e+00  6.70000000e+00  5.37000000e+01
   1.62000000e+01  1.82300000e+02  5.04000000e+01  3.82500000e+02
   6.97000000e+01  5.40600000e+02  7.82000000e+01  5.44800000e+02
   7.65000000e+01  4.89900000e+02  5.67000000e+01  3.57800000e+02
   3.81000000e+01  2.19400000e+02  2.04000000e+01  1.48500000e+02
   1.32000000e+01  6.97000000e+01  6.10000000e+00  4.51000000e+01]
 [ 1.00000000e-01 -2.90000000e+00 -4.00000000e-01 -3.90000000e+00
   3.30000000e+00  8.00000000e-01 -9.00000000e-01  4.00000000e-01
   5.00000000e-01  1.80000000e+00  2.90000000e+00  1.00000000e-01
   9.00000000e-01 -1.60000000e+00 -9.00000000e-01  1.30000000e+00
   4.30000000e+00  6.00000000e+00  3.76000000e+01  2.17000000e+01
   1.44300000e+02  4.89000000e+01  3.33400000e+02  8.32000000e+01
   5.66200000e+02  1.09800000e+02  6.62000000e+02  1.16500000e+02
   6.38900000e+02  8.49000000e+01  4.89100000e+02  6.72000000e+01
   3.42200000e+02  4.13000000e+01  2.06000000e+02  2.02000000e+01
   1.09900000e+02  1.01000000e+01  4.38000000e+01  4.80000000e+00]
 [ 1.00000000e-01  7.00000000e-01 -3.30000000e+00  0.00000000e+00
   1.90000000e+00  2.20000000e+00  1.30000000e+00  7.10542736e-15
   7.00000000e-01  0.00000000e+00 -3.70000000e+00 -9.00000000e-01
   1.80000000e+00  3.80000000e+00  2.60000000e+00  2.50000000e+00
   3.10000000e+00  1.96000000e+01  9.80000000e+00  9.64000000e+01
   2.91000000e+01  2.77500000e+02  6.83000000e+01  5.17200000e+02
   8.77000000e+01  6.69000000e+02  1.14300000e+02  7.31000000e+02
   7.97000000e+01  6.14700000e+02  6.81000000e+01  4.53100000e+02
   4.72000000e+01  2.86100000e+02  3.10000000e+01  1.53000000e+02
   1.61000000e+01  6.66000000e+01  6.10000000e+00  3.09000000e+01]
 [ 3.30000000e+00 -9.00000000e-01  8.00000000e-01  6.00000000e-01
  -3.60000000e+00  1.10000000e+00 -2.00000000e-01  1.30000000e+00
   1.40000000e+00  3.00000000e-01  1.60000000e+00  1.00000000e-01
   0.00000000e+00 -5.00000000e-01  1.20000000e+00  6.00000000e-01
   8.40000000e+00  6.40000000e+00  5.73000000e+01  2.63000000e+01
   1.93700000e+02  6.28000000e+01  4.26900000e+02  9.50000000e+01
   6.18500000e+02  1.27700000e+02  7.38200000e+02  1.29800000e+02
   6.68100000e+02  9.69000000e+01  5.17600000e+02  6.49000000e+01
   3.69900000e+02  5.00000000e+01  2.18600000e+02  2.18000000e+01
   9.12000000e+01  9.20000000e+00  3.50000000e+01  2.50000000e+00]
 [ 8.00000000e-01 -2.90000000e+00  1.30000000e+00  2.50000000e+00
   1.50000000e+00 -5.80000000e+00  1.60000000e+00 -1.00000000e-01
   5.00000000e-01 -9.00000000e-01  4.00000000e-01 -6.00000000e-01
   1.80000000e+00  3.00000000e-01  2.70000000e+00  7.20000000e+00
   3.00000000e-01  2.53000000e+01  1.51000000e+01  1.14600000e+02
   3.40000000e+01  2.82100000e+02  6.08000000e+01  5.11400000e+02
   9.37000000e+01  6.59200000e+02  1.05600000e+02  7.09900000e+02
   9.21000000e+01  5.78900000e+02  6.34000000e+01  4.09200000e+02
   4.77000000e+01  2.77700000e+02  2.03000000e+01  1.27500000e+02
   1.08000000e+01  5.07000000e+01  7.00000000e+00  1.34000000e+01]
 [-3.10000000e+00  5.00000000e-01 -8.00000000e-01 -1.00000000e-01
   6.00000000e-01  4.90000000e+00 -1.30000000e+00  5.00000000e-01
  -4.00000000e-01  1.60000000e+00  1.00000000e-01 -4.00000000e-01
   1.30000000e+00  1.00000000e-01  2.70000000e+00  3.50000000e+00
   9.70000000e+00  5.40000000e+00  5.08000000e+01  2.58000000e+01
   1.67700000e+02  5.84000000e+01  3.53500000e+02  9.03000000e+01
   5.34100000e+02  1.15000000e+02  6.15400000e+02  1.13100000e+02
   5.86700000e+02  9.07000000e+01  4.21400000e+02  5.94000000e+01
   2.93800000e+02  3.84000000e+01  1.50200000e+02  1.29000000e+01
   6.51000000e+01  5.70000000e+00  1.63000000e+01  2.00000000e+00]
 [ 1.10000000e+00  9.00000000e-01 -1.00000000e-01  1.40000000e+00
  -1.20000000e+00  1.60000000e+00  8.00000000e-01 -4.00000000e-01
   4.00000000e-01 -9.00000000e-01  4.00000000e-01 -4.00000000e-01
   7.00000000e-01 -3.00000000e-01  9.00000000e-01  4.80000000e+00
   4.00000000e-01  2.11000000e+01  1.01000000e+01  8.35000000e+01
   2.32000000e+01  2.22400000e+02  4.82000000e+01  3.86300000e+02
   7.43000000e+01  4.94700000e+02  7.49000000e+01  5.27900000e+02
   6.54000000e+01  4.16900000e+02  4.92000000e+01  2.88200000e+02
   3.27000000e+01  1.70000000e+02  1.68000000e+01  7.52000000e+01
   7.10000000e+00  2.23000000e+01  2.70000000e+00  5.00000000e+00]
 [-4.00000000e-01  1.70000000e+00  1.50000000e+00  1.20000000e+00
  -5.00000000e-01 -7.00000000e-01 -1.20000000e+00  1.00000000e+00
   1.10000000e+00  1.30000000e+00  4.00000000e-01  2.00000000e-01
   1.10000000e+00  6.00000000e-01  1.60000000e+00  5.00000000e-01
   6.50000000e+00  5.80000000e+00  2.94000000e+01  1.96000000e+01
   1.01200000e+02  3.35000000e+01  2.30600000e+02  5.66000000e+01
   3.44300000e+02  6.62000000e+01  3.91000000e+02  7.62000000e+01
   3.59600000e+02  5.39000000e+01  2.44500000e+02  3.76000000e+01
   1.66200000e+02  1.88000000e+01  7.38000000e+01  9.60000000e+00
   2.49000000e+01 -6.00000000e-01  5.70000000e+00  3.70000000e+00]
 [-3.90000000e+00 -1.40000000e+00  6.00000000e-01 -4.30000000e+00
   3.20000000e+00  1.00000000e-01 -2.20000000e+00  8.00000000e-01
   2.00000000e-01  3.50000000e+00  2.20000000e+00 -2.00000000e-01
   2.60000000e+00  1.10000000e+00 -7.00000000e-01  6.50000000e+00
  -3.00000000e-01  1.62000000e+01  5.70000000e+00  4.84000000e+01
   1.29000000e+01  1.05300000e+02  2.76000000e+01  2.04400000e+02
   4.00000000e+01  2.86700000e+02  4.98000000e+01  2.74100000e+02
   4.12000000e+01  2.00200000e+02  3.19000000e+01  1.44300000e+02
   1.66000000e+01  7.23000000e+01  5.70000000e+00  2.51000000e+01
   9.00000000e-01  6.40000000e+00 -2.00000000e-01  1.30000000e+00]
 [ 2.60000000e+00  7.00000000e-01 -9.00000000e-01  9.00000000e-01
  -1.00000000e-01  7.00000000e-01  5.00000000e-01  1.70000000e+00
  -2.00000000e-01  7.00000000e-01  2.40000000e+00 -6.00000000e-01
   5.70000000e+00  1.10000000e+00  6.00000000e-01  7.00000000e-01
   4.30000000e+00  3.40000000e+00  1.38000000e+01  5.10000000e+00
   3.73000000e+01  1.86000000e+01  8.89000000e+01  2.53000000e+01
   1.55600000e+02  3.42000000e+01  1.67700000e+02  2.87000000e+01
   1.50400000e+02  2.54000000e+01  1.02000000e+02  1.38000000e+01
   5.65000000e+01  5.10000000e+00  2.24000000e+01 -2.00000000e-01
   7.60000000e+00  1.30000000e+00  6.00000000e-01  2.10000000e+00]
 [ 3.30000000e+00  1.30000000e+00  2.00000000e-01  2.30000000e+00
  -2.40000000e+00  7.00000000e-01 -9.00000000e-01  3.00000000e-01
   4.00000000e-01  3.20000000e+00  4.00000000e-01  5.70000000e+00
   1.40000000e+00  5.60000000e+00  2.10000000e+00  4.30000000e+00
   1.80000000e+00  7.00000000e+00 -5.00000000e-01  1.27000000e+01
   5.30000000e+00  3.72000000e+01  9.80000000e+00  6.43000000e+01
   1.13000000e+01  8.53000000e+01  1.39000000e+01  9.43000000e+01
   1.15000000e+01  6.44000000e+01  5.40000000e+00  3.70000000e+01
   5.80000000e+00  1.56000000e+01  5.00000000e-01  6.50000000e+00
  -2.10000000e+00  3.40000000e+00 -1.00000000e-01 -2.00000000e-01]
 [-4.00000000e-01  6.00000000e-01 -1.00000000e-01  3.40000000e+00
  -4.10000000e+00  3.00000000e-01  7.10542736e-15 -7.00000000e-01
   1.30000000e+00 -2.00000000e-01  1.60000000e+00  3.10000000e+00
   4.60000000e+00  6.00000000e-01  1.03000000e+01  2.60000000e+00
   5.90000000e+00  1.60000000e+00  4.20000000e+00  2.50000000e+00
   4.90000000e+00  7.20000000e+00  1.71000000e+01  1.05000000e+01
   3.25000000e+01  8.60000000e+00  3.43000000e+01  7.10000000e+00
   3.49000000e+01  5.80000000e+00  1.75000000e+01  2.70000000e+00
   6.50000000e+00  1.80000000e+00  3.20000000e+00  2.30000000e+00
  -2.00000000e-01  2.20000000e+00  1.10000000e+00 -1.00000000e-01]
 [-8.00000000e-01  4.10000000e+00  6.00000000e-01  1.00000000e+00
   0.00000000e+00  2.00000000e-01  3.00000000e-01  1.60000000e+00
  -1.20000000e+00 -1.00000000e-01  2.30000000e+00  5.70000000e+00
  -5.00000000e-01  5.50000000e+00  2.90000000e+00  6.70000000e+00
   3.10000000e+00  8.70000000e+00  2.10000000e+00  5.30000000e+00
   2.10000000e+00  5.20000000e+00  6.00000000e-01  8.40000000e+00
   4.50000000e+00  1.25000000e+01  3.60000000e+00  1.36000000e+01
   4.00000000e-01  6.30000000e+00  3.00000000e-01 -5.00000000e-01
   2.00000000e+00  1.70000000e+00  1.90000000e+00 -3.00000000e-01
   1.70000000e+00  8.00000000e-01  2.10000000e+00  4.50000000e+00]
 [ 2.60000000e+00 -2.70000000e+00  3.10000000e+00 -2.10000000e+00
   2.00000000e-01 -3.00000000e+00 -6.00000000e-01  5.00000000e-01
  -4.00000000e-01  9.00000000e-01  5.00000000e+00  3.20000000e+00
   5.10000000e+00 -1.00000000e-01  9.50000000e+00  1.50000000e+00
   1.03000000e+01  2.70000000e+00  1.25000000e+01  5.00000000e-01
   9.90000000e+00  1.00000000e+00  1.00000000e-01  1.20000000e+00
   6.00000000e-01  3.00000000e+00  8.00000000e-01  9.00000000e-01
   1.30000000e+00  1.70000000e+00 -4.30000000e+00  2.00000000e-01
   3.00000000e-01  3.30000000e+00 -1.40000000e+00 -2.40000000e+00
   3.30000000e+00  2.20000000e+00  4.50000000e+00  1.50000000e+00]
 [ 5.00000000e-01  4.00000000e-01 -5.00000000e-01  1.00000000e-01
   9.00000000e-01  8.00000000e-01  1.80000000e+00 -1.00000000e-01
   2.00000000e-01  3.00000000e-01  2.20000000e+00  5.70000000e+00
   3.00000000e-01  4.20000000e+00  3.00000000e-01  1.59000000e+01
   6.00000000e-01  1.37000000e+01  1.60000000e+00  1.19000000e+01
   1.70000000e+00  8.50000000e+00  4.00000000e-01  3.70000000e+00
   1.00000000e-01  9.00000000e-01  2.00000000e-01 -7.00000000e-01
   1.80000000e+00  7.00000000e-01  1.80000000e+00  0.00000000e+00
   3.00000000e+00 -1.00000000e-01  1.70000000e+00  5.00000000e-01
   1.60000000e+00  1.50000000e+00  3.00000000e-01  3.80000000e+00]
 [ 3.10000000e+00 -4.00000000e-01  7.00000000e-01 -4.00000000e-01
   6.00000000e-01  1.60000000e+00  6.00000000e-01 -1.10000000e+00
  -4.00000000e-01  8.00000000e-01  1.00000000e+00  1.40000000e+00
   7.00000000e-01 -3.00000000e-01  9.70000000e+00  2.10000000e+00
   1.30000000e+01  1.00000000e-01  1.75000000e+01  4.00000000e-01
   1.58000000e+01  6.00000000e-01  1.12000000e+01  1.80000000e+00
   8.00000000e+00 -3.00000000e+00  4.00000000e+00  2.20000000e+00
   3.90000000e+00  1.00000000e+00  4.40000000e+00  1.00000000e-01
  -1.00000000e-01  6.00000000e-01  0.00000000e+00  1.90000000e+00
   4.30000000e+00  3.00000000e+00  5.20000000e+00 -2.00000000e-01]
 [ 8.00000000e-01 -6.00000000e-01 -4.00000000e+00 -9.00000000e-01
   1.00000000e+00  3.10000000e+00  3.00000000e-01 -5.00000000e-01
   1.80000000e+00 -5.00000000e-01 -7.00000000e-01  3.30000000e+00
  -3.70000000e+00  4.70000000e+00  1.70000000e+00  9.90000000e+00
  -5.00000000e-01  1.18000000e+01  2.20000000e+00  1.34000000e+01
   1.20000000e+00  1.32000000e+01  1.20000000e+00  9.10000000e+00
   3.00000000e+00  9.00000000e+00  3.60000000e+00  7.10000000e+00
   1.10000000e+00  5.20000000e+00  2.70000000e+00  6.10000000e+00
   2.10000000e+00  4.50000000e+00  2.00000000e+00  7.60000000e+00
   1.00000000e+00  5.20000000e+00  1.90000000e+00  9.30000000e+00]
 [ 5.00000000e-01  2.80000000e+00 -7.00000000e-01  0.00000000e+00
   1.00000000e-01  8.00000000e-01 -3.70000000e+00  4.00000000e-01
   4.00000000e-01  4.50000000e+00  2.20000000e+00  8.00000000e-01
  -1.00000000e-01 -2.00000000e-01  1.50000000e+00  2.10000000e+00
   4.20000000e+00  3.40000000e+00  1.04000000e+01  1.60000000e+00
   9.80000000e+00  3.20000000e+00  1.07000000e+01  2.80000000e+00
   1.01000000e+01  1.30000000e+00  9.40000000e+00  5.10000000e+00
   6.90000000e+00  1.70000000e+00  4.70000000e+00  1.00000000e+00
   3.80000000e+00  2.20000000e+00  5.20000000e+00  1.20000000e+00
   9.40000000e+00  5.00000000e-01  4.10000000e+00  2.40000000e+00]
 [ 8.00000000e-01  6.00000000e-01 -3.00000000e-01 -1.00000000e+00
  -5.00000000e-01  5.00000000e-01 -3.00000000e-01  2.90000000e+00
  -2.40000000e+00  1.40000000e+00  3.40000000e+00  1.80000000e+00
  -6.00000000e-01 -4.10000000e+00  2.30000000e+00  1.30000000e+00
   1.50000000e+00  3.60000000e+00  1.10000000e+00  7.70000000e+00
   3.80000000e+00  1.08000000e+01  1.00000000e-01  1.37000000e+01
   7.00000000e-01  9.60000000e+00  2.00000000e-01  5.30000000e+00
   2.80000000e+00  8.60000000e+00  1.70000000e+00  2.50000000e+00
   3.70000000e+00  4.30000000e+00  5.00000000e-01  4.00000000e+00
  -2.00000000e-01  4.70000000e+00  2.70000000e+00  4.30000000e+00]
 [-3.60000000e+00 -5.00000000e-01  1.00000000e-01  6.00000000e-01
  -5.00000000e-01 -3.00000000e-01  4.00000000e-01  9.00000000e-01
   1.00000000e-01  6.00000000e-01  1.00000000e-01 -5.10000000e+00
   4.20000000e+00  1.10000000e+00  1.00000000e-01  1.90000000e+00
   7.10542736e-15  0.00000000e+00  4.60000000e+00  0.00000000e+00
   6.10000000e+00  4.00000000e-01  8.00000000e+00  1.60000000e+00
   3.50000000e+00  1.20000000e+00  6.50000000e+00 -4.00000000e-01
   9.20000000e+00  8.00000000e-01  4.20000000e+00  2.40000000e+00
   4.90000000e+00  3.00000000e+00  5.80000000e+00  2.80000000e+00
   4.40000000e+00 -7.00000000e-01 -1.00000000e-01  7.00000000e-01]
 [-2.00000000e-01  4.00000000e-01  3.00000000e+00  3.00000000e+00
  -3.60000000e+00 -4.10000000e+00 -1.00000000e-01 -1.42108547e-14
   5.00000000e-01 -1.00000000e-01 -4.00000000e-01 -1.00000000e-01
   2.20000000e+00  2.00000000e+00  1.40000000e+00  9.00000000e-01
   5.00000000e-01  1.80000000e+00 -6.00000000e-01 -6.00000000e-01
   2.60000000e+00  2.70000000e+00 -8.00000000e-01  3.00000000e-01
   3.10000000e+00  4.90000000e+00  1.40000000e+00  6.90000000e+00
   5.00000000e-01  5.30000000e+00  2.20000000e+00  4.70000000e+00
   2.20000000e+00  4.50000000e+00  1.30000000e+00 -1.10000000e+00
   4.10000000e+00  7.00000000e-01  1.30000000e+00  1.20000000e+00]
 [ 1.80000000e+00 -3.20000000e+00 -9.00000000e-01  1.80000000e+00
  -7.00000000e-01  8.00000000e-01  1.70000000e+00  3.40000000e+00
  -1.30000000e+00 -1.60000000e+00  4.00000000e-01  1.90000000e+00
   1.70000000e+00  2.00000000e-01 -3.80000000e+00 -1.00000000e-01
   6.00000000e-01  3.20000000e+00 -3.40000000e+00  1.10000000e+00
   2.00000000e+00  3.30000000e+00  1.00000000e+00  1.00000000e+00
  -3.00000000e-01  2.10000000e+00  1.50000000e+00  2.80000000e+00
   8.00000000e-01  2.60000000e+00  4.20000000e+00 -5.00000000e-01
   6.00000000e+00  3.70000000e+00  1.30000000e+00  2.80000000e+00
   1.20000000e+00  1.80000000e+00  0.00000000e+00  1.40000000e+00]
 [ 1.00000000e-01  2.30000000e+00 -1.50000000e+00  6.00000000e-01
  -4.00000000e-01  1.50000000e+00  1.00000000e-01  1.30000000e+00
  -8.00000000e-01 -6.00000000e-01  2.00000000e-01  1.10000000e+00
  -1.42108547e-14  1.20000000e+00 -3.40000000e+00  2.60000000e+00
  -2.50000000e+00  3.40000000e+00  6.00000000e-01 -2.00000000e-01
   1.00000000e+00 -2.00000000e-01  9.00000000e-01 -2.90000000e+00
   2.10000000e+00  1.50000000e+00 -1.20000000e+00  2.00000000e+00
   2.80000000e+00  7.50000000e+00 -9.00000000e-01  1.10000000e+00
   3.20000000e+00  5.30000000e+00  1.80000000e+00  3.10000000e+00
  -2.40000000e+00  5.00000000e-01  8.00000000e-01  3.60000000e+00]
 [ 7.00000000e-01  9.00000000e-01 -1.00000000e-01 -4.40000000e+00
   3.20000000e+00  0.00000000e+00  2.00000000e-01  1.00000000e-01
   0.00000000e+00  7.00000000e-01  1.90000000e+00  1.50000000e+00
  -3.00000000e-01 -2.00000000e+00  2.00000000e-01 -3.90000000e+00
   3.00000000e+00  1.00000000e+00 -1.00000000e-01  1.00000000e-01
   1.00000000e-01  1.20000000e+00 -2.50000000e+00  2.70000000e+00
  -3.90000000e+00  2.80000000e+00  0.00000000e+00  9.00000000e-01
   2.00000000e-01  1.30000000e+00  6.70000000e+00  2.90000000e+00
  -1.00000000e-01 -3.90000000e+00  2.00000000e-01 -2.90000000e+00
   3.10000000e+00  1.00000000e-01 -1.20000000e+00 -2.00000000e-01]]
```

Body:
Introduction:

I have a 2D-array ìmg_roi that represents an image. Due to problems with my imaging system (the camera sensor is covered by a color filter), certain pixels are underexposed, yielding a checkerboard pattern. To better visualize the data, I also include a vertical cross-section where I fit a normal distribution to the relevant, i.e. bright, data points. The array data is provided at the end of this post.

In my image, the dark pixels contain no relevant information and I set them to nan using

img_roi[1::2, ::2] = np.nan
img_roi[::2, 1::2] = np.nan

Goal:

Calculate the Fourier Transform of this array by using only the values from the bright pixels. I managed to do this in the case of fitting a Gaussian (see above), and I think there must be a way to also do a Fourier transform.

Problems:

I have looked through past posts and it seems that np.fft routines cannot handle NaNs. In essence, each unknown output propagates to every Fourier coefficient. So I exclude any pre-made routines.

Approaches:

We consider a 2x2 block of pixels. Two pixels are relevant, and two pixels are dark and hence irrelevant. We could take the two relevant pixels, get their average, and populate a new array (with dimensions reduced by x2) with averages obtained this way. This works, but obviously just circumvents the problem.

Don't use routines from np.fft, but instead write our own FT code. Here I honestly don't know where to start.

Question
I don't expect someone to provide me a custom FT algorithm. But please confirm if there are no SciPy or NumPy routines to do what I want before I embark on finding a custom solution.

Edit:
On a different note: I can mask out the nan value. Is there a way to do a FT of masked data?

Data:

img_roi = [[ 3.10000000e+00  1.60000000e+00 -3.90000000e+00  4.10000000e+00
  -4.10000000e+00  3.10000000e+00  4.00000000e-01 -6.00000000e-01
   1.60000000e+00 -2.00000000e-01 -3.00000000e-01  3.00000000e-01
   3.00000000e-01  1.30000000e+00  9.00000000e-01  2.70000000e+00
  -1.80000000e+00 -6.00000000e-01  3.50000000e+00  2.00000000e+00
   1.30000000e+00 -7.00000000e-01  9.00000000e-01  7.10542736e-15
  -4.00000000e-01 -3.00000000e-01  3.00000000e-01  2.50000000e+00
  -2.20000000e+00  7.00000000e-01  2.40000000e+00 -9.00000000e-01
   7.00000000e-01  6.00000000e-01  2.70000000e+00  7.00000000e-01
   1.50000000e+00  1.40000000e+00  1.30000000e+00  9.00000000e-01]
 [ 7.00000000e-01  2.10000000e+00  1.30000000e+00  1.20000000e+00
   7.00000000e-01 -1.30000000e+00  3.20000000e+00 -3.90000000e+00
   2.50000000e+00 -2.40000000e+00  3.00000000e-01  1.70000000e+00
   6.00000000e-01  1.30000000e+00 -9.00000000e-01  1.00000000e-01
   1.00000000e+00  3.00000000e+00  2.00000000e-01  2.00000000e+00
   1.10000000e+00  2.00000000e-01 -1.00000000e-01  1.20000000e+00
   1.20000000e+00  6.00000000e-01  5.00000000e-01  9.00000000e-01
  -4.00000000e-01  7.00000000e-01 -1.00000000e-01 -9.00000000e-01
   3.10000000e+00  4.00000000e-01  1.10000000e+00  6.00000000e-01
   2.00000000e-01  3.00000000e-01 -1.00000000e-01  3.00000000e-01]
 [-3.30000000e+00 -3.00000000e-01 -2.00000000e-01  7.00000000e-01
   1.40000000e+00  4.00000000e-01  1.40000000e+00 -6.00000000e-01
   5.00000000e-01 -5.00000000e-01  2.20000000e+00  2.00000000e-01
   1.60000000e+00  3.00000000e-01 -2.60000000e+00  4.00000000e-01
   9.00000000e-01  3.10000000e+00 -5.00000000e-01  2.00000000e-01
   1.70000000e+00  8.00000000e-01 -1.50000000e+00  7.10542736e-15
   6.00000000e-01 -3.00000000e-01  1.70000000e+00 -1.10000000e+00
   1.10000000e+00 -1.00000000e-01  1.10000000e+00  2.00000000e-01
   2.60000000e+00  1.00000000e-01 -6.00000000e-01  3.00000000e-01
   3.50000000e+00  5.30000000e+00  4.10000000e+00  4.90000000e+00]
 [-4.00000000e-01 -2.00000000e-01  7.00000000e-01  1.40000000e+00
   8.00000000e-01  1.40000000e+00  6.00000000e-01  3.30000000e+00
  -4.00000000e-01  1.40000000e+00 -4.00000000e-01  3.20000000e+00
   1.10000000e+00  2.70000000e+00  8.00000000e-01  1.50000000e+00
   4.00000000e-01  1.50000000e+00 -4.40000000e+00  1.60000000e+00
   3.00000000e-01  3.90000000e+00 -4.00000000e-01  2.00000000e+00
  -9.00000000e-01  1.00000000e-01  2.00000000e-01  2.80000000e+00
   5.00000000e-01 -3.00000000e-01  8.00000000e-01 -3.00000000e-01
   5.20000000e+00  2.80000000e+00  5.70000000e+00  3.10000000e+00
   4.60000000e+00 -6.00000000e-01  9.60000000e+00  1.30000000e+00]
 [ 7.00000000e-01  7.00000000e-01  5.00000000e-01  2.30000000e+00
  -2.40000000e+00  7.00000000e-01  8.00000000e-01  2.00000000e-01
   3.20000000e+00  1.00000000e-01  1.00000000e-01 -2.00000000e-01
   1.40000000e+00  1.00000000e+00 -4.20000000e+00  8.00000000e-01
   4.00000000e-01  3.30000000e+00  5.00000000e-01  4.00000000e-01
  -4.00000000e-01 -4.00000000e-01 -4.00000000e-01 -3.00000000e-01
   1.00000000e+00  8.00000000e-01  3.70000000e+00  7.00000000e-01
   9.00000000e-01 -6.00000000e-01  1.20000000e+00  6.20000000e+00
   1.10000000e+00  4.70000000e+00 -1.00000000e-01  9.90000000e+00
   1.80000000e+00  1.31000000e+01 -5.00000000e-01  8.70000000e+00]
 [-6.00000000e-01  1.30000000e+00  9.00000000e-01  8.00000000e-01
   0.00000000e+00 -6.00000000e-01  1.40000000e+00  6.00000000e-01
   1.80000000e+00  1.60000000e+00  5.20000000e+00  3.70000000e+00
  -8.00000000e-01  3.00000000e-01 -3.70000000e+00 -8.00000000e-01
   5.00000000e-01  3.10000000e+00  3.00000000e-01 -2.00000000e-01
   6.00000000e-01  2.20000000e+00 -9.00000000e-01  1.00000000e+00
  -7.00000000e-01  1.20000000e+00  2.00000000e+00  2.00000000e-01
   3.60000000e+00  1.90000000e+00  8.50000000e+00 -2.00000000e-01
   7.60000000e+00  1.30000000e+00  1.48000000e+01  3.80000000e+00
   1.24000000e+01  3.00000000e-01  1.33000000e+01  2.60000000e+00]
 [ 1.00000000e-01  3.00000000e-01  1.50000000e+00  6.00000000e-01
   3.00000000e-01  5.00000000e-01  1.40000000e+00  3.20000000e+00
  -4.60000000e+00  9.00000000e-01  1.10000000e+00  4.00000000e-01
   1.60000000e+00 -1.00000000e-01  5.00000000e-01  2.20000000e+00
   6.00000000e-01  2.00000000e+00  1.10000000e+00  7.00000000e-01
   2.00000000e+00  0.00000000e+00 -2.90000000e+00 -5.00000000e-01
   7.00000000e-01  3.20000000e+00  7.00000000e-01  2.60000000e+00
  -1.70000000e+00  4.30000000e+00  1.20000000e+00  5.00000000e+00
   1.80000000e+00  9.00000000e+00  1.60000000e+00  1.36000000e+01
   8.00000000e-01  2.18000000e+01  2.50000000e+00  2.26000000e+01]
 [ 5.40000000e+00 -6.00000000e-01 -2.00000000e-01  4.00000000e-01
  -2.00000000e-01 -2.00000000e-01 -6.00000000e-01  2.00000000e+00
   1.00000000e+00  8.00000000e-01  4.00000000e-01  4.10000000e+00
  -4.00000000e-01  3.10000000e+00 -2.70000000e+00  3.00000000e+00
   1.10000000e+00  2.80000000e+00  2.40000000e+00  4.00000000e-01
   2.90000000e+00 -1.70000000e+00 -7.00000000e-01  9.00000000e-01
   1.10000000e+00  7.00000000e-01  2.30000000e+00  1.70000000e+00
   5.00000000e-01 -3.10000000e+00  7.00000000e-01  2.70000000e+00
   4.90000000e+00  2.20000000e+00  1.17000000e+01  7.00000000e+00
   1.53000000e+01  2.60000000e+00  2.80000000e+01  4.40000000e+00]
 [ 3.30000000e+00 -1.00000000e-01  5.00000000e-01 -6.00000000e-01
   2.80000000e+00  1.90000000e+00  2.10000000e+00  5.00000000e-01
   2.30000000e+00 -8.00000000e-01  3.20000000e+00  4.10000000e+00
   1.00000000e+00 -9.00000000e-01  1.50000000e+00  8.00000000e-01
   1.30000000e+00  3.20000000e+00 -6.00000000e-01  3.00000000e-01
   2.30000000e+00  1.00000000e-01  3.60000000e+00  1.20000000e+00
   1.00000000e-01 -2.00000000e-01  1.00000000e+00  8.00000000e-01
   1.60000000e+00  1.90000000e+00 -1.00000000e-01  6.70000000e+00
  -6.00000000e-01  1.37000000e+01  6.00000000e-01  1.55000000e+01
   6.80000000e+00  2.90000000e+01  4.10000000e+00  2.77000000e+01]
 [-6.00000000e-01  2.00000000e+00  3.00000000e-01  4.00000000e-01
   0.00000000e+00  6.00000000e-01  1.50000000e+00  2.80000000e+00
   1.40000000e+00  1.70000000e+00  1.00000000e-01  2.50000000e+00
  -3.00000000e-01  3.00000000e+00  2.40000000e+00  2.60000000e+00
   6.00000000e+00  1.70000000e+00  4.00000000e+00  1.00000000e+00
   1.00000000e-01  9.00000000e-01 -3.00000000e-01 -1.40000000e+00
   1.03000000e+01  3.10000000e+00  1.11000000e+01  8.00000000e-01
   8.20000000e+00  6.00000000e-01  9.20000000e+00  1.00000000e+00
   1.29000000e+01  6.00000000e-01  1.79000000e+01  4.90000000e+00
   2.35000000e+01  5.30000000e+00  2.31000000e+01  7.40000000e+00]
 [ 1.00000000e-01  2.50000000e+00  2.80000000e+00  4.10000000e+00
  -3.00000000e+00 -8.00000000e-01  2.90000000e+00 -3.00000000e-01
   2.40000000e+00 -1.00000000e-01  3.20000000e+00  2.90000000e+00
  -5.00000000e-01  7.00000000e-01 -4.00000000e-01  6.50000000e+00
  -3.00000000e-01  4.30000000e+00  1.20000000e+00  4.60000000e+00
  -6.00000000e-01  3.20000000e+00  2.50000000e+00  1.97000000e+01
   4.40000000e+00  2.58000000e+01  4.80000000e+00  3.30000000e+01
   1.00000000e-01  2.34000000e+01  0.00000000e+00  1.72000000e+01
   3.60000000e+00  2.74000000e+01 -2.00000000e-01  3.04000000e+01
   5.70000000e+00  3.94000000e+01  5.00000000e+00  3.15000000e+01]
 [ 2.60000000e+00  3.60000000e+00 -4.00000000e-01  2.60000000e+00
   5.00000000e-01  2.30000000e+00  2.30000000e+00  7.00000000e-01
   4.00000000e-01  1.20000000e+00  9.00000000e-01  0.00000000e+00
   5.20000000e+00  1.60000000e+00  5.30000000e+00  2.90000000e+00
   5.90000000e+00  5.00000000e-01  6.00000000e-01  3.50000000e+00
   8.00000000e-01  3.40000000e+00  2.31000000e+01  5.10000000e+00
   5.82000000e+01  1.01000000e+01  7.56000000e+01  7.70000000e+00
   6.34000000e+01  8.50000000e+00  4.76000000e+01  7.50000000e+00
   4.03000000e+01  6.00000000e+00  4.40000000e+01  3.90000000e+00
   4.30000000e+01  3.40000000e+00  4.10000000e+01  9.70000000e+00]
 [ 3.00000000e-01  5.00000000e-01 -4.10000000e+00  1.00000000e-01
  -6.00000000e-01  2.90000000e+00  2.10000000e+00  3.00000000e-01
   3.10000000e+00 -4.00000000e-01 -1.10000000e+00  4.50000000e+00
   1.90000000e+00  2.90000000e+00  1.70000000e+00  4.10000000e+00
  -1.00000000e-01  5.60000000e+00  1.50000000e+00  2.50000000e+00
   1.30000000e+00  2.47000000e+01  1.17000000e+01  7.51000000e+01
   1.50000000e+01  1.15200000e+02  2.28000000e+01  1.30900000e+02
   1.29000000e+01  1.09500000e+02  1.21000000e+01  7.60000000e+01
   1.13000000e+01  6.12000000e+01  6.30000000e+00  5.38000000e+01
   4.20000000e+00  4.44000000e+01  4.70000000e+00  4.59000000e+01]
 [ 9.00000000e-01  4.00000000e-01  1.80000000e+00  5.00000000e-01
   2.00000000e-01  5.00000000e-01 -3.00000000e-01  5.00000000e-01
   8.00000000e-01  2.30000000e+00  1.80000000e+00  2.80000000e+00
   1.20000000e+00  3.00000000e+00  4.90000000e+00 -1.00000000e-01
   5.20000000e+00  4.00000000e-01  1.30000000e+00  3.70000000e+00
   2.45000000e+01  1.48000000e+01  8.45000000e+01  3.01000000e+01
   1.60100000e+02  3.88000000e+01  2.24200000e+02  3.32000000e+01
   2.21900000e+02  2.77000000e+01  1.59000000e+02  2.22000000e+01
   1.14200000e+02  1.60000000e+01  8.95000000e+01  1.01000000e+01
   5.86000000e+01  1.03000000e+01  5.06000000e+01  5.00000000e+00]
 [ 3.10000000e+00  2.00000000e-01  6.00000000e-01 -1.20000000e+00
   3.50000000e+00  4.00000000e-01  2.00000000e+00  3.00000000e-01
  -3.00000000e-01  1.10000000e+00  1.50000000e+00  9.00000000e-01
   1.00000000e+00  4.40000000e+00  2.50000000e+00 -2.00000000e-01
   2.90000000e+00  2.00000000e-01  1.90000000e+00  1.76000000e+01
   1.19000000e+01  8.60000000e+01  2.25000000e+01  2.11800000e+02
   4.67000000e+01  3.03900000e+02  4.53000000e+01  3.38200000e+02
   3.98000000e+01  2.85500000e+02  2.98000000e+01  2.05900000e+02
   2.00000000e+01  1.42400000e+02  1.32000000e+01  9.68000000e+01
   1.12000000e+01  5.57000000e+01  6.40000000e+00  4.90000000e+01]
 [-4.00000000e+00  0.00000000e+00 -2.90000000e+00  3.00000000e+00
   4.00000000e-01  3.10000000e+00  1.40000000e+00  8.00000000e-01
  -1.10000000e+00  8.00000000e-01  1.30000000e+00  0.00000000e+00
   4.10000000e+00  2.10000000e+00  5.30000000e+00  2.80000000e+00
  -1.00000000e-01  1.30000000e+00  1.60000000e+01  1.42000000e+01
   7.20000000e+01  2.89000000e+01  2.05000000e+02  5.11000000e+01
   3.58600000e+02  7.71000000e+01  4.28900000e+02  7.63000000e+01
   4.32700000e+02  5.68000000e+01  3.30600000e+02  4.14000000e+01
   2.33900000e+02  3.12000000e+01  1.50400000e+02  1.80000000e+01
   8.39000000e+01  9.40000000e+00  5.02000000e+01  6.70000000e+00]
 [ 1.60000000e+00  5.00000000e-01  6.00000000e-01  5.00000000e-01
   6.00000000e-01  1.00000000e+00  2.00000000e+00  6.00000000e-01
  -6.00000000e-01  3.00000000e-01  1.20000000e+00  8.00000000e-01
   2.30000000e+00  1.00000000e-01  3.40000000e+00  6.00000000e-01
   1.90000000e+00  4.60000000e+00  6.70000000e+00  5.37000000e+01
   1.62000000e+01  1.82300000e+02  5.04000000e+01  3.82500000e+02
   6.97000000e+01  5.40600000e+02  7.82000000e+01  5.44800000e+02
   7.65000000e+01  4.89900000e+02  5.67000000e+01  3.57800000e+02
   3.81000000e+01  2.19400000e+02  2.04000000e+01  1.48500000e+02
   1.32000000e+01  6.97000000e+01  6.10000000e+00  4.51000000e+01]
 [ 1.00000000e-01 -2.90000000e+00 -4.00000000e-01 -3.90000000e+00
   3.30000000e+00  8.00000000e-01 -9.00000000e-01  4.00000000e-01
   5.00000000e-01  1.80000000e+00  2.90000000e+00  1.00000000e-01
   9.00000000e-01 -1.60000000e+00 -9.00000000e-01  1.30000000e+00
   4.30000000e+00  6.00000000e+00  3.76000000e+01  2.17000000e+01
   1.44300000e+02  4.89000000e+01  3.33400000e+02  8.32000000e+01
   5.66200000e+02  1.09800000e+02  6.62000000e+02  1.16500000e+02
   6.38900000e+02  8.49000000e+01  4.89100000e+02  6.72000000e+01
   3.42200000e+02  4.13000000e+01  2.06000000e+02  2.02000000e+01
   1.09900000e+02  1.01000000e+01  4.38000000e+01  4.80000000e+00]
 [ 1.00000000e-01  7.00000000e-01 -3.30000000e+00  0.00000000e+00
   1.90000000e+00  2.20000000e+00  1.30000000e+00  7.10542736e-15
   7.00000000e-01  0.00000000e+00 -3.70000000e+00 -9.00000000e-01
   1.80000000e+00  3.80000000e+00  2.60000000e+00  2.50000000e+00
   3.10000000e+00  1.96000000e+01  9.80000000e+00  9.64000000e+01
   2.91000000e+01  2.77500000e+02  6.83000000e+01  5.17200000e+02
   8.77000000e+01  6.69000000e+02  1.14300000e+02  7.31000000e+02
   7.97000000e+01  6.14700000e+02  6.81000000e+01  4.53100000e+02
   4.72000000e+01  2.86100000e+02  3.10000000e+01  1.53000000e+02
   1.61000000e+01  6.66000000e+01  6.10000000e+00  3.09000000e+01]
 [ 3.30000000e+00 -9.00000000e-01  8.00000000e-01  6.00000000e-01
  -3.60000000e+00  1.10000000e+00 -2.00000000e-01  1.30000000e+00
   1.40000000e+00  3.00000000e-01  1.60000000e+00  1.00000000e-01
   0.00000000e+00 -5.00000000e-01  1.20000000e+00  6.00000000e-01
   8.40000000e+00  6.40000000e+00  5.73000000e+01  2.63000000e+01
   1.93700000e+02  6.28000000e+01  4.26900000e+02  9.50000000e+01
   6.18500000e+02  1.27700000e+02  7.38200000e+02  1.29800000e+02
   6.68100000e+02  9.69000000e+01  5.17600000e+02  6.49000000e+01
   3.69900000e+02  5.00000000e+01  2.18600000e+02  2.18000000e+01
   9.12000000e+01  9.20000000e+00  3.50000000e+01  2.50000000e+00]
 [ 8.00000000e-01 -2.90000000e+00  1.30000000e+00  2.50000000e+00
   1.50000000e+00 -5.80000000e+00  1.60000000e+00 -1.00000000e-01
   5.00000000e-01 -9.00000000e-01  4.00000000e-01 -6.00000000e-01
   1.80000000e+00  3.00000000e-01  2.70000000e+00  7.20000000e+00
   3.00000000e-01  2.53000000e+01  1.51000000e+01  1.14600000e+02
   3.40000000e+01  2.82100000e+02  6.08000000e+01  5.11400000e+02
   9.37000000e+01  6.59200000e+02  1.05600000e+02  7.09900000e+02
   9.21000000e+01  5.78900000e+02  6.34000000e+01  4.09200000e+02
   4.77000000e+01  2.77700000e+02  2.03000000e+01  1.27500000e+02
   1.08000000e+01  5.07000000e+01  7.00000000e+00  1.34000000e+01]
 [-3.10000000e+00  5.00000000e-01 -8.00000000e-01 -1.00000000e-01
   6.00000000e-01  4.90000000e+00 -1.30000000e+00  5.00000000e-01
  -4.00000000e-01  1.60000000e+00  1.00000000e-01 -4.00000000e-01
   1.30000000e+00  1.00000000e-01  2.70000000e+00  3.50000000e+00
   9.70000000e+00  5.40000000e+00  5.08000000e+01  2.58000000e+01
   1.67700000e+02  5.84000000e+01  3.53500000e+02  9.03000000e+01
   5.34100000e+02  1.15000000e+02  6.15400000e+02  1.13100000e+02
   5.86700000e+02  9.07000000e+01  4.21400000e+02  5.94000000e+01
   2.93800000e+02  3.84000000e+01  1.50200000e+02  1.29000000e+01
   6.51000000e+01  5.70000000e+00  1.63000000e+01  2.00000000e+00]
 [ 1.10000000e+00  9.00000000e-01 -1.00000000e-01  1.40000000e+00
  -1.20000000e+00  1.60000000e+00  8.00000000e-01 -4.00000000e-01
   4.00000000e-01 -9.00000000e-01  4.00000000e-01 -4.00000000e-01
   7.00000000e-01 -3.00000000e-01  9.00000000e-01  4.80000000e+00
   4.00000000e-01  2.11000000e+01  1.01000000e+01  8.35000000e+01
   2.32000000e+01  2.22400000e+02  4.82000000e+01  3.86300000e+02
   7.43000000e+01  4.94700000e+02  7.49000000e+01  5.27900000e+02
   6.54000000e+01  4.16900000e+02  4.92000000e+01  2.88200000e+02
   3.27000000e+01  1.70000000e+02  1.68000000e+01  7.52000000e+01
   7.10000000e+00  2.23000000e+01  2.70000000e+00  5.00000000e+00]
 [-4.00000000e-01  1.70000000e+00  1.50000000e+00  1.20000000e+00
  -5.00000000e-01 -7.00000000e-01 -1.20000000e+00  1.00000000e+00
   1.10000000e+00  1.30000000e+00  4.00000000e-01  2.00000000e-01
   1.10000000e+00  6.00000000e-01  1.60000000e+00  5.00000000e-01
   6.50000000e+00  5.80000000e+00  2.94000000e+01  1.96000000e+01
   1.01200000e+02  3.35000000e+01  2.30600000e+02  5.66000000e+01
   3.44300000e+02  6.62000000e+01  3.91000000e+02  7.62000000e+01
   3.59600000e+02  5.39000000e+01  2.44500000e+02  3.76000000e+01
   1.66200000e+02  1.88000000e+01  7.38000000e+01  9.60000000e+00
   2.49000000e+01 -6.00000000e-01  5.70000000e+00  3.70000000e+00]
 [-3.90000000e+00 -1.40000000e+00  6.00000000e-01 -4.30000000e+00
   3.20000000e+00  1.00000000e-01 -2.20000000e+00  8.00000000e-01
   2.00000000e-01  3.50000000e+00  2.20000000e+00 -2.00000000e-01
   2.60000000e+00  1.10000000e+00 -7.00000000e-01  6.50000000e+00
  -3.00000000e-01  1.62000000e+01  5.70000000e+00  4.84000000e+01
   1.29000000e+01  1.05300000e+02  2.76000000e+01  2.04400000e+02
   4.00000000e+01  2.86700000e+02  4.98000000e+01  2.74100000e+02
   4.12000000e+01  2.00200000e+02  3.19000000e+01  1.44300000e+02
   1.66000000e+01  7.23000000e+01  5.70000000e+00  2.51000000e+01
   9.00000000e-01  6.40000000e+00 -2.00000000e-01  1.30000000e+00]
 [ 2.60000000e+00  7.00000000e-01 -9.00000000e-01  9.00000000e-01
  -1.00000000e-01  7.00000000e-01  5.00000000e-01  1.70000000e+00
  -2.00000000e-01  7.00000000e-01  2.40000000e+00 -6.00000000e-01
   5.70000000e+00  1.10000000e+00  6.00000000e-01  7.00000000e-01
   4.30000000e+00  3.40000000e+00  1.38000000e+01  5.10000000e+00
   3.73000000e+01  1.86000000e+01  8.89000000e+01  2.53000000e+01
   1.55600000e+02  3.42000000e+01  1.67700000e+02  2.87000000e+01
   1.50400000e+02  2.54000000e+01  1.02000000e+02  1.38000000e+01
   5.65000000e+01  5.10000000e+00  2.24000000e+01 -2.00000000e-01
   7.60000000e+00  1.30000000e+00  6.00000000e-01  2.10000000e+00]
 [ 3.30000000e+00  1.30000000e+00  2.00000000e-01  2.30000000e+00
  -2.40000000e+00  7.00000000e-01 -9.00000000e-01  3.00000000e-01
   4.00000000e-01  3.20000000e+00  4.00000000e-01  5.70000000e+00
   1.40000000e+00  5.60000000e+00  2.10000000e+00  4.30000000e+00
   1.80000000e+00  7.00000000e+00 -5.00000000e-01  1.27000000e+01
   5.30000000e+00  3.72000000e+01  9.80000000e+00  6.43000000e+01
   1.13000000e+01  8.53000000e+01  1.39000000e+01  9.43000000e+01
   1.15000000e+01  6.44000000e+01  5.40000000e+00  3.70000000e+01
   5.80000000e+00  1.56000000e+01  5.00000000e-01  6.50000000e+00
  -2.10000000e+00  3.40000000e+00 -1.00000000e-01 -2.00000000e-01]
 [-4.00000000e-01  6.00000000e-01 -1.00000000e-01  3.40000000e+00
  -4.10000000e+00  3.00000000e-01  7.10542736e-15 -7.00000000e-01
   1.30000000e+00 -2.00000000e-01  1.60000000e+00  3.10000000e+00
   4.60000000e+00  6.00000000e-01  1.03000000e+01  2.60000000e+00
   5.90000000e+00  1.60000000e+00  4.20000000e+00  2.50000000e+00
   4.90000000e+00  7.20000000e+00  1.71000000e+01  1.05000000e+01
   3.25000000e+01  8.60000000e+00  3.43000000e+01  7.10000000e+00
   3.49000000e+01  5.80000000e+00  1.75000000e+01  2.70000000e+00
   6.50000000e+00  1.80000000e+00  3.20000000e+00  2.30000000e+00
  -2.00000000e-01  2.20000000e+00  1.10000000e+00 -1.00000000e-01]
 [-8.00000000e-01  4.10000000e+00  6.00000000e-01  1.00000000e+00
   0.00000000e+00  2.00000000e-01  3.00000000e-01  1.60000000e+00
  -1.20000000e+00 -1.00000000e-01  2.30000000e+00  5.70000000e+00
  -5.00000000e-01  5.50000000e+00  2.90000000e+00  6.70000000e+00
   3.10000000e+00  8.70000000e+00  2.10000000e+00  5.30000000e+00
   2.10000000e+00  5.20000000e+00  6.00000000e-01  8.40000000e+00
   4.50000000e+00  1.25000000e+01  3.60000000e+00  1.36000000e+01
   4.00000000e-01  6.30000000e+00  3.00000000e-01 -5.00000000e-01
   2.00000000e+00  1.70000000e+00  1.90000000e+00 -3.00000000e-01
   1.70000000e+00  8.00000000e-01  2.10000000e+00  4.50000000e+00]
 [ 2.60000000e+00 -2.70000000e+00  3.10000000e+00 -2.10000000e+00
   2.00000000e-01 -3.00000000e+00 -6.00000000e-01  5.00000000e-01
  -4.00000000e-01  9.00000000e-01  5.00000000e+00  3.20000000e+00
   5.10000000e+00 -1.00000000e-01  9.50000000e+00  1.50000000e+00
   1.03000000e+01  2.70000000e+00  1.25000000e+01  5.00000000e-01
   9.90000000e+00  1.00000000e+00  1.00000000e-01  1.20000000e+00
   6.00000000e-01  3.00000000e+00  8.00000000e-01  9.00000000e-01
   1.30000000e+00  1.70000000e+00 -4.30000000e+00  2.00000000e-01
   3.00000000e-01  3.30000000e+00 -1.40000000e+00 -2.40000000e+00
   3.30000000e+00  2.20000000e+00  4.50000000e+00  1.50000000e+00]
 [ 5.00000000e-01  4.00000000e-01 -5.00000000e-01  1.00000000e-01
   9.00000000e-01  8.00000000e-01  1.80000000e+00 -1.00000000e-01
   2.00000000e-01  3.00000000e-01  2.20000000e+00  5.70000000e+00
   3.00000000e-01  4.20000000e+00  3.00000000e-01  1.59000000e+01
   6.00000000e-01  1.37000000e+01  1.60000000e+00  1.19000000e+01
   1.70000000e+00  8.50000000e+00  4.00000000e-01  3.70000000e+00
   1.00000000e-01  9.00000000e-01  2.00000000e-01 -7.00000000e-01
   1.80000000e+00  7.00000000e-01  1.80000000e+00  0.00000000e+00
   3.00000000e+00 -1.00000000e-01  1.70000000e+00  5.00000000e-01
   1.60000000e+00  1.50000000e+00  3.00000000e-01  3.80000000e+00]
 [ 3.10000000e+00 -4.00000000e-01  7.00000000e-01 -4.00000000e-01
   6.00000000e-01  1.60000000e+00  6.00000000e-01 -1.10000000e+00
  -4.00000000e-01  8.00000000e-01  1.00000000e+00  1.40000000e+00
   7.00000000e-01 -3.00000000e-01  9.70000000e+00  2.10000000e+00
   1.30000000e+01  1.00000000e-01  1.75000000e+01  4.00000000e-01
   1.58000000e+01  6.00000000e-01  1.12000000e+01  1.80000000e+00
   8.00000000e+00 -3.00000000e+00  4.00000000e+00  2.20000000e+00
   3.90000000e+00  1.00000000e+00  4.40000000e+00  1.00000000e-01
  -1.00000000e-01  6.00000000e-01  0.00000000e+00  1.90000000e+00
   4.30000000e+00  3.00000000e+00  5.20000000e+00 -2.00000000e-01]
 [ 8.00000000e-01 -6.00000000e-01 -4.00000000e+00 -9.00000000e-01
   1.00000000e+00  3.10000000e+00  3.00000000e-01 -5.00000000e-01
   1.80000000e+00 -5.00000000e-01 -7.00000000e-01  3.30000000e+00
  -3.70000000e+00  4.70000000e+00  1.70000000e+00  9.90000000e+00
  -5.00000000e-01  1.18000000e+01  2.20000000e+00  1.34000000e+01
   1.20000000e+00  1.32000000e+01  1.20000000e+00  9.10000000e+00
   3.00000000e+00  9.00000000e+00  3.60000000e+00  7.10000000e+00
   1.10000000e+00  5.20000000e+00  2.70000000e+00  6.10000000e+00
   2.10000000e+00  4.50000000e+00  2.00000000e+00  7.60000000e+00
   1.00000000e+00  5.20000000e+00  1.90000000e+00  9.30000000e+00]
 [ 5.00000000e-01  2.80000000e+00 -7.00000000e-01  0.00000000e+00
   1.00000000e-01  8.00000000e-01 -3.70000000e+00  4.00000000e-01
   4.00000000e-01  4.50000000e+00  2.20000000e+00  8.00000000e-01
  -1.00000000e-01 -2.00000000e-01  1.50000000e+00  2.10000000e+00
   4.20000000e+00  3.40000000e+00  1.04000000e+01  1.60000000e+00
   9.80000000e+00  3.20000000e+00  1.07000000e+01  2.80000000e+00
   1.01000000e+01  1.30000000e+00  9.40000000e+00  5.10000000e+00
   6.90000000e+00  1.70000000e+00  4.70000000e+00  1.00000000e+00
   3.80000000e+00  2.20000000e+00  5.20000000e+00  1.20000000e+00
   9.40000000e+00  5.00000000e-01  4.10000000e+00  2.40000000e+00]
 [ 8.00000000e-01  6.00000000e-01 -3.00000000e-01 -1.00000000e+00
  -5.00000000e-01  5.00000000e-01 -3.00000000e-01  2.90000000e+00
  -2.40000000e+00  1.40000000e+00  3.40000000e+00  1.80000000e+00
  -6.00000000e-01 -4.10000000e+00  2.30000000e+00  1.30000000e+00
   1.50000000e+00  3.60000000e+00  1.10000000e+00  7.70000000e+00
   3.80000000e+00  1.08000000e+01  1.00000000e-01  1.37000000e+01
   7.00000000e-01  9.60000000e+00  2.00000000e-01  5.30000000e+00
   2.80000000e+00  8.60000000e+00  1.70000000e+00  2.50000000e+00
   3.70000000e+00  4.30000000e+00  5.00000000e-01  4.00000000e+00
  -2.00000000e-01  4.70000000e+00  2.70000000e+00  4.30000000e+00]
 [-3.60000000e+00 -5.00000000e-01  1.00000000e-01  6.00000000e-01
  -5.00000000e-01 -3.00000000e-01  4.00000000e-01  9.00000000e-01
   1.00000000e-01  6.00000000e-01  1.00000000e-01 -5.10000000e+00
   4.20000000e+00  1.10000000e+00  1.00000000e-01  1.90000000e+00
   7.10542736e-15  0.00000000e+00  4.60000000e+00  0.00000000e+00
   6.10000000e+00  4.00000000e-01  8.00000000e+00  1.60000000e+00
   3.50000000e+00  1.20000000e+00  6.50000000e+00 -4.00000000e-01
   9.20000000e+00  8.00000000e-01  4.20000000e+00  2.40000000e+00
   4.90000000e+00  3.00000000e+00  5.80000000e+00  2.80000000e+00
   4.40000000e+00 -7.00000000e-01 -1.00000000e-01  7.00000000e-01]
 [-2.00000000e-01  4.00000000e-01  3.00000000e+00  3.00000000e+00
  -3.60000000e+00 -4.10000000e+00 -1.00000000e-01 -1.42108547e-14
   5.00000000e-01 -1.00000000e-01 -4.00000000e-01 -1.00000000e-01
   2.20000000e+00  2.00000000e+00  1.40000000e+00  9.00000000e-01
   5.00000000e-01  1.80000000e+00 -6.00000000e-01 -6.00000000e-01
   2.60000000e+00  2.70000000e+00 -8.00000000e-01  3.00000000e-01
   3.10000000e+00  4.90000000e+00  1.40000000e+00  6.90000000e+00
   5.00000000e-01  5.30000000e+00  2.20000000e+00  4.70000000e+00
   2.20000000e+00  4.50000000e+00  1.30000000e+00 -1.10000000e+00
   4.10000000e+00  7.00000000e-01  1.30000000e+00  1.20000000e+00]
 [ 1.80000000e+00 -3.20000000e+00 -9.00000000e-01  1.80000000e+00
  -7.00000000e-01  8.00000000e-01  1.70000000e+00  3.40000000e+00
  -1.30000000e+00 -1.60000000e+00  4.00000000e-01  1.90000000e+00
   1.70000000e+00  2.00000000e-01 -3.80000000e+00 -1.00000000e-01
   6.00000000e-01  3.20000000e+00 -3.40000000e+00  1.10000000e+00
   2.00000000e+00  3.30000000e+00  1.00000000e+00  1.00000000e+00
  -3.00000000e-01  2.10000000e+00  1.50000000e+00  2.80000000e+00
   8.00000000e-01  2.60000000e+00  4.20000000e+00 -5.00000000e-01
   6.00000000e+00  3.70000000e+00  1.30000000e+00  2.80000000e+00
   1.20000000e+00  1.80000000e+00  0.00000000e+00  1.40000000e+00]
 [ 1.00000000e-01  2.30000000e+00 -1.50000000e+00  6.00000000e-01
  -4.00000000e-01  1.50000000e+00  1.00000000e-01  1.30000000e+00
  -8.00000000e-01 -6.00000000e-01  2.00000000e-01  1.10000000e+00
  -1.42108547e-14  1.20000000e+00 -3.40000000e+00  2.60000000e+00
  -2.50000000e+00  3.40000000e+00  6.00000000e-01 -2.00000000e-01
   1.00000000e+00 -2.00000000e-01  9.00000000e-01 -2.90000000e+00
   2.10000000e+00  1.50000000e+00 -1.20000000e+00  2.00000000e+00
   2.80000000e+00  7.50000000e+00 -9.00000000e-01  1.10000000e+00
   3.20000000e+00  5.30000000e+00  1.80000000e+00  3.10000000e+00
  -2.40000000e+00  5.00000000e-01  8.00000000e-01  3.60000000e+00]
 [ 7.00000000e-01  9.00000000e-01 -1.00000000e-01 -4.40000000e+00
   3.20000000e+00  0.00000000e+00  2.00000000e-01  1.00000000e-01
   0.00000000e+00  7.00000000e-01  1.90000000e+00  1.50000000e+00
  -3.00000000e-01 -2.00000000e+00  2.00000000e-01 -3.90000000e+00
   3.00000000e+00  1.00000000e+00 -1.00000000e-01  1.00000000e-01
   1.00000000e-01  1.20000000e+00 -2.50000000e+00  2.70000000e+00
  -3.90000000e+00  2.80000000e+00  0.00000000e+00  9.00000000e-01
   2.00000000e-01  1.30000000e+00  6.70000000e+00  2.90000000e+00
  -1.00000000e-01 -3.90000000e+00  2.00000000e-01 -2.90000000e+00
   3.10000000e+00  1.00000000e-01 -1.20000000e+00 -2.00000000e-01]]


来源: stackexchange

问:
how to speed up deepface or use multiple cores?
I am using the deep face library to analyze pictures and predict race and gender for a social studies project. I am running the deep face library on my university grid with 250GB of working memory. It still is taking too long to analyze one picture. At the moment about 1.2 seconds... Any ideas are appreciated. Here is the code I am using at the moment.

```<code># This is the code I am using. The input is a folder containing three pictures of each person.

def ensemble_method(folder):
    try:
        obj = DeepFace.analyze(img_path = folder[0], actions = ['gender', 'race'])
    except ValueError:
        obj = {'gender': np.NaN, 'dominant_race': np.NaN}
    try:
        obj_2 = DeepFace.analyze(img_path = folder[1], actions = ['gender', 'race'])
    except ValueError:
        obj_2 = {'gender': np.NaN, 'dominant_race': np.NaN}
    try:
        obj_3 = DeepFace.analyze(img_path = folder[2], actions = ['gender', 'race'])
    except ValueError:
        obj_3 = {'gender': np.NaN, 'dominant_race': np.NaN}
    index_1 = folder[0].rfind('/')
    image1 = folder[0][index_1+1:-4]
    index_2 = folder[1].rfind('/')
    image2 = folder[1][index_2+1:-4]
    index_3 = folder[2].rfind('/')
    image3 = folder[2][index_3+1:-4]
    result_1 = {'img_path': image1, 'gender': obj['gender'], 'dominant_race': obj["dominant_race"]}
    result_2 = {'img_path': image2, 'gender': obj_2['gender'], 'dominant_race': obj_2["dominant_race"]}
    result_3 = {'img_path': image3, 'gender': obj_3['gender'], 'dominant_race': obj_3['dominant_race']}
    results = pd.DataFrame([result_1, result_2, result_3])
    print(results)
    name = results.iloc[0,0][:-2].replace('_', ' ')
    if results['gender'].isna().all() == True:
        final_result = {'name': name, 'gender': np.NaN , 'race': np.NaN}
    else:
        final_result = {'name': name, 'gender': results['gender'].mode()[0] , 'race': results['dominant_race'].mode()[0]}
    return final_result
</code>```

I tried finding whether deep face allows multiple CPUs but did not see how to use it..

ContentLicense: CC BY-SA 4.0

Body:
I am using the deep face library to analyze pictures and predict race and gender for a social studies project. I am running the deep face library on my university grid with 250GB of working memory. It still is taking too long to analyze one picture. At the moment about 1.2 seconds... Any ideas are appreciated. Here is the code I am using at the moment.

# This is the code I am using. The input is a folder containing three pictures of each person.

def ensemble_method(folder):
    try:
        obj = DeepFace.analyze(img_path = folder[0], actions = ['gender', 'race'])
    except ValueError:
        obj = {'gender': np.NaN, 'dominant_race': np.NaN}
    try:
        obj_2 = DeepFace.analyze(img_path = folder[1], actions = ['gender', 'race'])
    except ValueError:
        obj_2 = {'gender': np.NaN, 'dominant_race': np.NaN}
    try:
        obj_3 = DeepFace.analyze(img_path = folder[2], actions = ['gender', 'race'])
    except ValueError:
        obj_3 = {'gender': np.NaN, 'dominant_race': np.NaN}
    index_1 = folder[0].rfind('/')
    image1 = folder[0][index_1+1:-4]
    index_2 = folder[1].rfind('/')
    image2 = folder[1][index_2+1:-4]
    index_3 = folder[2].rfind('/')
    image3 = folder[2][index_3+1:-4]
    result_1 = {'img_path': image1, 'gender': obj['gender'], 'dominant_race': obj["dominant_race"]}
    result_2 = {'img_path': image2, 'gender': obj_2['gender'], 'dominant_race': obj_2["dominant_race"]}
    result_3 = {'img_path': image3, 'gender': obj_3['gender'], 'dominant_race': obj_3['dominant_race']}
    results = pd.DataFrame([result_1, result_2, result_3])
    print(results)
    name = results.iloc[0,0][:-2].replace('_', ' ')
    if results['gender'].isna().all() == True:
        final_result = {'name': name, 'gender': np.NaN , 'race': np.NaN}
    else:
        final_result = {'name': name, 'gender': results['gender'].mode()[0] , 'race': results['dominant_race'].mode()[0]}
    return final_result

I tried finding whether deep face allows multiple CPUs but did not see how to use it..


问:
Swagger OpenApi sends empty value "" instead of null and this ends up giving a 400 Bad Request status
I'm doing a rest api in spring boot and I need to receive 3 normal values and a file, as you can see in the image below.

endpoint image in swagger

My problem is that it is not mandatory to send the file, so when I make the request without the file, instead of going null it goes "" which is considered a string and this ends up giving status 400, because it is waiting for a type MultipartFile.

My method in spring boot:

```<code>@Operation(tags = {"Contato"}, summary = "Atualizar contato", description = "Atualiza os dados de um contato ativo a partir do ID.")
@PutMapping(path = "/atualizarContato",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseDto atualizarContato(@ModelAttribute ContatoUpdateDto contatoDto) throws IOException {// fazer a logica}
</code>```

My class, I even tried to put the default value in @Schema but it doesn't work.

```<code>package app.api.denuncia.Dto;

import org.springframework.web.multipart.MultipartFile;

import io.swagger.v3.oas.annotations.media.Schema;

public class ContatoUpdateDto {

    @Schema(description = "O identificador (ID) do contato", required = true)
    private int id;

    @Schema(description = "O nome do contato", required = true)
    private String nome;

    @Schema(description = "O número de telefone do contato")
    private String telefone;

    @Schema(description = "Imagem que representa o contato")
    private MultipartFile logotipo;

    public ContatoUpdateDto() {
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public MultipartFile getLogotipo() {
        return logotipo;
    }

    public void setLogotipo(MultipartFile logotipo) {
        this.logotipo = logotipo;
    }
}
</code>```

I just need that instead of sending "" it sends null.

The error:

image 1

image 2

Body:
I'm doing a rest api in spring boot and I need to receive 3 normal values and a file, as you can see in the image below.

endpoint image in swagger

My problem is that it is not mandatory to send the file, so when I make the request without the file, instead of going null it goes "" which is considered a string and this ends up giving status 400, because it is waiting for a type MultipartFile.

My method in spring boot:

@Operation(tags = {"Contato"}, summary = "Atualizar contato", description = "Atualiza os dados de um contato ativo a partir do ID.")
@PutMapping(path = "/atualizarContato",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseDto atualizarContato(@ModelAttribute ContatoUpdateDto contatoDto) throws IOException {// fazer a logica}

My class, I even tried to put the default value in @Schema but it doesn't work.

package app.api.denuncia.Dto;

import org.springframework.web.multipart.MultipartFile;

import io.swagger.v3.oas.annotations.media.Schema;

public class ContatoUpdateDto {

    @Schema(description = "O identificador (ID) do contato", required = true)
    private int id;

    @Schema(description = "O nome do contato", required = true)
    private String nome;

    @Schema(description = "O número de telefone do contato")
    private String telefone;

    @Schema(description = "Imagem que representa o contato")
    private MultipartFile logotipo;

    public ContatoUpdateDto() {
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public MultipartFile getLogotipo() {
        return logotipo;
    }

    public void setLogotipo(MultipartFile logotipo) {
        this.logotipo = logotipo;
    }
}

I just need that instead of sending "" it sends null.

The error:

image 1

image 2


问:
Inf or 0 values from np.random.lognormal
I'm trying to do a simulation, however, whenever I run variable x separately, I get either infinity or 0 as an output. Here's my code:

def steadystate():
    p = limited_values
    Cout= np.random.uniform(4700,32000,size=None)
    LambdaAER = np.random.lognormal(0.44,2.04,1)
    Vol=44.5
    Depo=np.random.normal(0.42,0.19,1)
    Uptime=0.1
    Effic=0.1
    Recirc= np.random.lognormal(4.36,1.44,1)
    x = np.random.lognormal(77000000000, 213000000000, 1 )
    conc = ((p*Cout*LambdaAER)+(x/Vol))/(LambdaAER+Depo+(Uptime*Effic*Recirc))
    return conc
```

Not really sure what I'm doing wrong, Any tips?

Body:
I'm trying to do a simulation, however, whenever I run variable x separately, I get either infinity or 0 as an output. Here's my code:

def steadystate():
    p = limited_values
    Cout= np.random.uniform(4700,32000,size=None)
    LambdaAER = np.random.lognormal(0.44,2.04,1)
    Vol=44.5
    Depo=np.random.normal(0.42,0.19,1)
    Uptime=0.1
    Effic=0.1
    Recirc= np.random.lognormal(4.36,1.44,1)
    x = np.random.lognormal(77000000000, 213000000000, 1 )
    conc = ((p*Cout*LambdaAER)+(x/Vol))/(LambdaAER+Depo+(Uptime*Effic*Recirc))
    return conc

Not really sure what I'm doing wrong, Any tips?


问:
ordene matrix with numpy.triu and non nan's values
I’ve a dataset where i need do a transformation to get a upper triangular matrix. So my matrix has this format:

```<code>             | 1        | 2         |  3             |
01/01/1999   | nan      | 582.96    | nan            |
02/01/1999   | nan      | 589.78    | 78.47          |
03/01/1999   | nan      | 588.74    | 79.41          |
…                       |           |                |
01/01/2022   | 752.14   | 1005.78   | 193.47         |
02/01/2022   | 754.14   | 997.57    | 192.99         |
</code>```

I use a dataframe.T, to get my date as columns, but I also need that my rows be ordened by non nan’s.

```<code>          | 01/01/1999   | 02/01/1999   |03/01/1999 |…  |01/01/2022   | 02/01/2022    |
2         | 582.96       |  589.78      | 588.74    |…  | 1005.78     | 997.57        |
3         | nan          | 78.47        | 79.41     | … | 193.47      | 192.99        |
1         | nan          | nan          | nan       | … | 752.14      | 754.14        |
</code>```

A tried use the different combinantions of numpy.triu, sort_by and dataframe.T but I haven’t success.

My main goal is get with this format, but if I get this with performance would be nice, cause my data is big.

Body:
I’ve a dataset where i need do a transformation to get a upper triangular matrix. So my matrix has this format:

             | 1        | 2         |  3             |
01/01/1999   | nan      | 582.96    | nan            |
02/01/1999   | nan      | 589.78    | 78.47          |
03/01/1999   | nan      | 588.74    | 79.41          |
…                       |           |                |
01/01/2022   | 752.14   | 1005.78   | 193.47         |
02/01/2022   | 754.14   | 997.57    | 192.99         |

I use a dataframe.T, to get my date as columns, but I also need that my rows be ordened by non nan’s.

          | 01/01/1999   | 02/01/1999   |03/01/1999 |…  |01/01/2022   | 02/01/2022    |
2         | 582.96       |  589.78      | 588.74    |…  | 1005.78     | 997.57        |
3         | nan          | 78.47        | 79.41     | … | 193.47      | 192.99        |
1         | nan          | nan          | nan       | … | 752.14      | 754.14        |

A tried use the different combinantions of numpy.triu, sort_by and dataframe.T but I haven’t success.

My main goal is get with this format, but if I get this with performance would be nice, cause my data is big.


问:
How to store a link as a variable in a python script and pass it to html script
I am building a web application using Flask web framework. The website includes map created using leaftlet. There is a section of the code in the script part that i want to store as a variable in the python code of the flask application. This is the address/link to an internal server so that the address would not be visible from the page source.

```<code><script>
    var map = L.map('map', {attributionControl: false}).setView([-5.78, -47.44], 11);
    L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(map);
        var wmsLayer = L.tileLayer.wms('http://ourdomain.com:8760/geoserver/test/wms?', {
        layers: 'N1Moisture',
        transparent: true,
        format: 'image/png',
    }).addTo(map);
    var wmsLayer = L.tileLayer.wms('http://localhost:8080/geoserver/test/wms?', {
        layers: 'North1km',
        transparent: true,
        format: 'image/png',
    }).addTo(map);
</script>
</code>```

Is there a way that i can store this address part http://_localhost:8080/geoserver/test/wms? and pass it to the script as a variable.

Body:
I am building a web application using Flask web framework. The website includes map created using leaftlet. There is a section of the code in the script part that i want to store as a variable in the python code of the flask application. This is the address/link to an internal server so that the address would not be visible from the page source.

Is there a way that i can store this address part http://_localhost:8080/geoserver/test/wms? and pass it to the script as a variable.


问:
Django-cron library does not seems to work?
my project.settings.py

```<code>CRON_CLASSES = ["user_statistic_status.cron.UserLoginCronJob",]

</code>```

my user_statistic_status.cron.py

```<code>
class UserLoginCronJob(CronJobBase):
    # checking if the user has taken a class in the last 24 h
    RUN_EVERY_MINS = 1 # every 2 hours

    schedule = Schedule(run_every_mins=RUN_EVERY_MINS)

    code = 'test'

    def do(self, request):

        today: date = timezone.now().date()

        print(f"Today's date is {today}")

</code>```

My app is registered in the settings.py

When I run python manage.py runcrons

I get :

```<code>
Running Crons
========================================
[✘] test

</code>```

Can anyone help out here, not sure why my task is not being triggered at all as I don't get the print() call

Body:
my project.settings.py

CRON_CLASSES = ["user_statistic_status.cron.UserLoginCronJob",]

my user_statistic_status.cron.py

class UserLoginCronJob(CronJobBase):
    # checking if the user has taken a class in the last 24 h
    RUN_EVERY_MINS = 1 # every 2 hours

    schedule = Schedule(run_every_mins=RUN_EVERY_MINS)

    code = 'test'

    def do(self, request):

        today: date = timezone.now().date()

        print(f"Today's date is {today}")

My app is registered in the settings.py

When I run python manage.py runcrons

I get :

Running Crons
========================================
[✘] test

Can anyone help out here, not sure why my task is not being triggered at all as I don't get the print() call


问:
Linq join, the best way to get the values bound by the FK
My scenario is this, there is a Sensor table in the database, in this table there is the FK of the sensor status table.

```<code>    public partial class Sensor
    {
        public Sensor()
        {
        }

        /// <summary>
        /// pk table sensor
        /// </summary>
        public int SensorId { get; set; }

        /// <summary>
        /// fk for table sensor_status
        ///
        /// </summary>
        public int SensorStatusId { get; set; }
        ....
        public virtual SensorStatus SensorStatus { get; set; } = null!;
        ....
    }
</code>```

When I use linq with joins, the virtual property sensor status inside the sensor class is not filled (null)

```<code>                var sensorList = (from s in _contextView.Sensor
                                  //join on table sensor status
                                  join status in _contextView.SensorStatus
                                  on s.SensorStatusId equals status.SensorStatusId

                                  join assiToProject in _contextView.SensorsAssignedToProject
                                  on s.SensorId equals assiToProject.SensorId

                                  // condition
                                  where assiToProject.ProjectId == 10
                                  && s.IsEnable
                                  select s).ToList();
</code>```

In this second case, I avoid the join on the sensor status table, but I return a new anonymous object.
In this way, however, the result is that the virtual property SensorStatus of the sensor class is filled

```<code>                var sensorList = (from s in _contextView.Sensor

                                  join assiToProject in _contextView.SensorsAssignedToProject
                                  on s.SensorId equals assiToProject.SensorId

                                  where assiToProject.ProjectId == 10
                                  && s.IsEnable
                                  select new
                                  {
                                      s,
                                      s.SensorStatus
                                  }).AsEnumerable().Select(s => s.s).ToList();
</code>```

Is there a better way to write the query?

The second method I use, can it work?

Is there a better way to make the other table's properties return as well?

Body:
My scenario is this, there is a Sensor table in the database, in this table there is the FK of the sensor status table.

    public partial class Sensor
    {
        public Sensor()
        {
        }

        ///
        /// pk table sensor
        ///
        public int SensorId { get; set; }

        ///
        /// fk for table sensor_status
        ///
        ///
        public int SensorStatusId { get; set; }
        ....
        public virtual SensorStatus SensorStatus { get; set; } = null!;
        ....
    }

When I use linq with joins, the virtual property sensor status inside the sensor class is not filled (null)

                var sensorList = (from s in _contextView.Sensor
                                  //join on table sensor status
                                  join status in _contextView.SensorStatus
                                  on s.SensorStatusId equals status.SensorStatusId

                                  join assiToProject in _contextView.SensorsAssignedToProject
                                  on s.SensorId equals assiToProject.SensorId

                                  // condition
                                  where assiToProject.ProjectId == 10
                                  && s.IsEnable
                                  select s).ToList();

In this second case, I avoid the join on the sensor status table, but I return a new anonymous object.
In this way, however, the result is that the virtual property SensorStatus of the sensor class is filled

                var sensorList = (from s in _contextView.Sensor

                                  join assiToProject in _contextView.SensorsAssignedToProject
                                  on s.SensorId equals assiToProject.SensorId

                                  where assiToProject.ProjectId == 10
                                  && s.IsEnable
                                  select new
                                  {
                                      s,
                                      s.SensorStatus
                                  }).AsEnumerable().Select(s => s.s).ToList();

Is there a better way to write the query?

The second method I use, can it work?

Is there a better way to make the other table's properties return as well?


问:
Vaadin 14 CDI JEE webapp: .js files being fetched as routes instead of scripts
I have a oldish Vaadin 14 Wildfly CDI app that has been continuously updated to the latest version of Vaadin, now at 14.9.2. At some unknown past update, certain javascript script files are now being fetched as unknown routes instead of the actual source file. Only certain directories are now useable for .js files and even subdirectories of those end up as routes.

I also have an Vaadin embedded application as per https://vaadin.com/docs/v14/flow/integrations/embedding/tutorial-webcomponent-exporter
and now even this apps .js files are attempted to be loaded as routes. For example the files
/vaadin/VAADIN/build/webcomponentsjs/webcomponents-loader.js fetch as routes.

Here is how the servlet is configured:

```<code>@WebServlet(urlPatterns = "/*",
            name = "myapp",
            asyncSupported = true,
            initParams = {
              @WebInitParam(name = "closeIdleSessions", value = "false")
            })
public class ApplicationServlet extends CdiVaadinServlet implements SessionInitListener, SessionDestroyListener, UIInitListener {
...
}
</code>```

I have no idea where to start looking for this problem. It fails on a local development machine so no firewalls, reverse proxies etc etc are interfering with the urls.

Any ideas of where to start on this problem would be appreciated. Were there any code changes I had to make for some update?

Body:
I have a oldish Vaadin 14 Wildfly CDI app that has been continuously updated to the latest version of Vaadin, now at 14.9.2. At some unknown past update, certain javascript script files are now being fetched as unknown routes instead of the actual source file. Only certain directories are now useable for .js files and even subdirectories of those end up as routes.

I also have an Vaadin embedded application as per https://vaadin.com/docs/v14/flow/integrations/embedding/tutorial-webcomponent-exporter
and now even this apps .js files are attempted to be loaded as routes. For example the files
/vaadin/VAADIN/build/webcomponentsjs/webcomponents-loader.js fetch as routes.

Here is how the servlet is configured:

@WebServlet(urlPatterns = "/*",
            name = "myapp",
            asyncSupported = true,
            initParams = {
              @WebInitParam(name = "closeIdleSessions", value = "false")
            })
public class ApplicationServlet extends CdiVaadinServlet implements SessionInitListener, SessionDestroyListener, UIInitListener {
...
}

I have no idea where to start looking for this problem. It fails on a local development machine so no firewalls, reverse proxies etc etc are interfering with the urls.

Any ideas of where to start on this problem would be appreciated. Were there any code changes I had to make for some update?


问:
On Firefox on Mobile, swipe gestures are causing the page to reload. How can I prevent this?
I've added this CSS, but it's still doing it. You can view the behavior at www.hocusfocus.fun.</p>
```<code>body {
  background-color: #000000;
  font-family: "Poppins", sans-serif;
  overscroll-behavior: contain;
  overflow: hidden;
  position: fixed;
  top: 0px;
  width: 100%;
}
</code>```

Body:
I've added this CSS, but it's still doing it. You can view the behavior at www.hocusfocus.fun.

body {
  background-color: #000000;
  font-family: "Poppins", sans-serif;
  overscroll-behavior: contain;
  overflow: hidden;
  position: fixed;
  top: 0px;
  width: 100%;
}


问:
Loop of creation via a user input, WPF C#
The system needs a way of taking input from txtBox.
I then need the system to take the number input, 1-10. And repeat the ticket and file creation for that x amount of times.
This code also creates a file on the pc with the Lottery ticket in it.
the files have to be named LottoKupon1, LottoKupon2 and so on, this needs to match user input of course.

this is for creation of file and folder

```<code>namespace Lottery
{
    internal class FolderCreater
    {
        static string folderName = @"C:\lotto";
        public static string fileName = @"C:\lotto\LottoKupon.txt";

        public static void CreateFolder()
        {
            if (!Directory.Exists(folderName))
            {
                Directory.CreateDirectory(folderName);
            }
            else if (!File.Exists(fileName))
            {
                File.Create(fileName);
            }
            else { }
        }
    }
}
</code>```

This is for creation of Lottry Ticket

```<code>namespace Lottery
{
    // the system needs a way of taking input
    // from txtBox, int user = int.Parse(txtBox.Text.Trim());  which this line does
    // i then need the system to take the number input, 1-10.
    // and repeat the ticket and file creation for that x amount of times.
    public partial class MainWindow : Window
    {
        public List<long> ListOfAllArrays = new List<long>();
        int i = 1;

        Random randNum = new Random();
        public MainWindow()
        {
            InitializeComponent();
        }

        public void Lotto ()
        {

            StreamWriter sw = new StreamWriter(FolderCreater.fileName);

             sw.WriteLine("    " + "Lotto " + DateTime.Now.ToString("dd/MM/yyyy\n"));
             sw.WriteLine("         " + "1-uge\n" + "       LYN-LOTTO\n");
             Random randNum = new Random();
             int[][] AllArrays = new int[10][];
             for (int i = 0; i < 10; i++)
             {
                AllArrays[i] = new int[7];
             }
             int RowNr = 0;
             foreach (int[] row in AllArrays)
             {
                RowNr++;
                sw.Write(RowNr + ". ");
                for (int j = 0; j < 7; j++)
                {
                    int number = randNum.Next(1, 37);
                    while (row.Any(n => n == number))
                    {
                        number = randNum.Next(1, 37);
                    }
                    row[j] = number;
                }

                Array.Sort(row);
                for(int l = 0; l < 7; l++)
                {
                    sw.Write(row[l].ToString("00") + " ");
                }
                sw.Write("\n");
             }
             TestIfSame(AllArrays);

                if (CheckBox.IsChecked == true)
                {
                    sw.WriteLine("\n****** Joker Tal ******");
                    int[][] AllJokerRows = new int[2][];
                    for (int i = 0; i < 2; i++)
                    {
                        AllJokerRows[i] = new int[7];
                    }
                    foreach (int[] n in AllJokerRows)
                    {
                        sw.Write(" ");
                        for (int i = 0; i < 7; i++)
                        {
                            var JokerNumber = randNum.Next(1, 10);
                            n[i] = JokerNumber;
                        }
                        Array.Sort(n);
                        for (int u = 0; u < 7; u++)
                        {
                            sw.Write(n[u] + "  ");
                        }
                        sw.Write("\n");
                    }
                }
                sw.Close();

        }

        public void TestIfSame(int[][] AllArrays)
        {
            //List<long> ListOfAllArrays = new List<long>();
            for (int i = 0; i < AllArrays.Length; i++)
            {
                ListOfAllArrays.Add(MakesLongNumber(AllArrays[i]));
            }

            for (int i = 0; i < AllArrays.Length; i++)
            {
                long temp = ListOfAllArrays[0];
                ListOfAllArrays.Remove(ListOfAllArrays[0]);

                if (ListOfAllArrays.Contains(MakesLongNumber(AllArrays[i])))
                {
                    Lotto();
                }
                else
                {
                    ListOfAllArrays.Add(temp);
                }
            }
            long MakesLongNumber(int[] row)
            {
                string a = "";
                for (int i = 0; i < row.Length; i++)
                {
                    a += row[i].ToString();
                }
                return Convert.ToInt64(a);
            }
        }
        private void CheckBox_Checked(object sender, RoutedEventArgs e)
        {

        }

        private void cmdOk_Click_1(object sender, RoutedEventArgs e)
        {
            FolderCreater.CreateFolder();
            Lotto();
            // add a ListBox.Items.Add(); within this needs to be the command for the Lottery ticket, so i can have it shown on a list box.
        }
</code>```

**This is for a Lottery assignment, its on a lower level of coding, so no answer that is way too complicated, hope you understand. please ask questions if needed.

I tried a dew things with a for loop around the first void which took user input, but i could not make it work.

the code is expected to create files and Lottery ticket depending on users input**

Body:
The system needs a way of taking input from txtBox.
I then need the system to take the number input, 1-10. And repeat the ticket and file creation for that x amount of times.
This code also creates a file on the pc with the Lottery ticket in it.
the files have to be named LottoKupon1, LottoKupon2 and so on, this needs to match user input of course.

this is for creation of file and folder

namespace Lottery
{
    internal class FolderCreater
    {
        static string folderName = @"C:\lotto";
        public static string fileName = @"C:\lotto\LottoKupon.txt";

        public static void CreateFolder()
        {
            if (!Directory.Exists(folderName))
            {
                Directory.CreateDirectory(folderName);
            }
            else if (!File.Exists(fileName))
            {
                File.Create(fileName);
            }
            else { }
        }
    }
}

This is for creation of Lottry Ticket

namespace Lottery
{
    // the system needs a way of taking input
    // from txtBox, int user = int.Parse(txtBox.Text.Trim());  which this line does
    // i then need the system to take the number input, 1-10.
    // and repeat the ticket and file creation for that x amount of times.
    public partial class MainWindow : Window
    {
        public List<long> ListOfAllArrays = new List<long>();
        int i = 1;

        Random randNum = new Random();
        public MainWindow()
        {
            InitializeComponent();
        }

        public void Lotto ()
        {

            StreamWriter sw = new StreamWriter(FolderCreater.fileName);

             sw.WriteLine("    " + "Lotto " + DateTime.Now.ToString("dd/MM/yyyy\n"));
             sw.WriteLine("         " + "1-uge\n" + "       LYN-LOTTO\n");
             Random randNum = new Random();
             int[][] AllArrays = new int[10][];
             for (int i = 0; i < 10; i++)
             {
                AllArrays[i] = new int[7];
             }
             int RowNr = 0;
             foreach (int[] row in AllArrays)
             {
                RowNr++;
                sw.Write(RowNr + ". ");
                for (int j = 0; j < 7; j++)
                {
                    int number = randNum.Next(1, 37);
                    while (row.Any(n => n == number))
                    {
                        number = randNum.Next(1, 37);
                    }
                    row[j] = number;
                }

                Array.Sort(row);
                for(int l = 0; l < 7; l++)
                {
                    sw.Write(row[l].ToString("00") + " ");
                }
                sw.Write("\n");
             }
             TestIfSame(AllArrays);

                if (CheckBox.IsChecked == true)
                {
                    sw.WriteLine("\n****** Joker Tal ******");
                    int[][] AllJokerRows = new int[2][];
                    for (int i = 0; i < 2; i++)
                    {
                        AllJokerRows[i] = new int[7];
                    }
                    foreach (int[] n in AllJokerRows)
                    {
                        sw.Write(" ");
                        for (int i = 0; i < 7; i++)
                        {
                            var JokerNumber = randNum.Next(1, 10);
                            n[i] = JokerNumber;
                        }
                        Array.Sort(n);
                        for (int u = 0; u < 7; u++)
                        {
                            sw.Write(n[u] + "  ");
                        }
                        sw.Write("\n");
                    }
                }
                sw.Close();

        }

        public void TestIfSame(int[][] AllArrays)
        {
            //List<long> ListOfAllArrays = new List<long>();
            for (int i = 0; i < AllArrays.Length; i++)
            {
                ListOfAllArrays.Add(MakesLongNumber(AllArrays[i]));
            }

            for (int i = 0; i < AllArrays.Length; i++)
            {
                long temp = ListOfAllArrays[0];
                ListOfAllArrays.Remove(ListOfAllArrays[0]);

                if (ListOfAllArrays.Contains(MakesLongNumber(AllArrays[i])))
                {
                    Lotto();
                }
                else
                {
                    ListOfAllArrays.Add(temp);
                }
            }
            long MakesLongNumber(int[] row)
            {
                string a = "";
                for (int i = 0; i < row.Length; i++)
                {
                    a += row[i].ToString();
                }
                return Convert.ToInt64(a);
            }
        }
        private void CheckBox_Checked(object sender, RoutedEventArgs e)
        {

        }

        private void cmdOk_Click_1(object sender, RoutedEventArgs e)
        {
            FolderCreater.CreateFolder();
            Lotto();
            // add a ListBox.Items.Add(); within this needs to be the command for the Lottery ticket, so i can have it shown on a list box.
        }

**This is for a Lottery assignment, its on a lower level of coding, so no answer that is way too complicated, hope you understand. please ask questions if needed.

I tried a dew things with a for loop around the first void which took user input, but i could not make it work.

the code is expected to create files and Lottery ticket depending on users input**


问:
How to automatically open the Markdown Preview side by side in VS Code
When I'm writing Markdown (*.md) files in VS Code I often need to press Ctrl + K then V to open up the Markdown Preview panel on the side. I'm trying to optimize my process and have this done automatically for me whenever I open a Markdown file. Please note I do not want to install any additional extension for this, I just want the built-in Markdown Preview provided by VS Code.


问:
Why does the headers option not work for setting Access-Control-Allow-Headers using Middy and Serverless?
I am getting the following error when trying to do a POST against my Serverless API that uses AWS API Gateway:

Access to fetch at 'https://example.com/shop' from origin 'https://otherexample.com' has been blocked by CORS policy: Request header field shop is not allowed by Access-Control-Allow-Headers in preflight response.

I tried using the header option to cors() with middy, but this does not work:

const handler = middy(async (event, context) => {
  // ...
})

handler.use(cors({
  headers: 'Content-Type, shop'
}));

module.exports.handler = handler;
```
<p>However, this works:</p>
<pre class="lang-yaml prettyprint-override"><code>findShop:
  handler: src/routes/findShop.handler
  events:
    - http:
        path: /shop
        method: post
        cors:
          origin: '*'
          headers:
            - Content-Type
            - shop
</code>```

Why does the latter work and not the former? The @middy/http-cors docs say the following, so it seems like specifying headers in cors() should work:

headers (string) (optional): value to put in Access-Control-Allow-Headers (default: false)

Body:
I am getting the following error when trying to do a POST against my Serverless API that uses AWS API Gateway:

Access to fetch at 'https://example.com/shop' from origin 'https://otherexample.com' has been blocked by CORS policy: Request header field shop is not allowed by Access-Control-Allow-Headers in preflight response.

I tried using the header option to cors() with middy, but this does not work:

const handler = middy(async (event, context) => {
  // ...
})

handler.use(cors({
  headers: 'Content-Type, shop'
}));

module.exports.handler = handler;

However, this works:

findShop:
  handler: src/routes/findShop.handler
  events:
    - http:
        path: /shop
        method: post
        cors:
          origin: '*'
          headers:
            - Content-Type
            - shop

Why does the latter work and not the former? The @middy/http-cors docs say the following, so it seems like specifying headers in cors() should work:

headers (string) (optional): value to put in Access-Control-Allow-Headers (default: false)


问:
Cannot read properties of undefined (reading 'pathname') on button compenent React js
I want to make a component button with this code :

```<code> if (props.type === "link") {
    if (props.isExternal) {
      return (
        <a
          href={props.href}
          className={className.join(" ")}
          style={props.style}
          target={props.target === "_blank" ? "_blank" : undefined}
          rel={props.target === "_blank" ? "noopener noreferrer" : undefined}
        >
          {props.children}
        </a>
      );
    } else {
      return (
        <Link
          to={props.href}
          className={className.join(" ")}
          style={props.style}
          onClick={onClick}
        >
          {props.children}
        </Link>
      );
    }
  }
</code>```

and then I try to test it with this code

```<code>
test("should render <Link/>  component", () => {
  const { container } = render(
    <Router>
        <Button href="" type="link"></Button>
    </Router>
  );
  expect(container.querySelector("a")).toBeInTheDocument();
});
</code>```

and always show errors like this

```<code>  TypeError: Cannot read properties of undefined (reading 'pathname')
</code>```

I've searched on google and still don't know how it is an error

I want this button to receive props type links with a different condition

Body:
I want to make a component button with this code :

 if (props.type === "link") {
    if (props.isExternal) {
      return (

          {props.children}

      );
    } else {
      return (
        <Link
          to={props.href}
          className={className.join(" ")}
          style={props.style}
          onClick={onClick}
        >
          {props.children}
        </Link>
      );
    }
  }

and then I try to test it with this code

test("should render <Link/>  component", () => {
  const { container } = render(
    <Router>
        <Button href="" type="link"></Button>
    </Router>
  );
  expect(container.querySelector("a")).toBeInTheDocument();
});

and always show errors like this

  TypeError: Cannot read properties of undefined (reading 'pathname')

I've searched on google and still don't know how it is an error

I want this button to receive props type links with a different condition