= np.loadtxt('BYGS008_top_segment_500samp_10cm_interp089.txt') image
Examples
When working with raster data we generally want to perform the following workflow: 1. Remove the best fit plane and normalize the data 2. Remove the underlying form by fitting a Degree 3 Polynomial 3. Apply a high frequency gaussian filter to attenuate noise 4. Generate our rotational profiles and sections 5. Calculate our parameters. 6. Analyze the data.
First let’s get some data
Let’s have a look
plt.imshow(image) plt.show()
Okay now let’s process it.
= plane_level(image)
levelled_image = remove_form(levelled_image)
remove_form_image
= smooth_image(remove_form_image)
data = gen_sections(data)
sections = gen_rot_prof(data)
profiles (data.shape,sections.shape,profiles.shape)
NameError: name 'plane_level' is not defined
Our processed datta should look a little different.
plt.imshow(data) plt.show()
Looks good, let’s get our profile parameters. We’ll use the default settings, so our profiles move down the ‘rows’ of the image/array/raster. We’ll also generate our rotational profiles and parameters.
= Ra(image)
image_ra = Rms(image)
image_rms = gen_rot_prof(image)
rotational_profiles= Ra(rotational_profiles)
image_rot_ra = Rms(rotational_profiles) image_rot_rms
Let’s visualise them. First we’ll make some boxplots to look at the distribution and find any outliers
plt.figure()221)
plt.subplot(
plt.boxplot(image_ra)'Image Ra')
plt.title(
222)
plt.subplot(
plt.boxplot(image_rms)'Image Rms')
plt.title(
223)
plt.subplot(
plt.boxplot(image_rot_ra)'Image Rotational Ra')
plt.title(
224)
plt.subplot(
plt.boxplot(image_rot_rms)'Image Rotational Rms')
plt.title( plt.tight_layout()
Let’s try a scatter plot, Ra/Rms against location of the profile and rotational Ra/Rms against degree
plt.figure()
221)
plt.subplot(range(len(image_ra)),image_ra)
plt.scatter('Image Ra')
plt.title(
222)
plt.subplot(range(len(image_rms)),image_rms)
plt.scatter('Image Rms')
plt.title(
223)
plt.subplot(range(len(image_rot_ra)),image_rot_ra)
plt.scatter('Image Rotational Ra')
plt.title(
224)
plt.subplot(range(len(image_rot_rms)),image_rot_rms)
plt.scatter('Image Rotational Rms')
plt.title( plt.tight_layout()
How about plotting Ra against Rms?
plt.figure()121)
plt.subplot(
plt.scatter(image_ra,image_rms)'Image Ra/Rms')
plt.title(
122)
plt.subplot(
plt.scatter(image_rot_ra,image_rot_rms)'Image Rotational Ra/Rms')
plt.title(
plt.tight_layout()