|
IIINSTRUMENT Pipeline Reference Manual 4.6.1
|
Functions | |
| cpl_error_code | visir_load_cube2_split (cpl_imagelist *alist, cpl_imagelist *blist, const irplib_framelist *rawframes, int pos, const int planestart, const int planeend) |
| Load and split the data in a CUBE2 file. | |
| cpl_bivector * | visir_load_lintable (cpl_frame *linframe, cpl_boolean is_spec) |
| load and normalize linearity table into a bivector | |
| cpl_image ** | visir_img_collapse_beam (cpl_propertylist *qclist, const cpl_image *self, const cpl_parameterlist *parlist, const char *recipename, visir_chopnod_mode mode, const cpl_propertylist *plist) |
| Collapse the 3/4 beams of a combined image. | |
| cpl_imagelist * | visir_inputs_combine (const char *recipename, const cpl_parameterlist *parlist, const irplib_framelist *rawframes, const char *badpix, const char *flat, int *nodding_p, cpl_boolean do_spc_fix, double wlen, visir_spc_resol resol) |
| The VISIR input data re-combination is performed here. | |
| cpl_image ** | visir_img_recombine_list (const char *recipename, const cpl_parameterlist *parlist, cpl_imagelist *nodded, const cpl_propertylist **plists, cpl_geom_combine combine_mode, cpl_boolean *pdid_resize) |
| The VISIR imaging combination using cross correlation. | |
| cpl_image ** | visir_img_recombine (const char *recipename, const cpl_parameterlist *parlist, const irplib_framelist *rawframes, const char *badpix, const char *flat, cpl_geom_combine combine_mode, cpl_boolean *pdid_resize, cpl_boolean do_spc_fix, double wlen, visir_spc_resol resol) |
| The VISIR imaging combination using cross correlation. | |
| cpl_imagelist * | visir_load_hcycle (const irplib_framelist *rawframes, int pos) |
| Load the HCYCLE images from a VISIR file. | |
| visir_aplist * | visir_aplist_new_from_file (const char *apfile) |
| Load the user-supplied apertures definition file. | |
| char * | visir_apdefs_dump (const visir_apdefs *ap) |
| Convert an aperture definition into its string representation. | |
| visir_apdefs * | visir_apdefs_new_from_line (char *line, int ident) |
| Parse a line from the user-supplied apertures definition file, creating a new visir_apdefs object. | |
| cpl_error_code | visir_image_reject_hot (cpl_image *self, const char *bpmfile) |
| Reject the hot pixels in an image. | |
| cpl_imagelist * | visir_imagelist_load_last (const irplib_framelist *rawframes) |
| Load the last frame of the input files to an image list. | |
| cpl_imagelist * | visir_load_imagelist (const irplib_framelist *rawframes, int pos, cpl_boolean is_interm) |
| Load either a INTERM or Half-Cycle cube from a VISIR file. | |
| char * visir_apdefs_dump | ( | const visir_apdefs * | ap | ) |
Convert an aperture definition into its string representation.
| ap | A pointer to the aperture definition |
Definition at line 1698 of file visir_inputs.c.
| visir_apdefs * visir_apdefs_new_from_line | ( | char * | line, |
| int | ident | ||
| ) |
Parse a line from the user-supplied apertures definition file, creating a new visir_apdefs object.
| line | A pointer to a char buffer containing the line from the definition file to be parsed |
Definition at line 1720 of file visir_inputs.c.
Referenced by visir_aplist_new_from_file().
| visir_aplist * visir_aplist_new_from_file | ( | const char * | apfile | ) |
Load the user-supplied apertures definition file.
| apfile | Path to file with user-supplied aperture definition, or NULL |
Definition at line 1655 of file visir_inputs.c.
References visir_apdefs_new_from_line().
| cpl_error_code visir_image_reject_hot | ( | cpl_image * | self, |
| const char * | bpmfile | ||
| ) |
Reject the hot pixels in an image.
| self | The image with hot pixels |
| bpmfile | Name of file with bad-pixel-map, or NULL |
Iff a name of a bad pixel map FITS file is provided it is used for the cleaning. Otherwise auto-cleaning is done.
Definition at line 1852 of file visir_inputs.c.
| cpl_imagelist * visir_imagelist_load_last | ( | const irplib_framelist * | rawframes | ) |
Load the last frame of the input files to an image list.
| rawframes | List of frames with identical number of planes |
Definition at line 1904 of file visir_inputs.c.
References visir_pfits_get_naxis3().
| cpl_image ** visir_img_collapse_beam | ( | cpl_propertylist * | qclist, |
| const cpl_image * | self, | ||
| const cpl_parameterlist * | parlist, | ||
| const char * | recipename, | ||
| visir_chopnod_mode | mode, | ||
| const cpl_propertylist * | plist | ||
| ) |
Collapse the 3/4 beams of a combined image.
| qclist | Append QC parameters here |
| self | The combined image to collapse |
| parlist | Parameterlist w. maximum allowed eccentricity |
| recipename | The recipe name in the parameterlist |
| mode | VISIR_CHOPNOD_PERPENDICULAR, _PARALLEL or _AUTO |
| plist | Propertylist of the 1st raw image |
The returned images array contains 2 images:
If not null, the returned image array arr must be deallocated like this: cpl_image_delete(arr[0]); cpl_image_delete(arr[1]); cpl_free(arr);
Definition at line 613 of file visir_inputs.c.
References visir_parameterlist_get_double(), visir_pfits_get_chop_posang(), visir_pfits_get_chop_throw(), visir_pfits_get_chopnod_dir(), and visir_pfits_get_pixscale().
| cpl_image ** visir_img_recombine | ( | const char * | recipename, |
| const cpl_parameterlist * | parlist, | ||
| const irplib_framelist * | rawframes, | ||
| const char * | badpix, | ||
| const char * | flat, | ||
| cpl_geom_combine | combine_mode, | ||
| cpl_boolean * | pdid_resize, | ||
| cpl_boolean | do_spc_fix, | ||
| double | wlen, | ||
| visir_spc_resol | resol | ||
| ) |
The VISIR imaging combination using cross correlation.
| recipename | The name of the calling recipe |
| parlist | the recipe parameter list |
| rawframes | the list of raw frames |
| badpix | the optionally user provided bad pixels map |
| flat | the optionally user provided flat field |
| combine_mode | The combine mode (first, union, intersect) |
| pdid_resize | Set to true if the combined image was resized |
| do_spc_fix | True iff spectro distortion correction is to be done |
| wlen | Central wavelength (ignored unless do_spc_fix is true) |
| resol | Spectral resolution (ignored unless do_spc_fix is true) |
The input files are first recombined to create the nodded images using visir_inputs_combine().
The created nodded images are then shifted and added to create the final combined image. The offsets stored in the SEQ.CUMOFFSETX and Y keywords of the frames whose nod_pos==1 are used as first estimate. If the offsets keywords are missing in the header, a user can provide an ascii file containing the x and y offsets of each input pair of file as here:
1 0 0 # correspond to file 1 2 -10 10 # correspond to file 4
A cross-correlation method is used to refine the offsets before the shift&add. The cross-correlation needs anchor points that typically are bright objects. These are automatically detected but can also be provided by the user through an ascii file containing as many lines as objects, and for each one the x and y positions of the object in the image:
1 125 135 # correspond to object 1
The returned images array contains 2 images:
If not null, the returned image array arr must be deallocated like this: cpl_image_delete(arr[0]); cpl_image_delete(arr[1]); cpl_free(arr);
Definition at line 1543 of file visir_inputs.c.
References visir_img_recombine_list(), and visir_inputs_combine().
| cpl_image ** visir_img_recombine_list | ( | const char * | recipename, |
| const cpl_parameterlist * | parlist, | ||
| cpl_imagelist * | nodded, | ||
| const cpl_propertylist ** | plists, | ||
| cpl_geom_combine | combine_mode, | ||
| cpl_boolean * | pdid_resize | ||
| ) |
The VISIR imaging combination using cross correlation.
| recipename | The name of the calling recipe |
| parlist | the recipe parameter list |
| nodded | List of nod combined images |
| plists | Array of property lists, same length as nodded images |
| combine_mode | The combine mode (first, union, intersect) |
| pdid_resize | Set to true if the combined image was resized |
recombine variant taking a list as input, see visir_img_recombine for documentation
Definition at line 1332 of file visir_inputs.c.
References visir_parameterlist_get_bool(), visir_parameterlist_get_int(), and visir_parameterlist_get_string().
Referenced by visir_img_recombine().
| cpl_imagelist * visir_inputs_combine | ( | const char * | recipename, |
| const cpl_parameterlist * | parlist, | ||
| const irplib_framelist * | rawframes, | ||
| const char * | badpix, | ||
| const char * | flat, | ||
| int * | nodding_p, | ||
| cpl_boolean | do_spc_fix, | ||
| double | wlen, | ||
| visir_spc_resol | resol | ||
| ) |
The VISIR input data re-combination is performed here.
| recipename | The name of the calling recipe |
| parlist | hte recipe parameter list |
| rawframes | the frames list |
| badpix | the optionally user provided bad pixels map |
| flat | the optionally user provided flat field |
| nodding_p | Optional, pre-allocated array for nodding positions |
| do_spc_fix | True iff spectro distortion correction is to be done |
| wlen | Central wavelength (ignored unless do_spc_fix is true) |
| resol | Spectral resolution (ignored unless do_spc_fix is true) |
The input list of files has to contain an even number if files: 2*n.
Let's suppose n=2. We have here 4 input files.
Each file is a 'INTERM' type of file produced by IRACE. If A and B are the two images produced by the 2 chopping positions, an 'INTERM' file contains (example with 3 chopping cycles):
A1-B1 ((A1-B1) + (A2-B2)) / 2 ((A1-B1) + (A2-B2) + (A3-B3)) / 3
The first step of the algorithm is to convert each of these 4 files in:
A1-B1 A2-B2 A3-B3
The glitches are removed from each image of each image set (if requested).
The image sets are purged from their bad images (if requested).
Each input file/cube (f) is then averaged (avg(f)) and normalised by a factor defined like this: factor(f) = nod_pos(f) * DIT * nimages * 2 where nod_pos(f) is 1 is the object is observed in the center of the image and -1 if the sky is observed in the center (object is on the side).
Each pair of files (f1, f2) is then reduce to one nodded image: nodded = (avg(f1)/factor(f1) + avg(f2)/factor(f2))/2
Each nodded image is then flatfielded and bad pixels corrected if requested.
If no bad pixel map is provided, and if the auto_bpm flag is set, the first file hcycle image is used to determine a map of bad pixels: the pixels whose value is bigger than VISIR_HCYCLE_BPM_THRESHOLD are flagged as bad.
Each nodded image (there should be 2 in this example) shall represent a bright star in the center with 2 shadows. The shadow comes from the chopping (A-B), and it is duplicated because of the nodding (2 files used to create nodded).
The nodded images are returned in an image set.
Two modes are allowed : the staring mode where all nod_pos=1 (no nodding) and the nodding mode where in each pair, there must be one nod_pos=1 and one nod_pos=-1.
The NODPOS keyword is used to determine if the object (val=A, nod_pos=1) or the sky (val=B, nod_pos=-1) is in the center. If this keyword is missing in the header, a user can provide an ascii file containing 0 (for A positions) or 1 (for B positions) in each line (as many lines as input files) :
1 0 2 1 3 1 4 0
If the passed nodding_p is not NULL, it must be a pointer to an allocated integers array containing one element per input frame. Something like nodding_p = cpl_malloc(nb_input_frames * sizeof(int)); must be done by the caller function. nodding_p is filled with 1 if the file correspond to an object observation, and with -1 for the sky.
The returned image set must be deallocated with cpl_imagelist_delete().
Definition at line 795 of file visir_inputs.c.
References visir_destripe_image(), visir_load_imagelist(), visir_parameterlist_get_bool(), visir_parameterlist_get_double(), visir_parameterlist_get_int(), visir_parameterlist_get_string(), visir_pfits_get_dit(), and visir_pfits_get_nodpos().
Referenced by visir_img_recombine().
| cpl_error_code visir_load_cube2_split | ( | cpl_imagelist * | alist, |
| cpl_imagelist * | blist, | ||
| const irplib_framelist * | rawframes, | ||
| int | pos, | ||
| const int | planestart, | ||
| const int | planeend | ||
| ) |
Load and split the data in a CUBE2 file.
| alist | The list to be filled with A-frames |
| blist | The list to be filled with B-frames |
| rawframes | The rawframes |
| pos | The position of the frame |
| planestart | Number of the first frame to load. Counting from 0 |
| planeend | Number of the last frame to load + 1. Counting from 0 |
The input VISIR file must have the format CUBE2 (DET FRAM TYPE = CUBE2) :
This function gets the chopping image set A1-B1, ..., (A1-B1+...+An-Bn)/n (also named INTERM-INT) out of it.
Definition at line 242 of file visir_inputs.c.
References visir_pfits_get_chop_ncycles(), and visir_pfits_get_naxis3().
| cpl_imagelist * visir_load_hcycle | ( | const irplib_framelist * | rawframes, |
| int | pos | ||
| ) |
Load the HCYCLE images from a VISIR file.
| rawframes | The rawframes |
| pos | The frame to load |
The input file is a VISIR file can have the format CUBE1 (DET FRAM TYPE = CUBE1) :
or the format CUBE2 (DET FRAM TYPE = CUBE2) :
This function gets the HCYCLE images
Definition at line 1643 of file visir_inputs.c.
References visir_load_imagelist().
| cpl_imagelist * visir_load_imagelist | ( | const irplib_framelist * | rawframes, |
| int | pos, | ||
| cpl_boolean | is_interm | ||
| ) |
Load either a INTERM or Half-Cycle cube from a VISIR file.
| rawframes | The rawframes |
| pos | The position of the frame |
| is_interm | True iff the the requested image type is INTERM |
Definition at line 1941 of file visir_inputs.c.
References visir_pfits_get_chop_ncycles(), and visir_pfits_get_naxis3().
Referenced by visir_inputs_combine(), visir_load_hcycle(), and visir_spc_phot_sensit_from_image().
| cpl_bivector * visir_load_lintable | ( | cpl_frame * | linframe, |
| cpl_boolean | is_spec | ||
| ) |
load and normalize linearity table into a bivector
| linframe | linearity table frame |
| is_spec | select spectroscopy data, if false select imaging |
Definition at line 536 of file visir_inputs.c.