Changeset 4563
- Timestamp:
- Jul 15, 2005, 11:42:13 AM (21 years ago)
- Location:
- trunk/doc/modules
- Files:
-
- 2 edited
-
CameraImages.tex (modified) (7 diffs)
-
ModulesSDRS.tex (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/CameraImages.tex
r4555 r4563 157 157 faster. The cell also contains metadata containers for the concepts 158 158 and analysis, a link to the parent, and pointers to the various FITS 159 data, if that corresponds to this level. 159 data, if that corresponds to this level. A boolean indicates whether 160 the cell is of interest, allowing it to be excluded from analysis. 160 161 161 162 \begin{verbatim} … … 173 174 psArray *readouts; // The readouts (referred to by number) 174 175 pmChip *parent; // Parent chip 176 bool valid; // Do we bother about reading and working with this cell? 175 177 // FITS data 176 178 const char *extname; // Extension name, if it corresponds to this level … … 196 198 amplifiers on the device). The chip contains metadata containers for 197 199 the concepts and analysis, a link to the parent, and pointers to the 198 various FITS data, if that corresponds to this level. For astrometry, 199 in addition to the rough positioning information, it contains a 200 coordinate transform from the chip to the focal plane. It is expected 201 that this transform will consist of two second-order 2D polynomials; 202 hence we think that it is prudent to include a reverse transformation 203 which will be derived from numerically inverting the forward 204 transformation. 200 pointers to the various FITS data, if that corresponds to this level. 201 For astrometry, in addition to the rough positioning information, it 202 contains a coordinate transform from the chip to the focal plane. It 203 is expected that this transform will consist of two second-order 2D 204 polynomials; hence we think that it is prudent to include a reverse 205 transformation which will be derived from numerically inverting the 206 forward transformation. A boolean indicates whether the chip is of 207 interest, allowing it to be excluded from analysis. 205 208 206 209 \begin{verbatim} … … 217 220 psArray *cells; // The cells (referred to by name) 218 221 pmFPA *parent; // Parent FPA 222 bool valid; // Do we bother about reading and working with this chip? 219 223 // FITS data 220 224 const char *extname; // Extension name, if it corresponds to this level … … 240 244 of pieces of contiguous silicon). It contains metadata containers for 241 245 the concepts and analysis, a link to the parent, and pointers to the 242 various FITS data, if that corresponds to this level. For astrometry, 243 it contains a transformation from the focal plane to the tangent plane 244 and the fixed pattern residuals. It is expected that the 245 transformation will consist of two 4D polynomials (i.e.\ a function of 246 two coordinates in position, the magnitude of the object, and the 247 color of the object) in order to correct for optical distortions and 248 the effects of the atmosphere; hence we think that it is prudent to 249 include a reverse transformation which will be derived from 250 numerically inverting the forward transformation. 246 FITS header, if that corresponds to this level (the FPA may be the 247 PHU, but will not ever contain pixels). For astrometry, it contains a 248 transformation from the focal plane to the tangent plane and the fixed 249 pattern residuals. It is expected that the transformation will 250 consist of two 4D polynomials (i.e.\ a function of two coordinates in 251 position, the magnitude of the object, and the color of the object) in 252 order to correct for optical distortions and the effects of the 253 atmosphere; hence we think that it is prudent to include a reverse 254 transformation which will be derived from numerically inverting the 255 forward transformation. 251 256 252 257 \begin{verbatim} … … 263 268 psArray *chips; // The chips 264 269 // FITS data 265 const char *extname; // Extension name, if it corresponds to this level266 psArray *pixels; // The pixel data, if it corresponds to this level267 270 psMetadata *header; // The FITS header, if it corresponds to this level 268 271 } pmFPA; 269 272 \end{verbatim} 273 274 \tbd{Carrying the DB handle around in the pmFPA may not be what we 275 really want to do in the end (we might want to stuff it into a 276 separate structure with other sources of information), but for now this 277 serves as an approximation and a useful convenience.} 270 278 271 279 The constructor for \code{pmFPA} shall be: … … 367 375 extant \code{fpa}. 368 376 369 \tbd{Functions to remove things from an fpa so that only certain370 pieces of the FITS file are read in, and not the whole thing?}377 \tbd{Functions to set the valid booleans within an fpa so that only 378 certain pieces of the FITS file are read in, and not the whole thing?} 371 379 372 380 We specify an additional two functions to write out a focal plane -
trunk/doc/modules/ModulesSDRS.tex
r4555 r4563 1 %%% $Id: ModulesSDRS.tex,v 1.4 6 2005-07-15 00:54:03 price Exp $1 %%% $Id: ModulesSDRS.tex,v 1.47 2005-07-15 21:42:13 price Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 120 120 command line if provided, or from the the camera configuration (more 121 121 detail below). 122 123 \begin{prototype}124 bool pmConfigRead(psMetadata **site, psMetadata **camera, psMetadata **recipe,125 int *argc, char **argv, const char *recipeName);126 psMetadata *pmConfigCameraFromHeader(const psMetadata *site, const psMetadata *header);127 psMetadata *pmConfigRecipeFromCamera(const psMetadata *camera, const char *recipeName);128 \end{prototype}129 130 \code{pmConfigRead} shall load the \code{site} configuration131 (according to the above rule for determining the source). The132 \code{camera} configuration shall also be loaded if it is specified on133 the command line (\code{argc, argv}); otherwise it shall be set to134 \code{NULL}. The \code{recipe} shall also be loaded from the command135 line (if specified) or, if the camera configuration has been loaded,136 from the camera configuration and recipe specification therein (see137 below). In dealing with the command line parameters, the functions138 shall use the appropriate functions in psLib to retrieve and remove139 the relevant options from the argument list; this simplifies140 assignment of the mandatory arguments, since all the optional command141 line arguments are removed leaving only the mandatory arguments.142 143 \code{pmConfigCameraFromHeader} shall load the \code{camera}144 configuration based on the contents of the FITS \code{header}, using145 the list of known cameras contained in the \code{site} configuration.146 If more than one camera matches the FITS header, a warning shall be147 generated and the first matching camera returned.148 149 \code{pmConfigRecipeFromCamera} shall load the \code{recipe}150 configuration based on the \code{recipeName} and the list of known151 recipes contained in the \code{camera} configuration (details below).152 153 We also specify an additional function:154 \begin{prototype}155 bool pmConfigValidateCamera(psMetadata *camera, psMetadata *header);156 \end{prototype}157 158 This function, used by \code{pmConfigCameraFromHeader}, shall return159 \code{true} if the FITS \code{header} matches the rule contained in160 the \code{camera} configuration (see \S\ref{sec:camerarule});161 otherwise it shall return \code{false}.162 163 \subsubsection{Example usage}164 165 The following is provided as an example of how the above functions166 are envisioned in use.167 168 \begin{verbatim}169 int main(int argc, char *argv[])170 {171 // Parse other command-line arguments here172 psMetadata *site = NULL; // Site configuration173 psMetadata *camera = NULL; // Camera configuration174 psMetadata *recipe = NULL; // Recipe configuration175 if (! pmConfigRead(&site, &camera, &recipe, &argc, argv, "moduleName")) {176 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find site configuration!\n");177 exit(EXIT_FAILURE);178 }179 // Parse other command-line arguments here180 181 // The command-line argument list now contains only mandatory arguments182 // Assume the first of these is an input image183 char *imageName = argv[1]; // Name of FITS file184 psFits *imageFH = psFitsOpen(imageName, "r"); // File handle for FITS file185 if (! imageFH) {186 psLogMsg("moduleName", PS_LOG_ERROR, "Can't open input image %s\n", imageName);187 exit(EXIT_FAILURE);188 }189 psMetadata *header = psFitsReadHeader(NULL, imageFH); // FITS header190 191 if (!camera && !(camera = pmConfigCameraFromHeader(site, header))) {192 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find camera configuration!\n");193 exit(EXIT_FAILURE);194 }195 196 if (! recipe && !(recipe = pmConfigRecipeFromCamera(camera, "moduleName"))) {197 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find recipe configuration!\n");198 exit(EXIT_FAILURE);199 }200 201 // Now go on and do stuff202 ....203 }204 \end{verbatim}205 122 206 123 \subsection{Configuration Files} … … 225 142 the data. 226 143 \end{itemize} 144 145 \tbd{No doubt there is a need for better security than storing the 146 database password directly in the file, but we push this problem onto 147 the stack for now.} 148 149 \tbd{We will add other data sources in the future, e.g., file paths, 150 configuration for Nebulous and DVO, etc.}. 151 227 152 228 153 An example site configuration file: … … 341 266 CELLS METADATA 342 267 left METADATA # Left amplifier 268 CELL.BIASSEC.SOURCE STR HEADER 343 269 CELL.BIASSEC STR BIASSEC 270 CELL.TRIMSEC.SOURCE STR HEADER 344 271 CELL.TRIMSEC STR DATASEC 345 272 CELL.PARITY S32 1 … … 347 274 right METADATA # Right amplifier 348 275 # This cell is read out in the opposite direction 276 CELL.BIASSEC.SOURCE STR HEADER 349 277 CELL.BIASSEC STR BIASSEC 350 CELL.TRIMSEC STR DATASEC 278 CELL.TRIMSEC.SOURCE STR VALUE 279 CELL.TRIMSEC STR [1025:2048,1:2048] 351 280 CELL.PARITY S32 -1 352 281 END … … 358 287 associated with a chip, and has a cell type. 359 288 360 The \code{_SOURCE} keywords will be explained in \S\ref{sec:concepts}. 289 The \code{.SOURCE} keywords in the \code{CELLS}, explained in more 290 detail in \S\ref{sec:concepts}, are necessary in order to distinguish 291 a pointer to a header from an actual value. 361 292 362 293 \paragraph{Deriving concept values} … … 412 343 DEFAULTS METADATA 413 344 CELL.BAD S32 0 414 CELL.YPARITY _DEPEND STR CHIP.NAME345 CELL.YPARITY.DEPEND STR CHIP.NAME 415 346 CELL.YPARITY METADATA 416 347 ccd00 S32 -1 … … 421 352 END 422 353 423 # How to translat ionPS concepts into database lookups354 # How to translate PS concepts into database lookups 424 355 DATABASE METADATA 425 356 TYPE dbEntry TABLE COLUMN GIVENDBCOL GIVENPS … … 429 360 \end{verbatim} 430 361 431 The \code{ _DEPEND} entry in the \code{DEFAULTS} will be explained in362 The \code{.DEPEND} entry in the \code{DEFAULTS} will be explained in 432 363 \S\ref{sec:concepts}. 433 364 … … 463 394 configuration filename. 464 395 396 An example: 397 \begin{verbatim} 398 # Recipes for LRIS 399 RECIPES METADATA 400 PHASE1 STR lris_phase1.config 401 PHASE2 STR lris_phase2.config 402 PHASE4 STR lris_phase4.config 403 END 404 \end{verbatim} 405 465 406 \subsubsection{Recipe Configuration} 466 407 … … 481 422 level, while others are logically defined at the cell level. 482 423 483 Below is a list of concepts that the IPP should require, with the424 Below is a list of concepts that the IPP requires, with the 484 425 expected type and a short description. 485 426 … … 517 458 \item The \code{DEFAULTS} value. 518 459 \end{itemize} 519 When a concept is retrieved, it shall be stored in the cache to 520 optimise future retrieval. We have specified a cache and FITS header 521 storage in the various focal plane structures for the purposes of 522 concept retrieval. 460 When a concept is retrieved, it shall be stored in a cache (a 461 \code{psMetadata} within the FPA/chip/cell structures) to optimise 462 future retrieval. We have specified a cache and FITS header storage 463 in the various focal plane structures for the purposes of concept 464 retrieval. 523 465 524 466 Because of the variety of methods for specifying these concepts … … 528 470 529 471 In the \code{DEFAULTS} table in the camera configuration, we allow the 530 specification of the concept with an additional suffix, 531 \code{_DEPEND}. The value (of type \code{STR}) ofthe532 \code{CONCEPT_DEPEND} is the name of a concept on which the first533 concept depends. For example, it might depend on the chip name. Then 534 the first concept becomes of type \code{METADATA}, with the component 535 keywords being the value of the second concept (on which the first 536 depends). To avoid infinite recursion, no further dependency is 537 permitted. An example of thedependency:472 specification of the concept with an additional suffix, \code{DEPEND}. 473 The value (of type \code{STR}) of the \code{CONCEPT.DEPEND} is the 474 name of a concept on which the first concept depends. For example, it 475 might depend on the chip name. Then the first concept becomes of type 476 \code{METADATA}, with the component keywords being the value of the 477 second concept (on which the first depends). To avoid infinite 478 recursion, no further dependency is permitted. An example of the 479 dependency: 538 480 539 481 \begin{verbatim} 540 482 # Default PS concepts that may be specified by value 541 483 DEFAULTS METADATA 542 CELL.GAIN _DEPEND STR CHIP.NAME484 CELL.GAIN.DEPEND STR CHIP.NAME 543 485 CELL.GAIN METADATA 544 486 ccd00 F32 1.2 … … 551 493 In the FITS \code{TRANSLATION} table in the camera configuration, for 552 494 certain concepts we allow the specification of the concept with an 553 additional suffix, \code{ _FORMAT} which specifies the format of the495 additional suffix, \code{FORMAT} which specifies the format of the 554 496 FITS header. The value is dependent upon the particular concept. 555 497 … … 559 501 ways in FITS files, so care must be taken to specify what the format 560 502 is in the file under consideration. Permitted values of 561 \code{CELL.TIME _FORMAT} are:503 \code{CELL.TIME.FORMAT} are: 562 504 563 505 \begin{itemize} … … 591 533 The binning is usually specified in FITS headers either as separate 592 534 headers for the x and the y, or in the same FITS header separated by a 593 space or a comma. Permitted values of \code{CELL.BINNING _FORMAT} are:535 space or a comma. Permitted values of \code{CELL.BINNING.FORMAT} are: 594 536 595 537 \begin{itemize} 596 \item \code{SEPARATE}: The \code{CELL.BINNING} contains the headers 597 for the x and the y binning separated by whitespace or a comma. 598 \item \code{TOGETHER}: The value pointed to by \code{CELL.BINNING} 599 contains the x and y binning separated by whitespace and/or a comma. 538 \item \code{SEPARATE}: The \code{CELL.BINNING} contains the header 539 keywords for the x and the y binning separated by whitespace or a 540 comma. 541 \item \code{TOGETHER}: \code{CELL.BINNING} contains the keyword for 542 which the x and y binning are separated by whitespace and/or a 543 comma. 600 544 \end{itemize} 601 545 … … 604 548 The RA and Declination of the boresight might be specified in a few 605 549 ways. We need to specify both how the value is interpreted and the 606 units. \code{FPA.RA _FORMAT} and \code{FPA.DEC_FORMAT} should be one550 units. \code{FPA.RA.FORMAT} and \code{FPA.DEC.FORMAT} should be one 607 551 of the following: 608 552 … … 629 573 contain \code{CELL.GAIN} and \code{CELL.READNOISE} values as well 630 574 instead of going to the trouble of specifying these in the 631 \code{DEFAULTS} with a long \code{ _DEPENDS} listing.632 633 However, we need to specify for these where the value comes from. It634 should be sufficient to declare the following rules:575 \code{DEFAULTS} with a long \code{.DEPENDS} listing. 576 577 However, in some cases, we need to specify for these where the value 578 comes from. We declare the following rule: 635 579 636 580 \begin{itemize} 637 581 \item If the type is other than \code{STR}, then the concept has that 638 582 value for the cell. 639 \item If the type is \code{STR} and contains square brackets 640 \code{[]}, then it shall be interpreted as a value for one of the 641 image section concepts (\code{CELL.BIASSEC} and 642 \code{CELL.TRIMSEC}). 643 \item Otherwise, it shall be interpreted as a FITS header keyword 644 which will provide the value. 583 \item If the type is \code{STR}, then the value might potentially be 584 confused between being a header keyword or an actual value. For 585 this reason, we introduce an additional concept suffix, 586 \code{.SOURCE} (of type \code{STR}) which may be either 587 \code{HEADER} or \code{VALUE}. 645 588 \end{itemize} 646 589 647 These rules mean that we don't have to bother adding an additional 648 suffix like \code{_SOURCE}. 590 591 \subsection{Configuration APIs} 592 593 \begin{prototype} 594 bool pmConfigRead(psMetadata **site, psMetadata **camera, psMetadata **recipe, 595 int *argc, char **argv, const char *recipeName); 596 psMetadata *pmConfigCameraFromHeader(const psMetadata *site, const psMetadata *header); 597 psMetadata *pmConfigRecipeFromCamera(const psMetadata *camera, const char *recipeName); 598 \end{prototype} 599 600 \code{pmConfigRead} shall load the \code{site} configuration 601 (according to the above rule for determining the source). The 602 \code{camera} configuration shall also be loaded if it is specified on 603 the command line (\code{argc, argv}); otherwise it shall be set to 604 \code{NULL}. The \code{recipe} shall also be loaded from the command 605 line (if specified) or, if the camera configuration has been loaded, 606 from the camera configuration and recipe specification therein (see 607 below). In dealing with the command line parameters, the functions 608 shall use the appropriate functions in psLib to retrieve and remove 609 the relevant options from the argument list; this simplifies 610 assignment of the mandatory arguments, since all the optional command 611 line arguments are removed leaving only the mandatory arguments. 612 613 \code{pmConfigCameraFromHeader} shall load the \code{camera} 614 configuration based on the contents of the FITS \code{header}, using 615 the list of known cameras contained in the \code{site} configuration. 616 If more than one camera matches the FITS header, a warning shall be 617 generated and the first matching camera returned. 618 619 \code{pmConfigRecipeFromCamera} shall load the \code{recipe} 620 configuration based on the \code{recipeName} and the list of known 621 recipes contained in the \code{camera} configuration (details below). 622 623 We also specify an additional function: 624 \begin{prototype} 625 bool pmConfigValidateCamera(psMetadata *camera, psMetadata *header); 626 \end{prototype} 627 628 This function, used by \code{pmConfigCameraFromHeader}, shall return 629 \code{true} if the FITS \code{header} matches the rule contained in 630 the \code{camera} configuration (see \S\ref{sec:camerarule}); 631 otherwise it shall return \code{false}. 632 633 \subsubsection{Example usage} 634 635 The following is provided as an example of how the above functions 636 are envisioned in use. 637 638 \begin{verbatim} 639 int main(int argc, char *argv[]) 640 { 641 // Parse other command-line arguments here 642 psMetadata *site = NULL; // Site configuration 643 psMetadata *camera = NULL; // Camera configuration 644 psMetadata *recipe = NULL; // Recipe configuration 645 if (! pmConfigRead(&site, &camera, &recipe, &argc, argv, "moduleName")) { 646 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find site configuration!\n"); 647 exit(EXIT_FAILURE); 648 } 649 // Parse other command-line arguments here 650 651 // The command-line argument list now contains only mandatory arguments 652 // Assume the first of these is an input image 653 char *imageName = argv[1]; // Name of FITS file 654 psFits *imageFH = psFitsOpen(imageName, "r"); // File handle for FITS file 655 if (! imageFH) { 656 psLogMsg("moduleName", PS_LOG_ERROR, "Can't open input image %s\n", imageName); 657 exit(EXIT_FAILURE); 658 } 659 psMetadata *header = psFitsReadHeader(NULL, imageFH); // FITS header 660 661 if (!camera && !(camera = pmConfigCameraFromHeader(site, header))) { 662 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find camera configuration!\n"); 663 exit(EXIT_FAILURE); 664 } 665 666 if (! recipe && !(recipe = pmConfigRecipeFromCamera(camera, "moduleName"))) { 667 psLogMsg("moduleName", PS_LOG_ERROR, "Can't find recipe configuration!\n"); 668 exit(EXIT_FAILURE); 669 } 670 671 // Now go on and do stuff 672 .... 673 } 674 \end{verbatim} 649 675 650 676 \subsubsection{Lookups} … … 2660 2686 END 2661 2687 2662 # How to translat ionPS concepts into database lookups2688 # How to translate PS concepts into database lookups 2663 2689 DATABASE METADATA 2664 2690 TYPE dbEntry TABLE COLUMN GIVENDBCOL GIVENPS … … 2771 2797 2772 2798 2773 # How to translat ionPS concepts into database lookups2799 # How to translate PS concepts into database lookups 2774 2800 DATABASE METADATA 2775 2801 TYPE dbEntry TABLE COLUMN GIVENDBCOL GIVENPS … … 3086 3112 END 3087 3113 3088 # How to translat ionPS concepts into database lookups3114 # How to translate PS concepts into database lookups 3089 3115 DATABASE METADATA 3090 3116 TYPE dbEntry TABLE COLUMN GIVENDBCOL GIVENPS
Note:
See TracChangeset
for help on using the changeset viewer.
