XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


srcmatch (srcmatch-3.23) [xmmsas_20230412_1735-21.0.0]


Algorithm

    subroutine srcmatch
      call subroutine read_set in order to read set 1
      IF number of EMLDETECT datasets > 1 THEN   
         LOOP over input EMLDETECT datasets
            call i/o subroutine for additional input sets       
            call subroutine compare_src (correlates the two sets)
            call subroutine combine_src (merge two sets into one set)
            ! the first set is the main set and will finally constitute the
            ! summary set
         END LOOP
         LOOP over input CROSSID datasets
            call i/o subroutine for input sets  
            call subroutine compare_src (correlates the two sets)
            call subroutine crossid_srcs (fills in cross id pointers)
         END LOOP
      END IF

      Copy source coordinate and source numbers from
        OM observation source lists to memory.

      LOOP over EMLDETECT source list

        IF (ID_INST=0).AND.(ID_BAND=0) THEN 
                    
           LOOP over OM source coordinates
              
             Find EPIC OM counterparts (distance < distance parameter) 

             Increment `number of counterparts' counter and copy
               to output record buffer

             Write OM source number to output record buffer
                 
             Update OMFLAG and copy to output record buffer

           END LOOP

           Copy EMLDETECT source parameters to output record buffer.

        END IF

        IF (ID_INST>=0.OR.ID_BAND>=0) THEN  
           Copy instrument and band specific EMLDETECT source parameters 
             to output record buffer.
        END IF

       
        IF (ID_INST=0.AND.ID_BAND.AND..NOT.first pass through loop) THEN
           
           Write out output record buffer in FITS format 
             (EPIC FITS observation source list).             
           Write out output record buffer in HTML format
             (EPIC HTML observation source list).

        END IF

      END LOOP

    end subroutine  srcmatch

    subroutine compare_srcs
        LOOP over two source lists
          IF two sources are within max_err sigma of each other THEN
                IF sources have no associations assigned yet THEN
                        let the two sources point to each other
          ELSE
             IF New association is better than previous one THEN
                  let the two sources point to each other
             END
          END IF
        END LOOP
    end subroutine compare_srcs



XMM-Newton SOC -- 2023-04-16