I have a 3D (time, X, Y) numpy array containing 6 hour time series for several years. (say 5). I would like to create a selective time series containing 1 instance of each calendar day, randomly taken from the available entries (5 possibilities per day), as follows.
- 01/01/2006
- January 02: 2011
- January 03: 2009
- ...
This means that I need to take 4 values from 01/01/2006, 4 values from 02/01/2011, etc. I have a working version that works as follows:
- Modify the input array to add the year dimension (time, year, X, Y).
- Create an array of 365 values from randomly generated integers from 0 to 4
- Use np.repeat and an array of integers to extract only the appropriate values:
Example:
sampledValues = Variable[np.arange(numberOfDays * ValuesPerDays), sampledYears.repeat(ValuesPerDays),:,:]
, , , / ? , , .
?
, , 29- feb .
- 365- , .. , .