示例#1
0
  /**
   * _more_
   *
   * @param satgrid _more_
   * @param cenlat _more_
   * @param cenlon _more_
   * @param posm _more_
   * @param curdate _more_
   * @param cursat _more_
   * @param g_domain _more_
   * @return _more_
   */
  public StormAODTInfo.IRData aodtv72_drive(
      FlatField satgrid,
      float cenlat,
      float cenlon,
      int posm,
      double curdate,
      int cursat,
      String g_domain,
      int satId,
      int satChannel,
      boolean isTemperature) {

    float ftmps, flats, flons, cenlon2;

    int radius, irad, np, ii, jj, length;
    int idomain = 0;

    /*
     * Set miscoptions flags in AODT
     */

    int eyeSize = -99;
    oland_v72 = 0; /* allow AODT operation over land */
    osearch_v72 = false; /* search for maximum curved band position */
    rmwsizeman_v72 = eyeSize; /* eye size parameter */
    odtcurrent_v72IR = new StormAODTInfo.IRData();
    odtcurrent_v72IR.domain = idomain_v72;

    /*
     * Set initial classification flag and value in AODT
     */

    ostartstr_v72 = 0; /* user defined initial classification flag */
    osstr_v72 = 0.0f; /* starting initial classification value */

    /*
     * Set image date/time info in AODT
     */

    int iaodt = aodtv72_setIRimageinfo(curdate, cursat);

    /*
     * Get storm center lat/lon
     */
    if (lauto == true) {
      // aodtv72_runautomode( nauto, fauto, imagefile, &cenlat, &cenlon,
      // &posm );
    }

    /*
     * Set center location in AODT positioning method (1=interpolation,
     * 4=extrapolation, 0=error)
     */
    // posm = 1;
    aodtv72_setlocation(cenlat, cenlon, posm);

    /*
     * Set domain FLAG in AODT
     */

    if (g_domain.equalsIgnoreCase("AUTO")) {
      idomain = 0;
    }
    if (g_domain.equalsIgnoreCase("Atlantic")) {
      idomain = 1;
    }
    if (g_domain.equalsIgnoreCase("Pacific")) {
      idomain = 2;
    }
    if (g_domain.equalsIgnoreCase("Indian")) {
      idomain = 2;
    }

    iaodt = aodtv72_setdomain(idomain);

    /*
     * Retrieve temperatures from image. This to be done in IDV
     */

    GridUtil.Grid2D g2d = null;
    float[][] temps = null;
    float[][][] satimage = null;
    float[][] lons = null;
    float[][] lats = null;
    int numx = 123;
    int numy = 123;

    try {
      g2d = GridUtil.makeGrid2D(satgrid);
      lons = g2d.getlons();
      lats = g2d.getlats();

    } catch (Exception re) {
    }

    /* now spatial subset numx by numy */
    GridUtil.Grid2D g2d1 = spatialSubset(g2d, cenlat, cenlon, numx, numy);

    satimage = g2d1.getvalues();
    float[][] temp0 = satimage[0];
    int imsorc = satId, imtype = satChannel;

    if (isTemperature) temps = temp0;
    else temps = im_gvtota(numx, numy, temp0, imsorc, imtype);

    /*
     * Load the IR image information in AODT init areadata_v72
     */

    aodtv72_loadIRimage(temps, g2d1.getlats(), g2d1.getlons(), numx, numy);

    /*
     * Set eye and cloud temperature values in AODT, return position for IR
     * image data read
     */

    StormAODTInfo.IRData tvIR = aodtv72_seteyecloudtemp(StormAODTInfo.keyerM_v72, areadata_v72);

    odtcurrent_v72IR.warmt = tvIR.warmt;
    odtcurrent_v72IR.warmlatitude = tvIR.warmlatitude;
    odtcurrent_v72IR.warmlongitude = tvIR.warmlongitude;
    odtcurrent_v72IR.eyet = tvIR.eyet;
    odtcurrent_v72IR.cwcloudt = tvIR.cwcloudt;
    odtcurrent_v72IR.cwring = tvIR.cwring;

    /*
     * Determine scene type Set scene type
     */

    float[] oscen = StormAODTSceneType.aodtv72_calcscene(odtcurrent_v72IR, areadata_v72);

    odtcurrent_v72IR.cloudt = oscen[0];
    odtcurrent_v72IR.cloudt2 = oscen[1];
    odtcurrent_v72IR.eyestdv = oscen[2];
    odtcurrent_v72IR.cloudsymave = oscen[3];
    odtcurrent_v72IR.eyefft = (int) oscen[4];
    odtcurrent_v72IR.cloudfft = (int) oscen[5];
    // { alst, Aaveext, Estdveye, Aavesym, eyecnt, rngcnt};
    float[] oscen1 =
        StormAODTSceneType.aodtv72_classify(
            odtcurrent_v72IR, rmwsizeman_v72, areadata_v72, osstr_v72, osearch_v72);

    odtcurrent_v72IR.eyescene = (int) oscen1[0];
    odtcurrent_v72IR.cloudscene = (int) oscen1[1];
    odtcurrent_v72IR.eyesceneold = -1;
    odtcurrent_v72IR.cloudsceneold = -1;
    odtcurrent_v72IR.eyecdosize = oscen1[2];
    odtcurrent_v72IR.ringcb = (int) oscen1[3];
    odtcurrent_v72IR.ringcbval = (int) oscen1[4];
    odtcurrent_v72IR.ringcbvalmax = (int) oscen1[5];
    odtcurrent_v72IR.ringcblatmax = oscen1[6];
    odtcurrent_v72IR.ringcblonmax = oscen1[7];
    odtcurrent_v72IR.rmw = oscen1[8];

    /*
     * Determine intensity
     */

    iaodt = aodtv72_calcintensity(idomain);
    if (iaodt == 71) {
      throw new IllegalStateException("center location is over land");
    }

    /*
     * Print out all diagnostic messages to screen
     */
    return odtcurrent_v72IR;
  }
