0

Problem

I have a data set of describing geological structures. Each structure has a row with two attributes - its length and orientation (0-360 degrees).

Within this data set, there are two types of structure.

  • Type 1: less data points, but the structures are physically larger (large length, and so more significant).
  • Type 2: more data points, but the structures are physically smaller (small length, and so less significant).

I want to create a rose plot to show the spread of the structures' orientations. However, I want this plot to also represent the significance of the structures in combination with the direction they face - taking into account the lengths.

Is it possible to scale this by length in MATLAB somehow so that the subset which is less numerous is not under represented, when the structures are large?


Example

A data set might contain:

  • 10 structures orientated North-South, 50km long.
  • 100 structures orientated East-West, 0.5km long.

In this situation the East-West population would look to be more significant than the North-South population based on absolute numbers. However, in reality the length of the members contributing to this population are much smaller and so the structures are less significant.


Code

This is the code I have so far:

load('WG_rose_data.xy') 
azimuth = WG_rose_data(:,2); 
length = WG_rose_data(:,1); 
rose(azimuth,20); 

Where WG_rose_data.xy is a data file with 2 columns containing the length and azimuth (orientation) data for the geological structures.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Alexander Peace
  • 113
  • 2
  • 14
  • Give us example data and plots of what you have now, so it's easier to indicate what you want. – Wolfie Mar 28 '17 at 12:27
  • Hi, I have now amended my original post to include this as it didn't really come across very well in a comment. – Alexander Peace Mar 28 '17 at 12:39
  • 1
    I still don't really understand what you mean by "one population is less numerous but contains physically larger members" - what populations? As far as I can see you just have one vector you're plotting... Also from the [rose documentation](https://uk.mathworks.com/help/matlab/ref/rose.html): "rose is not recommended. Use polarhistogram instead". – Wolfie Mar 28 '17 at 12:47
  • Ok so as an example say we had 10 linear structures that were orientated North-South that were 50km long but we had 100 structures orientated East-West that were 0.5km long. In this situation the East-West population would look to be more significant than the North-South population based on absolute numbers. However, in reality the length of the members contributing to this population are much smaller. I am looking for a way to scale such orientation datasets. So yes I am currently just plotting the orientation as I don't know how to use the length. – Alexander Peace Mar 28 '17 at 13:02
  • I have edited your question to improve its clarity, I think it's greatly improved based on the extra information you've given, but feel free to further edit it to improve clarity. – Wolfie Mar 28 '17 at 13:17
  • Thanks for that. – Alexander Peace Mar 28 '17 at 13:18

2 Answers2

2

For each row in your data, you could duplicate it a given number of times, according to its length value. Therefore, if you had a structure with length 50, it counts for 50 data points, whereas a structure with length 1 only counts as 1 data point. Of course you have to round your lengths since you can only have integer numbers of rows.

This could be achieved like so, with your example data in the matrix d

% Set up example data: 10 large vertical structures, 100 small ones perpendicular
d = [repmat([0, 50], 10, 1); repmat([90, .5], 100, 1)];
% For each row, duplicate the data in column 1, according to the length in column 2
d1 = [];
for ii = 1:size(d,1)
    % make d(ii,2) = length copies of d(ii,1) = orientation
    d1(end+1:end+ceil(d(ii,2))) = d(ii,1); 
end

Output rose plot:

rose plot

You could fine tune how to duplicate the data to achieve the desired balance of actual data and length weighting.

Wolfie
  • 27,562
  • 7
  • 28
  • 55
  • yes, that's a great suggestion thanks. I will attempt this now with my actual dataset and report results. – Alexander Peace Mar 28 '17 at 13:45
  • On a side note. How do you get MATLAB to treat orientation data as bi-directional? i.e. make the rose diagram symmetrical about the North-South axis as a azimuth of 90 degress is actually the same as 270 degrees and so on. – Alexander Peace Mar 28 '17 at 14:03
  • 1
    I would use the `mod` function to make all your `azimuth` data sit in the range `(0,180)`. So `azimuth = mod(azimuth,180)`. – Wolfie Mar 28 '17 at 14:14
0

Thanks for all the help with this. This code is my final working version for reference:

clear all
close all

% Input dataset
original_data = load('WG_rose_data.xy');

d = [];
%reformat azimuth
d(:,1)= original_data(:,2);
%reformat length
d(:,2)= original_data(:,1);

% For each row, duplicate the data in column 1, according to the length in column 2

d1 = [];
for a = 1:size(d,1)
    d1(end+1:end+ceil(d(a,2))) = d(a,1); 
end

%create oposite directions for rose diagram
length_d1_azi = length(d1);
d1_op_azi=zeros(1,length_d1_azi);

for i = 1:length_d1_azi

    d1_op_azi(i)=d1(i)-180;
    if d1_op_azi(i) < 1;
        d1_op_azi(i) = 360 - (d1_op_azi(i)*-1);
    end    

end

%join calculated oposites to original input
new_length = length_d1_azi*2;
all=zeros(new_length,1);

for i = 1:length_d1_azi
    all(i)=d1(i);
end

for j = length_d1_azi+1:new_length;
    all(j)=d1_op_azi(j-length_d1_azi);
end

%convert input aray into radians to plot
d1_rad=degtorad(all);

rose(d1_rad,24)
set(gca,'View',[-90 90],'YDir','reverse');
Alexander Peace
  • 113
  • 2
  • 14