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

extract/lib/proc_plot.c File Reference

Misc. (mostly DISLIN-related) plotting procedures. More...

Go to the source code of this file.

Defines

#define NCOORD   100
#define MAXNBIN   100
#define NTICKS   6

Functions

void plot_set_limits (const float x[], const float y[], int n, PlotLimits *limits)
 Set limits of the plot.

void plot_increase_limits (PlotLimits *limits)
 Increase plot limits by 10% (or to valid range if min=max).

int inside_plot_limits (float x, float y, PlotLimits limits)
 Test if point is inside plot limits.

int plot_compticks (int nticks, float min, float max, float *first, float *step)
void plot_set_device (char *devname)
 Set the DISLIN output device or file from the device name.

void plot_start (Plot *plot, float scale)
 Initialize and set various default quantities for a DISLIN 2D-plot.

void plot_axes (const Plot *plot, char *xlabel, char *ylabel)
 Plot the axes in a DISLIN 2D-plot.

void plot_title (char *string)
 Plot the title strings.

void plot_set_bkgnd (IMAGE2D *bkgndima, Plot *plot, float mincut, float maxcut, int *nx, int *ny, float ***zmat)
 Set a background plot.

void plot_max (const Maxima_Set *maxset, const Plot *plot, const double shift[])
 Plot max data.

void plot_lens (const SnifsOptics *optics, int nopup, float xppup, float yppup, int nlbda, const float lbda[], int order, const Plot *plot, float lbdaref, float pixsize, int dxnc, double dxcoeff[], const double shift[], double *xmla, double *ymla)
 Plot a lens spectrum onto the CCD.

void plot_lens_tab (const SnifsOptics *optics, float xppup, float yppup, int nlbda, const float lbda[], int order, TABLE *table, const int colid[], int row, float lbdaref, float pixsize, int dxnc, double dxcoeff[], const double shift[], double *xmla, double *ymla)
 Plot a lens spectrum onto the CCD (table storage).

void plot_array_err (const PlotSymbol *symbol, float x[], float y[], int n, float dx[], float dy[])
 DISLIN curve with errors.

void plot_initialize (Plot *plot, const char *devname, const PlotLimits *limits, const PlotSymbol *symbol, float mincut, float maxcut)
 Initialize a Plot structure.


Detailed Description

Misc. (mostly DISLIN-related) plotting procedures.

Copyright:
(c) 2003 CRAL-Observatoire de Lyon
Date:
Thu Mar 24 17:28:33 2005
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.23
Id
proc_plot.c,v 1.23 2005/05/27 14:12:38 ycopin Exp

Definition in file proc_plot.c.


Define Documentation

#define NCOORD   100
 

Number of coordinates per line in ASCII output

Definition at line 27 of file proc_plot.c.

Referenced by plot_lens(), and plot_max().

#define MAXNBIN   100
 

Maximum number of bin in background frame histogram

Definition at line 30 of file proc_plot.c.

Referenced by plot_set_bkgnd().

#define NTICKS   6
 

Number of ticks on each axis

Definition at line 33 of file proc_plot.c.

Referenced by plot_axes().


Function Documentation

void plot_set_limits const float  x[],
const float  y[],
int  n,
PlotLimits limits
 

Set limits of the plot.

If the PlotLimits structure has never been set (ie = 0,0,0,0), it is set according to the min and max of the input arrays. Otherwise, it is updated to include these min and max.

Parameters:
x 
y Input arrays
n Size of input arrays
limits PlotLimits structure.
Note:
See DISLIN routine setscl.

Definition at line 52 of file proc_plot.c.

References x, PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main(), model_distMLA(), and study_triangulation().

void plot_increase_limits PlotLimits limits  ) 
 

Increase plot limits by 10% (or to valid range if min=max).

Definition at line 81 of file proc_plot.c.

References PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main(), model_distMLA(), and study_triangulation().

