ceo 0.1.0

CUDA Engined Optics
Documentation
#ifndef __IMAGING_H__
#define __IMAGING_H__

#ifndef __UTILITIES_H__
#include "utilities.h"
#endif

#ifndef __SOURCE_H__
#include "source.h"
#endif

#define NRANK 2

struct imaging {

  int N_PX_PUPIL, N_DFT, N_SIDE_LENSLET, N_LENSLET,
      N_SOURCE, N_PX_IMAGE, N_PX_CAMERA, N_FRAME, 
    BIN_IMAGE, LOCAL_RAND_SEED;
  cufftHandle plan;
  float N_PHOTON_PER_SECOND_PER_FRAME, N_PHOTON_PER_FRAME;
  float2 *d__wave_PUPIL;
  float  *d__frame, zenith, azimuth, theta_x, theta_y, 
    *d__zenith, *d__azimuth, *d__theta_x, *d__theta_y,
    pixel_scale, photoelectron_gain;
  char absolute_pointing;
  curandState *devStates;

  void setup(int __N_PX_PUPIL, int __N_SIDE_LENSLET,
             int DFT_osf, float IMAGE_osf, float CAMERA_osf);
  void setup(int __N_PX_PUPIL, int __N_SIDE_LENSLET,
             int DFT_osf, float IMAGE_osf, float CAMERA_osf, int __N_SOURCE);
  void setup(int __N_PX_PUPIL, int __N_SIDE_LENSLET,
             int DFT_osf, int N_PX_IMAGE_, float CAMERA_osf, int __N_SOURCE);
  void setup(int __N_PX_PUPIL, int __N_SIDE_LENSLET,
             int DFT_osf, int N_PX_IMAGE_, int BIN_IMAGE, int __N_SOURCE);
  void setupSegmentPistonSensor(int __N_PX_PUPIL, int __N_SIDE_LENSLET,
                                int _N_DFT_, int N_PX_IMAGE_, int _BIN_IMAGE_,
                                int __N_SOURCE);

  void cleanup(void);
  void cleanupSegmentPistonSensor(void);

  void set_pointing_direction(float *zen, float *azim);

  void reset(void);
  void reset_rng(int SEED);

  void propagate(source *src);
  void propagate_cpx(source *src);
  void propagateNoOverlap(source *src);
  void propagateNoOverlapBare(source *src);
  void propagateNoOverlapSPS(source *src, float d, float wavenumber);
  void propagateTT7(source *src);
  void propagateTT7(source *src, int *d__piston_mask);
  void propagateThroughFieldStop(source *src, float field_stop_diam);
  void propagateThroughPyramid(source *src, float alpha);
  void propagateThroughModulatedPyramid(source *src,
                                        float modulation,
                                        int modulation_sampling,
                                        float alpha);

  void readout(float exposureTime, float readOutNoiseRms);
  void noiseless_readout(float exposureTime);
  void readout(float exposureTime, float readOutNoiseRms, 
               float nBackgroundPhoton, float noiseFactor);
  float strehl_ratio(imaging *ref);

  void info(void);

  void frame2file(const char *filename);

  void show_frame(char *filename);
  void show_frame(char *filename, imaging *ref);
};

#endif  // __IMAGING_H__