|
UVES Pipeline Reference Manual
5.4.0
|
Functions | |
| static bool | illegal_position (const uves_iterate_position *p) |
| Find out if the current position is valid. | |
| uves_iterate_position * | uves_iterate_new (int nx, int ny, const polynomial *order_locations, int minorder, int maxorder, slit_geometry sg) |
| Allocate iterator. | |
| void | uves_iterate_delete (uves_iterate_position **p) |
| Deallocate iterator and set pointer to NULL. | |
| void | uves_iterate_set_first (uves_iterate_position *p, int xmin, int xmax, int ordermin, int ordermax, const cpl_binary *bpm, bool loop_y) |
| Initialize iteration. | |
| void | uves_iterate_increment (uves_iterate_position *p) |
| Get next position. | |
| bool | uves_iterate_finished (const uves_iterate_position *p) |
| Finished iterating? | |
| void | uves_iterate_dump (const uves_iterate_position *p, FILE *stream) |
| dump iterator (for debugging) | |
This class exists in order to be able to write
instead of repeating the same structure of nested loops + selections again and again in the extraction module. I.e. to avoid repetitions of (in pseudocode)
where only the "do something" part is different
|
static |
Find out if the current position is valid.
| p | iterator to check |
Definition at line 347 of file uves_extract_iterate.c.
Referenced by uves_iterate_increment(), and uves_iterate_set_first().
| uves_iterate_position* uves_iterate_new | ( | int | nx, |
| int | ny, | ||
| const polynomial * | order_locations, | ||
| int | minorder, | ||
| int | maxorder, | ||
| slit_geometry | sg | ||
| ) |
Allocate iterator.
| image | the image to iterate over |
| order_locations | order polynomial |
| minorder | first order (inclusive) in image |
| maxorder | last order (inclusive) in image |
| slit_geometry | extraction slit length and offset |
The iterator, pos, should be used in constructs like
The struct members
int order; int x, y; double ycenter; int ylow; int yhigh;
can be accessed inside the loop.
Definition at line 154 of file uves_extract_iterate.c.
Referenced by create_spectrum(), test_extract(), test_iterate(), and uves_extract().
| void uves_iterate_delete | ( | uves_iterate_position ** | p | ) |
Deallocate iterator and set pointer to NULL.
| p | iterator to delete |
Definition at line 178 of file uves_extract_iterate.c.
Referenced by create_spectrum(), test_extract(), test_iterate(), and uves_extract().
| void uves_iterate_set_first | ( | uves_iterate_position * | p, |
| int | xmin, | ||
| int | xmax, | ||
| int | ordermin, | ||
| int | ordermax, | ||
| const cpl_binary * | bpm, | ||
| bool | loop_y | ||
| ) |
Initialize iteration.
| p | iterator to initialize |
| xmin | minimum x bin |
| xmax | maximum x bin |
| ordermin | first order to iterate over |
| ordermax | last order to iterate over |
| bpm | image bad pixel map to use for this iteration. If NULL all pixels are considered good |
| loop_y | if true, the iteration is over (order, x, y). If false, the iteration is over (order, x) only, and the bpm is not used |
Definition at line 203 of file uves_extract_iterate.c.
References illegal_position(), uves_iterate_finished(), uves_iterate_increment(), and uves_polynomial_evaluate_2d().
Referenced by create_spectrum(), estimate_sn(), opt_extract(), opt_measure_profile(), opt_measure_profile_order(), opt_sample_spatial_profile(), opt_subtract_sky(), revise_noise(), test_iterate(), uves_create_image(), and uves_extract().
| void uves_iterate_increment | ( | uves_iterate_position * | p | ) |
Get next position.
| p | iterator to increment |
p is changed to contain the next position
Definition at line 246 of file uves_extract_iterate.c.
References illegal_position(), uves_iterate_finished(), and uves_polynomial_evaluate_2d().
Referenced by create_spectrum(), estimate_sn(), opt_extract(), opt_measure_profile(), opt_measure_profile_order(), opt_sample_spatial_profile(), opt_subtract_sky(), revise_noise(), test_iterate(), uves_create_image(), uves_extract(), and uves_iterate_set_first().
| bool uves_iterate_finished | ( | const uves_iterate_position * | p | ) |
Finished iterating?
| p | iterator to check |
This function should always be checked after calling uves_iterate_increment() and uves_iterate_set_first()
Definition at line 301 of file uves_extract_iterate.c.
Referenced by create_spectrum(), estimate_sn(), opt_extract(), opt_measure_profile(), opt_measure_profile_order(), opt_sample_spatial_profile(), opt_subtract_sky(), revise_noise(), test_iterate(), uves_create_image(), uves_extract(), uves_iterate_increment(), and uves_iterate_set_first().
| void uves_iterate_dump | ( | const uves_iterate_position * | p, |
| FILE * | stream | ||
| ) |
dump iterator (for debugging)
| p | iterator to check |
| stream | stream to write to |
Definition at line 314 of file uves_extract_iterate.c.
1.8.1.1