int inside_plot_limits float  x,
float  y,
PlotLimits  limits
 

Test if point is inside plot limits.

Parameters:
x 
y Input coordinates
limits Plot limits
Returns:
TRUE or FALSE

Definition at line 107 of file proc_plot.c.

References x, PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by plot_lens(), and plot_max().

int plot_compticks int  nticks,
float  min,
float  max,
float *  first,
float *  step
 

Compute reasonable first and step values to get approx. nticks ticks over range min-max

Parameters:
nticks Requested (approximate) nb of ticks in input range
min 
max Input range
first First value
step Step value
Returns:
Actual number of ticks

Definition at line 127 of file proc_plot.c.

Referenced by main(), and plot_axes().

void plot_set_device char *  devname  ) 
 

Set the DISLIN output device or file from the device name.

The device name devname can be either:

  • an empty string, for traditionnal ASCII output
  • a standard DISLIN device

Parameters:
devname Output device or file (or empty string for ASCII output)

Definition at line 161 of file proc_plot.c.

Referenced by main(), and plot_start().

void plot_start Plot plot,
float  scale
 

Initialize and set various default quantities for a DISLIN 2D-plot.

Parameters:
plot Plot structure
scale Plot scaling.
  • if scale=0, default scale (2/3 of the whole window) is used
  • if scale>0, the scale is used
  • if scale<0, the scale is used such that the plot is isoscale in x and y.
Note:
This routine has to be called from DISLIN level 0 (i.e. before any call to to disini) and will set it to 1 (e.g. suitable for plot_axes).

Definition at line 210 of file proc_plot.c.

References Plot::devname, Plot::Limits, plot_set_device(), PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main(), model_distMLA(), and study_triangulation().

Here is the call graph for this function:

void plot_axes const Plot plot,
char *  xlabel,
char *  ylabel
 

Plot the axes in a DISLIN 2D-plot.

Parameters:
plot Plot structure
xlabel X-axis label
ylabel Y-axis label
Note:
This routine has to be called from DISLIN level 1 (i.e. after a call to plot_start) and will set it to 3 (e.g. suitable for title).

Definition at line 272 of file proc_plot.c.

References Plot::Limits, Plot::maxcut, Plot::mincut, NTICKS, plot_compticks(), PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main(), model_distMLA(), and study_triangulation().

Here is the call graph for this function:

void plot_title char *  string  ) 
 

Plot the title strings.

Parameters:
string Title string
The title string (of length 4*lg_ident+1) contains the (up to 4) title chunks separated with newlines.

Definition at line 310 of file proc_plot.c.

Referenced by main(), model_distMLA(), and study_triangulation().

void plot_set_bkgnd IMAGE2D *  bkgndima,
Plot plot,
float  mincut,
float  maxcut,
int *  nx,
int *  ny,
float ***  zmat
 

Set a background plot.

Parameters:
bkgndima Background image
plot Plot structure
mincut 
maxcut LUT cuts (in percentile of histogram)
nx 
ny 
zmat Resulting 2D array (nx$\times$ny)

Todo:
Set the limits so that the border spaxels are displayed completely.

Definition at line 345 of file proc_plot.c.

References histo_threshold(), Plot::Limits, Plot::maxcut, MAXNBIN, Plot::mincut, subframe_histo(), PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main().

Here is the call graph for this function:

void plot_max const Maxima_Set *  maxset,
const Plot plot,
const double  shift[]
 

Plot max data.

Parameters:
maxset Max structure
plot Plot definition
shift Offset (NULL if none)

Definition at line 429 of file proc_plot.c.

References PlotSymbol::color, Plot::devname, inside_plot_limits(), Plot::Limits, NCOORD, PlotSymbol::shape, PlotSymbol::size, Plot::Symbol, and x.

Referenced by main().

Here is the call graph for this function:

