COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_centroider_corr.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // This file is part of COMPASS <https://anr-compass.github.io/compass/>
3 //
4 // Copyright (C) 2011-2019 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 // Distributed under GNU - LGPL
7 //
8 // COMPASS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
9 // General Public License as published by the Free Software Foundation, either version 3 of the License,
10 // or any later version.
11 //
12 // COMPASS: End-to-end AO simulation tool using GPU acceleration
13 // The COMPASS platform was designed to meet the need of high-performance for the simulation of AO systems.
14 //
15 // The final product includes a software package for simulating all the critical subcomponents of AO,
16 // particularly in the context of the ELT and a real-time core based on several control approaches,
17 // with performances consistent with its integration into an instrument. Taking advantage of the specific
18 // hardware architecture of the GPU, the COMPASS tool allows to achieve adequate execution speeds to
19 // conduct large simulation campaigns called to the ELT.
20 //
21 // The COMPASS platform can be used to carry a wide variety of simulations to both testspecific components
22 // of AO of the E-ELT (such as wavefront analysis device with a pyramid or elongated Laser star), and
23 // various systems configurations such as multi-conjugate AO.
24 //
25 // COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
26 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 // See the GNU Lesser General Public License for more details.
28 //
29 // You should have received a copy of the GNU Lesser General Public License along with COMPASS.
30 // If not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>.
31 // -----------------------------------------------------------------------------
32 
41 
42 
43 #ifndef _SUTRA_CENTROIDER_CORR_H_
44 #define _SUTRA_CENTROIDER_CORR_H_
45 
46 #include <sutra_centroider.h>
47 
48 template <class Tin, class T>
49 class SutraCentroiderCorr : public SutraCentroider<Tin, T> {
50  public:
51  int npix;
60 
61  public:
63  float offset, float scale, bool filter_TT, int device);
66 
67  string get_type();
68  int fill_bincube(T *img);
69 
70  int init_corr(int isizex, int isizey, T *interpmat);
71  int load_corr(T *corr, T *corr_norm, int ndim);
72 
73  int set_npix(int npix);
74 
75  int get_cog(float *cube, float *intensities, T *centroids, int nvalid,
76  int npix, int ntot, cudaStream_t stream=0);
77  int get_cog(float *intensities, T *slopes, bool noise);
78  int get_cog();
79 };
80 
81 template <class T>
82 void subap_sortmaxi(int threads, int blocks, T *d_idata, int *values, int nmax,
83  int offx, int offy, int npix, int Npix);
84 template <class T>
85 void subap_pinterp(int threads, int blocks, T *d_idata, int *values,
86  T *d_centroids, T *d_matinterp, int sizex, int sizey,
87  int nvalid, int Npix, float scale, float offset);
88 
89 template <class Tcu, class T>
90 int fillcorr(Tcu *d_out, T *d_in, int npix_in, int npix_out, int N, int nvalid,
91  CarmaDevice *device);
92 
93 template <class T>
94 int correl(T *d_odata, T *d_idata, int N, CarmaDevice *device);
95 
96 template <class Tcu, class T>
97 int roll2real(T *d_odata, Tcu *d_idata, int n, int Npix, int N,
98  CarmaDevice *device);
99 
100 template <class T>
101 int corr_norm(T *d_odata, T *d_idata, int Npix, int N, CarmaDevice *device);
102 
103 #endif // _SUTRA_CENTROIDER_CORR_H_
SutraCentroiderCorr
this class provides the centroider_corr features to COMPASS
Definition: sutra_centroider_corr.h:49
sutra_centroider.h
subap_pinterp
void subap_pinterp(int threads, int blocks, T *d_idata, int *values, T *d_centroids, T *d_matinterp, int sizex, int sizey, int nvalid, int Npix, float scale, float offset)
SutraCentroiderCorr::d_corrfnct
CarmaObj< cuFloatComplex > * d_corrfnct
Definition: sutra_centroider_corr.h:54
CarmaDevice
Definition: carma_context.h:57
fillcorr
int fillcorr(Tcu *d_out, T *d_in, int npix_in, int npix_out, int N, int nvalid, CarmaDevice *device)
SutraCentroider< Tin, T >::wfs
SutraWfs * wfs
Definition: sutra_centroider.h:54
SutraCentroiderCorr::get_cog
int get_cog(float *cube, float *intensities, T *centroids, int nvalid, int npix, int ntot, cudaStream_t stream=0)
SutraCentroiderCorr::set_npix
int set_npix(int npix)
SutraCentroider< Tin, T >::filter_TT
bool filter_TT
Definition: sutra_centroider.h:59
SutraCentroider< Tin, T >::offset
float offset
Definition: sutra_centroider.h:61
SutraCentroiderCorr::interp_sizey
int interp_sizey
Definition: sutra_centroider_corr.h:53
correl
int correl(T *d_odata, T *d_idata, int N, CarmaDevice *device)
SutraWfs
this class provides the wfs features to COMPASS
Definition: sutra_wfs.h:60
SutraCentroiderCorr::get_cog
int get_cog(float *intensities, T *slopes, bool noise)
SutraCentroiderCorr::d_corrmax
CarmaObj< int > * d_corrmax
Definition: sutra_centroider_corr.h:57
subap_sortmaxi
void subap_sortmaxi(int threads, int blocks, T *d_idata, int *values, int nmax, int offx, int offy, int npix, int Npix)
SutraCentroiderCorr::npix
int npix
Definition: sutra_centroider_corr.h:51
SutraCentroiderCorr::fill_bincube
int fill_bincube(T *img)
SutraCentroiderCorr::SutraCentroiderCorr
SutraCentroiderCorr(const SutraCentroiderCorr &centroider)
SutraCentroiderCorr::~SutraCentroiderCorr
~SutraCentroiderCorr()
SutraCentroiderCorr::load_corr
int load_corr(T *corr, T *corr_norm, int ndim)
SutraCentroiderCorr::get_cog
int get_cog()
SutraCentroiderCorr::init_corr
int init_corr(int isizex, int isizey, T *interpmat)
CarmaObj< cuFloatComplex >
CarmaContext
this class provides the context in which CarmaObj are created
Definition: carma_context.h:104
SutraCentroider
this class provides the centroider features to COMPASS
Definition: sutra_centroider.h:51
SutraCentroiderCorr::get_type
string get_type()
corr_norm
int corr_norm(T *d_odata, T *d_idata, int Npix, int N, CarmaDevice *device)
SutraCentroiderCorr::SutraCentroiderCorr
SutraCentroiderCorr(CarmaContext *context, SutraWfs *wfs, long nvalid, float offset, float scale, bool filter_TT, int device)
SutraCentroider< Tin, T >::scale
float scale
Definition: sutra_centroider.h:62
roll2real
int roll2real(T *d_odata, Tcu *d_idata, int n, int Npix, int N, CarmaDevice *device)
SutraCentroider< Tin, T >::nvalid
int nvalid
Definition: sutra_centroider.h:55
SutraCentroider< Tin, T >::device
int device
Definition: sutra_centroider.h:53
SutraCentroiderCorr::d_interpmat
CarmaObj< T > * d_interpmat
Definition: sutra_centroider_corr.h:59
SutraCentroiderCorr::d_corrspot
CarmaObj< cuFloatComplex > * d_corrspot
Definition: sutra_centroider_corr.h:55
SutraCentroiderCorr::interp_sizex
int interp_sizex
Definition: sutra_centroider_corr.h:52
SutraCentroiderCorr::d_corrnorm
CarmaObj< T > * d_corrnorm
Definition: sutra_centroider_corr.h:56
SutraCentroiderCorr::d_corr
CarmaObj< T > * d_corr
Definition: sutra_centroider_corr.h:58