COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_centroider_bpcog.h
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 #ifndef _SUTRA_CENTROIDER_BPCOG_H_
43 #define _SUTRA_CENTROIDER_BPCOG_H_
44 
45 #include <sutra_centroider.h>
46 
47 template <class Tin, class T>
48 class SutraCentroiderBpcog : public SutraCentroider<Tin, T> {
49  public:
50  int nmax;
53 
54  public:
56  float offset, float scale, bool filter_TT, int device,
57  int nmax);
60 
61  string get_type();
62 
63  int init_nmax(int nmax);
64  int set_nmax(int nmax);
65 
66  int get_cog(float *cube, float *intensities, T *centroids, int nvalid,
67  int npix, int ntot, cudaStream_t stream=0);
68  int get_cog(float *intensities, T *slopes, bool noise);
69  int get_cog();
70 };
71 template <class T>
72 void get_centroids(int size, int threads, int blocks, int n, float *d_idata,
73  T *d_odata, T *ref, int *validx, int *validy,
74  float *intensities, int nbpix, float scale, float offset,
75  CarmaDevice *device);
76 
77 template <class T>
78 void subap_sortmax(int threads, int blocks, T *d_idata, T *d_odata,
79  unsigned int *values, int nmax, CarmaDevice *device);
80 template <class T>
81 void subap_bpcentro(int threads, int blocks, int npix, T *d_idata,
82  unsigned int *values, T *d_odata, float scale,
83  float offset);
84 
85 #endif // _SUTRA_CENTROIDER_H_
sutra_centroider.h
SutraCentroiderBpcog::get_cog
int get_cog()
SutraCentroiderBpcog::SutraCentroiderBpcog
SutraCentroiderBpcog(CarmaContext *context, SutraWfs *wfs, long nvalid, float offset, float scale, bool filter_TT, int device, int nmax)
SutraCentroiderBpcog::nmax
int nmax
Definition: sutra_centroider_bpcog.h:50
CarmaDevice
Definition: carma_context.h:57
SutraCentroiderBpcog::SutraCentroiderBpcog
SutraCentroiderBpcog(const SutraCentroiderBpcog &centroider)
SutraCentroider< Tin, T >::wfs
SutraWfs * wfs
Definition: sutra_centroider.h:54
SutraCentroiderBpcog
Definition: sutra_centroider_bpcog.h:48
SutraCentroider< Tin, T >::filter_TT
bool filter_TT
Definition: sutra_centroider.h:59
SutraCentroiderBpcog::get_cog
int get_cog(float *cube, float *intensities, T *centroids, int nvalid, int npix, int ntot, cudaStream_t stream=0)
SutraCentroider< Tin, T >::offset
float offset
Definition: sutra_centroider.h:61
SutraCentroiderBpcog::get_type
string get_type()
SutraWfs
this class provides the wfs features to COMPASS
Definition: sutra_wfs.h:60
SutraCentroiderBpcog::d_bpix
CarmaObj< T > * d_bpix
Definition: sutra_centroider_bpcog.h:51
SutraCentroiderBpcog::set_nmax
int set_nmax(int nmax)
SutraCentroider< Tin, T >::npix
int npix
Definition: sutra_centroider.h:57
get_centroids
void get_centroids(int size, int threads, int blocks, int n, float *d_idata, T *d_odata, T *ref, int *validx, int *validy, float *intensities, float scale, float offset, CarmaDevice *device, cudaStream_t stream=0)
CarmaObj< T >
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
SutraCentroiderBpcog::~SutraCentroiderBpcog
~SutraCentroiderBpcog()
SutraCentroider< Tin, T >::scale
float scale
Definition: sutra_centroider.h:62
SutraCentroiderBpcog::d_bpind
CarmaObj< uint > * d_bpind
Definition: sutra_centroider_bpcog.h:52
SutraCentroider< Tin, T >::nvalid
int nvalid
Definition: sutra_centroider.h:55
SutraCentroiderBpcog::get_cog
int get_cog(float *intensities, T *slopes, bool noise)
SutraCentroider< Tin, T >::device
int device
Definition: sutra_centroider.h:53
SutraCentroiderBpcog::init_nmax
int init_nmax(int nmax)