Class Auto

java.lang.Object
edu.wisc.ssec.mcidasv.adt.Auto

public class Auto extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static int[][]
     
    private static int[][]
     
    private static int[][]
     
    private static double[]
    Array containing element coordinates
    private static double[][]
     
    private static double[][]
     
    private static double[][]
     
    private static int
     
    private static int
     
    private static double[][]
     
    private static double[]
    Array containing line coordinates
    private static int
    Minimum block size (bytes) for domap
    private static int
    Minimum block size (lines)
    private static int[][]
     
    private static double[][]
     
    private static Remap
     
    private static double
     
    private static double[][]
     
    private static double[][]
     
    private static TiffVars
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    AutoMode1(String ForecastFile, int ForecastFileType)
    Determine storm position at time CurrentTime using NHC/JTWC forecast discussion products.
    static double[]
    AutoMode2(double InputLatitudePosition, double InputLongitudePosition)
    Additional automatic positioning of storm center location using official forecasts from NHC or JTWC as input.
    private static int
    BWImage(int ConnectednessValue, int NumberRows, int NumberColumns)
     
    private static double[]
    CalcScores(double FirstGuessLatitude, double FirstGuessLongitude, double SpiralCenterLatitude, double SpiralCenterLongitude, double SpiralCenterScoreValue, double RingFitLatitude, double RingFitLongitude, double RingFitScoreValue)
    This routine will determine the confidence scores for the spiral fitting and ring fitting routines and calculate the best possible position for the storm center based upon a combination of the two methods, if available.
    private static void
    CircleFilt(int RingRadiusInput)
     
    private static void
    Corner(int NumberOfCornersInput, int LineSplineInput, int ElementSplineInput)
    Compute transformations at corners.
    private static void
    Interpolate between two arrays of different size.
    private static int
    DoMap(int NumberOfCornersInput, int LineSplineInput, int ElementSplineInput)
     
    private static int
    Find(int[] InputArray, int InputValue)
     
    private static int[]
    FindPoint(double latitude, double longitude)
    Find specific lat/lon location in array and return index values.
    private static double[]
    FindRingScore(double FirstGuessLatitude, double FirstGuessLongitude, double[][] RingScoreAnalysisField)
    Find Ring score at selected location (spiral analysis location)
    private static void
    Gradient(double[][] TemperatureInputArray, int ElementXNumber, int LineYNumber, double LongitudeIncrement, double LatitudeIncrement)
     
    private static int
    IND(int y, int x)
     
    private static double[]
    Inds2LaloFloat(int XAxisPosition, int YAxisPosition, double[][] LatitudeArrayInput, double[][] LongitudeArrayInput, int ElementXNumber, int LineYNumber)
     
    private static int
    Init(int LineSplineInput, int ElementSplineInput)
    Compute number of corners for transformation and block sizes.
    private static int[]
    Lalo2IndsFloat(double LatitudeInput, double LongitudeInput, double[][] LatitudeArrayInput, double[][] LongitudeArrayInput, int ElementXNumber, int LineYNumber)
     
    private static void
    MeshGrid(double TemperatureThresholdValue, int MoatSignCheckFlag)
     
    private static void
    MoatMaskCalc(double MoatMaskTempThreshold, double RingFitMaxRadiusDegree, int MoatSignCheckFlag)
     
    private static double[]
    PickFinalLocation(int InputPositioningID, double ForecastLatitude, double ForecastLongitude, double RingSpiralLatitude, double RingSpiralLongitude, double RingSpiralScore, int RingSpiralSelectionIDValue)
    Determine method location scheme to use by examining various empirically-defined confidence factors.
    private static void
    Calls routines to setup transformation, transform, data move.
    private static double[]
    RingFit(double RingFitFirstGuessLatitude, double RingFitFirstGuessLongitude)
     
    private static double[]
    SpiralCenterLowRes(double InputLatitude, double InputLongitude)
     
    private static int[]
    UMap(int LineValueInput, int ElementValueInput)
    Provide coordinates between original point and transformed point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Auto

      public Auto()
  • Method Details

    • AutoMode1

      public double[] AutoMode1(String ForecastFile, int ForecastFileType) throws IOException
      Determine storm position at time CurrentTime using NHC/JTWC forecast discussion products. Time and location information from these products are then interpolated to time in question to derive a estimated storm position. If position estimation cannot be calculated, a lat/lon position of -99.5/-999.5 will be returned. Inputs : None Outputs : Latitude_Return - estimated latitude position Longitude_Return - estimated longitude position PositioningMethodID_Return - method used to derive storm location Return : -43 : Error w/ forecast file open and BAD extrapolation -44 : Invalid forecast file and BAD extrapolation -45 : Error w/ forecast file read and BAD extrapolation -46 : Error w/ forecast interpolation and BAD extrapolation 42 : GOOD INTERPOLATION 43 : Error w/ forecast file open but GOOD EXTRAPOLATION 44 : Invalid forecast file but GOOD extrapolation 45 : Error w/ forecast file read but GOOD extrapolation 46 : Error w/ forecast interpolation but GOOD EXTRAPOLATION 0 : Subroutine Error
      Throws:
      IOException
    • AutoMode2

      public static double[] AutoMode2(double InputLatitudePosition, double InputLongitudePosition) throws IOException
      Additional automatic positioning of storm center location using official forecasts from NHC or JTWC as input. Storm location will be estimated using spiral fitting and ring fitting routines derived by Tony Wimmers in his MatLab routines (which have been converted). The final position will be determined utilizing empirically defined confidence factors for each method. The final storm position will be returned along with a position determination flag.
      Parameters:
      InputLatitudePosition - Storm center latitude.
      InputLongitudePosition - Storm center longitude. Outputs : Latitude_Return - final storm center latitude position Longitude_Return - final storm center longitude position PositioningMethodID_Return - method used to derive storm location 0-error 1-interpolation of operational forecast 2-Laplacian analysis (not used anymore) 3-Warm Spot location 4-10^ log spiral analysis 5-Combo method of spiral and ring analyses 6-linear extrapolation from prior locations Return : Error flag = 0
      Throws:
      IOException
    • SpiralCenterLowRes

      private static double[] SpiralCenterLowRes(double InputLatitude, double InputLongitude)
    • Gradient

      private static void Gradient(double[][] TemperatureInputArray, int ElementXNumber, int LineYNumber, double LongitudeIncrement, double LatitudeIncrement)
    • RingFit

      private static double[] RingFit(double RingFitFirstGuessLatitude, double RingFitFirstGuessLongitude)
    • Lalo2IndsFloat

      private static int[] Lalo2IndsFloat(double LatitudeInput, double LongitudeInput, double[][] LatitudeArrayInput, double[][] LongitudeArrayInput, int ElementXNumber, int LineYNumber)
    • Inds2LaloFloat

      private static double[] Inds2LaloFloat(int XAxisPosition, int YAxisPosition, double[][] LatitudeArrayInput, double[][] LongitudeArrayInput, int ElementXNumber, int LineYNumber)
    • CircleFilt

      private static void CircleFilt(int RingRadiusInput)
    • MoatMaskCalc

      private static void MoatMaskCalc(double MoatMaskTempThreshold, double RingFitMaxRadiusDegree, int MoatSignCheckFlag)
    • MeshGrid

      private static void MeshGrid(double TemperatureThresholdValue, int MoatSignCheckFlag)
    • BWImage

      private static int BWImage(int ConnectednessValue, int NumberRows, int NumberColumns)
    • Find

      private static int Find(int[] InputArray, int InputValue)
    • CalcScores

      private static double[] CalcScores(double FirstGuessLatitude, double FirstGuessLongitude, double SpiralCenterLatitude, double SpiralCenterLongitude, double SpiralCenterScoreValue, double RingFitLatitude, double RingFitLongitude, double RingFitScoreValue)
      This routine will determine the confidence scores for the spiral fitting and ring fitting routines and calculate the best possible position for the storm center based upon a combination of the two methods, if available. If the ring fitting routine does not determine a good candidate position, the spiral fitting routine will be used alone. If the spiral fitting routine candidate point is not "good", the forecast point will be selected.
      Parameters:
      FirstGuessLatitude - First Guess latitude.
      FirstGuessLongitude - First Guess longitude.
      SpiralCenterLatitude - Spiral Analysis latitude at max location.
      SpiralCenterLongitude - Spiral Analysis longitude at max location.
      SpiralCenterScoreValue - Spiral Analysis Score value.
      RingFitLatitude - Ring Analysis latitude at max score location.
      RingFitLongitude - Ring Analysis longitude at max score location.
      RingFitScoreValue - Ring Analysis Score value.
      Returns:
      Array of four double values. The values represent: latitude of final selected location, longitude of final selected location, confidence score of final selected location, and the "method" used to determine the final selected location. Possible values for the method: 1 for first guess, 2 for enhanced spiral analysis, and 5 for combo ring/spiral analysis.
    • FindRingScore

      private static double[] FindRingScore(double FirstGuessLatitude, double FirstGuessLongitude, double[][] RingScoreAnalysisField)
      Find Ring score at selected location (spiral analysis location)
      Parameters:
      FirstGuessLatitude - Latitude of search location.
      FirstGuessLongitude - Longitude of search location.
      RingScoreAnalysisField - - Array/Grid of Ring Analysis scores.
      Returns:
      Array of two doubles. The first value will be either -1 (if nothing was found) or 1 (if found). The second value is the value at search location in ring analysis grid (if the first value is 1).
    • PickFinalLocation

      private static double[] PickFinalLocation(int InputPositioningID, double ForecastLatitude, double ForecastLongitude, double RingSpiralLatitude, double RingSpiralLongitude, double RingSpiralScore, int RingSpiralSelectionIDValue)
      Determine method location scheme to use by examining various empirically-defined confidence factors. Confidence factors will be derived, with the "most confident" value used as the final automatically determined storm position.
      Parameters:
      ForecastLatitude - NHC/JTWC interpolated latitude position.
      ForecastLongitude - NHC/JTWC interpolated longitude position.
      RingSpiralLatitude - Ring/Spiral Analysis latitude position.
      RingSpiralLongitude - Ring/Spiral Analysis longitude position.
      RingSpiralScore - Ring/Spiral Analysis confidence factor score.
      RingSpiralSelectionIDValue - Ring/Spiral Analysis position derivation method.
      Returns:
      Array of three doubles. First value is latitude to be used, second value is longitude to be used, and the third value is the method used to determine storm position values.
    • RemapData

      private static void RemapData()
      Calls routines to setup transformation, transform, data move. Input data provided with global variable arrays containing original and transformed arrays.
    • DetermineDest

      private static void DetermineDest()
      Interpolate between two arrays of different size.
    • Init

      private static int Init(int LineSplineInput, int ElementSplineInput)
      Compute number of corners for transformation and block sizes.
      Parameters:
      LineSplineInput - Spline function for line values.
      ElementSplineInput - Spline function for element values.
      Returns:
      Total number of corners to interpolate.
    • Corner

      private static void Corner(int NumberOfCornersInput, int LineSplineInput, int ElementSplineInput)
      Compute transformations at corners. Operates on the LineCoordinateArray and ElementCoordinateArray.
      Parameters:
      NumberOfCornersInput - Total number of corners to interpolate.
      LineSplineInput - Spline function for line values.
      ElementSplineInput - Spline function for element values.
    • UMap

      private static int[] UMap(int LineValueInput, int ElementValueInput)
      Provide coordinates between original point and transformed point.
      Parameters:
      LineValueInput - Original line coordinate.
      ElementValueInput - Ooriginal element coordinate.
      Returns:
      Array containing three values: possible error code, interpolated line coordinate, and interpolated element coordinate.
    • FindPoint

      private static int[] FindPoint(double latitude, double longitude)
      Find specific lat/lon location in array and return index values.
      Parameters:
      latitude - Latitude value.
      longitude - Longitude value.
      Returns:
      Array of three values. The first value is the status (-1 for error, 0 for ok), the second value is array line value of lat/lon input, and the third value is array element value of lat/lon input.
    • DoMap

      private static int DoMap(int NumberOfCornersInput, int LineSplineInput, int ElementSplineInput)
    • IND

      private static int IND(int y, int x)