coffee
Coronagraph Optimization For Fast Exoplanet Exploration
|
Go to the source code of this file.
Functions | |
void | __attribute__ ((constructor)) libinit_linARfilterPred() |
int_fast8_t | init_linARfilterPred () |
2. I/O TOOLS | |
int | NBwords (const char sentence[]) |
long | LINARFILTERPRED_LoadASCIIfiles (double tstart, double dt, long NBpt, long NBfr, const char *IDoutname) |
load ascii file(s) into image cube More... | |
long | LINARFILTERPRED_SelectBlock (const char *IDin_name, const char *IDblknb_name, long blkNB, const char *IDout_name) |
3. BUILD PREDICTIVE FILTER | |
long | linARfilterPred_repeat_shift_X (const char *IDin_name, long NBstep, const char *IDout_name) |
Expand 2D image/matrix in X direction by repeat and shift. More... | |
long | LINARFILTERPRED_Build_LinPredictor (const char *IDin_name, long PForder, float PFlag, double SVDeps, double RegLambda, const char *IDoutPF_name, int outMode, int LOOPmode, float LOOPgain, int testmode) |
Build predictive filter. More... | |
4. APPLY PREDICTIVE FILTER | |
long | LINARFILTERPRED_Apply_LinPredictor_RT (const char *IDfilt_name, const char *IDin_name, const char *IDout_name) |
long | LINARFILTERPRED_Apply_LinPredictor (const char *IDfilt_name, const char *IDin_name, float PFlag, const char *IDout_name) |
long | LINARFILTERPRED_PF_updatePFmatrix (const char *IDPF_name, const char *IDPFM_name, float alpha) |
long | LINARFILTERPRED_PF_RealTimeApply (const char *IDmodevalOL_name, long IndexOffset, int semtrig, const char *IDPFM_name, long NBPFstep, const char *IDPFout_name, int nbGPU, long loop, long NBiter, int SAVEMODE, float tlag, long PFindex) |
5. MISC TOOLS, DIAGNOSTICS | |
float | LINARFILTERPRED_ScanGain (char *IDin_name, float multfact, float framelag) |
void __attribute__ | ( | (constructor) | ) |
int_fast8_t init_linARfilterPred | ( | ) |
long LINARFILTERPRED_Apply_LinPredictor | ( | const char * | IDfilt_name, |
const char * | IDin_name, | ||
float | PFlag, | ||
const char * | IDout_name | ||
) |
long LINARFILTERPRED_Apply_LinPredictor_RT | ( | const char * | IDfilt_name, |
const char * | IDin_name, | ||
const char * | IDout_name | ||
) |
long LINARFILTERPRED_Build_LinPredictor | ( | const char * | IDin_name, |
long | PForder, | ||
float | PFlag, | ||
double | SVDeps, | ||
double | RegLambda, | ||
const char * | IDoutPF_name, | ||
int | outMode, | ||
int | LOOPmode, | ||
float | LOOPgain, | ||
int | testmode | ||
) |
Build predictive filter.
Optional pixel masks select input and output variables: "inmask" and "outmask"
if LOOPmode = 1, operate in a loop, and re-run filter computation everytime IDin_name changes
Build predictive filter from real-time AO telemetry
Optional input and output pixel masks select active input & output
If LOOPmode = 1, operate in a loop, and re-run filter computation everytime IDin_name changes
if <IFoutPF_name>_PFparam image exist, read parameters from it: PFlag, SVDeps, RegLambda, LOOPgain create it in shared memory by default
If image named <IDoutPF_name>_PFparam exists, the predictive filter parameters are read from it instead of the function arguments.
This mode is particularly useful in LOOP mode if the user needs to change the parameters between LOOP iterations.
The goal of this function is to build a linear link between input and output variables.
Input variables values are provided by the input telemetry image which is first read to measure dimensions, and allocate memory.
Note that an optional variable selection step allows only a subset of the telemetry variables to be considered.
If 2D image:
If 3D image
Once input telemetry size measured, arrays are created:
If image "inmask" exists, use it to select which variables are active. Otherwise, all variables are active
The number of active input variables is stored in NBpixin.
By default, the output variables are the same as the input variables, so the prediction is performed on the same variables as the input.
With inmask and outmask, input AND output variables can be selected amond the telemetry.
Arrays are created:
PFlag_run needs to be read before entering the loop as some array sizes depend on its value.
Note: column / row description follows FITS file viewing conventions.
The data matrix is build from the telemetry. Each column (= time sample) of the data matrix consists of consecutives columns (= time sample) of the input telemetry.
Variable naming:
Data matrix is stored as image of size NBmvec x mvecsize, to be fed to routine compute_SVDpseudoInverse in linopt_imtools (CPU mode) or in cudacomp (GPU mode)
Regularization can be added to penalize strong coefficients in the predictive filter. It is optionally implemented by adding extra columns at the end of the data matrix.
Data matrix conventions :
In LOOP mode, LOOP STARTS HERE
STEP: Read parameters from external image (optional)
STEP: In loop mode, wait for input data to arrive
STEP: Copy IDin to IDincp
Necessary as input may be continuously changing between consecutive loop iterations.
STEP: if DC_MODE==1, compute average value from each variable
STEP: Fill up data matrix PFmatD from input telemetry
STEP: Write regularization coefficients (optional)
STEP: Compute Pseudo-Inverse of PFmatD
If using MAGMA, call function CUDACOMP_magma_compute_SVDpseudoInverse()
Otherwise, call function linopt_compute_SVDpseudoInverse()
Result (pseudoinverse) is stored in image PFmatC
In LOOP mode, LOOP ENDS HERE
[in] | IDin_name | Input telemetry, a 2D or 3D image |
[in] | PForder | Number of time steps in output filter |
[in] | PFlag | Time lag between last measurement and prediction, unit: sampling period |
[in] | SVDeps | Singular value cutoff limit. Ratio between strongest singular value and limit |
[in] | RegLambda | Regularization paramater |
[in] | IDoutPF_name | Output predictive filter name |
[in] | outMode | Output mode. 0: do not write individual files, 1: write individual files (note: output filter cube is always written) |
[in] | LOOPmode | 1 if running in infinite loop waiting for input telemetry |
[in] | LOOPgain | If running in loop, mixing coefficient between previous and current filter |
long LINARFILTERPRED_LoadASCIIfiles | ( | double | tstart, |
double | dt, | ||
long | NBpt, | ||
long | NBfr, | ||
const char * | IDoutname | ||
) |
load ascii file(s) into image cube
resamples sequence(s) of data points INPUT FILES HAVE TO BE NAMED seq000.dat, seq001.dat etc...
file starts at tstart, sampling = dt NBpt per file NBfr files
long LINARFILTERPRED_PF_RealTimeApply | ( | const char * | IDmodevalOL_name, |
long | IndexOffset, | ||
int | semtrig, | ||
const char * | IDPFM_name, | ||
long | NBPFstep, | ||
const char * | IDPFout_name, | ||
int | nbGPU, | ||
long | loop, | ||
long | NBiter, | ||
int | SAVEMODE, | ||
float | tlag, | ||
long | PFindex | ||
) |
measure time
long LINARFILTERPRED_PF_updatePFmatrix | ( | const char * | IDPF_name, |
const char * | IDPFM_name, | ||
float | alpha | ||
) |
long linARfilterPred_repeat_shift_X | ( | const char * | IDin_name, |
long | NBstep, | ||
const char * | IDout_name | ||
) |
Expand 2D image/matrix in X direction by repeat and shift.
float LINARFILTERPRED_ScanGain | ( | char * | IDin_name, |
float | multfact, | ||
float | framelag | ||
) |
long LINARFILTERPRED_SelectBlock | ( | const char * | IDin_name, |
const char * | IDblknb_name, | ||
long | blkNB, | ||
const char * | IDout_name | ||
) |
int NBwords | ( | const char | sentence[] | ) |