Commit 5d150231 authored by Bryce Hepner's avatar Bryce Hepner

small testing changes

parent b0b364b9
...@@ -13,7 +13,7 @@ from sklearn.metrics import mean_squared_error ...@@ -13,7 +13,7 @@ from sklearn.metrics import mean_squared_error
scenes = remote_file_extractor("/media/elphel/NVME/lwir16-proc/te0607/scenes/") scenes = remote_file_extractor("/media/elphel/NVME/lwir16-proc/te0607/scenes/")
images = remote_image_extractor(scenes) images = remote_image_extractor(scenes)
# images = find_only_in_channel(images, "11") images = find_only_in_channel(images, "5")
sftp_client = setup_remote_sftpclient() sftp_client = setup_remote_sftpclient()
image_array = np.array(Image.open(sftp_client.open(images[250]))) image_array = np.array(Image.open(sftp_client.open(images[250])))
# image_array = np.array(Image.open(images[250])).astype(np.uint16) # image_array = np.array(Image.open(images[250])).astype(np.uint16)
...@@ -56,14 +56,14 @@ information_array = np.zeros((len(images),3)) ...@@ -56,14 +56,14 @@ information_array = np.zeros((len(images),3))
def celcius_to_kelvin(celcius): def celcius_to_kelvin(celcius):
return celcius + 273.15 return celcius + 273.15
for i in range(len(images)): for i in range(1000):
image_array = np.array(Image.open(sftp_client.open(images[i]))).astype(np.uint16) image_array = np.array(Image.open(sftp_client.open(images[i]))).astype(np.uint16)
current_frame_count = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[84:88]) current_frame_count = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[84:88])
frame_count_at_FFC = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[88:92]) frame_count_at_FFC = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[88:92])
# signaltonoise.append(1/np.std(image_array[1:])) # signaltonoise.append(1/np.std(image_array[1:]))
information_array[i,0] = current_frame_count - frame_count_at_FFC information_array[i,0] = current_frame_count - frame_count_at_FFC
# information_array[i,-1] = 1/np.std(image_array[1:]) # information_array[i,-1] = 1/np.std(image_array[1:])
information_array[i,-1] = mean_squared_error(image_array[1:],gaussian_filter(image_array[1:],sigma=.3)) information_array[i,-1] = mean_squared_error(gaussian_filter(image_array[1:],sigma=.2),image_array[1:])
# print(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[76:77]) # print(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[76:77])
# print("start") # print("start")
information_array[i,1] = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[94:96]) - \ information_array[i,1] = intarray_to_uint32(repopulate_array_with_bitstring(uint16_array_to_bitstring(image_array[0]))[94:96]) - \
...@@ -84,7 +84,7 @@ for i in range(len(images)): ...@@ -84,7 +84,7 @@ for i in range(len(images)):
mask = information_array[:,0] > 0 mask = information_array[:,0] > 0
information_df = pd.DataFrame(information_array[mask],columns=["Frame_Spacing","Curr_Temp_Diff","Signal_to_Noise"]) information_df = pd.DataFrame(information_array[mask],columns=["Frame_Spacing","Curr_Temp_Diff","Signal_to_Noise"])
information_df.to_csv("information_weird_array.csv") information_df.to_csv("information_weird_array.csv")
# information_df = pd.read_csv("information_array.csv") information_df = pd.read_csv("information_weird_array.csv")
information_array = information_df.values information_array = information_df.values
plt.scatter(information_array[:,0],information_array[:,-1],s=1) plt.scatter(information_array[:,0],information_array[:,-1],s=1)
plt.legend() plt.legend()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment