protected static Object fieldValue(DapSequence seq, DataRecord record, String field) throws DapException { DapVariable dapv = seq.findByName(field); if (dapv == null) throw new DapException("Unknown variable in filter: " + field); if (dapv.getSort() != DapSort.ATOMICVARIABLE) throw new DapException("Non-atomic variable in filter: " + field); if (dapv.getRank() > 0) throw new DapException("Non-scalar variable in filter: " + field); DataAtomic da = (DataAtomic) (record.readfield(field)); if (da == null) throw new DapException("No such field: " + field); return da.read(0); }