Obtaining real numbers from FFT with same length as original signal In this article the real valued time domain signal is transformed to the frequency domain to extract some features like mean or variance.
But after transform to the frequency domain I calculate average hourly values (original measurements are 1/hour), so I need the signal in the frequency domain with the same length as the signal in the time domain.
Later I need features as real numbers (e.g. mean, variance), so I also need real numbers in the frequency domain. To this end, I think they use PSD. But after using Scipy's PSD (Welch estimation) I get much shorter array.
Question:

How can I get real valued array in the frequency domain from the signal with the same length as the original signal?

How should I use FFT / real FFT / PSD to get this (what arguments' values should I use)?

Would taking absolute values of the FFT output make sense?
Since you are reproducing the paper's results, read it carefully.
At the bottom of page 4 it says

This representation is formed by complex numbers, eliminating the imaginary part of each number in the frequency-domain signal. For this transformation, it is needed to calculate the power spectral density (PSD), as shown in Equation (3),
$$
P = \lim_{T\to\infty} \frac{1}{T} \int_0^T |x(k)|^2 dt \tag{3}
$$
where $P$ represents the energy from the signal, $T$ represents the length of the signal lapse and $x(k)$ represents the frequency-domain signal. The spectrum is normalized by the length of the signal.

The PSD is a real function with respect to frequency $k$, so it has the same length of FFT result $x(k)$ if you keepace with Eq. (3).
There are many methods to estimate PSD, but if you want to recreate the results in the paper, you should use exactly the same equation.