Home

Documentation

Project Support

Changes in Version 1 of GraspExtrasSoftwareOtatool

Author:
isani
Timestamp:
Fri Mar 13 14:13:25 2009

Legend:

Unmodified
Added
Removed
Modified
  • GraspExtrasSoftwareOtatool

    v0 v1
      1  '''[wiki:GraspExtrasSoftware otatool]''' 
      2   
      3  An "OTA" is an Orthogonal Transfer Array CCD composed of 8x8 cells of (typ.) 500x500 or 600x600 each.  We have developed a tool to generate some quick image statistics and create a fix color stretch quicklook JPEG from an OTA image saved as a standard Iraf Multi-Extension FITS (MEF) with 64 image extensions.  With the proper keywords, otatool may be useful on other MEF images as well. 
      4   
      5   
      6  {{{ 
      7  % otatool -h 
      8  }}} 
      9   
      10  Currently produces the following help summary: 
      11   
      12  {{{ 
      13  OTA FITS Manipulation Tool v1.23 (svn 3567, Mar 13 2009) 
      14  usage: otatool [options] < inputfile.fits > outputfile.fits 
      15   
      16  where [options] can be (default values shown in [...]) 
      17          open=   Specify an open-filter or default input FITS file 
      18          blue=   For making color images, specify a blue-filter FITS file 
      19           red=   For making color images, specify a red-filter FITS file 
      20          dark=   Specify a dark calibration FITS file to subtract 
      21         j*peg=   [false] Output full sized JPEGs by name of each extension 
      22       jmosaic=   [false] Generate a mosaic JPEG of all cells/extensions 
      23        jthumb=   [false] Generate thumbnail JPEGs (1/8 size) of everything 
      24        jnoise=   [false] Generate RMS noise diag JPEG mosaic of full OTA 
      25        jc*map=   [gamma] Colormap (gamma, rainbow, or terra) 
      26        jgamma=   (Obsolete, ignored.) 
      27     jq*uality=   [95] JPEG quality factor (1 to 100) 
      28      ext*name=   Specify a single extension to extract, by its EXTNAME 
      29            x0=   Corner pixel x-coord of a cropping box. 
      30            y0=   Corner pixel y-coord of a cropping box. 
      31            xs=   Size in x of a region to crop. 
      32            ys=   Size in y of a region to crop. 
      33       prescan=   Override any row-prescan value in the FITS files 
      34     bias*norm=   [true] Normalize all overscan bias levels at 250 ADU 
      35    fancy*bias=   [false] Custom bias filter (not valid for science!) 
      36       ped*sub=   [true] Subtract pedestal if present (true/false) 
      37      gaussian=   [0.0] If >0, apply a blur of that FWHM (before scaling) 
      38    cut*levels=   [auto,auto] Force low and high ADU cut levels 
      39     ramp*jpeg=   [off] Just output a color-bar intensity ramp 
      40          flip=   [false] Flip image top-to-bottom 
      41    comp*osite=   [false] Convert from a MEF to a basic, composite FITS 
      42        median=   [false] Display median values of all cells 
      43         stats=   [false] Generate pedestal, bias, sky level and noise stats 
      44  ponstats*file=   Text input file with XRAY (gain) and LED (linearity) stats 
      45  up*date_keywords=   [false] Attempt to update FITS keywords with stats 
      46     statsfile=   Text file to create which contains statistics 
      47     cplotfile=   Create color plot from existing stats file 
      48      cplotccd=   Name of the ccd, such as "ota34" 
      49      cplotvar=   [rmsov] Variable to color-plot 
      50  (Do not type the *.  Letters after the * are optional.) 
      51  }}} 
      52   
      53  == Dark Subtraction == 
      54   
      55  Some day, '''otatool''' is supposed to be able to do a scaled DARK subtraction from the image before generating JPEGs so they look nicer, but this is '''untested and probably not working correctly.''' 
      56   
      57  ||'''option'''||'''description''' 
      58  ||dark=darkmef.fits|| 
      59   
      60  == True Color JPEG Generation == 
      61   
      62  The '''otatool''' utility can generate a realistic JPEG image of a scene if provided with FITS files with neutral filter, red, and blue (without anything in the scene changing.)  This functionality has '''not been used or tested recently and probably does not work correctly.'''  This just documents the options that belong with this mode of operation. 
      63   
      64  ||'''option'''||'''description''' 
      65  ||open=mef0.fits|| 
      66  ||blue=mef1.fits|| 
      67  ||red=mef2.fits|| 
      68   
      69  == False Color JPEG Generation == 
      70   
      71  More commonly, we use '''otatool''' to generate a false color image of a single FITS frame.  That mode of operation produces JPEG files with fixed names, so we run it in a separate subdirectory and then rename those output files.  (In the future, we may add another command line option to control the output names.)  Typical invocation for this mode of operation is: 
      72   
      73  {{{ 
      74  % otatool jpeg=true < mef.fits 
      75  % ls 
      76  < ... produces *.jpeg where "*" is the EXTNAME found in the FITS file. > 
      77  }}} 
      78   
      79  ||'''option'''||'''description''' 
      80  ||jpeg=true   ||Cause full 1:1 JPEGS to be generated for each image extension 
      81  ||jmosaic=true|| 
      82  ||jthumb=true || 
      83  ||jcmap=      ||Choose between colormaps called '''gamma''' (the default) '''rainbow''', and '''terra'''.  The '''gamma''' colormap is special because it modulates the brightness (using the '''rainbow''' colormap as a start) so that the steepest changes in brightness occur at the median of the image (see cutlevels=, below.) 
      84   
      85  == Statistics Generation == 
      86   
      87  You can use '''otatool''' to calculate the RMS of the overscan, or a part of the image in each extension and report the results to a "stats" text file.  This can happen at the same time as JPEG generation, or instead.  (Just specify all the relevant options and otatool will carry out the operations requested.)  Options related to statistics calculation are: 
      88   
      89  ||'''option'''||'''description''' 
      90  ||stats=true  ||Generate statistics 
      91  ||statsfile=foo.txt||Where to write the calculated numbers 
      92  ||prescan=    ||Normally, our practice is to remove prescan with the controller (using clv prescan=3 or 4 for OTAs, or prescan=50 for e2v for example.)  If the image still contains prescan pixels, you must tell otatool how many there are with this option so it can skip them. 
      93   
      94  Here is a description of the statistics values calculated in the stats files: 
      95   
      96  ||'''stats var'''||'''description''' 
      97  ||ped=           ||If a readout was performed with "bpp=32" and the FITS file was '''save'''d with "bpp=32" then otatool can report on the mean pedestal level in the pedestal image.  Usually, the pedestal image is subtracted from the data before saving but this can be a good diagnostic.  Pedestal levels should be within a few 100 ADU of 5000 (or whatever value you use for "readcal".) 
      98  ||bias=          ||Measures the bias level, in ADU.  '''This assumes otatool is looking in the right place for overscan.  See "prescan=" above, and notes below.''' 
      99  ||back=          ||Measures the mean level (above bias) in a portion of the image area.  The portion used is currently hardcoded into otatool.c 
      100  ||rmsped=        ||If you have a 32bpp STARGRASP FITS file (see ped= above) then this statistic reports the RMS in ADU of the pedestal.  Expect this to be quite high in many applications.  This is the uncorrelated sampling noise. 
      101  ||rmsvid=        ||If you have a 32bpp STARGRASP FITS file (see ped= above) then this statistic reports the RMS in ADU of the uncorrelated video sample.  Like rmsped=, it could also be quite high (100s of ADU sometimes) but should be similar to the rmsped value. 
      102  ||rmsov=         ||This is the RMS of the subtraction of (vid-ped) which is the 16-bit value normally delivered as the image, for pixels in the serial overscan region.  '''See notes below.''' 
      103   
      104  Additional RMS values for image regions (intended to be used on BIAS readouts only) are available if otatool has been compiled with "-DDO_STREAKY" in the Makefile.  These stats are: 
      105   
      106  ||'''stats var'''||'''description''' 
      107  ||rmsmask=       ||The RMS in ADU of part of the image (region used is hardcoded in otatool.c) after masking out any bright chip defects. 
      108  ||rmsrow=        ||The RMS in ADU of the same region, after applying a "row-by-row" bias correction to each pixel row individually. 
      109  ||rmsplane=      ||The RMS in ADU after the above treatment by rmsrow, but after fitting a plane to the image to take out any overall horizontal slope. 
      110  ||rmstilt=       ||The RMS in ADU after fitting a sloped bias correction to each individual row of pixels. 
      111   
      112  '''NOTE:''' The region which '''otatool''' uses for "overscan" statistics and the window where the rmsmask/row/plane/tilt are taken are fragile, and hardcoded into the program!  Most commonly, they can be confused by incorrect "prescan" setting.  '''otatool''' is usually only used on data that contains no serial prescan pixels!  The STARGRASP controller will read them and not transmit them if the '''clvset''' clocking pattern is set up with '''prescan=N'''.