This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // ignores the higher 16 bits | |
| public static float toFloat( int hbits ) | |
| { | |
| int mant = hbits & 0x03ff; // 10 bits mantissa | |
| int exp = hbits & 0x7c00; // 5 bits exponent | |
| if( exp == 0x7c00 ) // NaN/Inf | |
| exp = 0x3fc00; // -> NaN/Inf | |
| else if( exp != 0 ) // normalized value | |
| { | |
| exp += 0x1c000; // exp - 15 + 127 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import numpy as np | |
| import h5py | |
| if __name__ == '__main__': | |
| print('Making large attribute test files...') | |
| # Can only work with latest | |
| f = h5py.File('large_attribute.hdf5', 'w', libver='latest') | |
| # Small test dataset with large attributes | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from tables import * | |
| import numpy as np | |
| # Open a file in "w"rite mode | |
| file = open_file("bitfield.hdf5", mode ="w") | |
| # Create the last table in group2 | |
| data = [bool(i % 2) for i in range(15)] | |
| file.create_array("/", "bitfield", data) | |
| file.create_carray("/", "chnunked_bitfield", chunkshape=(2,), obj=data) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #------------------------------------------------------------------------------- | |
| # This file is part of jHDF. A pure Java library for accessing HDF5 files. | |
| # | |
| # http://jhdf.io | |
| # | |
| # Copyright 2019 James Mudd | |
| # | |
| # MIT License see 'LICENSE' file | |
| #------------------------------------------------------------------------------- | |
| import h5py | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package examples.datasets; | |
| import static java.util.stream.Collectors.joining; | |
| import java.io.File; | |
| import java.lang.reflect.Array; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashMap; | |
| import java.util.List; |