Goal
====
Goal of the simulations was to mimic the observations of the Ly-alpha emitter
J033218.92-275302.7 (z=5.563, m_AB(F850LP)=24.53) at various redshifts,
apparent brightness and in different background situations with the
WFC3/IR/G102 grism.

Software
========
For the simulations we use the current version of aXeSIM, which is 1.2, which
is offered on the the ST-ECF website
(see http://www.stecf.org/software/slitless_software/axesim/).
The tasks to be run for simulating everything is wrapped in the script
"goodsobj.py". Essentially there is one aXeSIM task executed for every
background value.

Input
=====
The different components to allow the simulations are:
- the spectrum of the Ly-alpha emitter, which was provided by Bob
  and is stored in 'OUTSIM/highz_goods_55.txt';
- the various configuration and calibration files for WFC3/IR/G102,
  which are available at "http://www.stecf.org/instruments/WFC3grism/";
- the total passband of the ACS/WFC F850LP filter, which is stored at
  "SIMDATA/wfc_f850lp_t77_m01.dat" and was taken from the STSCI webpage;
  please not that, thought the passband likely is very accurate, in our
  simulations the absolute throughput values are NOT relevant;
- the m_AB(F850LP)-value of the object was provided by Bob (originating
  from a paper by Raiter et al.;
- the three background values (low/ave/high = 0.5/1.0/2.0 e/s/pix)
  were taken from the WFC3 IR spectroscopic ETC for the cases of
  low sky + low Zodi, average sky + average Zodi and shadow sky 
  + low Zodi respectively
- the size of the object was set as circular with 0.5 pixel radius;
  this make the object essentially point-like.

Procedure
=========
In order to shift the spectrum in redshift space without much thinking
I have first generated a spectrum of the object at z=0.0
(see 'OUTSIM/highz_goods_00.txt'). Then I have prepared an Input Object
List ('highz_05.cat') which tells aXeSIM where to 'simulate which object
with which spectrum and brightness value at which redhift.
Each simulation contains 31 spectra. The first is a control object
(see later), objects 2-11 are the Ly-alpha emitter at m_AB(F850LP)=24.50
with redshifts varying from 5.563 to 6.463 in steps of 0.1, objects 12-21
are the Ly-alpha emitter at m_AB(F850LP)=25.25 (a factor of ~2 fainter than
2-11) with redshifts varying from 5.563 to 6.463 in steps of 0.1, and
objects 22-31 are the Ly-alpha emitter at m_AB(F850LP)=26.0 (again a factor
of ~2 fainter than 12-21) with redshifts varying from 5.563 to 6.463
in steps of 0.1. For object 1, I simulate the original spectrum at
5.563 with NO 'additional' redshift and the same brightness as object 2.
If everything (de-redshifting and re-redshifting) worked well, objects
1 and 2 MUST be identical.

Note that since the template spectrum is redshifted and then the z-band 
magnitude is computed, the higher redshift spectra (>~6) have higher flux 
(in line and continuum) since the shorter spectral extent beyond the 
Ly-alpha must make a proportionally greater contribution to the bandpass.

Results
=======
All results are collected in the directory "OUTSIM/". The simulations
with the background values 0.5, 1.0 and 2.0 have the prefix "highz_05_lowbgr_",
"highz_05_avebgr_" and "highz_05_higbgr_" respectively.
In detail, for each background value there is:
- "highz_05_avebgr_slitless.fits": the simulated 2D grism image; 
  the first extension contains the data, the second the error 
  (Poisson+readout) and the third the quality flags (empty as of now); 
  the trace of the G102 grism is essentially horizontal. To find an object 
  simulated at y=50, go to this row and you will find its spectrum there;

- "highz_05_avebgr_spectra.fits": the input spectra, shifted to the correct
  redshift and flux level;

- "highz_05_higbgr_slitless_2.SPC.fits": the extracted spectra from aXeSIM;
  the default extraction width used here is 3.0 the object radius, hence 
  1.5 pixels on each side of the trace; the file is a multi-extension
  fits table, and next to the first order also the zeroth and second order
  spectra were simulated and extracted; the different layers contain
  the spectra "first order obj 1, zeroth order obj 1, second order obj 1,
  first order obj 2, ......; please check the aXeSIM manual for more details

- "highz_05_higbgr_slitless_2.STP.fits": the so called stamp image for the
  various orders of each object. The spectrum as on the grism image
  was aligned without re-sampling the pixels, hence the sudden shifts;
  the different layers of the multi-extension image are filled as the 
  extracted spectrum table.

Analysis
========
For a selection of redshifts, the 1D spectra were analysed by fitting the
continuum by eye and the emission lines by a Gaussian. The following
summarise the results:
   results_aver.txt - line flux, error and S/N for the lines with 
   S/N > 2 at selected redshifts (z=5.56,5.76,6.06,6.26,6.46) for
   the average background case
   results_lb.txt - line flux, error and S/N for the lines with 
   S/N > 2 as results_aver.txt but for the low background case 
   results_hb.txt - line flux, error and S/N for the lines with 
   S/N > 2 as results_aver.txt but for the high background case 
