comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » area of symmetric differences of contours
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
area of symmetric differences of contours [message #94387] Fri, 05 May 2017 08:47
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
Hello,

does anyone here know of a function/procedure, that calculates the
area of symmetric difference from contours?
https://en.wikipedia.org/wiki/Symmetric_difference

;---
; input: field1, field2, lim1, lim2, offsetX, offsetY

contour,field1, path_info=li, path_xy=lines, $
/path_data_coord,levels=[lim1], /path_double
n1=max(li.n,jmax1)
line1=lines[*,li[jmax1].offset+lindgen(li[jmax1].n)]
contour, field2, path_info=li, path_xy=lines, $
/path_data_coord,levels=[lim2], /path_double
n2=max(li.n,jmax2)
line2=lines[*,li[jmax2].offset+lindgen(li[jmax2].n)]
line2[0,*]+=offsetX
line2[1,*]+=offsetY

print, area_symmetric_difference(line1,line2)

;---
I've been working on such a function for a few days an always find a new
special case that breaks my code, so I thought I asked here whether
somebody else already solved that problem.

Markus

PS: I'm looking for an exact geometric solution, not one where I count
pixels of a mask.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extracting array with same date, lat, long
Next Topic: Features of the colon operator

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:20:41 PDT 2025

Total time taken to generate the page: 0.00521 seconds