Opened 11 years ago

Closed 10 years ago

#348 closed defect (fixed)

Bug-fix to ropp_pp_cutoff_amplitude

Reported by: Ian Culverwell Owned by: Ian Culverwell
Priority: normal Milestone: 8.0
Component: ROPP (all) Version: 7.0
Keywords: Cc: Stig Syndergaard

Description

While researching #301, Stig Syndergaard (DMI) found a small bug in Section 3.1 of ropp_pp_cutoff_amplitude:

     DO i=1,n
       IF (BTEST(LCF(i),3)) THEN
         imax = MIN(i, imax)
         EXIT
       ENDIF
     ENDDO

...

     DO i=n,1,-1
       IF (BTEST(LCF(i),3)) THEN
         imin = MAX(i, imin)
         EXIT
       ENDIF
     ENDDO

should be replaced by

     DO i=1,n
       IF (BTEST(LCF(i),3)) THEN
         imax = MIN(i-1, imax)
         EXIT
       ENDIF
     ENDDO

...

     DO i=n,1,-1
       IF (BTEST(LCF(i),3)) THEN
         imin = MAX(i+1, imin)
         EXIT
       ENDIF
     ENDDO

This means that one too many data points get through the cut-off.

The bug probably has little impact - it doesn't in a quick test - but should nevertheless be put right.

Attachments (2)

bangle_diff_348.png (20.4 KB ) - added by Ian Culverwell 10 years ago.
refrac_diff_348.png (21.1 KB ) - added by Ian Culverwell 10 years ago.

Download all attachments as: .zip

Change history (5)

comment:1 by Ian Culverwell, 10 years ago

The above is a little insecure (we could get imax < 0, imin > n and imin > imax), so I've made it safer in r4208. (The extreme cases aren't likely to occur in practice.)

This makes tiny changes the output of ropp_pp_occ_tool when IT-PP-05_prof3 is passed through it:

ROPP7.1 text

INFO (from ropp_pp_cutoff_amplitude):  Cut-off (amplitude/LCF criterion). Keep data        1 to   154145
... (from ropp_pp_preprocess):  Merged RS+CL data size: 154145

ROPP8.0 text

INFO (from ropp_pp_cutoff_amplitude):  Cut-off (amplitude/LCF criterion). Keep data        1 to   154144
... (from ropp_pp_preprocess):  Merged RS+CL data size: 154144

ROPP8.0-ROPP7.1 bangle

ROPP8.0-ROPP7.1 bangle

comment:2 by Ian Culverwell, 10 years ago

2nd ones's refrac, obviously.

comment:3 by Ian Culverwell, 10 years ago

Resolution: fixed
Status: newclosed

I think it's safe to close this ticket.

by Ian Culverwell, 10 years ago

Attachment: bangle_diff_348.png added

by Ian Culverwell, 10 years ago

Attachment: refrac_diff_348.png added
Note: See TracTickets for help on using tickets.