Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

extract/lib/optics_signature.c File Reference

Compute the ray tracing through the SNIFS optics. More...

Go to the source code of this file.

Defines

#define camera_backward(camera, lambda, r)
 Light propagation through the camera, backward.

#define collimator_backward(collimator, gamma, lambda, tantheta)
 Light propagation through the collimator, backward.

#define x_rotation(x, y, z, t)   (rotation_2D((y),(z),(t)))
 Rotation around x-axis (see rotation_2D).

#define y_rotation(x, y, z, t)   (rotation_2D((x),(z),(t)))
 Rotation around y-axis (see rotation_2D).

#define z_rotation(x, y, z, t)   (rotation_2D((x),(y),(t)))
 Rotation around z-axis (see rotation_2D).


Functions

double blaze_function (const Grism *grism, int order, double lambda)
 Return the blaze function of the grism.

double lateral_color_ampl (const CameraCollimator *element, double lambda)
 Compute lateral color for camera or collimator.

double collimator_forward (const CameraCollimator *collimator, double gamma, double lambda, double r)
 Light propagation through the collimator, forward.

double camera_forward (const CameraCollimator *camera, double lambda, double tantheta)
 Light propagation through the camera, forward.

double invert_camcoll (double y, double e, double b)
 Inversion of $y=x(ex^2+b)$.

void rotation_2D (double *x, double *y, double theta)
 2D-rotation

void refraction (double *x, double *y, double *z, double n1, double n2)
 Refraction law from 1 to 2.

void grating_forward (double *x, double *y, double *z, double lambda, double n, double g_per_mm, int order)
 Light propagation through a grating, forward.

void grating_backward (double *x, double *y, double *z, double lambda, double n, double g_per_mm, int order)
 Light propagation through a grating, backward.

double sellmeier_index (double lambda, const double sellcoeffs[])
 Compute refractive index from Sellmeier coefficients.

void grism_forward (const Grism *grism, double lambda, double *x, double *y, double *z, int order)
 Light propagation through a grism, forward.

void grism_backward (const Grism *grism, double lambda, double *x, double *y, double *z, int order)
 Light propagation through a grism, backward.

void snifs_optics_forward (const SnifsOptics *optics, double xmla, double ymla, double *xccd, double *yccd, double lambda, int order)
 Light propagation through the Snifs instrument, forward.

void snifs_optics_backward (const SnifsOptics *optics, double xccd, double yccd, double *xmla, double *ymla, double lambda, int order)
 Light propagation through the Snifs instrument, backward.

void snifs_optics_test_forward (const SnifsOptics *optics, double xmla, double ymla, double *xccd, double *yccd, double lambda, int order)
 Testing version of snifs_optics_forward.

void snifs_optics_CCD2MLA (const SnifsOptics *optics, double xccd, double yccd, double *xmla, double *ymla, double pixsize, double lbdaref)
 Wrapper to snifs_optics_backward, [CCD/px] to [MLA/mm].

void snifs_optics_MLA2CCD (const SnifsOptics *optics, double xmla, double ymla, double *xccd, double *yccd, double pixsize, double lbda, int order)
 Wrapper to snifs_optics_forward, [MLA/mm] to [CCD/px].


Detailed Description

Compute the ray tracing through the SNIFS optics.

Copyright:
(c) 2003 CRAL-Observatoire de Lyon
Date:
Thu Mar 11 12:11:30 2004
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.11
Id
optics_signature.c,v 1.11 2004/07/22 15:23:18 ycopin Exp

Definition in file optics_signature.c.


Define Documentation

#define camera_backward camera,
lambda,
 ) 
 

Value:

invert_camcoll((r)/(camera)->focal,(camera)->distor, \
                       1.+lateral_color_ampl((camera),lambda))
Light propagation through the camera, backward.

Parameters:
camera CameraCollimator structure
lambda Input wavelength [AA]
r Input radius [units of fcam]
Returns:
tan(output angle)
The camera equation is

\[ \frac{r}{f_{cam}} = \tan\theta(1+e_{cam}\tan^2\theta+a_{cam}) \]

i.e. $y=x(ex^2+b)$ of invert_camcoll with

  • $y=r/f_{cam}$,
  • $x=\tan\theta$
  • $b=1+a_{cam}$

Definition at line 220 of file optics_signature.c.

Referenced by snifs_optics_backward(), and snifs_optics_test_forward().

#define collimator_backward collimator,
gamma,
lambda,
tantheta   ) 
 

