COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_sensors.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 #ifndef _SUTRA_SENSORS_H_
43 #define _SUTRA_SENSORS_H_
44 
45 #include <carma_utils.h>
46 #include <sutra_telescope.h>
47 #include <sutra_utils.h>
48 #include <sutra_wfs.h>
49 #include <sutra_wfs_pyr_pyrhr.h>
50 #include <sutra_wfs_sh.h>
51 
52 #include <map>
53 #include <vector>
54 
55 using std::map;
56 using std::string;
57 using std::vector;
58 
59 class SutraSensors {
60  public:
61  int device;
62  bool roket;
64  size_t nsensors() { return d_wfs.size(); }
65  vector<SutraWfs *> d_wfs;
66  map<vector<int>, cufftHandle *> campli_plans;
67  map<vector<int>, cufftHandle *> fttotim_plans;
68  map<vector<int>, cufftHandle *> ftlgskern_plans;
69 
75 
76  public:
78  vector<string> type, int nwfs, long *nxsub, long *nvalid,
79  long *npupils, long *npix, long *nphase, long *nrebin,
80  long *nfft, long *ntot, long *npup, float *pdiam, float *nphot,
81  float *nphot4imat, int *lgs, bool *fakecam, int *max_flux_per_pix,
82  int *max_pix_value, int device, bool roket);
84 
86  int define_mpi_rank(int rank, int size);
87  int set_noise(int nwfs, float noise, long seed);
88 
89  int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop,
90  long *size, float *noise, long *seed, float *G, float *thetaML,
91  float *dx, float *dy);
92  int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop,
93  long *size, float *noise, float *G, float *thetaML, float *dx,
94  float *dy);
95  int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop,
96  long *size, float *G, float *thetaML, float *dx, float *dy);
97 };
98 
99 // General utilities
100 
101 #endif // _SUTRA_SENSORS_H_
SutraSensors::d_lgskern
CarmaObj< float > * d_lgskern
Definition: sutra_sensors.h:74
SutraSensors::fttotim_plans
map< vector< int >, cufftHandle * > fttotim_plans
Definition: sutra_sensors.h:67
SutraSensors::SutraSensors
SutraSensors(CarmaContext *context, SutraTelescope *d_tel, vector< string > type, int nwfs, long *nxsub, long *nvalid, long *npupils, long *npix, long *nphase, long *nrebin, long *nfft, long *ntot, long *npup, float *pdiam, float *nphot, float *nphot4imat, int *lgs, bool *fakecam, int *max_flux_per_pix, int *max_pix_value, int device, bool roket)
SutraSensors::device
int device
Definition: sutra_sensors.h:61
SutraSensors::current_context
CarmaContext * current_context
Definition: sutra_sensors.h:63
carma_utils.h
this file provides tools to CarmaObj
SutraSensors::initgs
int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop, long *size, float *noise, long *seed, float *G, float *thetaML, float *dx, float *dy)
sutra_telescope.h
SutraSensors::campli_plans
map< vector< int >, cufftHandle * > campli_plans
Definition: sutra_sensors.h:66
SutraSensors::define_mpi_rank
int define_mpi_rank(int rank, int size)
sutra_wfs.h
SutraSensors::initgs
int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop, long *size, float *G, float *thetaML, float *dx, float *dy)
SutraSensors::set_noise
int set_noise(int nwfs, float noise, long seed)
SutraTelescope
this class provides the telescope features to COMPASS
Definition: sutra_telescope.h:53
SutraSensors::nsensors
size_t nsensors()
Definition: sutra_sensors.h:64
CarmaObj< cuFloatComplex >
CarmaContext
this class provides the context in which CarmaObj are created
Definition: carma_context.h:104
SutraSensors::initgs
int initgs(float *xpos, float *ypos, float *lambda, float *mag, float zerop, long *size, float *noise, float *G, float *thetaML, float *dx, float *dy)
sutra_wfs_sh.h
SutraSensors::d_camplipup
CarmaObj< cuFloatComplex > * d_camplipup
Definition: sutra_sensors.h:70
sutra_utils.h
SutraSensors::d_camplifoc
CarmaObj< cuFloatComplex > * d_camplifoc
Definition: sutra_sensors.h:71
SutraSensors::d_fttotim
CarmaObj< cuFloatComplex > * d_fttotim
Definition: sutra_sensors.h:72
SutraSensors::ftlgskern_plans
map< vector< int >, cufftHandle * > ftlgskern_plans
Definition: sutra_sensors.h:68
SutraSensors::d_wfs
vector< SutraWfs * > d_wfs
Definition: sutra_sensors.h:65
SutraSensors
this class provides the sensors features to COMPASS
Definition: sutra_sensors.h:59
SutraSensors::~SutraSensors
~SutraSensors()
SutraSensors::roket
bool roket
Definition: sutra_sensors.h:62
sutra_wfs_pyr_pyrhr.h
SutraSensors::d_ftlgskern
CarmaObj< cuFloatComplex > * d_ftlgskern
Definition: sutra_sensors.h:73
SutraSensors::allocate_buffers
int allocate_buffers()