1. 28 Oct, 2020 1 commit
  2. 27 Oct, 2020 2 commits
  3. 13 Oct, 2020 1 commit
  4. 25 Sep, 2020 1 commit
    • Leo Pound Singer's avatar
      Document integer OBJECT fields in bayestar-localize-coincs · 6dd6a5e1
      Leo Pound Singer authored
      The script `bayestar-localize-coincs` saves FITS files with
      integer-valued `OBJECT` cards in their FITS headers. This is
      somewhat unusual, because the `OBJECT` card is usually a string
      used to give the designation of an astronomical object (such as
      `M83` or `Feige 55`). The `OBJECT` cards saved by
      `bayestar-localize-coincs`, on the other hand, are integers that
      refer to a coinc_event table row in the input LIGO-LW file. Add
      an explanation to the `bayestar-localize-coincs` command-line
      help message and also to the `COMMENT` in the FITS header.
      
      Here is an example FITS headere generated by
      `bayestar-localize-coincs`:
      
      ```
      SIMPLE  =                    T / conforms to FITS standard
      BITPIX  =                    8 / array data type
      NAXIS   =                    0 / number of array dimensions
      EXTEND  =                    T
      
      XTENSION= 'BINTABLE'           / binary table extension
      BITPIX  =                    8 / array data type
      NAXIS   =                    2 / number of array dimensions
      NAXIS1  =                   40 / length of dimension 1
      NAXIS2  =                19200 / length of dimension 2
      PCOUNT  =                    0 / number of group parameters
      GCOUNT  =                    1 / number of groups
      TFIELDS =                    5 / number of table fields
      TTYPE1  = 'UNIQ    '
      TFORM1  = 'K       '
      TTYPE2  = 'PROBDENSITY'
      TFORM2  = 'D       '
      TUNIT2  = 'sr-1    '
      TTYPE3  = 'DISTMU  '
      TFORM3  = 'D       '
      TUNIT3  = 'Mpc     '
      TTYPE4  = 'DISTSIGMA'
      TFORM4  = 'D       '
      TUNIT4  = 'Mpc     '
      TTYPE5  = 'DISTNORM'
      TFORM5  = 'D       '
      TUNIT5  = 'Mpc-2   '
      PIXTYPE = 'HEALPIX '           / HEALPIX pixelisation
      ORDERING= 'NUNIQ   '           / Pixel ordering scheme: RING, NESTED, or NUNIQ
      COORDSYS= 'C       '           / Ecliptic, Galactic or Celestial (equatorial)
      MOCORDER=                    9 / MOC resolution (best order)
      INDXSCHM= 'EXPLICIT'           / Indexing: IMPLICIT or EXPLICIT
      OBJECT  =                    0 / Unique identifier for this event
      INSTRUME= 'H1,L1,V1'           / Instruments that triggered this event
      DATE-OBS= '2012-07-17T22:13:12.220679' / UTC date of the observation
      MJD-OBS =    56125.92583588749 / modified Julian date of the observation
      DATE    = '2020-09-25T17:26:49.000000' / UTC date of file creation
      CREATOR = 'BAYESTAR'           / Program that created this file
      ORIGIN  = 'LIGO/Virgo'         / Organization responsible for this FITS file
      RUNTIME =         53.403897459 / Runtime in seconds of the CREATOR program
      DISTMEAN=     299.256659137929 / Posterior mean distance (Mpc)
      DISTSTD =    92.05707284960283 / Posterior standard deviation of distance (Mpc)
      LOGBCI  =    4.326877727439793 / Log Bayes factor: coherent vs. incoherent
      LOGBSN  =    7.485118470191388 / Log Bayes factor: signal vs. noise
      VCSVERS = 'ligo.skymap 0.5.1.dev5+g5fa79380.d20200925' / Software version
      HISTORY
      HISTORY Generated by calling the following Python function:
      HISTORY ligo.skymap.bayestar.localize(event=..., waveform='o2-uberbank', f_low=3
      HISTORY 0, min_inclination=0.0, max_inclination=1.5707963267948966, min_distance
      HISTORY =None, max_distance=None, prior_distance_power=2, cosmology=False, mcmc=
      HISTORY False, chain_dump=None, enable_snr_series=True, f_high_truncate=0.95)
      HISTORY
      HISTORY This was the command line that started the program:
      HISTORY bayestar-localize-coincs runs/O3/bns_astro/events.xml.gz --coinc-event-i
      HISTORY d 0 -o /tmp
      COMMENT
      COMMENT The integer value in the OBJECT card in this FITS header is a row ID
      COMMENT that refers to a coinc_event table row in the input LIGO-LW document.
      COMMENT
      ```
      6dd6a5e1
  5. 24 Sep, 2020 1 commit
  6. 22 Sep, 2020 1 commit
  7. 28 Aug, 2020 2 commits
  8. 27 Aug, 2020 6 commits
  9. 26 Aug, 2020 2 commits
    • Leo Pound Singer's avatar
      Repack fields to fix undefined behavior in rasterize · c31a8904
      Leo Pound Singer authored
      Fixes these UBSan errors from the unit test suite when
      rasterizing a Boolean HEALPix mask image:
      
          ligo/skymap/tool/tests/test_bayestar.py src/bayestar_moc.c:109:27: runtime error: load of misaligned address 0x7febfedc6009 for type 'const int64_t', which requires 8 byte alignment
          0x7febfedc6009: note: pointer points here
           00 00 00  01 61 61 2d 00 00 00 00  00 01 66 61 2d 00 00 00  00 00 01 73 61 2d 00 00  00 00 00 01 38
      c31a8904
    • Leo Pound Singer's avatar
      Fix changelog · 8842299e
      Leo Pound Singer authored
      8842299e
  10. 21 Aug, 2020 2 commits
    • Leo Pound Singer's avatar
      Increase range of validity of moments_to_parameters · e1d423c7
      Leo Pound Singer authored
      Increase the range of validity of the solver used in
      `ligo.skymap.distance.moments_to_parameters` for low-probability
      pixels that are very prior dominated. Sky maps that have many such
      pixels could have credible volumes repoted as infinity. The
      incidence of such cases should now be decreased.
      e1d423c7
    • Leo Pound Singer's avatar
      Fix typo · 0abd15b7
      Leo Pound Singer authored
      0abd15b7
  11. 19 Aug, 2020 2 commits
  12. 18 Aug, 2020 5 commits
    • Leo Pound Singer's avatar
      Add changelog entry [ci skip] · 56ccfbf1
      Leo Pound Singer authored
      56ccfbf1
    • Leo Pound Singer's avatar
      Bump upcoming version to 0.5.0 · f1416318
      Leo Pound Singer authored
      f1416318
    • Leo Pound Singer's avatar
      b0476ebb
    • Leo Pound Singer's avatar
      Improve numerical stability of conditional_ppf · d64bc06c
      Leo Pound Singer authored
      Improve the numerical stability of the method
      `ligo.skymap.distance.conditional_ppf` by reparametrizing the equation
      that is being solved. This method, which calculates the inverse of the
      distance CDF, works by solving the equation `f(x) - p = 0` for `x`,
      where `f(x)` is the distance CDF, and `p` is the desired probability.
      
      The reparametrized equation is `log(1 - f(x)) - log(1 - p) = 0` if `p >
      1/2` and `log(f(x)) - log(p) = 0` otherwise. This reparametrization is
      effective because it improves the dynamic range in the tails of the
      distribution. This same reparametrization had already proven effective
      in the related method `ligo.skymap.distance.marginal_ppf`.
      
      This change also fixes some rare corner cases where `marginal_ppf`
      returned silly values becauses it uses `conditional_ppf` internally to
      create its own initial guess. One example was the median distance for
      the binary neutron star candidate S191205ah. Before this patch, the
      result was negative and invalid:
      
          >>> from ligo.skymap.distance import marginal_ppf
          >>> from ligo.skymap.moc import uniq2pixarea
          >>> from ligo.skymap.io import read_sky_map
          >>> url = 'https://gracedb.ligo.org/apiweb/superevents/S191205ah/files/bayestar.multiorder.fits'
          >>> s = read_sky_map(url, moc=True)
          >>> marginal_ppf(0.5, s['PROBDENSITY'] * uniq2pixarea(s['UNIQ']),
          ...              s['DISTMU'], s['DISTSIGMA'], s['DISTNORM'])
          /Users/lpsinger/src/ligo.skymap/ligo/skymap/util/numpy.py:46:
          RuntimeWarning: invalid value encountered in marginal_ppf
            return func(*args, **kwargs)
          -223357.8508233767
      
      After this patch, the result is positive and sensible:
      
          >>> marginal_ppf(0.5, s['PROBDENSITY'] * uniq2pixarea(s['UNIQ']),
          ...              s['DISTMU'], s['DISTSIGMA'], s['DISTNORM'])
          362.7485740018039
      d64bc06c
    • Leo Pound Singer's avatar
      Add per-branch acceptance tests · 7ec54ad0
      Leo Pound Singer authored
      7ec54ad0
  13. 17 Aug, 2020 5 commits
  14. 15 Aug, 2020 4 commits
  15. 14 Aug, 2020 1 commit
  16. 13 Aug, 2020 3 commits
  17. 07 Aug, 2020 1 commit