Value:

(collimator)->focal * \
        invert_camcoll((tantheta),(collimator)->distor, \
               1.+lateral_color_ampl((collimator),(lambda))/(gamma))
Light propagation through the collimator, backward.

Parameters:
collimator CameraCollimator structure
gamma Spectrograph magnification (fcam/fcoll)
lambda Input wavelength [AA]
tantheta tan(input angle)
Returns:
Output radius [units of fcoll]
The collimator equation is

\[ \tan\theta = \frac{r}{f_{coll}} (1+e_{coll}\frac{r}{f_{coll}}^2+\frac{a_{coll}}{\gamma}) \]

i.e. $y=x(ex^2+b)$ of invert_camcoll with

  • $y=\tan\theta$,
  • $x=\frac{r}{f_{coll}}$
  • $b=1+\frac{a_{coll}}{\gamma}$

Definition at line 245 of file optics_signature.c.

Referenced by snifs_optics_backward(), and snifs_optics_test_forward().

#define x_rotation x,
y,
z,
 )     (rotation_2D((y),(z),(t)))
 

Rotation around x-axis (see rotation_2D).

Definition at line 280 of file optics_signature.c.

Referenced by grism_backward(), grism_forward(), and snifs_optics_test_forward().

#define y_rotation x,
y,
z,
 )     (rotation_2D((x),(z),(t)))
 

Rotation around y-axis (see rotation_2D).

Definition at line 288 of file optics_signature.c.

Referenced by grism_backward(), grism_forward(), and snifs_optics_test_forward().

#define z_rotation x,
y,
z,
 )     (rotation_2D((x),(y),(t)))
 

Rotation around z-axis (see rotation_2D).

Definition at line 296 of file optics_signature.c.

Referenced by grism_backward(), grism_forward(), and snifs_optics_test_forward().


Function Documentation

double blaze_function const Grism grism,
int  order,
double  lambda
 

Return the blaze function of the grism.

Parameters:
grism Grism structure
order Order
lambda Wavelength [AA]
Returns:
Blaze function
In the normal configuration, the blaze function of a grism is given by

\[ B = \left(\frac{\sin^2\Theta}{\Theta}\right) \]

with

  • $\Theta = \pi\cos\gamma(n_r\sin i - \sin r) / \rho / \lambda $, $\gamma$ being the blaze angle and $\rho$ the line density of the grating
  • $i = \alpha' - \gamma$ where $\alpha' = \arcsin(n_g/n_r \sin A)$ with $n_g$ and $n_r$ the ref. index of prism glass and grating resine resp. and $A$ the grism angle
  • $r = \beta - \gamma$ where $\beta = \arcsin(n_g\sin A - m\rho\lambda)$ with $m$ the diffraction order.

