Skip to content

Instantly share code, notes, and snippets.

#%%
"""
This script shows how to load CCE data into a `scri.AsymptoticBondiData` object
and evaluate a set of constraints that should be satisfied involving the strain
and the Newman-Penrose quantities (assuming the waveform is in Bondi gauge).
These constraints are listed in the plot legend (see below) as equations to be
satisfied at each instant. The violation is just one side minus the other, and
the norm is that difference squared integrated over the sphere (and
square-rooted).
"""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moble
moble / doi2bibtex.sh
Created December 13, 2023 17:13
doi2bibtex
# This bash/zsh function queries for the input DOI's bibtex entry. When the DOI points
# to a journal article, this usually resolves to the journal's own bibtex output.
doi2bibtex () {
curl -fsSLH "Accept: application/x-bibtex" "https://doi.org/$1" | sed -e 's|%2F|/|g'
}
@moble
moble / make_plots.out
Last active June 9, 2023 19:45
Compare results of `to_coprecessing_frame` before and after CoM correction with old and new versions of scri/sxs/...
=======================================
Running in CoprecessingFrameTransients1
=======================================
/Users/boyle/.continuum/mambaforge/envs/CoprecessingFrameTransients1/lib/python3.9/site-packages/quaternion/calculus.py:310: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
def fd_indefinite_integral(f, t):
python.__version__ = 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:42:20)
[Clang 14.0.6 ]
numpy.__version__ = 1.21.0
scipy.__version__ = 1.7.0
@moble
moble / CompareSquads.ipynb
Last active May 30, 2023 19:52
Compare quaternion interpolation methods
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# The vector method is roughly 2.5x than the existing code with a
# sorted t′, and about 15% slower with a worst-case-disordered t′.
using BenchmarkTools
using DataInterpolations
shuffle(v) = collect(Iterators.flatten(zip(v[begin:length(v)÷2], v[length(v)÷2+1:end])))
function inplace(u, interp, t)
@assert length(u) == length(t)
@moble
moble / X2D.py
Last active September 28, 2022 15:43
"""Convert RPXMB files to RPDMB
This file can be run either as a script, or by calling its functions. To run as a script, do
something like this:
python X2D.py Strain_N2.h5 Strain_N3.h5 Strain_N4.h5 ExtraWaveforms.h5
To call the functions, and assuming that this file is in the same directory as the script using it,
do something like this: