Main Page | Class List | Directories | File List | Class Members | File Members

auto.c File Reference

AutoFlatField/AutoFocus. More...

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdarg.h>
#include "auto.h"
#include "acquisition.h"
#include "background.h"
#include "preview.h"
#include "ccu.h"
#include "instctrl.h"
#include "fitsoutput.h"
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_sort.h>
#include <gsl/gsl_fit.h>

Defines

#define SQR(a)   ((a)*(a))

Functions

void auto_image_statistics_changed (struct image_statistics_struct stat)
 called whenever the image statistics have changed.
void auto_calibration_finished (char *dummy)
 called whenever a callibration procedure (in auto.c) has finished
void auto_fail (char *description)
 called whenever something went severly wrong in auto.c, and automode needs to be stopped
void auto_error (char *description)
 called whenever something went wrong in auto.c, but automode can be kept active
void auto_success (char *description)
 called whenever something succeded in auto.c
void auto_set_timeout (double timeout)
 sets the timeout value for automated operations, and resets the timeout clock
void auto_check_timeout ()
 checks the timeout clock for automated operations
void auto_set_flat_minmax_exposuretime (double min, double max)
 sets the minimum and manximum exposuretime, that is accepted during automated flatfielding
int auto_check_exp_time (double time)
 checks whether a proposed exposuretime fits between the minimum and maximum limits for automated flatfileding.
void auto_start_flat (int gain, int sequence, long counts, int n)
 Starts the automated flatfielding mode.
void auto_start_focus ()
 Starts the automated focussing mode.
void auto_start_shutter_offset ()
 Starts the automated shutter offset calibration.
void auto_start_mask ()
 Starts the automated flatmask generation (deprected).
void auto_set_focus (double focus)
 Moving the telescope focus to a requested position.
double auto_get_counts (double time, int gain)
 Takes a test exposure and calculates the median of the test image.
double auto_get_fwhm (double time, int gain)
 Takes a test exposure and calculates the median of the fwhms of the test image (uses sextractor).
void auto_do_flat ()
 Acquires one automated flatfield.
void auto_do_mask ()
 Acquires one automated mask exposure (deprected).
void auto_do_shutter_offset ()
 does the automated shutter calibration
void auto_do_focus ()
 does the automated focussing procedure
void auto_stop_thread ()
 stops the automated mode

Variables

volatile double auto_flat_min_exposuretime = 0.3
volatile double auto_flat_max_exposuretime = 30.0
volatile double auto_exptime = 0.3
volatile int auto_sequence
volatile int auto_gain
volatile int auto_counts
volatile int auto_run_mode = 0
volatile int auto_flat_seq
volatile int auto_focus_seq
volatile int auto_first
volatile int auto_flats_todo
volatile int auto_flats_done
volatile int auto_timeout
volatile double auto_worst_fwhm = 5.0
timeval auto_start_time
image_statistics_struct auto_image_statistics
volatile int auto_image_statistics_done = 0
char auto_end_msg [1000]


Detailed Description

AutoFlatField/AutoFocus.

Copyright (C) 2001-2003 Dirk Huenniger (dhun@astro.uni-bonn.de)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.


Function Documentation

void auto_calibration_finished char *  dummy  ) 
 

called whenever a callibration procedure (in auto.c) has finished

Parameters:
dummy string describing the calibration that has just finished
Returns:
void
This function is called whenever a callibration procedure has finished.

int auto_check_exp_time double  time  ) 
 

checks whether a proposed exposuretime fits between the minimum and maximum limits for automated flatfileding.

Parameters:
time proposed exposuretime
Returns:
0 on Ok, -1 on Fail This function checks whether a proposed exposuretime fits between the minimum and maximum limits for automated flatfileding. The automeated mode is stopped if it does not.

void auto_check_timeout  ) 
 

checks the timeout clock for automated operations

Returns:
void
This function checks the timeout clock for automated operations and stops everything if timeout occurred

void auto_do_flat  ) 
 

Acquires one automated flatfield.

Returns:
void This function acquires one automated flatfield. It does the test exposure calcultes the exposuretime. Than it takes the actual Flatfield exposure and writes it to disk.

void auto_do_focus  ) 
 

does the automated focussing procedure

Returns:
void This function does the automated shutter calibration

void auto_do_mask  ) 
 

Acquires one automated mask exposure (deprected).

Returns:
void This function acquires one automated mask exposure. It has never been tested or used. Masks could be usefull for sextractor based astrometry.

void auto_do_shutter_offset  ) 
 

does the automated shutter calibration

Returns:
void This function does the automated shutter calibration

void auto_error char *  description  ) 
 

called whenever something went wrong in auto.c, but automode can be kept active

Parameters:
description string describing what went wrong
Returns:
void
This function is called whenever something went wrong in auto.c. This function does not stop anything. So the problem might go away after a while.

void auto_fail char *  description  ) 
 

called whenever something went severly wrong in auto.c, and automode needs to be stopped

Parameters:
description string describing what went wrong
Returns:
void
This function is called whenever something went wrong in auto.c. This function stops any automated procedures.

double auto_get_counts double  time,
int  gain
 

Takes a test exposure and calculates the median of the test image.

Parameters:
time the exposuretime of the test exposure
gain the readout gain of the test exposure
Returns:
the median of the test image in counts The function takes a test exposure and calculates the median of the test image

double auto_get_fwhm double  time,
int  gain
 

Takes a test exposure and calculates the median of the fwhms of the test image (uses sextractor).

Parameters:
time the exposuretime of the test exposure
gain the readout gain of the test exposure
Returns:
the median the fwhms of the test image The function takes a test exposure and calculates the median of the fwhms of the test image

void auto_image_statistics_changed struct image_statistics_struct  stat  ) 
 

called whenever the image statistics have changed.

This function is called whenever the image statistics have changed.

void auto_set_flat_minmax_exposuretime double  min,
double  max
 

sets the minimum and manximum exposuretime, that is accepted during automated flatfielding

Parameters:
min minimum
max maximum
Returns:
void
This function sets the minimum and manximum exposuretime, that is accepted during automated flatfielding

void auto_set_focus double  focus  ) 
 

Moving the telescope focus to a requested position.

Parameters:
focus the requested position
Returns:
void The function move the telescope focus to a requeseted position

void auto_set_timeout double  timeout  ) 
 

sets the timeout value for automated operations, and resets the timeout clock

Parameters:
timeout timout value in seconds
Returns:
void
This function sets the timeout value for automated operations

void auto_start_flat int  gain,
int  sequence,
long  counts,
int  n
 

Starts the automated flatfielding mode.

Parameters:
gain The readout gain of the CCD Controller
sequence The readout sequence of the CCD Controller
counts The requested median of the counts in the Flatfiled
n the number of flatfield exposures requested
Returns:
void This function checks whether a proposed exposuretime fits between the minimum and maximum limits for automated flatfileding. The automeated mode is stopped if it does not.

void auto_start_focus  ) 
 

Starts the automated focussing mode.

Returns:
void This function starts the automated focussing mode

void auto_start_mask  ) 
 

Starts the automated flatmask generation (deprected).

Returns:
void This function starts the automated flatmask generation (deprected). Flatmasks might be usefull in combination with pipepline based astrometric reduction systems (masks for sextractor). This function is neither tested nor used.

void auto_start_shutter_offset  ) 
 

Starts the automated shutter offset calibration.

Returns:
void This function starts the automated shutter offset calibration

void auto_stop_thread  ) 
 

stops the automated mode

Returns:
void This function stops the automated mode

void auto_success char *  description  ) 
 

called whenever something succeded in auto.c

Parameters:
description string describing what succeded
Returns:
void
This function is called whenever something succeded in auto.c. This function stops any automated procedures.


Variable Documentation

volatile int auto_counts
 

the requested median of the image in counts in automated flatfiedling

char auto_end_msg[1000]
 

A string describing how and why the automated operation ended

volatile double auto_exptime = 0.3
 

the exposuretime used for test exposures in automated flatfielding

volatile int auto_first
 

1 if the automated mode was just started, 0 otherwise

volatile double auto_flat_max_exposuretime = 30.0
 

the maximal exposuretime allowed for automated flatfielding

volatile double auto_flat_min_exposuretime = 0.3
 

the minimal exposuretime allowed for automated flatfielding

volatile int auto_flat_seq
 

the readout sequence used for test exposures in automated flatfielding

volatile int auto_flats_done
 

the number of flatfields to allready acquired

volatile int auto_flats_todo
 

the number of flatfields to be acquired

volatile int auto_focus_seq
 

the readout sequence used in automated focussing

volatile int auto_gain
 

the readout gain used in automated mode

struct image_statistics_struct auto_image_statistics
 

the image statistics of the image just acquired

volatile int auto_image_statistics_done = 0
 

1 if the image statics have been calculated and are ready to be read, 0 otherwise

volatile int auto_run_mode = 0
 

the run mode as defined in auto.h

volatile int auto_sequence
 

the readout sequence used in automated mode

struct timeval auto_start_time
 

the time when the automated mode was started

volatile int auto_timeout
 

the timeout value for automated operations in seconds

volatile double auto_worst_fwhm = 5.0
 

the worst fwhm that is still accepted as a best fwhm found in automated focussing


Generated on Fri Dec 16 22:23:35 2005 for gboccia by  doxygen 1.4.2