uk.ac.leeds.ccg.andyt.grids.exchange
Class io

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.exchange.io

public class io
extends java.lang.Object

This class holds general utility methods for io.


Constructor Summary
io()
          Creates a new instance of io
 
Method Summary
static void gamOutputToGrid(java.io.File gamOutputFile, Grid2DSquareCellAbstract grid, double weight)
           
static void generateGamInput(java.io.File gamInputFile, Grid2DSquareCellAbstract countGrid, Grid2DSquareCellAbstract parGrid)
          Creates gamInputFile from the countFile and parFile.
static double[] getBasicGridInfo(java.io.File gridFile)
          Returns a double[] of grid information where; [0] = (double) ncols; [1] = (double) nrows; [2] = xllcorner; [3] = yllcorner; [4] = cellsize; [5] = noDataValue if it exists or Double.NEGATIVE_INFINITY otherwise
static java.lang.String getDefaultDataDirectory()
          Returns a default data directory
static void gridArray2CSV(Grid2DSquareCellAbstract[] gridArray, java.lang.String header, java.io.File csvFile)
          Generates CSV file from gridArray
static boolean isImageWriterAvailable(java.lang.String writerType)
          Returns true if writerType is available
static void xyFileToGAM(java.io.File parFile, java.io.File countFile, java.io.File gamFile, double radius, double xmin, double ymin, double xmax, double ymax)
           
 void xyFileToGrid(java.io.File xyFile, Grid2DSquareCellAbstract grid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

io

public io()
Creates a new instance of io

Method Detail

getDefaultDataDirectory

public static java.lang.String getDefaultDataDirectory()
Returns a default data directory


getBasicGridInfo

public static double[] getBasicGridInfo(java.io.File gridFile)
Returns a double[] of grid information where; [0] = (double) ncols; [1] = (double) nrows; [2] = xllcorner; [3] = yllcorner; [4] = cellsize; [5] = noDataValue if it exists or Double.NEGATIVE_INFINITY otherwise

Parameters:
gridFile - The File of the grid.

isImageWriterAvailable

public static boolean isImageWriterAvailable(java.lang.String writerType)
Returns true if writerType is available

Parameters:
writerType - - usually a well known text String for an image type

generateGamInput

public static void generateGamInput(java.io.File gamInputFile,
                                    Grid2DSquareCellAbstract countGrid,
                                    Grid2DSquareCellAbstract parGrid)
Creates gamInputFile from the countFile and parFile. The basic format is: id x y count par


xyFileToGrid

public void xyFileToGrid(java.io.File xyFile,
                         Grid2DSquareCellAbstract grid)

gamOutputToGrid

public static void gamOutputToGrid(java.io.File gamOutputFile,
                                   Grid2DSquareCellAbstract grid,
                                   double weight)

xyFileToGAM

public static void xyFileToGAM(java.io.File parFile,
                               java.io.File countFile,
                               java.io.File gamFile,
                               double radius,
                               double xmin,
                               double ymin,
                               double xmax,
                               double ymax)

gridArray2CSV

public static void gridArray2CSV(Grid2DSquareCellAbstract[] gridArray,
                                 java.lang.String header,
                                 java.io.File csvFile)
Generates CSV file from gridArray