COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sutra_centroider_pyr.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-2023 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 // -----------------------------------------------------------------------------
7 
15 
16 #ifndef _SUTRA_CENTROIDER_PYR_H_
17 #define _SUTRA_CENTROIDER_PYR_H_
18 
19 #include <sutra_centroider.h>
20 
21 struct Method_CoG {
22  bool is_local = false;
23  bool is_sinus = true;
24 
25  Method_CoG(bool isLocal_ = false, bool isSinus_ = true)
26  : is_local(isLocal_), is_sinus(isSinus_) {}
27 
35  Method_CoG(uint8_t method) : is_local(method > 1), is_sinus(!(method % 2)) {}
36 
37  static const char *str(const struct Method_CoG &method) {
38  if (method.is_sinus && !method.is_local) return "sinus global"; // 0
39  if (!method.is_sinus && !method.is_local) return "nosinus global"; // 1
40  if (method.is_sinus && method.is_local) return "sinus local"; // 2
41  if (!method.is_sinus && method.is_local) return "nosinus local"; // 3
42  throw "method unknown";
43  };
44 };
45 
46 template <class Tin, class T>
47 class SutraCentroiderPyr : public SutraCentroider<Tin, T> {
48  private:
49  string pyr_type;
50 
51  public:
53  float offset, float scale, bool filter_TT, int device);
56 
57  string get_type();
58  int set_valid_thresh(T valid_thresh);
60 
61  int set_method(Method_CoG method);
63  string get_method_str();
64 
65  int get_pyr(float *cube, float *intensities, T *centroids, int *subindx,
66  int *subindy, int nvalid, int ns, int nim);
67  int get_cog(float *cube, float *intensities, T *centroids, int nvalid,
68  int npix, int ntot, cudaStream_t stream=0);
69  int get_cog(float *intensities, T *slopes, bool noise);
70  int get_cog();
71 
72  private:
73  T valid_thresh;
74  Method_CoG method;
75 };
76 
77 template <class T>
78 void pyr_slopes(T *d_odata, T *d_idata, int *subindx, int *subindy,
79  float *intensities, int ns, int nvalid, int nim,
81 
82 template <class T>
83 void pyr2_slopes(T *d_odata, T *ref, T *d_idata, int *subindx, int *subindy,
84  float *intensities, int ns, int nvalid, float scale,
85  T valid_thresh, int do_sin, SlopeOrder slope_order,
86  CarmaDevice *device);
87 #endif // _SUTRA_CENTROIDER_PYR_H_
this class provides the context in which CarmaObj are created
Definition: carma_context.h:79
this class provides the centroider features to COMPASS
this class provides the centroider_pyr features to COMPASS
int get_cog(float *cube, float *intensities, T *centroids, int nvalid, int npix, int ntot, cudaStream_t stream=0)
int get_cog(float *intensities, T *slopes, bool noise)
SutraCentroiderPyr(const SutraCentroiderPyr &centroider)
int set_method(Method_CoG method)
Method_CoG get_method()
int set_valid_thresh(T valid_thresh)
int get_pyr(float *cube, float *intensities, T *centroids, int *subindx, int *subindy, int nvalid, int ns, int nim)
SutraCentroiderPyr(CarmaContext *context, SutraWfs *wfs, long nvalid, float offset, float scale, bool filter_TT, int device)
string get_method_str()
this class provides the wfs features to COMPASS
Definition: sutra_wfs.h:35
Method_CoG(uint8_t method)
static const char * str(const struct Method_CoG &method)
Method_CoG(bool isLocal_=false, bool isSinus_=true)
SlopeOrder
SlopeOrder slope_order(std::size_t value)
void pyr_slopes(T *d_odata, T *d_idata, int *subindx, int *subindy, float *intensities, int ns, int nvalid, int nim, SlopeOrder slope_order, CarmaDevice *device)
void pyr2_slopes(T *d_odata, T *ref, T *d_idata, int *subindx, int *subindy, float *intensities, int ns, int nvalid, float scale, T valid_thresh, int do_sin, SlopeOrder slope_order, CarmaDevice *device)