pysep icon indicating copy to clipboard operation
pysep copied to clipboard

incorrect sort order when using multi-page plotw_rs

Open bch0w opened this issue 2 years ago • 10 comments

@aakash10gupta pointed out that using plotw_rs with option max_traces_per_rs, which splits a record section over multiple pages, sorts incorrectly over the pages. That is, if sorted by distance, each individual page is sorted correctly, but when viewed all together the sorting runs in the opposite direction.

bch0w avatar Feb 17 '23 20:02 bch0w

@bch0w,

While the above fix resolved issues with some sorting options, there are still some similar issues with some of the other sorting options. I have tried tabulating these pending 'sorting' issues, which are kind of related but not necessarily related to 'multi-page' plotw_rs below -

'sort_by' trace ordering multi-page plot ordering labels
distance ok ok ok
abs_distance reversed reversed inside the plot
azimuth ok ok ok
abs_azimuth reversed reversed inside the plot
distance_r ok ok ok
abs_distance_r reversed reversed inside the plot
azimuth_r ok ok ok
abs_azimuth_r reversed reversed inside the plot

I am also attaching a quick python script pysep_test.txt to run all the above tabulated cases at once. The notebook runs in the latest pysep@devel [41c2d47] environment.

I am also listing some additional checks that would be needed once this is resolved -

  • consistency in the spacing of traces sorted by absolute values of both distance as well as azimuth, over multi-page figures
  • non-redundancy in the placement of red horizontal lines in azimuthally sorted plots at multiples of 45 degrees, over multi-page figures
  • correctness of plots when using start_azimuth_deg = 30 i.e. something non-zero as a plotw_rs input

aakash10gupta avatar Feb 23 '23 01:02 aakash10gupta

Thanks for compiling this table and providing the example script @aakash10gupta, very helpful for quickly fixing things.

A question for you re. 'inside the plot' y labels: since we can only have one set of labels for the y-axis, it was either show the distances or trace labels there. My solution was to place the text labels inside the plot so we can see the distances on the y-axis. How does the old version of the code handle this? I suppose we could do the same thing as the azimuth bins and place red lines to mark distances, or not have them at all. (fyi, there is a parameter y_label_loc that allows you to force those labels to different locations, but that doesnt seem to be working properly either)

To summarize fixes in the next PR:

  • [x] reverse sort order for abs_distance and abs_distance_r
  • [x] reverse sort order for abs_azimuth and abs_azimuth_r
  • [x] bugfix: y-label locations for absolute sorting not showing properly
  • [x] fix multi-page sort order for abs_distance and abs_distance_r record sections
  • [ ] maintain consistent trace spacing for multi-page abs_* sorting
  • [x] fix multi-page sort order for abs_azimuth and abs_azimuth_r record sections
  • [x] ensure unique azimuthal lines for multi-page abs_azimuth and abs_azimuth_r
  • [ ] bugfix: nonzero azimuth starting point for multi-page record sections

bch0w avatar Feb 23 '23 19:02 bch0w

How about this? For absolute azimuth, we remove the azimuth from the label and place the label on the left or right, not on top of the seismograms. Previously it was on the right, as shown in this example: Screen Shot 2023-02-23 at 12 11 00 PM For absolute distance, we remove the distance from the label and do the same.

carltape avatar Feb 23 '23 21:02 carltape

How about this? For absolute azimuth, we remove the azimuth from the label and place the label on the left or right, not on top of the seismograms. Previously it was on the right, as shown in this example: Screen Shot 2023-02-23 at 12 11 00 PM For absolute distance, we remove the distance from the label and do the same.

Thanks @carltape , that looks good, I'll make the default behavior when plotting on absolute bounds to place the text labels to the right side of the figure

bch0w avatar Feb 24 '23 20:02 bch0w

The tests above were based on only 8 of the total choices for the plotting option sort_by. Extending the tests to the sort_by options abs_backazimuth and abs_backazimuth_r seems to break the script.

aakash10gupta avatar Mar 07 '23 22:03 aakash10gupta

The tests above were based on only 8 of the total choices for the plotting option sort_by. Extending the tests to the sort_by options abs_backazimuth and abs_backazimuth_r seems to break the script.

This is addressed in #100

bch0w avatar Mar 08 '23 01:03 bch0w

sort_by options abs_backazimuth and abs_backazimuth_r seem to be working now. Thanks.

aakash10gupta avatar Mar 08 '23 08:03 aakash10gupta

Something that has come up during discussions is that for absolute azimuth sorting cases, since we have the absolute azimuths marked along the y-axis we can get done with the horizontal red lines demarcating specific azimuth intervals. This might also help tackle some of the pending issues in this thread.

aakash10gupta avatar Mar 08 '23 08:03 aakash10gupta

Yes, I second the vote to remove the horizontal red lines for plotting by absolute azimuth, since this information is already visible (in the text labels and in the y-axis).

carltape avatar Mar 09 '23 23:03 carltape

Just tested the sorting by absolute (back)azimuth with the update. The horizontal red lines no longer show up for these cases.

aakash10gupta avatar Mar 11 '23 02:03 aakash10gupta