private int getGrateOffset(String grate) {
    int grateOffset = -1;//deliberately goofy - inelegant fail if badparams
    if(grate.compareToIgnoreCase("hgrate3")==0){
      grateOffset = 0;
    }
    else if (grate.compareToIgnoreCase("vgrate3")==0){
      grateOffset = 1;
    }
    else if (grate.compareToIgnoreCase("hgrate6")==0){
      grateOffset = 2;
    }
    else if (grate.compareToIgnoreCase("vgrate6")==0){
      grateOffset = 3;
    }
    else if (grate.compareToIgnoreCase("fSlashGrate3")==0){
      grateOffset = 4;
    }
    else if (grate.compareToIgnoreCase("bSlashGrate3")==0){
      grateOffset = 5;
    }
    else if (grate.compareToIgnoreCase("fSlashGrate6")==0){
      grateOffset = 6;
    }
    else if (grate.compareToIgnoreCase("bSlashGrate6")==0){
      grateOffset = 7;
    }
    else{
      System.out.println("EEEK: bad params in getGrateOffset, V1v2GratingsConnect.java");
    }

    return grateOffset;
  }