Changeset 11569
- Timestamp:
- Feb 1, 2007, 6:46:06 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/doc/config/config.tex (modified) (42 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/config/config.tex
r9815 r11569 1 %%% $Id: config.tex,v 1. 4 2006-11-01 02:54:16 price Exp $1 %%% $Id: config.tex,v 1.5 2007-02-02 04:46:06 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 4 4 % Basic document variables 5 \title{Pan-STARRS PS-1 Image Processing Pipeline Configurations}6 \subtitle{ Guide}7 \shorttitle{IPP C onfigurations}5 \title{Pan-STARRS Image Processing Pipeline} 6 \subtitle{Configuration Guide} 7 \shorttitle{IPP CG} 8 8 \author{Paul Price} 9 9 \audience{Pan-STARRS PMO} … … 11 11 \project{Pan-STARRS Image Processing Pipeline} 12 12 \organization{Institute for Astronomy} 13 \version{ 11}13 \version{DR} 14 14 \docnumber{PSDC-430-???} 15 15 … … 63 63 using a human-readable syntax. We therefore use these ``metadata 64 64 configuration'' (MDC) files as the basis for our configuration files. 65 When referring to entries in an MDC file, we use the convention that66 \code{NAME(TYPE)} refers to the item called \code{NAME}, with type 67 \code{ TYPE}.65 When referring to entries in an MDC file, we use the convention in 66 this document that \code{NAME(TYPE)} refers to the item called 67 \code{NAME}, with type \code{TYPE}. 68 68 69 69 The IPP uses configuration parameters on four levels: … … 97 97 \item The \code{-site} option\footnote{\code{-site} is used for C 98 98 programs. For Perl programs, we use the \code{Getopt::Long} module 99 which requires us to use :\code{--site}} on the command line if99 which requires us to use \code{--site}} on the command line if 100 100 provided; 101 101 \item The environment variable \code{PS_SITE}, if defined; or 102 \item \code{$HOME/.ipprc} otherwise. %$ 102 \item \code{$HOME/.ipprc} otherwise. %$ --- Balancing the former dollar sign for Emacs 103 103 \end{enumerate} 104 104 … … 116 116 and camera configuration files. 117 117 118 The \code{WORKDIR(STR)} entry gives a top-level working directory that 119 is prepended to all filenames used by the \code{pXtools}. This allows 120 the database to be moved to a different system (with different 121 directory structure) without having to search and replace all paths. 118 The \code{DATAPATH(METADATA)} entry contains a series of symbolic 119 links (of tyoe \code{STR}) to data directories. This allows data to 120 be moved to a different system (with different directory structure) 121 without having to search and replace all paths within the database; 122 and also to juggle multiple projects using the same configuration 123 file. In the Perl components of the IPP, we use \code{path://DIR} to 124 mean ``look up \code{DIR} in the \code{DATAPATH} to get the 125 directory''. 122 126 123 127 \subsubsection{Database setup} … … 132 136 \code{DBUSER(STR)} specifies the database user name. 133 137 134 \code{DBPASSWORD(STR)} specifies the database password. \tbd{This is135 an insecure method of storing what might be sensitive information. 136 This is to be revised in the future.}138 \code{DBPASSWORD(STR)} specifies the database password. 139 \tbd{DBPASSWORD is an insecure method of storing what might be 140 sensitive information. This is to be revised in the future.} 137 141 138 142 \subsubsection{Cameras} … … 156 160 157 161 \code{TIME(STR)} specifies the location of the time configuration file 158 for psLib. 162 for psLib. This is not too important, since the original installation 163 location is known by psLib. 159 164 160 165 \code{LOGLEVEL(S32)} specifies the logging level for \code{psLogMsg}. … … 164 169 165 170 \code{LOGDEST(STR)} specifies the log destination (see 166 \code{psMessageDestination} for acceptable formats). 171 \code{psMessageDestination} for acceptable formats). We recommend 172 setting this to \code{STDERR} to avoid problems associated with 173 higher-level programs attempting to parse unintended input from 174 \code{stdout}. 167 175 168 176 \code{TRACEFORMAT(STR)} specifies the trace format (see … … 170 178 171 179 \code{TRACEDEST(STR)} specifies the trace destination (see 172 \code{psMessageDestination} for acceptable formats). 180 \code{psMessageDestination} for acceptable formats). We recommend 181 setting this to \code{STDERR} to avoid problems associated with 182 higher-level programs attempting to parse unintended input from 183 \code{stdout}. 173 184 174 185 \code{TRACE(METADATA)} gives a list of trace facilities and their 175 186 accompanying levels (of type \code{S32}); see \code{psTraceSetLevel}. 176 It is useful to include at least \code{err}, with level \code{10}, 177 since this will print all error messages. 178 187 We recommend including at least \code{err}, with level \code{10}, 188 since this will print all error messages. Other useful traces to set 189 are \code{psModules.camera} for camera (and especially 190 \code{pmFPAfile}) operations; and \code{psLib.db} for database 191 lookups. 179 192 180 193 \subsection{Example} … … 184 197 185 198 PATH STR .:/my/home/.ipp # Default search path for configuration files 186 WORKDIR STR /my/data/disk/ # Top-level working directory 199 200 # Place your data directories here and refer to as path://PATH/remainder 201 DATAPATH METADATA 202 HERE STR /data/my/host/ 203 THERE STR /data/other/host/ 204 END 187 205 188 206 ### Database configuration … … 194 212 ### Setups for each camera system 195 213 CAMERAS METADATA 196 MCSHORT STR mcshort/camera.config 197 MCSHORT_CHIP STR mcshort_chip/camera.config 198 MCSHORT_FPA STR mcshort_fpa/camera.config 199 MEGACAM STR megacam/camera.config 200 MEGACAM_CHIP STR megacam_chipmosaic/camera.config 201 MEGACAM_FPA STR megacam_fpamosaic/camera.config 202 MEGACAM_DET STR megacam_detrended/camera.config 203 UCAM STR ucam/camera.config 204 UCAM_MOSAIC STR ucam_mosaic/camera.config 205 GPC1 STR gpc1/camera.config 206 LRIS_BLUE STR lris_blue/camera.config 207 LRIS_RED STR lris_red/camera.config 208 ISP STR isp/camera.config 209 SIMPLE STR simple/camera.config 214 CTIO_MOSAIC2 STR ctio_mosaic2/camera.config # CTIO MOSAIC2 camera, for ESSENCE 215 MEGACAM STR megacam/camera.config # Megacam, on CFHT 216 GPC1 STR gpc1/camera.config # Pan-STARRS GigaPixel Camera 1 217 ISP STR isp/camera.config # Pan-STARRS Imaging Sky Probe 218 SIMPLE STR simple/camera.config # Simple single-chip camera 210 219 END 211 220 … … 218 227 TRACEFORMAT STR THLNM # Trace format 219 228 TRACE METADATA # Trace levels 220 err S32 10 229 err S32 10 230 # psLib.db S32 10 231 # psModules.camera S32 10 221 232 END 222 233 223 234 RECIPES METADATA # Site-level recipes 224 PPMERGE STR ppMerge_template.config # Recipe for combination 225 PPSTATS_PHASE0 STR ppStats_phase0.config # Recipe for phase 0 processing 235 PPIMAGE STR recipes/ppImage.config # Image reduction 236 PPMERGE STR recipes/ppMerge.config # Image combination 237 PPSTATS STR recipes/ppStats.config # Image statistics 238 PPSTATS_PHASE0 STR recipes/ppStats_phase0.config # Image statistics for Phase 0 239 PSPHOT STR recipes/psphot.config # Photometry 240 PSASTRO STR recipes/psastro.config # Astrometry 226 241 END 227 242 \end{verbatim} … … 249 264 the \code{CAMERAS(METADATA)}, which lists cameras by name, with their 250 265 corresponding configuration file. Note that the \code{PATH(STR)} in 251 the site configuration defines the search path sfor these files.266 the site configuration defines the search path for these files. 252 267 253 268 \subsection{Contents} … … 257 272 stored in different formats (e.g., one amplifier per extension, vs all 258 273 amplifiers spliced together in the PHU). The camera configuration 259 contains the formats, the camera description, filter translation table, 260 recipes, rejection levels and file rules. 274 contains the formats, the camera description, filter translation 275 table, observation type translation table, recipes, rejection levels 276 and file rules. 261 277 262 278 \subsubsection{Formats} … … 280 296 \subsubsection{Filter translation table} 281 297 282 \tbd{EAM: This needs a better description of the purpose.} 283 284 \code{FILTER.ID(METADATA)} contains a list of filter identifications 285 (generally those found within the header), with a general term to 286 describe the filter, of type \code{STR}. 298 \code{FILTER.ID(METADATA)} contains a list of filter names (generally 299 those found within the FITS header; e.g., \code{r.MP9601}), with an 300 abstract name to describe the filter (e.g., \code{r}), of type 301 \code{STR}. This allows multiple descriptions of the same filter that 302 may exist in the FITS headers to be resolved as the same thing. 303 304 \subsubsection{Observation type translation table} 305 306 \code{OBSTYPE.TABLE(METADATA)} contains a list of observation types 307 (generally those found within the FITS header; e.g., \code{ZERO}), 308 with an abstract name to describe the observation type (e.g., 309 \code{BIAS}). This allows multiple descriptions of the same 310 observation type that may exist in the FITS headers to be resolved as 311 the same thing (e.g., \code{BIAS}, \code{ZERO} and \code{PEDESTAL} can 312 all be set to \code{BIAS}). 287 313 288 314 \subsubsection{Recipes} … … 335 361 the mean to the mean standard deviation of the mean; in terms of 336 362 standard deviations. \tbd{Confusing enough?} 363 \item \code{IMFILE.SN}: rejection level for the signal-to-noise at the 364 imfile level. 365 \item \code{EXP.SN}: rejection level for the signal-to-noise at the 366 exposure level. 337 367 \end{itemize} 338 368 Apart from \code{FILTER}, values that are set to zero are ignored. … … 341 371 be useful to define a type: 342 372 \begin{verbatim} 343 TYPE LIMITS FILTER EXPECTED IMFILE.MEAN IMFILE.STDEV EXP.MEAN EXP.STDEV EXP.MEANSTDEV ENSEMBLE.MEAN ENSEMBLE.STDEV ENSEMBLE.MEANSTDEV373 TYPE LIMITS FILTER EXPECTED IMFILE.MEAN IMFILE.STDEV EXP.MEAN EXP.STDEV EXP.MEANSTDEV ENSEMBLE.MEAN ENSEMBLE.STDEV ENSEMBLE.MEANSTDEV IMFILE.SN EXP.SN 344 374 \end{verbatim} 345 375 346 376 \subsubsection{File rules} 347 377 348 \tbd{EAM to fill this in} 378 \tbd{EAM to check and supplement this description.} 379 380 The file rules are one of the most important aspects of the camera 381 configuration, and one of the easiest to get wrong. When setting up a 382 new camera configuration and getting errors (or worse, segmentation 383 faults), check the file rules first. Try turning up the 384 \code{psModules.camera} trace level to see what's going on. 385 386 \code{FILERULES(METADATA)} lists the different types of files used in 387 the image processing, which specify how and when a file is read in and 388 written out. The files usually are of two or three components, 389 separated by a period (not for any particular reason except that's 390 what's been adopted); the first part specifies the program the file 391 will be used in, the second and third parts identify its role. For 392 example, \code{PPIMAGE.INPUT} specifies the input file for 393 \code{ppImage}; \code{PPIMAGE.OUTPUT.MASK} specifies the output mask 394 file from \code{ppImage}. 395 396 \subsubsubsection{Replacements} 397 398 Throughout the file rules, a syntax for defining strings from 399 variables is used: curly brackets \verb|{}| around an abstract name 400 are replaced by the program to obtain the proper value. Supported 401 abstract names are: 402 \begin{itemize} 403 \item \verb|{OUTPUT}| --- replaced with the output file root; 404 \item \verb|{CHIP.NAME}| --- replaced with the chip name; 405 \item \verb|{CHIP.N}| --- replaced with the chip number (printed \code{%02d}); 406 \item \verb|{CELL.NAME}| --- replaced with the cell name; 407 \item \verb|{CELL.N}| --- replaced with the chip number (printed \code{%02d}); 408 \item \verb|{EXTNAME}| --- replaced with the extension name; 409 \item \verb|{FILTER}| --- replaced with the filter name (without 410 applying the \code{FILTER.ID} translation table); 411 \item \verb|{FILTER.ID}| --- replaced with the filter identifier (after 412 applying the \code{FILTER.ID} translation table); 413 \item \verb|{CAMERA}| --- replaced with the instrument name (from \code{FPA.INSTRUMENT}); 414 \item \verb|{INSTRUMENT}| --- replaced with the instrument name (from \code{FPA.INSTRUMENT}); 415 \item \verb|{DETECTOR}| --- replaced with the detector name (from \code{FPA.DETECTOR}); and 416 \item \verb|{TELESCOPE}| --- replaced with the telescope name (from \code{FPA.TELESCOPE}). 417 \end{itemize} 418 419 (More could potentially be added. If one you greatly desire is 420 missing, please ask!) 421 422 423 \subsubsubsection{Redirections} 424 425 Entries with type \code{STR} are treated as symbolic links to another 426 line. For example, specifying: 427 \begin{verbatim} 428 PPIMAGE.OUTPUT STR PPIMAGE.OUTPUT.SPLIT 429 \end{verbatim} 430 means that the program will look up \code{PPIMAGE.OUTPUT.SPLIT} in the 431 place of \code{PPIMAGE.OUTPUT}. This allows a quick replacement if a 432 different output format is desired (e.g., \code{PPIMAGE.OUTPUT.MEF} 433 instead of \code{PPIMAGE.OUTPUT.SPLIT}). 434 435 \subsubsubsection{File types} 436 \label{sec:camera-filerules-types} 437 438 Both the input and output file rules use file types. The currently 439 supported file types are: 440 \begin{itemize} 441 \item \code{IMAGE} --- image data in FITS image format (treated as \code{F32}); 442 \item \code{MASK} --- mask data in FITS image format (treated as \code{U8}); 443 \item \code{WEIGHT} --- weight data in FITS image format (treated as \code{F32}) 444 \item \code{FRINGE} --- fringe image with fringe tables (one for each 445 cell) in FITS image format (image treated as \code{F32}); 446 \item \code{JPEG} --- image data in JPEG format (output only); 447 \item \code{CMP} --- object data in CMP format; 448 \item \code{CMF} --- object data in CMF format; 449 \item \code{RAW} --- object data in RAW format; 450 \item \code{SX} --- object data in SX format; and 451 \item \code{OBJ} --- object data in OBJ format. 452 \end{itemize} 453 454 \tbd{EAM to fill in details on the object formats.} 455 456 457 \subsubsubsection{Inputs} 458 459 It is useful to make the following \code{TYPE} declaration, which can 460 be used for all input files: 461 \begin{verbatim} 462 TYPE INPUT FILENAME.RULE FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA DATA.LEVEL FILE.TYPE 463 \end{verbatim} 464 The components are: 465 \begin{itemize} 466 \item \code{FILENAME.RULE} --- this specifies the rule for 467 constructing the filename. Options for doing so are: 468 \begin{itemize} 469 \item A simple filename, perhaps using the replacement syntax 470 defined above; 471 \item \code{@DETDB} to look up the appropriate file using the 472 detrend database (see \S\ref{sec:detrend-database}); or 473 \item \code{@FILES} to indicate that the input file(s) will be 474 specified on the command-line of the program. 475 \end{itemize} 476 \item \code{FILENAME.XTRA} --- \tbd{PAP is not entirely sure what this 477 is for; it may be unnecessary.} 478 \item \code{EXTNAME.RULE} --- This defines the extension name. 479 \tbd{Is this true? PAP thinks the camera format does that; this may 480 be unnecessary, or it may have to be tied into the camera format.} 481 \item \code{EXTNAME.XTRA} --- \tbd{PAP is not entirely sure what this 482 is for; it may be unnecessary.} 483 \item \code{DATA.LEVEL} --- the level of the hierarchy at which the 484 data is to be opened for reading. This should correspond to the 485 level of the extension in the FITS file, or higher. There are some 486 checks against the camera format that this is sensical, but don't 487 bet your life on it just yet. This is an important setting to check 488 if you're having problems. 489 \item \code{FILE.TYPE} --- the type of file, from the above list 490 (\S\ref{sec:camera-filerules-types}). 491 \end{itemize} 492 493 \subsubsubsection{Outputs} 494 495 It is useful to make the following \code{TYPE} declaration, which 496 can be used for all output files: 497 \begin{verbatim} 498 TYPE OUTPUT FILENAME.RULE FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA FILE.LEVEL DATA.LEVEL FILE.TYPE FILE.SAVE FILE.FORMAT 499 \end{verbatim} 500 The components are: 501 \begin{itemize} 502 \item \code{FILENAME.RULE} --- this specifies the rule for 503 constructing the filename. You most likely want to include 504 \verb|{OUTPUT}| somewhere here; Pan-STARRS convention is that 505 it goes at the front. 506 \item \code{FILENAME.XTRA} --- \tbd{PAP is not entirely sure what this 507 is for; it may be unnecessary.} 508 \item \code{EXTNAME.RULE} --- This defines the extension name. 509 \tbd{Is this true? PAP thinks the camera format does that; this may 510 be unnecessary, or it may have to be ties into the camera format.} 511 \item \code{EXTNAME.XTRA} --- \tbd{PAP is not entirely sure what this 512 is for; it may be unnecessary.} 513 \item \code{FILE.LEVEL} --- the level of the hierarchy at which a file 514 should be opened and the PHU written. This should correspond to the 515 level of the PHU. There are some checks against the camera format 516 that this is sensical, but don't bet your life on it just yet. This 517 is an important setting to check if you're having problems. 518 \item \code{DATA.LEVEL} --- the level of the hierarchy at which an 519 extension should be written. This should correspond to the level of 520 the extensions in the FITS file, or higher. There are some checks 521 against the camera format that this is sensical, but don't bet your 522 life on it just yet. This is an important setting to check if 523 you're having problems. 524 \item \code{FILE.TYPE} --- the type of file, from the above list 525 (\S\ref{sec:camera-filerules-types}). 526 \item \code{FILE.SAVE} --- whether this type of file should be saved 527 (\code{TRUE}) or not (\code{FALSE}). 528 \item \code{FILE.FORMAT} --- if the file format is to be changed, this 529 is the name of the file format (from the \code{FORMATS} metadata). 530 Otherwise, it is \code{NONE}. 531 \end{itemize} 532 349 533 350 534 \subsection{Example} … … 372 556 373 557 374 # Lookup table to go from filter ID to abstract name558 # Lookup table to go from FPA.FILTER to abstract name for the filter 375 559 FILTER.ID METADATA 376 560 u.MP9301 STR u … … 387 571 END 388 572 573 # Lookup table to go from FPA.OBSTYPE values to abstract name for the exposure type 574 OBSTYPE.TABLE METADATA 575 bias STR BIAS 576 zero STR BIAS 577 dark STR DARK 578 flat STR SKYFLAT 579 skyflat STR SKYFLAT 580 domeflat STR DOMEFLAT 581 object STR OBJECT 582 science STR OBJECT 583 END 389 584 390 585 # Recipe options 391 RECIPES METADATA 392 # Recipes for ppImage 393 PPIMAGE STR megacam/ppImage.config # Default: all (normal) options on 394 PPIMAGE_O STR megacam/ppImage_o.config # Overscan only 395 PPIMAGE_OB STR megacam/ppImage_ob.config # Overscan, bias only 396 PPIMAGE_OBD STR megacam/ppImage_obd.config # Overscan, bias, dark only 397 PPIMAGE_OBDF STR megacam/ppImage_obdf.config # Overscan, bias, dark, flat only 398 PPIMAGE_B STR megacam/ppImage_b.config # Bias only 399 PPIMAGE_D STR megacam/ppImage_d.config # Dark only 400 PPIMAGE_F STR megacam/ppImage_f.config # Flat only 401 PPIMAGE_J1 STR megacam/ppImage_j1.config # JPEG only; binning 1 402 PPIMAGE_J2 STR megacam/ppImage_j2.config # JPEG only; binning 2 403 PPIMAGE_N STR megacam/ppImage_n.config # Nothing significant; binning only 404 405 # Recipes for ppMerge 406 PPMERGE STR ppMerge_template.config # ppMerge recipe 407 PPMERGE_BIAS STR megacam/ppMerge_bias.config 408 PPMERGE_DARK STR megacam/ppMerge_dark.config 409 PPMERGE_FLAT STR megacam/ppMerge_flat.config 410 411 # Other recipes 586 RECIPES METADATA 587 # Other recipes 412 588 PSPHOT STR megacam/psphot.config # psphot details 413 589 PSASTRO STR megacam/psastro.config # psastro details 414 PPSTATS STR megacam/ppStats.config# ppStats recipe415 END 416 590 PPSTATS STR megacam/ppStats.config # ppStats recipe 591 PPIMAGE STR megacam/ppImage.config # ppImage recipe 592 END 417 593 418 594 # Rejection levels for detrend creation 419 REJECTION METADATA 420 TYPE LIMITS FILTER EXPECTED IMFILE.MEAN IMFILE.STDEV EXP.MEAN EXP.STDEV EXP.MEANSTDEV ENSEMBLE.MEAN ENSEMBLE.STDEV ENSEMBLE.MEANSTDEV 421 FLAT MULTI 422 423 BIAS LIMITS * 0 0 15 0 15 0 0 0 0 424 DARK LIMITS * 0 0 0 0 0 0 0 0 0 425 FLAT LIMITS * 0 0 0 0 0 0 0 0 0 426 FLAT LIMITS u 0 0 0 0 0 0 0 0 0 427 FLAT LIMITS g 0 0 0 0 0 0 0 0 0 428 FLAT LIMITS r 0 0 0 0 0 0 0 0 0 429 FLAT LIMITS i 0 0 0 0 0 0 0 0 0 430 FLAT LIMITS z 0 0 0 0 0 0 0 0 0 431 432 END 433 595 REJECTION METADATA 596 TYPE LIMITS FILTER EXPECTED IMFILE.MEAN IMFILE.STDEV EXP.MEAN EXP.STDEV EXP.MEANSTDEV ENSEMBLE.MEAN ENSEMBLE.STDEV ENSEMBLE.MEANSTDEV IMFILE.SN EXP.SN 597 FLAT MULTI 598 599 BIAS LIMITS * 0 1 5 0.5 3 0.5 3 3 0 0 0 600 DARK LIMITS * 0 1 5 0.5 3 0.5 3 3 0 0 0 601 FLAT LIMITS * 0 0 0 0 0 0 0 0 3 0 0 602 # FLAT LIMITS u 0 0 0 0 0 0 0 0 3 0 0 603 # FLAT LIMITS g 0 0 0 0 0 0 0 0 3 0 0 604 # FLAT LIMITS r 0 0 0 0 0 0 0 0 3 0 0 605 # FLAT LIMITS i 0 0 0 0 0 0 0 0 3 0 0 606 # FLAT LIMITS z 0 0 0 0 0 0 0 0 3 0 0 607 FRINGE LIMITS * 0 0 0 0 0 0 0 0 0 0 0 608 609 # FILTER is an additional qualifier, and may be "*" (or absent!), in which case it matches everything 610 # EXPECTED is the expected mean value 611 # IMFILE.MEAN is the maximum permitted mean value for an imfile, relative to the standard deviation 612 # IMFILE.STDEV is the maximum permitted standard deviation for an imfile 613 # EXP.MEAN is the maximum permitted mean value for an exposure, relative to the standard deviation 614 # EXP.STDEV is the maximum permitted standard deviation for an exposure 615 # EXP.MEANSTDEV is the maximum permitted mean standard deviation for an exposure relative to the mean 616 # ENSEMBLE.MEAN is the maximum permitted mean for an ensemble of exposures 617 # ENSEMBLE.STDEV is the maximum permitted standard deviation for an ensemble of exposures 618 # ENSEMBLE.MEANSTDEV is the maximum permitted mean standard deviation for an ensemble of exposures 619 # IMFILE.SN is the minimum permitted signal-to-noise for an imfile 620 # EXP.SN is the minimum permitted signal-to-noise for an exposure 621 # These values (all except FILTER) may be zero, in which case no clipping is applied. 622 623 END 624 434 625 435 626 FILERULES METADATA … … 496 687 \section{Camera format configuration} 497 688 498 The FITS data storage formation is a standard in the astronomical499 community for storing astronomical images. A FITS file consists of an 500 arbitrary number of coupled human readable \code{ASCII} header 501 segments and binary data segments. The headers describe the format 502 and layout of the data segments. The first of these groups is689 The FITS (Flexible Image Transport System) format is a standard in the 690 astronomical community for storing astronomical images. A FITS file 691 consists of an arbitrary number of coupled human readable \code{ASCII} 692 header segments and binary data segments. The headers describe the 693 format and layout of the data segments. The first of these groups is 503 694 traditionally called the ``primary header unit'' (PHU) and the rest 504 695 are referred to as ``extensions''. The header segments may contain … … 507 698 the data, the header metadata is not so consistently defined within 508 699 the astronomical community. Also, the flexibility of the data format 509 means that different representations are possible for the same510 fundamental collection of data.700 means that it is possible to construct a variety of different 701 representations for the same fundamental collection of data. 511 702 512 703 The purpose of the camera format file is to define how FITS files are … … 518 709 The camera formats for a particular camera are listed in the 519 710 \code{FORMATS} metadata of the camera configuration file. Note that 520 the \code{PATH (STR)} in the site configuration defines the search711 the \code{PATH} in the site configuration defines the search 521 712 paths for these files. 522 713 … … 525 716 The camera format specifies how a FITS file from a particular camera 526 717 is to be read. Different formats may be defined for a single camera 527 (e.g., one amplifier per extension, vs all amplifiers spliced together 528 in the PHU). The camera format configuration file contains the rules 529 for recognising the format, how to read the file, the contents of a 530 FITS file, data appropriate to different types of cells, information 531 on how to determine the concepts from the headers, default values, or 532 database, and expected formats for certain concepts. 718 (e.g., one amplifier per extension, or all amplifiers spliced together 719 in the PHU, or anything in between). The camera format configuration 720 file contains the rules for recognising the format, how to read the 721 file, the contents of a FITS file, data appropriate to different types 722 of cells, information on how to determine the concepts from the 723 headers, default values, or database, and expected formats for certain 724 concepts. 533 725 534 726 \subsubsection{Rules for recognising} 535 727 536 \code{RULE(METADATA)} contains a list of telescope headers with537 expected values (of the appropriate type) for this particular 538 combination of the camera and format. It is often useful to include 539 \code{TELESCOP} and \code{DETECTOR}, if possible, along with any other 540 headers that uniquely identify the camera and format. Note that all 541 of the headers must match exactly (modulo leading and trailing spaces 542 for strings), including the data type and value, for the rule to 543 match, and that the first format's rule to match is accepted. If a 544 rule doesn't match the header, try adjusting the types (especially for 545 numerical types; tryS32 for integers, F32 and F64 for floats).728 \code{RULE(METADATA)} contains a list of FITS headers with expected 729 values (of the appropriate type) for this particular combination of 730 the camera and format. It is often useful to include \code{TELESCOP} 731 and \code{DETECTOR}, if possible, along with any other headers that 732 uniquely identify the camera and format. Note that all of the headers 733 must match exactly (modulo leading and trailing spaces for strings), 734 including the data type and value, for the rule to match, and that the 735 first format's rule to match is accepted. If a rule doesn't match the 736 header, try adjusting the types (especially for numerical types --- 737 use S32 for integers, F32 and F64 for floats). 546 738 547 739 \subsubsection{How to read the file} … … 551 743 In the simplest case, the camera consists of a single chip consisting 552 744 of a single cell always read with a single readout. In this case, the 553 image data could be written as part of the primary header unit. In a 554 more complex case with multiple chips and multiple cells, the data may 555 be organized in several ways. The data may be distributed into 556 multiple files or in multiple FITS data extensions. A single camera 557 image may be written as a collection of files for individual chips 558 with separate extensions for each cell (CFH12K.split, GPC). Another 559 camera may write a single file with multiple extensions for each cell 560 (Megacam.raw), or multiple extensions per chip, with each cell 561 representing portions of the chip image (Megacam.splice, CFHT-IR). 745 image data is generally written as part of the primary header unit. 746 However, in a more complex case with multiple chips and multiple 747 cells, the data may be organized in several ways. The data may be 748 distributed into multiple files or in multiple FITS data extensions 749 within a single file.. A single camera image may be written as a 750 collection of files for individual chips with separate extensions for 751 each cell (CFH12K.split, GPC). Another camera may write a single file 752 with multiple extensions for each cell (Megacam.raw), or multiple 753 extensions per chip, with each cell representing portions of the chip 754 image (Megacam.splice, CFHT-IR). 562 755 563 756 In all of these representations, there are only two basic distinctions … … 565 758 entire FITS file corresponds to (FPA, chip, or cell), and what level 566 759 the extensions correspond to (chip, cell or no extensions at all). 567 Knowing these, and having a list of the extensions, we can construct568 the Focal Plane hierarchy.760 Knowing these, and having a list of the contents of each extension, we 761 can construct the Focal Plane hierarchy. 569 762 570 763 \code{FILE(METADATA)} contains information on how to read the FITS … … 583 776 with the same value of \code{FPA.NAME} can be admitted to the same 584 777 FPA structure. 585 \item \code{CHIP.NAME(STR)} ( necessaryif \code{PHU} is \code{CHIP} or778 \item \code{CHIP.NAME(STR)} (only required if \code{PHU} is \code{CHIP} or 586 779 \code{CELL}) specifies a PHU header keyword that identifies the name 587 780 of the chip. The purpose is to identify to which chip in the 588 781 hierarchy the file belongs. 589 \item \code{CELL.NAME(STR)} ( necessaryif \code{PHU} is \code{CELL})782 \item \code{CELL.NAME(STR)} (only required if \code{PHU} is \code{CELL}) 590 783 specifies a PHU header keyword that identifies the name of the cell 591 784 within the chip. The purpose is to identify to which cell in the 592 785 hierarchy the file belongs. 593 \item \code{CONTENT(STR)} ( necessaryif \code{EXTENSIONS} is786 \item \code{CONTENT(STR)} (only required if \code{EXTENSIONS} is 594 787 \code{NONE} and \code{PHU} is \code{CHIP} or \code{CELL}) specifies 595 788 a key to the \code{CONTENTS} menu (see below). The purpose is to … … 599 792 \code{CELL.NAME} only; \tbd{future concepts may be permitted in the 600 793 future if there exists sufficient demand}. This allows such a 601 construct as \ code{\{CHIP.NAME\}_\{CELL.NAME\}}to identify a794 construct as \verb|{CHIP.NAME}_{CELL.NAME}| to identify a 602 795 combination of chip and cell. 603 796 \end{itemize} … … 611 804 contents of an extension: the chip and cell to which a component 612 805 belongs, and the type of the cell (see \S\ref{sec:cell_data} for cell 613 types), with the symbolic names separated by colons. The triplets may614 be listed one after the other, separated by whitespace, where an 615 extension contains more than one cell.806 types), with the symbolic names separated by colons. Where an 807 extension contains more than one cell, the triplets are listed one 808 after the other, separated by whitespace. 616 809 617 810 \begin{itemize} … … 642 835 here, since these differ according to the cell type. Since there is 643 836 ambiguity in what the values here refer to (if the concept is of type 644 \code{STR}), we also require an additional entry with \code{.SOURCE} 837 \code{STR}, then the value could be a header name or the actual value 838 to use), we also require an additional entry with \code{.SOURCE} 645 839 suffixed to the concept name, with the value (of type \code{STR}) 646 840 being \code{VALUE} to indicate that the concept is specified by value, … … 652 846 name may vary depending on the cell type. For example, the Megacam 653 847 spliced format uses \code{TSECA} and \code{TSECB} to specify the trim 654 sections for the left and right amplifiers .]848 sections for the left and right amplifiers, respectively.] 655 849 656 850 \subsubsection{Concepts from headers} … … 661 855 the concept is ingested. No distinction is made between the PHU and 662 856 extension headers, but inheritance (look at the PHU if it's not in the 663 extension header) should be the normal behaviour. Multiple header s664 may be given for certain concepts:857 extension header) should be the normal behaviour. Multiple header 858 keywords (separated by whitespace) may be given for certain concepts: 665 859 \begin{itemize} 666 860 \item \code{FPA.TIME} and \code{CELL.TIME} to specify the date and 667 time in separate headers861 time (in that order) are contained in separate header keywords. 668 862 \item \code{CELL.BIASSEC} to specify multiple bias regions (e.g., a 669 863 prescan and an overscan). … … 719 913 indicates the date is a julian date. 720 914 \item \code{CELL.X0}, \code{CELL.Y0}, \code{CHIP.X0} and 721 \code{CHIP.Y0}: \code{FORTRAN} indicates that the corner corresponds 722 to corner (1,1); if missing, assumes that the corner is at (0,0). 915 \code{CHIP.Y0}: \code{FORTRAN} indicates that the corner lower 916 left-hand pixel corresponds to coordinates (1,1); if missing, 917 assumes that the corner is at (0,0). 723 918 \end{itemize} 724 919 … … 729 924 \code{DATABASE}: 730 925 \begin{itemize} 731 \item \code{FPA.CAMERA}: Camera used 926 \item \code{FPA.TELESCOPE}: Telescope used 927 \item \code{FPA.INSTRUMENT}: Instrument used 928 \item \code{FPA.DETECTOR}: Detector used 929 \item \code{FPA.CAMERA}: Camera used; \tbd{To be deprecated?} 732 930 \item \code{FPA.FOCUS}: Telescope focus 733 931 \item \code{FPA.AIRMASS}: Airmass at boresight 734 932 \item \code{FPA.FILTER}: Filter used 933 \item \code{FPA.FILTERID}: Filter identifier (parsed through the 934 \code{FILTER.ID} translation table in the camera configuration). 735 935 \item \code{FPA.POSANGLE}: Position angle of instrument 736 936 \item \code{FPA.RADECSYS}: Celestial coordinate system … … 743 943 \item \code{FPA.TIMESYS}: Time system 744 944 \item \code{FPA.TIME}: Time of exposure 945 \item \code{FPA.TEMP}: Temperature of the focal plane 946 \item \code{FPA.EXPOSURE}: Exposure time for the focal plane 745 947 \item \code{CHIP.XPARITY}: Orientation in x compared to the rest of the FPA 746 948 \item \code{CHIP.YPARITY}: Orientation in y compared to the rest of the FPA … … 1174 1376 to. In addition, they may be specified in the site configuration and 1175 1377 the camera configuration under the \code{RECIPES} metadata. Note that 1176 the \code{PATH (STR)} in the site configuration defines the search1378 the \code{PATH} in the site configuration defines the search 1177 1379 paths for these files. 1178 1380 1179 \subsubsection{Symbolic links} 1180 1181 Symbolic links to another recipe may be specified on the command line, 1182 removing the need for the user to memorise a file name: e.g., 1183 \code{-recipe PPIMAGE PPIMAGE_BIAS} might perform a bias subtraction 1184 only. A symbolic link is recognised as such if the value is the name 1185 of a recipe that has already been read (and the link is immediately 1186 resolved), or if no filename of that name exists (in which case the 1187 link is to be resolved later, as further sources become available). 1188 1189 \subsubsection{Precedence} 1190 1191 If multiple recipes have the same name, the precedence order is: 1192 \begin{enumerate} 1193 \item Command-line 1194 \item Camera configuration 1195 \item Site configuration 1196 \end{enumerate} 1197 with sources higher in this list having greater precedence. This 1198 allows the user to override any recipes using the command-line, and to 1199 specify bottom-level defaults in the site configuration while also 1200 having camera-specific recipes in the camera configurations. 1381 \subsubsection{Recipe combination} 1382 1383 A single recipes are defined at multiple levels (site, camera, and 1384 command-line), so it's important to know how these are loaded. The 1385 site configuration recipes serve as the default recipes. Once the 1386 particular camera is known, the values contained within its recipes 1387 (provided either as a filename or as a symbolic link; see below for 1388 symbolic links) override those defined in the site configuration 1389 (unless the value has been declared as \code{MULTI}, in which case it 1390 supplements). This is useful because recipes often depend on the 1391 camera from which the data being processed originated; for example, 1392 not all cameras require a dark to be subtracted. 1393 1394 Finally, the command line can be used to provide further refinement. 1395 A recipe can be defined on the command line using \code{-recipe 1396 RECIPE_NAME filename.config} to specify a file containing the recipe, 1397 or \code{-recipe RECIPE_NAME ALTERNATE_RECIPE_NAME} to specify an 1398 symbolic link from which to inget values for the original recipe. 1399 1400 Symbolic links offer the ability to override the default recipe values 1401 by specifying a name, rather than a filename. A symbolic link can 1402 refer to a recipe of a different name that has already been defined, 1403 or it can refer to a \code{METADATA} within the recipe of that same 1404 name. 1405 1406 A few examples are useful here. Say the site configuration contains: 1407 \begin{verbatim} 1408 RECIPES METADATA 1409 RECIPE STR recipe_default.config 1410 RECIPE_EXOTIC STR recipe_exotic.config 1411 END 1412 \end{verbatim} 1413 1414 The camera configuration has: 1415 \begin{verbatim} 1416 RECIPES METADATA 1417 RECIPE STR recipe_camera.config 1418 END 1419 \end{verbatim} 1420 1421 \code{recipe_default.config} has: 1422 \begin{verbatim} 1423 VALUE STR Default 1424 1425 RECIPE_DULL METADATA 1426 VALUE STR Dull 1427 END 1428 \end{verbatim} 1429 1430 1431 \code{recipe_exotic.config} has: 1432 \begin{verbatim} 1433 VALUE STR Exotic 1434 \end{verbatim} 1435 1436 And \code{recipe_camera.config} has: 1437 \begin{verbatim} 1438 VALUE STR Camera 1439 \end{verbatim} 1440 1441 Then: 1442 \begin{itemize} 1443 \item If the recipe is examined without knowing the camera, 1444 \code{VALUE} will be \code{Default}. 1445 \item If the recipe is examined once the camera is known, \code{VALUE} 1446 will be \code{Camera}. 1447 \item If the command-line contains \code{-recipe RECIPE recipe_exotic.config}, 1448 \code{VALUE} will be \code{Exotic}. 1449 \item If the command-line contains \code{-recipe RECIPE RECIPE_EXOTIC}, 1450 \code{VALUE} will be \code{Exotic}. 1451 \item If the command-line contains \code{-recipe RECIPE RECIPE_DULL}, 1452 \code{VALUE} will be \code{Dull}. 1453 \end{itemize} 1454 1201 1455 1202 1456 \subsection{Contents} … … 1243 1497 good choice). 1244 1498 \end{itemize} 1499 \tbd{Non-linearity correction is implemented but not tested.} 1245 1500 \item \code{OVERSCAN.SINGLE(BOOL)} indicates if the entire overscan is 1246 1501 to be reduced to a single value. … … 1253 1508 overscan: \code{MEAN} or \code{MEDIAN}. \tbd{Would like to change 1254 1509 this to allow the full range of statistics.} 1510 \item \code{FRINGE.ITER(S32)} specifies the number of rejection iterations for fringe solution. 1511 \item \code{FRINGE.REJ(F32)} specifies the rejection threshold (in standard deviations) for fringe solution. 1512 \item \code{FRINGE.KEEP(F32)} specifies the minimum fraction of points to keep in the fringe solution. 1255 1513 \item \code{BIN1.XBIN(S32)} gives the level 1 binning in x 1256 1514 \item \code{BIN2.YBIN(S32)} gives the level 1 binning in y … … 1258 1516 \item \code{BIN2.YBIN(S32)} gives the level 2 binning in y: 1259 1517 \item \code{PHOTCODE.RULE(STR)} gives a rule for producing a 1260 photometry code, with values in curly brackets interpolated. 1518 photometry code, with values in curly brackets interpolated in the 1519 same manner as the file rules in the camera configuration. 1520 \item \code{PPIMAGE.JPEG1(METADATA)} and \code{PPIMAGE.JPEG2(METADATA)} give parameters for JPEG scaling, and contains: 1521 \begin{itemize} 1522 \item \code{COLORMAP(STR)} specifies the colormap to use: 1523 \code{greyscale}, \code{-greyscale} (inverse greyscale), 1524 \code{rainbow}, \code{heat}. 1525 \item \code{SCALE.MODE(STR)} specifies how the scaling is performed: \code{RANGE} or \code{FRACTION}. 1526 \item \code{SCALE.MIN(F32)} specifies the minimum scale. 1527 \item \code{SCALE.MAX(F32)} specifies the maximum scale. 1528 \end{itemize} 1261 1529 \end{itemize} 1262 1530 … … 1305 1573 OVERSCAN.STAT STR MEAN # MEAN | MEDIAN 1306 1574 1575 # Fringe subtraction options 1576 FRINGE.ITER S32 10 # Number of rejection iterations for fringe solution 1577 FRINGE.REJ F32 2.0 # Rejection threshold for fringe solution 1578 FRINGE.KEEP F32 0.5 # Minimum fraction to keep in fringe solution 1579 1307 1580 # binned output image options 1308 1581 BIN1.XBIN S32 8 … … 1310 1583 BIN2.XBIN S32 64 1311 1584 BIN2.YBIN S32 64 1585 1586 PPIMAGE.JPEG1 METADATA 1587 COLORMAP STR -greyscale 1588 SCALE.MODE STR RANGE 1589 SCALE.MIN F32 -5.0 1590 SCALE.MAX F32 20.0 1591 END 1592 1593 PPIMAGE.JPEG2 METADATA 1594 COLORMAP STR greyscale 1595 SCALE.MODE STR FRACTION 1596 SCALE.MIN STR 0.50 1597 SCALE.MAX STR 2.00 1598 END 1312 1599 1313 1600 PHOTCODE.RULE STR {CAMERA}.{FILTER.ID}.{CHIP.N} … … 1332 1619 \item \code{MASKVAL(S32)} gives the mask value for input data. 1333 1620 \item \code{COMBINE(STR)} gives the statistic to use for combination. 1334 \item \code{BACKGROUND(STR)} gives the statistic to use to measure the background. 1621 \item \code{MEAN(STR)} gives the statistic to use to measure the mean. 1622 \item \code{STDEV(STR)} gives the statistic to use to measure the standard deviation. 1623 \item \code{WEIGHTS(BOOL)} specifies whether image (Poisson) weights should be used in the combination. 1624 \item For combining a fringe: 1625 \begin{itemize} 1626 \item \code{FRINGE.NUM(S32)} specifies the number of fringe regions for fringe combination. 1627 \item \code{FRINGE.SIZE(S32)} specifies the half-size of the fringe regions. 1628 \item \code{FRINGE.XSMOOTH(S32)} specifies the number of smoothing regions in x. 1629 \item \code{FRINGE.YSMOOTH(S32)} specifies the number of smoothing regions in y. 1630 \end{itemize} 1631 \item For generating a shutter correction: 1632 \begin{itemize} 1633 \item \code{SHUTTER.SIZE(S32)} specifies the size for shutter measurement regions. 1634 \item \code{SHUTTER.ITER(S32)} specifies the number of iterations for performing the shutter measurement. 1635 \item \code{SHUTTER.REJECT(F32)} specifies the rejection limit for shutter measurement. 1636 \end{itemize} 1637 \item For generating a bad pixel mask: 1638 \begin{itemize} 1639 \item \code{MASK.SUSPECT(F32)} specifies the threshold for suspect pixels (in standard deviations). 1640 \item \code{MASK.BAD(F32)} specifies the threshold for bad pixels 1641 (in standard deviations); if negative, assume it's something like 1642 a Poisson distribution. 1643 \end{itemize} 1335 1644 \end{itemize} 1336 1645 1337 Statistics specified by a string (for \code{COMBINE} and 1338 \code{BACKGROUND}) may be one of \code{MEAN}, \code{MEDIAN}, 1339 \code{ROBUST}, \code{FITTED} or \code{CLIPPED}. 1646 Mean statistics specified by a string (for \code{COMBINE}, 1647 \code{MEAN}) may be one of \code{MEAN}, \code{MEDIAN}, \code{ROBUST}, 1648 \code{FITTED} or \code{CLIPPED}. The standard deviation statistic 1649 (\code{STDEV}) may be one of \code{STDEV}, \code{ROBUST_STDEV}, 1650 \code{FITTED_STDEV}, or \code{CLIPPED_STDEV}. 1651 1340 1652 1341 1653 \subsubsubsection{Example} … … 1344 1656 # Recipe configuration for ppMerge 1345 1657 1346 ROWS S32 128# Number of rows to read at once1658 ROWS S32 512 # Number of rows to read at once 1347 1659 ELECTRONS F32 100.0 # Minimum number of electrons for useful signal 1348 1660 SAMPLE S32 100 # Sampling factor for measuring the background 1349 REJ F32 3.0 # Rejection threshold (sigma) 1350 ITER S32 1 # Number of rejection iterations 1351 FRACHIGH F32 0.3 # Fraction of high pixels to reject immediately 1352 FRACLOW F32 0.1 # Fraction of low pixels to reject immediately 1353 NKEEP S32 5 # Minimum number of pixels in stack to keep 1354 MASKVAL S32 0xff # Mask value for input data 1355 ### Statistics options: MEAN | MEDIAN | ROBUST | FITTED | CLIPPED 1356 COMBINE STR MEAN # Statistic to use for combination: 1357 BACKGROUND STR MEDIAN # Statistic to use to measure the background 1661 REJ F32 3.0 # Rejection threshold (sigma) 1662 ITER S32 1 # Number of rejection iterations 1663 FRACHIGH F32 0.0 # Fraction of high pixels to reject immediately 1664 FRACLOW F32 0.0 # Fraction of low pixels to reject immediately 1665 NKEEP S32 5 # Minimum number of pixels in stack to keep 1666 FRINGE.NUM S32 10000 # Number of fringe regions 1667 FRINGE.SIZE S32 5 # Half-size of fringe regions 1668 FRINGE.XSMOOTH S32 5 # Number of smoothing regions in x 1669 FRINGE.YSMOOTH S32 11 # Number of smoothing regions in y 1670 SHUTTER.SIZE S32 128 # Size for shutter measurement regions 1671 SHUTTER.ITER S32 1 # Number of iterations for shutter measurement 1672 SHUTTER.REJECT F32 2 # Rejection limit for shutter measurement 1673 MASK.SUSPECT F32 5.0 # Threshold for suspect pixels (sigma) 1674 MASK.BAD F32 -4.0 # Threshold for bad pixels (sigma) 1675 MASKVAL S32 0xff # Mask value for input data 1676 COMBINE STR CLIPPED # Statistic to use for combination 1677 MEAN STR ROBUST_MEDIAN # Statistic to use to measure the mean 1678 STDEV STR ROBUST_STDEV # Statistic to use to measure the stdev 1679 WEIGHTS BOOL FALSE # Use image weights? 1358 1680 \end{verbatim} 1359 1681
Note:
See TracChangeset
for help on using the changeset viewer.
