ctf4science.data_module.get_prediction_timesteps#
- ctf4science.data_module.get_prediction_timesteps(dataset_name: str, pair_id: int, subset: str = 'test') ndarray#
Return physical time values at which predictions must be evaluated.
Computes absolute physical times using the formula:
timesteps[i] = (start_index + i) * delta_t, i = 0, ..., N-1
where
start_index = metadata['matrix_start_index'][matrix_name],N = metadata['matrix_shapes'][matrix_name][0](number of rows), anddelta_t = metadata['delta_t']. These are absolute times along the underlying trajectory, not zero-based indices. The first value isstart_index * delta_tand the last is(start_index + N - 1) * delta_t.- Parameters:
- dataset_namestr
Name of the dataset (e.g.
'ODE_Lorenz','PDE_KS').- pair_idint
ID of the train-test pair.
- subset{‘test’, ‘initialization’}, optional
Which matrix to use. Default is
'test'.
- Returns:
- ndarray
1D array of length
Nwith physical time values spanning[start_index * delta_t, (start_index + N - 1) * delta_t].
- Raises:
- ValueError
If pair_id is missing, subset matrix or metadata (e.g.
matrix_shapes,matrix_start_index,delta_t) is missing.
Notes
Example — ODE_Lorenz, pair 1, subset=’test’:
X1test.mathas shape[1000, 3],start_index=10000,delta_t=0.05. Returns 1000 values in[500.0, 549.95].Example — ODE_Lorenz, pair 6, subset=’test’:
X6test.mathas shape[1000, 3],start_index=100,delta_t=0.05. Returns 1000 values in[5.0, 54.95].See the dataset YAML configs under
data/<dataset_name>/for thematrix_shapes,matrix_start_index, anddelta_tvalues for every matrix.