void plot_lens const SnifsOptics optics,
int  nopup,
float  xppup,
float  yppup,
int  nlbda,
const float  lbda[],
int  order,
const Plot plot,
float  lbdaref,
float  pixsize,
int  dxnc,
double  dxcoeff[],
const double  shift[],
double *  xmla,
double *  ymla
 

Plot a lens spectrum onto the CCD.

Parameters:
optics Optical structure
nopup Mpup number (needed just for labelling)
xppup 
yppup Mpup coordinates [px]
nlbda 
lbda Wavelength array to be plotted
order Order of dispersion
plot Plot structure
lbdaref Ref. wavelength [AA]
pixsize Pixel size [mm]
dxnc Nb of coefficients in local adjustment
dxcoeff Coefficients of the local adjustment (1st-order)
shift Offset (NULL if none)
xmla 
ymla MLA coordinates [mm] Set to MAXDOUBLE if unknown (will then be computed)

Definition at line 530 of file proc_plot.c.

References blaze_function(), PlotSymbol::color, Plot::devname, SnifsOptics::filter, SnifsOptics::grism, inside_plot_limits(), Plot::Limits, NCOORD, PlotSymbol::shape, PlotSymbol::size, snifs_optics_CCD2MLA(), snifs_optics_MLA2CCD(), and Plot::Symbol.

Referenced by main().

Here is the call graph for this function:

void plot_lens_tab const SnifsOptics optics,
float  xppup,
float  yppup,
int  nlbda,
const float  lbda[],
int  order,
TABLE *  table,
const int  colid[],
int  row,
float  lbdaref,
float  pixsize,
int  dxnc,
double  dxcoeff[],
const double  shift[],
double *  xmla,
double *  ymla
 

Plot a lens spectrum onto the CCD (table storage).

Parameters:
optics Optical structure
xppup 
yppup Mpup coordinates [px]
nlbda 
lbda Wavelength array to be plotted
order Order of dispersion
table Output table (previously created)
colid Output column IDs (previously created) xlbda_1, ylbda_1, ... , xlbda_nlbda, ylbda_nlbda
row Row in output table
lbdaref Ref. wavelength [AA]
pixsize Pixel size [mm]
dxnc Nb of coefficients in local adjustment
dxcoeff Coefficients of the local adjustment (1st-order)
shift Offset (NULL if none)
xmla 
ymla MLA coordinates [mm] Set to MAXDOUBLE if unknown (will then be computed)

Definition at line 662 of file proc_plot.c.

References SnifsOptics::filter, snifs_optics_CCD2MLA(), and snifs_optics_MLA2CCD().

Referenced by main().

Here is the call graph for this function:

void plot_array_err const PlotSymbol symbol,
float  x[],
float  y[],
int  n,
float  dx[],
float  dy[]
 

DISLIN curve with errors.

Parameters:
symbol PlotSymbol structure
x data-x
y data-y
n data size
dx sym. error in x (or NULL if none)
dy sym. error in y (or NULL if none)

Definition at line 715 of file proc_plot.c.

References PlotSymbol::color, PlotSymbol::shape, PlotSymbol::size, and x.

Referenced by main().

void plot_initialize Plot plot,
const char *  devname,
const PlotLimits limits,
const PlotSymbol symbol,
float  mincut,
float  maxcut
 

Initialize a Plot structure.

Parameters:
plot Plot structure
devname Device name (empty for ASCII)
limits PlotLimits structure (or NULL)
symbol PlotSymbol structure (or NULL)
mincut 
maxcut z-axis limits

Definition at line 758 of file proc_plot.c.

References PlotSymbol::color, Plot::devname, Plot::Limits, Plot::maxcut, Plot::mincut, PlotSymbol::shape, PlotSymbol::size, Plot::Symbol, PlotLimits::xmax, PlotLimits::xmin, PlotLimits::ymax, and PlotLimits::ymin.

Referenced by main(), model_distMLA(), and study_triangulation().


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