Menu

#509 psradd -T does not correctly handle aux:rm or aux:dm

next release
closed-fixed
None
5
2026-02-26
2026-02-13
No

During psradd -T, absolute/aux DM and RM are correctly handled during the first T-scrunch of the first two files, because at this point both of the files have aux:rmc=0

After the first T-scruch, the resulting total has aux:rmc=1. Consequently, as subsequent files are added to this total, the incoming sub-integrations are no longer correctly handled, because

  1. sub-integrations don't store their own flags to say what has and has not been corrected;
  2. instead, they use the flags stored in their parent archive; and
  3. after ownership of a sub-integration is transferred to the running total archive (which already has aux:rmc=1 after the first T-scrunch) the sub-integration will incorrectly report that it has already been corrected.

Here's some evidence to support the theory: In psradd-T.log, there are 116640 line of verbose output in which the value of the get_absolute_birefringence_corrected flag is reported

$ grep Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | tail -1
116640  Integration::get_absolute_birefringence_corrected returning parent archive value =1

Only the first 2160 of these correctly show that Integration::get_absolute_birefringence_corrected is false

$ grep Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | grep -F '=0' | tail -1
  2160  Integration::get_absolute_birefringence_corrected returning parent archive value =0

116640 / 2160 = 54 and 55 sub-integrations were combined in the resulting total, resulting in 54 tscrunch operations. On only the first tscrunch, the flag is correctly false.

Potential solutions:

  1. orphan the sub-integration before it is added to the total, perform the T-scrunch, then adopt it in the total (kludgey)
  2. have sub-integrations store their own aux:rmc flag; this has the potential for inconsistent definitions in sub-integrations and parent archives. However, inconsistent definitions are clearly already a problem.
  3. have psradd explicitly perform aux DM/RM corrections before combining; this is the simplest solution. However, it fixes only psradd (there might be other use cases where inconsistency creates a problem)

Discussion

  • Willem van Straten

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,14 +8,14 @@
     Here's some evidence to support the theory: In psradd-T.log, there are 116640 line of verbose output in which the value of the `get_absolute_birefringence_corrected flag` is reported
    
     ~~~
    -[wvanstra@tooarrana1 psradd_test]$ grep Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | tail -1
    +$ grep Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | tail -1
     116640  Integration::get_absolute_birefringence_corrected returning parent archive value =1
     ~~~
    
     Only the first  2160 of these correctly show  that Integration::get_absolute_birefringence_corrected is false
    
     ~~~
    -Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | grep -F '=0' | tail -1
    +$ grep Integration::get_absolute_birefringence_corrected psradd-T.log | cat -n | grep -F '=0' | tail -1
       2160  Integration::get_absolute_birefringence_corrected returning parent archive value =0
     ~~~
    
     
  • Willem van Straten

    I've implemented a fix on the bugs-509-psradd-tscrunch-aux branch. (I went with potential solution #2: have sub-integrations store their own aux:rmc flag.) I'll perform more testing before checking in to the master branch

     
  • Willem van Straten

    • status: open --> closed-fixed
     
  • Willem van Straten

    Fix merged to main branch

    commit 72a750f7912552294c0db13f43b64d9ea6a4ebce (HEAD -> master)
    Merge: 4640db25d 8d532e2c3
    Author: Willem van Straten <vanstraten.willem@gmail.com>
    Date:   Thu Feb 26 21:43:35 2026 +1300
    
        Merge branch 'bugs-509-psradd-tscrunch-aux'
    
     

Log in to post a comment.

MongoDB Logo MongoDB