COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
sutra_wfs_sh.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_WFS_SH_H_
43 #define _SUTRA_WFS_SH_H_
44 
45 #include <sutra_lgs.h>
46 #include <sutra_phase.h>
47 #include <sutra_target.h>
48 #include <sutra_telemetry.h>
49 #include <sutra_utils.h>
50 #include <sutra_wfs.h>
51 #include <map>
52 #include <vector>
53 
54 class SutraWfsSH : public SutraWfs {
55  public:
56  // sh only
60 
61  public:
66  long npix, long nphase, long nrebin, long nfft, long ntot,
67  long npup, float pdiam, float nphotons, float nphot4imat,
68  int lgs, bool fakecam, int max_flux_per_pix, int max_pix_value,
69  bool is_low_order, bool roket, int device);
70  SutraWfsSH(const SutraWfsSH &wfs);
72 
73  int define_mpi_rank(int rank, int size);
74  int allocate_buffers(map<vector<int>, cufftHandle *> campli_plans,
75  map<vector<int>, cufftHandle *> fttotim_plans);
76 
77  int load_arrays(int *phasemap, int *hrmap, int *binmap, float *offsets,
78  float *fluxPerSub, int *validsubsx, int *validsubsy,
79  int *istart, int *jstart, cuFloatComplex *kernel);
80 
81  int fill_binimage(int async);
82  int comp_image(bool noise = true);
83  int comp_nphot(float ittime, float optthroughput, float diam, int nxsub,
84  float zerop = 0, float gsmag = 0, float lgsreturnperwatt = 0,
85  float laserpower = 0);
86  int set_bincube(float *bincube, int nElem);
87 
88  private:
89  int comp_generic();
90 };
91 
92 #endif // _SUTRA_WFS_SH_H_
SutraWfsSH::SutraWfsSH
SutraWfsSH(CarmaContext *context, SutraTelescope *d_tel, CarmaObj< cuFloatComplex > *d_camplipup, CarmaObj< cuFloatComplex > *d_camplifoc, CarmaObj< cuFloatComplex > *d_fttotim, long nxsub, long nvalid, long npix, long nphase, long nrebin, long nfft, long ntot, long npup, float pdiam, float nphotons, float nphot4imat, int lgs, bool fakecam, int max_flux_per_pix, int max_pix_value, bool is_low_order, bool roket, int device)
SutraWfsSH::load_arrays
int load_arrays(int *phasemap, int *hrmap, int *binmap, float *offsets, float *fluxPerSub, int *validsubsx, int *validsubsy, int *istart, int *jstart, cuFloatComplex *kernel)
SutraWfs::max_flux_per_pix
int max_flux_per_pix
Definition: sutra_wfs.h:84
SutraWfs::d_fttotim
CarmaObj< cuFloatComplex > * d_fttotim
Definition: sutra_wfs.h:92
SutraWfs::max_pix_value
int max_pix_value
Definition: sutra_wfs.h:85
sutra_target.h
SutraWfs::fakecam
bool fakecam
Definition: sutra_wfs.h:83
SutraWfsSH::d_validpuppixy
CarmaObj< int > * d_validpuppixy
Definition: sutra_wfs_sh.h:59
SutraWfsSH::comp_nphot
int comp_nphot(float ittime, float optthroughput, float diam, int nxsub, float zerop=0, float gsmag=0, float lgsreturnperwatt=0, float laserpower=0)
SutraWfs::nphase
long nphase
Definition: sutra_wfs.h:71
SutraWfs::roket
bool roket
Definition: sutra_wfs.h:80
SutraWfs::nxsub
long nxsub
Definition: sutra_wfs.h:64
SutraWfs
this class provides the wfs features to COMPASS
Definition: sutra_wfs.h:60
SutraWfsSH::set_bincube
int set_bincube(float *bincube, int nElem)
SutraWfsSH::comp_image
int comp_image(bool noise=true)
SutraWfsSH::d_binmap
CarmaObj< int > * d_binmap
Definition: sutra_wfs_sh.h:57
SutraWfsSH::d_validpuppixx
CarmaObj< int > * d_validpuppixx
Definition: sutra_wfs_sh.h:58
sutra_wfs.h
SutraWfsSH::define_mpi_rank
int define_mpi_rank(int rank, int size)
sutra_lgs.h
SutraWfsSH::SutraWfsSH
SutraWfsSH(const SutraWfsSH &wfs)
SutraWfs::npix
long npix
Definition: sutra_wfs.h:66
SutraWfs::nfft
long nfft
Definition: sutra_wfs.h:68
SutraTelescope
this class provides the telescope features to COMPASS
Definition: sutra_telescope.h:53
CarmaObj< int >
CarmaContext
this class provides the context in which CarmaObj are created
Definition: carma_context.h:104
SutraWfs::noise
float noise
Definition: sutra_wfs.h:77
sutra_telemetry.h
sutra_utils.h
SutraWfs::ntot
long ntot
Definition: sutra_wfs.h:69
SutraWfs::npup
long npup
Definition: sutra_wfs.h:70
SutraWfs::rank
int rank
Definition: sutra_wfs.h:126
SutraWfs::device
int device
Definition: sutra_wfs.h:62
SutraWfs::nvalid
long nvalid
Definition: sutra_wfs.h:65
SutraWfs::d_camplifoc
CarmaObj< cuFloatComplex > * d_camplifoc
Definition: sutra_wfs.h:91
SutraWfsSH
this class provides the wfs_sh features to COMPASS
Definition: sutra_wfs_sh.h:54
SutraWfs::is_low_order
bool is_low_order
Definition: sutra_wfs.h:81
SutraWfsSH::~SutraWfsSH
~SutraWfsSH()
SutraWfsSH::allocate_buffers
int allocate_buffers(map< vector< int >, cufftHandle * > campli_plans, map< vector< int >, cufftHandle * > fttotim_plans)
SutraWfs::lgs
bool lgs
Definition: sutra_wfs.h:78
SutraWfs::d_camplipup
CarmaObj< cuFloatComplex > * d_camplipup
Definition: sutra_wfs.h:90
SutraWfsSH::fill_binimage
int fill_binimage(int async)
SutraWfs::nrebin
long nrebin
Definition: sutra_wfs.h:67
SutraWfs::nphot4imat
float nphot4imat
Definition: sutra_wfs.h:76
sutra_phase.h