COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_centroider_maskedPix.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
9 // terms of the GNU Lesser General Public License as published by the Free
10 // Software Foundation, either version 3 of the License, 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
14 // the simulation of AO systems.
15 //
16 // The final product includes a software package for simulating all the
17 // critical subcomponents of AO, particularly in the context of the ELT and a
18 // real-time core based on several control approaches, with performances
19 // consistent with its integration into an instrument. Taking advantage of the
20 // specific hardware architecture of the GPU, the COMPASS tool allows to
21 // achieve adequate execution speeds to conduct large simulation campaigns
22 // called to the ELT.
23 //
24 // The COMPASS platform can be used to carry a wide variety of simulations to
25 // both testspecific components of AO of the E-ELT (such as wavefront analysis
26 // device with a pyramid or elongated Laser star), and various systems
27 // configurations such as multi-conjugate AO.
28 //
29 // COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY
30 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
31 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
32 // details.
33 //
34 // You should have received a copy of the GNU Lesser General Public License
35 // along with COMPASS. If not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>.
36 // -----------------------------------------------------------------------------
37 
46 
47 #ifndef _SUTRA_CENTROIDER_MASKEDPIX_H_
48 #define _SUTRA_CENTROIDER_MASKEDPIX_H_
49 
50 #include <sutra_centroider.h>
51 #include <sutra_wfs_pyr_pyrhr.h>
52 #include <string>
53 
54 template <class Tin, class T>
55 class SutraCentroiderMaskedPix : public SutraCentroider<Tin, T> {
56  public:
59 
60  public:
62  long nvalid, long npupils, float offset,
63  float scale, bool filter_TT, int device);
64 
66 
67  string get_type();
68 
69  int get_maskedPix(float *img, float *intensities, T *centroids, int *subindx,
70  int *subindy, int nvalid, int ns);
71  int get_cog(float *img, float *intensities, T *centroids, int nvalid,
72  int npix, int ntot, cudaStream_t stream=0);
73  int get_cog(float *intensities, T *slopes, bool noise);
74  int get_cog();
76  int fill_mask();
77 };
78 
79 void fill_intensities(float *intensities, float *img, int *subindx,
80  int *subindy, int ns, int nslopes, CarmaDevice *device);
81 template <class T>
82 void get_masked_pix(T *centroids, T *ref, float *img, int *subindx, int *subindy,
83  float *psum, int ns, int nslopes, CarmaDevice *device);
84 template <class T>
85 void pyr_fill_selected_pix(T *img, int img_sizex, T *pix, int *subindx, int *subindy,
86  int nvalid, CarmaDevice *device);
87 template <class T>
88 void pyr_fill_mask(T *mask, int img_sizex, int *subindx, int *subindy,
89  int nvalid, CarmaDevice *device);
90 
91 #endif // _SUTRA_CENTROIDER_MASKEDPIX_H_
sutra_centroider.h
SutraCentroiderMaskedPix::get_maskedPix
int get_maskedPix(float *img, float *intensities, T *centroids, int *subindx, int *subindy, int nvalid, int ns)
SutraCentroiderMaskedPix::get_cog
int get_cog(float *intensities, T *slopes, bool noise)
CarmaDevice
Definition: carma_context.h:57
pyr_fill_selected_pix
void pyr_fill_selected_pix(T *img, int img_sizex, T *pix, int *subindx, int *subindy, int nvalid, CarmaDevice *device)
SutraCentroider< Tin, T >::wfs
SutraWfs * wfs
Definition: sutra_centroider.h:54
SutraCentroiderMaskedPix::~SutraCentroiderMaskedPix
~SutraCentroiderMaskedPix()
SutraCentroider< Tin, T >::filter_TT
bool filter_TT
Definition: sutra_centroider.h:59
SutraCentroider< Tin, T >::offset
float offset
Definition: sutra_centroider.h:61
SutraCentroiderMaskedPix::fill_mask
int fill_mask()
SutraWfs
this class provides the wfs features to COMPASS
Definition: sutra_wfs.h:60
SutraCentroiderMaskedPix::get_cog
int get_cog()
pyr_fill_mask
void pyr_fill_mask(T *mask, int img_sizex, int *subindx, int *subindy, int nvalid, CarmaDevice *device)
SutraCentroider< Tin, T >::npix
int npix
Definition: sutra_centroider.h:57
fill_intensities
void fill_intensities(float *intensities, float *img, int *subindx, int *subindy, int ns, int nslopes, CarmaDevice *device)
get_masked_pix
void get_masked_pix(T *centroids, T *ref, float *img, int *subindx, int *subindy, float *psum, int ns, int nslopes, CarmaDevice *device)
CarmaObj< T >
SutraCentroiderMaskedPix::d_mask
CarmaObj< T > * d_mask
Definition: sutra_centroider_maskedPix.h:58
SutraCentroiderMaskedPix::SutraCentroiderMaskedPix
SutraCentroiderMaskedPix(CarmaContext *context, SutraWfs *wfs, long nvalid, long npupils, float offset, float scale, bool filter_TT, int device)
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
SutraCentroider< Tin, T >::scale
float scale
Definition: sutra_centroider.h:62
SutraCentroiderMaskedPix::get_cog
int get_cog(float *img, float *intensities, T *centroids, int nvalid, int npix, int ntot, cudaStream_t stream=0)
SutraCentroiderMaskedPix
this class provides the centroider_maskedPix features to COMPASS
Definition: sutra_centroider_maskedPix.h:55
SutraCentroider< Tin, T >::nvalid
int nvalid
Definition: sutra_centroider.h:55
SutraCentroiderMaskedPix::fill_selected_pix
int fill_selected_pix(CarmaObj< T > *pix)
SutraCentroiderMaskedPix::get_type
string get_type()
sutra_wfs_pyr_pyrhr.h
SutraCentroider< Tin, T >::device
int device
Definition: sutra_centroider.h:53
SutraCentroiderMaskedPix::d_selected_pix
CarmaObj< T > * d_selected_pix
Definition: sutra_centroider_maskedPix.h:57