ui/src/main/java/ucar/nc2/ui/op/BufrTableBViewer.java
private void writeDiff(TableB wmo, TableB t, Formatter out) {
    out.format("#%n# BUFR diff written from %s against %s %n#%n", t.getName(), wmo.getName());
    out.format("Class,FXY,enElementName,BUFR_Unit,BUFR_Scale,BUFR_ReferenceValue,BUFR_DataWidth_Bits%n");
    List<TableB.Descriptor> listDesc = new ArrayList<>(t.getDescriptors());
    Collections.sort(listDesc);
    for (TableB.Descriptor d1 : listDesc) {
      TableB.Descriptor d2 = wmo.getDescriptor(d1.getId());
      if ((d2 == null) || (d1.getScale() != d2.getScale()) || (d1.getRefVal() != d2.getRefVal()) || (d1.getDataWidth() != d2.getDataWidth())) {
        short fxy = d1.getId();
//        int f = (fxy & 0xC000) >> 14;
        int x  = (fxy & 0x3F00) >> 8;
        int y  = fxy & 0xFF;
        out.format("%d,%2d%03d,\"%s\",%s,%d,%d,%d%n",x,x,y, d1.getName(), d1.getUnits(), d1.getScale(), d1.getRefVal(), d1.getDataWidth());
      }
    }
    out.flush();
  }
private void writeDiff(TableB wmo, TableB t, Formatter out) {
    out.format("#%n# BUFR diff written from %s against %s %n#%n", t.getName(), wmo.getName());
    out.format("Class,FXY,enElementName,BUFR_Unit,BUFR_Scale,BUFR_ReferenceValue,BUFR_DataWidth_Bits%n");
    List<TableB.Descriptor> listDesc = new ArrayList<>(t.getDescriptors());
    Collections.sort(listDesc);
    for (TableB.Descriptor d1 : listDesc) {
      TableB.Descriptor d2 = wmo.getDescriptor(d1.getId());
      if ((d2 == null) || (d1.getScale() != d2.getScale()) || (d1.getRefVal() != d2.getRefVal()) || (d1.getDataWidth() != d2.getDataWidth())) {
        short fxy = d1.getId();
//        int f = (fxy & 0xC000) >> 14;
        int x  = (fxy & 0x3F00) >> 8;
        int y  = fxy & 0xFF;
        out.format("%d,%2d%03d,\"%s\",%s,%d,%d,%d%n",x,x,y, d1.getName(), d1.getUnits(), d1.getScale(), d1.getRefVal(), d1.getDataWidth());
      }
    }
    out.flush();
  }
private void writeDiff ( TableB wmo , TableB t , Formatter out ) { out . format ( "#%n# BUFR diff written from %s against %s %n#%n" , t . getName ( ) , wmo . getName ( ) ) ; out . format ( "Class,FXY,enElementName,BUFR_Unit,BUFR_Scale,BUFR_ReferenceValue,BUFR_DataWidth_Bits%n" ) ; List < TableB . Descriptor > listDesc = new ArrayList <> ( t . getDescriptors ( ) ) ; Collections . sort ( listDesc ) ; for ( TableB . Descriptor d1 : listDesc ) { TableB . Descriptor d2 = wmo . getDescriptor ( d1 . getId ( ) ) ; if ( ( d2 == null ) || ( d1 . getScale ( ) != d2 . getScale ( ) ) || ( d1 . getRefVal ( ) != d2 . getRefVal ( ) ) || ( d1 . getDataWidth ( ) != d2 . getDataWidth ( ) ) ) { short fxy = d1 . getId ( ) ; //        int f = (fxy & 0xC000) >> 14;
 int x = ( fxy & 0x3F00 ) >> 8 ; int y = fxy & 0xFF ; out . format ( "%d,%2d%03d,\"%s\",%s,%d,%d,%d%n" , x , x , y , d1 . getName ( ) , d1 . getUnits ( ) , d1 . getScale ( ) , d1 . getRefVal ( ) , d1 . getDataWidth ( ) ) ; } } out . flush ( ) ; }
/*
Class,FXY,enElementName,BUFR_Unit,BUFR_Scale,BUFR_ReferenceValue,BUFR_DataWidth_Bits,CREX_Unit,CREX_Scale,CREX_DataWidth
20,20009,General weather indicator (TAF/METAR),Code table,0,0,4,Code table,0,2
/ * Class FXY enElementName BUFR_Unit BUFR_Scale BUFR_ReferenceValue BUFR_DataWidth_Bits CREX_Unit CREX_Scale CREX_DataWidth 20 20009 General weather indicator ( TAF / METAR ) Code table 0 0 4 Code table 0 2