Skip to content

Commit

Permalink
change BIN string to integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Ercius ncem-gauss jupyter committed Mar 2, 2024
1 parent 52cb95d commit 55fd1dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ncempy/io/smv.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ def smvReader(file_name, verbose=False):
im1 = f1.getDataset() # read in the dataset

# Calculate the pixel size in inverse angstroms according to the geometry in the header
alpha = (f1.heaer_info['BIN'] * f1.header_info['PIXEL_SIZE']) / f1.header_info['DISTANCE'] # angle across 1 pixel
BIN = [int(ii) for ii in f1.header_info['BIN'].split('x')]
alpha = (BIN[0] * f1.header_info['PIXEL_SIZE']) / f1.header_info['DISTANCE'] # angle across 1 pixel
dp_pixel_distance = alpha / f1.header_info['WAVELENGTH'] * 1e-10 # divide by wavelength to get distance in Angstroms
pixelSize = (dp_pixel_distance, dp_pixel_distance)
extra_metadata = {'pixelSize': pixelSize, 'pixelUnit':'A', 'filename': f1.file_name,
Expand Down

0 comments on commit 55fd1dc

Please sign in to comment.