Skip to content

Commit

Permalink
cdf: honour UBYTE_FLAG_INFO column annotation
Browse files Browse the repository at this point in the history
The CDF table input handler now marks UINT1 columns with
UBYTE_FLAG_INFO on read.
  • Loading branch information
mbtaylor committed Feb 26, 2015
1 parent d041658 commit 616f833
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cdf/src/main/uk/ac/starlink/cdf/CdfStarTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import uk.ac.starlink.table.DescribedValue;
import uk.ac.starlink.table.DomainMapper;
import uk.ac.starlink.table.RowSequence;
import uk.ac.starlink.table.Tables;
import uk.ac.starlink.table.ValueInfo;

/**
Expand Down Expand Up @@ -377,9 +378,18 @@ private static ColumnInfo createColumnInfo( Variable var, String descrip,
auxData.add( new DescribedValue( auxInfo, auxValue ) );
}
}
info.setAuxData( auxData );

/* Flag unsigned byte values according to STIL convention. */
DataType dtype = var.getDataType();
if ( dtype == DataType.UINT1 ) {
assert dtype.getByteCount() == 1;
assert dtype.getScalarClass() == Short.class;
auxData.add( new DescribedValue( Tables.UBYTE_FLAG_INFO,
Boolean.TRUE ) );
}

/* Return metadata. */
info.setAuxData( auxData );
return info;
}

Expand Down

0 comments on commit 616f833

Please sign in to comment.