The galaxy models are a collection of mathematical functions, often with randomly varying features, that provide an interface to draw themselves onto an image. The rasterization step is up to the model -- some may perform very simple sampling while others generate Poisson noise models. Selection of the random parameters is also up to the particular model, though the interface includes functionality that will allow a module to decide when the parameters should be reselected.
When the galaxies draw themselves, they will bias their shape by the last given Shear Bias. If this function has been called, all galaxies drawn from then on will be biased.
User interface definitions are given in the virtual GalModel class, located
in modelGal/GalModel.h. These are:
| void setShearBias(double g1, double g2); | Set the amount of shear bias to use in subsequent drawGal calls. g1 is the amount of bias on the x-y axis, and g2 the amount 45 deg to x-y. These values are typically small, which causes only a slight distortion in the rasterization. |
| bool select(); | Reselect the random parameters of the model. Some models may automatically call this function when drawGal is called (though this behaviour can be turned off). |
| bool drawGal(double *arr, int w, int h, double locX, double locY); | Draw the galaxy on to the provided image array. Values will be added with the += operator, so multiple galaxies can be drawn on to a single image. arr is a pointer to the pixel value array, w and h provide the pixel dimensions of the array, and locX and locY are the coordinates of the desired center of the galaxy image relative to the (0,0) element of the array. Centers, as are all pixel coordinates, are integer at the center of each pixel. |