Note:
See `Redefinition of the blue grating' (E.P., SNIFS/02-004) for an extensive description.

Definition at line 51 of file optics_signature.c.

References Grism::A, Grism::blaze, Grism::g_per_mm, Grism::grating, Grism::prism, Material::sellcoeffs, and sellmeier_index().

Referenced by plot_lens().

Here is the call graph for this function:

double lateral_color_ampl const CameraCollimator element,
double  lambda
 

Compute lateral color for camera or collimator.

Parameters:
element CameraCollimator structure
lambda Input wavelength [AA]
Returns:
Lateral color term

Definition at line 81 of file optics_signature.c.

References CameraCollimator::LateralColor.

Referenced by camera_forward(), and collimator_forward().

double collimator_forward const CameraCollimator collimator,
double  gamma,
double  lambda,
double  r
 

Light propagation through the collimator, forward.

Parameters:
collimator CameraCollimator structure
gamma Spectrograph magnification (fcam/fcoll)
lambda Input wavelength
r Input radius [units of fcoll]
Returns:
tan(output angle)
The collimator equation is

\[ \tan\theta = \frac{r}{f_{coll}} (1+e_{coll}\frac{r}{f_{coll}}^2+\frac{a_{coll}}{\gamma}) \]

Definition at line 111 of file optics_signature.c.

References CameraCollimator::distor, CameraCollimator::focal, and lateral_color_ampl().

Referenced by snifs_optics_forward(), and snifs_optics_test_forward().

Here is the call graph for this function:

double camera_forward const CameraCollimator camera,
double  lambda,
double  tantheta
 

Light propagation through the camera, forward.

Parameters:
camera CameraCollimator structure
lambda Input wavelength [AA]
tantheta tan(input angle)
Returns:
Output radius [units of fcam]
The camera equation is

\[ \frac{r}{f_{cam}} = \tan\theta(1+e_{cam}\tan^2\theta+a_{cam}) \]

Definition at line 139 of file optics_signature.c.

References CameraCollimator::distor, CameraCollimator::focal, and lateral_color_ampl().

Referenced by snifs_optics_forward(), and snifs_optics_test_forward().

Here is the call graph for this function:

double invert_camcoll double  y,
double  e,
double  b
 

Inversion of $y=x(ex^2+b)$.

Inversion of $y=x(ex^2+b)$ using analytical solutions from GSL

gsl_poly_solve_cubic solves $x^3 + a x^2 + b x + c = 0$. Our eq. can be written $x^3 + b/e x - y/e = 0$

Definition at line 161 of file optics_signature.c.

References x.

void rotation_2D double *  x,
double *  y,
double  theta
 

2D-rotation

Parameters:
x 
y Input/output coordinates
theta Rotation angle [rad]

Definition at line 260 of file optics_signature.c.

References x.

void refraction double *  x,
double *  y,
double *  z,
double  n1,
double  n2
 

Refraction law from 1 to 2.

Parameters:
x 
y 
z Input/output vector
n1 Indice of first material
n2 Indice of second material

Definition at line 310 of file optics_signature.c.

References x.

Referenced by grism_backward(), grism_forward(), and snifs_optics_test_forward().

void grating_forward double *  x,
double *  y,
double *  z,
double  lambda,
double  n,
double  g_per_mm,
int  order
 

Light propagation through a grating, forward.

The grooves of the (transmission) grating are aligned along x. The propagation is done from material (n) to air (1).

Parameters:
x 
y 
z Input/output vector
lambda Input wavelength [AA]
n Refractive index
g_per_mm Nb of grooves [1/mm]
order Order of dispersion (0,1,2,...)

Definition at line 334 of file optics_signature.c.

References x.

Referenced by grism_forward(), and snifs_optics_test_forward().

void grating_backward double *  x,
double *  y,
double *  z,
double  lambda,
double  n,
double  g_per_mm,
int  order
 

Light propagation through a grating, backward.

The grooves of the (transmission) grating are aligned along x. The back-propagation is done from air (1) to material (n).

Parameters:
x 
y 
z Input/output vector
lambda Input wavelength [AA]
n Refractive index
g_per_mm Nb of grooves/mm
order Order of dispersion (0,1,2,...)

Definition at line 358 of file optics_signature.c.

References x.

Referenced by grism_backward().

double sellmeier_index double  lambda,
const double  sellcoeffs[]
 

Compute refractive index from Sellmeier coefficients.

Sellmeier expansion for refractive index:

\[ n(\lambda)^2 = 1+\sum_{i=1}^3\frac{B_i\lambda^2}{\lambda^2-C_i} \]

with $\lambda$ in microns.

Parameters:
lambda Input wavelength [AA]
sellcoeffs Sellmeier coeffs (B1,B2,B3,C1,C2,C3) as defined in snifs_materials.h
Returns:
Refractive index at input wavelength

Definition at line 388 of file optics_signature.c.

Referenced by blaze_function(), grism_backward(), grism_forward(), and snifs_optics_test_forward().

void grism_forward const Grism grism,
double  lambda,
double *  x,
double *  y,
double *  z,
int  order
 

Light propagation through a grism, forward.

Parameters:
grism Grism structure
lambda Input wavelength [AA]
x 
y 
z Input/output vector
order Order of dispersion

Definition at line 413 of file optics_signature.c.

References Grism::A, Grism::g_per_mm, grating_forward(), Grism::prism, refraction(), Grism::rotz, Material::sellcoeffs, sellmeier_index(), Grism::tiltx, Grism::tilty, x, x_rotation, y_rotation, and z_rotation.

Referenced by snifs_optics_forward(), and snifs_optics_test_forward().

Here is the call graph for this function:

void grism_backward const Grism grism,
double  lambda,
double *  x,
double *  y,
double *  z,
int  order
 

Light propagation through a grism, backward.

Parameters:
grism Grism structure
lambda Input wavelength [AA]
x 
y 
z Input/output vector
order Order of dispersion

Definition at line 454 of file optics_signature.c.

References Grism::A, Grism::g_per_mm, grating_backward(), Grism::prism, refraction(), Grism::rotz, Material::sellcoeffs, sellmeier_index(), Grism::tiltx, Grism::tilty, x, x_rotation, y_rotation, and z_rotation.

Referenced by snifs_optics_backward(), and snifs_optics_test_forward().

Here is the call graph for this function:

void snifs_optics_forward const SnifsOptics optics,
double  xmla,
double  ymla,
double *  xccd,
double *  yccd,
double  lambda,
int  order
 

Light propagation through the Snifs instrument, forward.

Parameters:
optics Optical structure
xmla 
ymla MLA coordinates [mm]
xccd 
yccd Image coordinates [mm]
lambda Wavelength [AA]
order Order of dispersion
Warning:
The collimator, the grism and the camera are supposed to be perfectly aligned

Bug:
In previous optics_signature functions, the computation of the direction vector is probably wrong by the sign of the x and y components. However, since the tilts of the grism are adjusted, there should not be any incidence.

Definition at line 504 of file optics_signature.c.

References SnifsOptics::camera, camera_forward(), SnifsOptics::collimator, collimator_forward(), CameraCollimator::focal, SnifsOptics::grism, grism_forward(), and x.

Referenced by main(), and snifs_optics_MLA2CCD().

Here is the call graph for this function:

void snifs_optics_backward const SnifsOptics optics,
double  xccd,
double  yccd,
double *  xmla,
double *  ymla,
double  lambda,
int  order
 

Light propagation through the Snifs instrument, backward.

Parameters:
optics Optical structure
xccd 
yccd Image coordinates [mm]
xmla 
ymla MLA coordinates [mm]
lambda Wavelength [AA]
order Order of dispersion
Warning:
The collimator, the grism and the camera are supposed to be perfectly aligned

I'm not sure about the (x,y,z) definition: should it be backward-ed too? Probably not, as whatever_backward just invert the whatever equation, but the light always propagate in the same direction.

Definition at line 571 of file optics_signature.c.

References SnifsOptics::camera, camera_backward, SnifsOptics::collimator, collimator_backward, CameraCollimator::focal, SnifsOptics::grism, grism_backward(), and x.

Referenced by main(), and snifs_optics_CCD2MLA().

Here is the call graph for this function:

void snifs_optics_test_forward const SnifsOptics optics,
double  xmla,
double  ymla,
double *  xccd,
double *  yccd,
double  lambda,
int  order
 

Testing version of snifs_optics_forward.

Definition at line 623 of file optics_signature.c.

References Grism::A, SnifsOptics::camera, camera_backward, camera_forward(), SnifsOptics::collimator, collimator_backward, collimator_forward(), CameraCollimator::focal, Grism::g_per_mm, grating_forward(), SnifsOptics::grism, grism_backward(), grism_forward(), Grism::prism, refraction(), Grism::rotz, Material::sellcoeffs, sellmeier_index(), Grism::tiltx, Grism::tilty, x, x_rotation, y_rotation, and z_rotation.

Referenced by main().

Here is the call graph for this function:

void snifs_optics_CCD2MLA const SnifsOptics optics,
double  xccd,
double  yccd,
double *  xmla,
double *  ymla,
double  pixsize,
double  lbdaref
 

Wrapper to snifs_optics_backward, [CCD/px] to [MLA/mm].

Parameters:
optics Optical structure
xccd 
yccd Image coordinates [px]
xmla 
ymla MLA coordinates [mm]
pixsize Pixel size [mm]
lbdaref Ref. wavelength [AA]

Definition at line 771 of file optics_signature.c.

References SnifsOptics::center, and snifs_optics_backward().

Referenced by main(), nllsqfit_mask(), plot_lens(), plot_lens_tab(), and pup_get_maxdata().

Here is the call graph for this function:

void snifs_optics_MLA2CCD const SnifsOptics optics,
double  xmla,
double  ymla,
double *  xccd,
double *  yccd,
double  pixsize,
double  lbda,
int  order
 

Wrapper to snifs_optics_forward, [MLA/mm] to [CCD/px].

Parameters:
optics Optical structure
xmla 
ymla MLA coordinates [mm]
xccd 
yccd Image coordinates [px]
pixsize Pixel size [mm]
lbda Wavelength [AA]
order Order

Definition at line 800 of file optics_signature.c.

References SnifsOptics::center, and snifs_optics_forward().

Referenced by main(), nllsqfit_mask(), plot_lens(), plot_lens_tab(), and pup_get_maxdata().

Here is the call graph for this function:


Generated on Thu Oct 27 00:00:02 2005 for Snifs by doxygen 1.3.5