예제 #1
0
arr_data_single[0:50,:]['i'] = 3
arr_data_single[50:,:]['i'] = 6    
                                                     
        
# simulate 10 samples of data followed by 10 sample gap
global_sample_arr = numpy.array(range(10), dtype = numpy.uint64) * 20
block_sample_arr = numpy.array(range(10), dtype = numpy.uint64) * 10
        
# constants
sample_rate = 1.0E2
files_per_directory = 10
# start 2014-03-09 12:30:30 plus one sample
start_global_index = (1394368230 * sample_rate) + 1

# test get unix time
dt, picoseconds = digital_rf_hdf5.get_unix_time(long(start_global_index), sample_rate)
print('For start_global_index=%i and sample_rate=%f, dt is %s and picoseconds is %i' % (start_global_index, sample_rate,
                                                                                        dt, picoseconds))

# set up top level directory
os.system("rm -rf /tmp/hdf5 ; mkdir /tmp/hdf5");
os.system("rm -rf /tmp/hdf52 ; mkdir /tmp/hdf52");
        
print("Test 0 - simple single write to multiple files, no compress, no checksum - channel 0");
os.system("rm -rf /tmp/hdf5/junk0 ; mkdir /tmp/hdf5/junk0");
data_object = digital_rf_hdf5.write_hdf5_channel("/tmp/hdf5/junk0", 'i4', 40, files_per_directory, start_global_index,
                                                 sample_rate, "FAKE_UUID_0", 0, False, True, num_subchannels=num_subchannels);
data = numpy.array(base_data, numpy.int32)
result = data_object.rf_write(data);
data_object.close();
print("done test 0.1");
예제 #2
0
arr_data_single[0:50,:]['i'] = 3
arr_data_single[50:,:]['i'] = 6    
                                                     
        
# simulate 10 samples of data followed by 10 sample gap
global_sample_arr = numpy.array(range(10), dtype = numpy.uint64) * 20
block_sample_arr = numpy.array(range(10), dtype = numpy.uint64) * 10
        
# constants
sample_rate = 1.0E2
files_per_directory = 10
# start 2014-03-09 12:30:30 plus one sample
start_global_index = (1394368230 * sample_rate) + 1

# test get unix time
dt, picoseconds = digital_rf_hdf5.get_unix_time(long(start_global_index), sample_rate)
print('For start_global_index=%i and sample_rate=%f, dt is %s and picoseconds is %i' % (start_global_index, sample_rate,
                                                                                        dt, picoseconds))

# set up top level directory
os.system("rm -rf /tmp/hdf5 ; mkdir /tmp/hdf5");
os.system("rm -rf /tmp/hdf52 ; mkdir /tmp/hdf52");
        
print("Test 0 - simple single write to multiple files, no compress, no checksum - channel 0");
os.system("rm -rf /tmp/hdf5/junk0 ; mkdir /tmp/hdf5/junk0");
data_object = digital_rf_hdf5.write_hdf5_channel("/tmp/hdf5/junk0", 'i4', 40, files_per_directory, start_global_index,
                                                 sample_rate, "FAKE_UUID_0", 0, False, True, num_subchannels=num_subchannels);
data = numpy.array(base_data, numpy.int32)
result = data_object.rf_write(data);
data_object.close();
print("done test 0.1");