示例#2
0
  /**
   * _more_
   *
   * @param redo _more_
   * @param odtcurrent_v72IR _more_
   * @return _more_
   */
  int aodtv72_initcurrent(boolean redo, StormAODTInfo.IRData odtcurrent_v72IR)
        /*
         * initialize odtcurrent_v72 array or reset values for land interaction
         * situations
         */
      {
    int b, bb;
    // char comm[50]="\0";

    if (!redo) {
      // odtcurrent_v72=(struct odtdata *)malloc(sizeof(struct odtdata));
      odtcurrent_v72IR.latitude = 999.99f;
      odtcurrent_v72IR.longitude = 999.99f;
      odtcurrent_v72IR.land = 0;
      odtcurrent_v72IR.autopos = 0;
      // strcpy(odtcurrent_v72IR.comment,comm);
      // diagnostics_v72=(char *)calloc((size_t)50000,sizeof(char));
      // hfile_v72=(char *)calloc((size_t)200,sizeof(char));
      // fixfile_v72=(char *)calloc((size_t)200,sizeof(char));

      // b=sizeof(float);
      // bb=sizeof(double);
      // fcstlat_v72=(float *)calloc((size_t)5,b);
      // fcstlon_v72=(float *)calloc((size_t)5,b);
      // fcsttime_v72=(double *)calloc((size_t)5,bb);
    }

    odtcurrent_v72IR.Traw = 0.0f;
    odtcurrent_v72IR.TrawO = 0.0f;
    odtcurrent_v72IR.Tfinal = 0.0f;
    odtcurrent_v72IR.Tfinal3 = 0.0f;
    odtcurrent_v72IR.CI = 0.0f;
    odtcurrent_v72IR.eyet = 99.99f;
    odtcurrent_v72IR.warmt = 99.99f;
    odtcurrent_v72IR.cloudt = 99.99f;
    odtcurrent_v72IR.cloudt2 = 99.99f;
    odtcurrent_v72IR.cwcloudt = 99.99f;
    odtcurrent_v72IR.warmlatitude = 999.99f;
    odtcurrent_v72IR.warmlongitude = 999.99f;
    odtcurrent_v72IR.eyecdosize = 0.0f;
    odtcurrent_v72IR.eyestdv = 0.0f;
    odtcurrent_v72IR.cloudsymave = 0.0f;
    odtcurrent_v72IR.eyescene = 0;
    odtcurrent_v72IR.cloudscene = 0;
    odtcurrent_v72IR.eyesceneold = -1;
    odtcurrent_v72IR.cloudsceneold = -1;
    odtcurrent_v72IR.rule9 = 0;
    odtcurrent_v72IR.rule8 = 0;
    odtcurrent_v72IR.LBflag = 0;
    odtcurrent_v72IR.rapiddiss = 0;
    odtcurrent_v72IR.eyefft = 0;
    odtcurrent_v72IR.cloudfft = 0;
    odtcurrent_v72IR.cwring = 0;
    odtcurrent_v72IR.ringcb = 0;
    odtcurrent_v72IR.ringcbval = 0;
    odtcurrent_v72IR.ringcbvalmax = 0;
    odtcurrent_v72IR.CIadjp = 0.0f;
    odtcurrent_v72IR.rmw = -99.9f;
    /* odtcurrent_v72->IR.TIEflag=0; */
    /* odtcurrent_v72->IR.TIEraw=0.0; */
    /* odtcurrent_v72->IR.TIEavg=0.0; */
    /* odtcurrent_v72->IR.sst=-99.9; */
    // if(!redo) odtcurrent_v72->nextrec=NULL; /* added by CDB */

    return 0;
  }