HiRISE

HiRISE.HiColor
Class JitParser

java.lang.Object
  extended by HiRISE.HiColor.JitParser

public class JitParser
extends Object

JitParser Utilities for reading and writing jitter registration files.

Author:
Guy McArthur JitParser.java,v 1.9 2013/04/29 20:55:55 guym Exp

Field Summary
protected  float badnessLimit
          From configuration the max badness before a point is ignored
protected  int boxcarLength
          From configuration, the number of points to use in the running median
static Properties CCD_PAIRS
          ccd pairings ir-red and bg-red
static String[] COLOR_CCD_NAMES
          Names of the color CCDs
protected  Configuration config
          Our configuration
protected  float excludeLimit
          From configuration, the max diff from median before a point is ignored
static String ID
          CVS ID
 
Constructor Summary
JitParser()
          Create a new instance of JitParser with the default configuration
JitParser(String conf)
          Create a new instance of JitParser with a particular configuration
 
Method Summary
protected static boolean foundMatch(Map<String,String> map)
          Determines if enough data has been collected in a ControlPoint group to evaluate it.
static Set<CCD> getAvailableColorCCDs(Observation observation)
          Obtains the set of color CCDs that were available for jitter registration.
 JitData getJitData(CCD ccd)
          Analyze the data for a particular CCD.
static void main(String... args)
           
 Map<CCD,JitData> parse(Observation observation)
          Analyze all of the data for an observation.
protected  void parseCNetPVL(File file, JitData data)
          Parse Control File
protected  void parseFlatTab(File file, JitData data)
          Parse Flat File
protected  void parseRegDefs(File file, JitData data)
          Parse registration definition file for jitter parameters.
static void smooth(JitData data, int boxcarLength, float excludeLimit)
          Perform 'boxcar smoothing' algorithm on a set of jitter data.
protected  void writeCNetPVL(File file, JitData data)
          Writes a new Control Net (overwrites the existing file), setting points to ignore unless they are in the accepted series TODO finish and test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
CVS ID

See Also:
Constant Field Values

COLOR_CCD_NAMES

public static final String[] COLOR_CCD_NAMES
Names of the color CCDs


CCD_PAIRS

public static final Properties CCD_PAIRS
ccd pairings ir-red and bg-red


excludeLimit

protected float excludeLimit
From configuration, the max diff from median before a point is ignored


badnessLimit

protected float badnessLimit
From configuration the max badness before a point is ignored


boxcarLength

protected int boxcarLength
From configuration, the number of points to use in the running median


config

protected Configuration config
Our configuration

Constructor Detail

JitParser

public JitParser()
          throws Exception
Create a new instance of JitParser with the default configuration

Throws:
Exception - Invalid config file

JitParser

public JitParser(String conf)
          throws Exception
Create a new instance of JitParser with a particular configuration

Parameters:
conf - Path to config file
Throws:
Exception - PVL parameters could not be loaded
Method Detail

getAvailableColorCCDs

public static Set<CCD> getAvailableColorCCDs(Observation observation)
                                      throws Invalid_Argument_Exception,
                                             IOException
Obtains the set of color CCDs that were available for jitter registration. This includes RED, BG, and IR CCDs.

Parameters:
observation - The observation to parse
Returns:
Color CCDs available
Throws:
IOException - Jitreg source file could not be opened
Invalid_Argument_Exception - Bad Product_IDs in source file

parse

public Map<CCD,JitData> parse(Observation observation)
                       throws Invalid_Argument_Exception,
                              IOException
Analyze all of the data for an observation.

Parameters:
observation - The observation to parse
Returns:
Map from CCD to collected data instance
Throws:
Invalid_Argument_Exception - Bad observation ID
IOException - Files could not be parsed

getJitData

public JitData getJitData(CCD ccd)
                   throws Invalid_Argument_Exception,
                          IOException
Analyze the data for a particular CCD.

Parameters:
ccd - The CCD for which to parse data files
Returns:
The collected jitter data
Throws:
Invalid_Argument_Exception - Bad observation ID
IOException - Files could not be parsed

parseRegDefs

protected void parseRegDefs(File file,
                            JitData data)
                     throws IOException
Parse registration definition file for jitter parameters.

Parameters:
file - File object of .pvl file to be parsed
data - The jitter data we are collecting
Throws:
IOException - File is not in expected format or could not be parsed

parseFlatTab

protected void parseFlatTab(File file,
                            JitData data)
                     throws IOException
Parse Flat File

Parameters:
file - The jitter output flat file
data - The jitter data we are collecting
Throws:
IOException - File could not be opened

foundMatch

protected static final boolean foundMatch(Map<String,String> map)
Determines if enough data has been collected in a ControlPoint group to evaluate it.


parseCNetPVL

protected void parseCNetPVL(File file,
                            JitData data)
                     throws IOException
Parse Control File

Parameters:
file - Jitter output control net
data - The jitter data we are collecting
Throws:
IOException - File could not be opened

smooth

public static void smooth(JitData data,
                          int boxcarLength,
                          float excludeLimit)
Perform 'boxcar smoothing' algorithm on a set of jitter data. Points are taken from the matched series and placed in either the accepted, rejected or ignored (bad) series.

Parameters:
data - The collected data
boxcarLength - Number of points to use in smoothing at each point
excludeLimit - Values with an offset greater than this will be rejected

writeCNetPVL

protected void writeCNetPVL(File file,
                            JitData data)
                     throws IOException,
                            PVL_Exception
Writes a new Control Net (overwrites the existing file), setting points to ignore unless they are in the accepted series TODO finish and test

Parameters:
file - The control net file for a CCD
data - The smoothed jitter data for that CCD
Throws:
IOException - Could not write to file
PVL_Exception - Existing file not in expected format

main

public static void main(String... args)
                 throws Exception
Throws:
Exception

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona