Group Sources Fortran Subroutines

Description

This module provides the Fortran code for the handling of the grouping of sources between the two catalogues being cross-matched, identifying astrometric overlaps.

Quick access

Routines:

calc_j1s(), cumulative_fourier_distance(), cumulative_fourier_probability(), get_integral_length(), get_overlap_indices()

Variables

  • group_sources_fortran/dp [integer,parameter=kind(0.0d0)]
  • group_sources_fortran/pi [real,parameter=4.0_dp*atan(1.0_dp)]

Subroutines and functions

subroutine  group_sources_fortran/calc_j1s(rho, r, j1s)

Calculate the Bessel Function of First Kind of First Order for a set of fourier-space coordinates.

Parameters:
  • rho (*) [real,in]

  • r (*) [real,in]

  • j1s (size(rho,size(r) [real,out]

Call to:

jy01a_j1()

subroutine  group_sources_fortran/cumulative_fourier_probability(pr, drho, dist, j1s, cumulative_prob)

Calculates the cumulative 2-D spacial integral of the convolved AUFs of two sources, based on an inverse 2-D Fourier (Hankel) transform of the fourier-space representation of the individual AUF components, returning the probability under a specific radial distance.

Parameters:
  • pr (*) [real,in]

  • drho (*) [real,in]

  • dist [real,in]

  • j1s (*) [real,in]

  • cumulative_prob [real,out]

Called from:

get_overlap_indices(), cumulative_fourier_distance()

subroutine  group_sources_fortran/get_overlap_indices(a_ax_1, a_ax_2, b_ax_1, b_ax_2, a_inds, a_size, b_inds, b_size, amax, bmax, a_axerr, b_axerr, r, rho, drho, j1s, afouriergrid, bfouriergrid, amodrefind, bmodrefind, max_frac, aindices, bindices, anumoverlap, bnumoverlap, a_auf_cdf, b_auf_cdf)

Once total potential overlap is found in getmaxn, we can keep track of each individual source overlap between the two catalogues, storing their respective indices to keep links of potential counterparts between the two catalogues.

Parameters:
  • a_ax_1 (*) [real,in]

  • a_ax_2 (*) [real,in]

  • b_ax_1 (*) [real,in]

  • b_ax_2 (*) [real,in]

  • a_inds (,) [integer,in]

  • a_size (*) [integer,in]

  • b_inds (,) [integer,in]

  • b_size (*) [integer,in]

  • amax [integer,in]

  • bmax [integer,in]

  • a_axerr (*) [real,in]

  • b_axerr (*) [real,in]

  • r (*) [real,in]

  • rho (*) [real,in]

  • drho (*) [real,in]

  • j1s (,) [real,in]

  • afouriergrid (,,*,*) [real,in]

  • bfouriergrid (,,*,*) [real,in]

  • amodrefind (,) [integer,in]

  • bmodrefind (,) [integer,in]

  • max_frac [real,in]

  • aindices (amax,size(a_ax_1) [integer,out]

  • bindices (bmax,size(b_ax_1) [integer,out]

  • anumoverlap (size(a_ax_1) [integer,out]

  • bnumoverlap (size(b_ax_1) [integer,out]

  • a_auf_cdf (amax,size(a_ax_1) [real,out]

  • b_auf_cdf (bmax,size(b_ax_1) [real,out]

Call to:

haversine(), cumulative_fourier_probability()

subroutine  group_sources_fortran/get_integral_length(a_err, b_err, r, rho, drho, j1s, a_fouriergrid, b_fouriergrid, a_modrefind, b_modrefind, a_inds, a_size, frac_array, int_areas)

Calculate the “error circle” areas for sources, based on various cumulative integral fractions of the convolution of all overlapping opposing catalogue source AUFs with the given source’s AUF.

Parameters:
  • a_err (*) [real,in]

  • b_err (*) [real,in]

  • r (*) [real,in]

  • rho (*) [real,in]

  • drho (*) [real,in]

  • j1s (,) [real,in]

  • a_fouriergrid (,,*,*) [real,in]

  • b_fouriergrid (,,*,*) [real,in]

  • a_modrefind (,) [integer,in]

  • b_modrefind (,) [integer,in]

  • a_inds (,) [integer,in]

  • a_size (*) [integer,in]

  • frac_array (*) [real,in]

  • int_areas (size(a_err,size(frac_array) [real,out]

Call to:

cumulative_fourier_distance()

subroutine  group_sources_fortran/cumulative_fourier_distance(f, r, drho, probs, j1s, cumulative_dists)

Calculates the cumulative 2-D spacial integral of the convolved AUFs of two sources, based on an inverse 2-D Fourier (Hankel) transform of the fourier-space representation of the individual AUF components, up to a specified set of probabilities, returning the radial distance to reach those integral fractions.

Parameters:
  • f (*) [real,in]

  • r (*) [real,in]

  • drho (*) [real,in]

  • probs (*) [real,in]

  • j1s (,) [real,in]

  • cumulative_dists (size(probs) [real,out]

Called from:

get_integral_length()

Call to:

cumulative_fourier_probability()