Skip to content

Instantly share code, notes, and snippets.

View avivajpeyi's full-sized avatar
🦥

Avi Vajpeyi avivajpeyi

🦥
View GitHub Profile
trigger-time=1268431094.157825
channel-dict={ H1:DCS-CALIB_STRAIN_CLEAN_SUB60HZ_C01, L1:DCS-CALIB_STRAIN_CLEAN_SUB60HZ_C01,V1:Hrec_hoft_16384Hz }
coherence-test=False
detectors=['H1', 'L1', 'V1']
duration=16.0
psd-dict={ H1:/home/daniel.williams/events/O3/event_repos/S200316a/C01_offline/psds/4096/H1-psd.dat, L1:/home/daniel.williams/events/O3/event_repos/S200316a/C01_offline/psds/4096/L1-psd.dat, V1:/home/daniel.williams/events/O3/event_repos/S200316a/C01_offline/psds/4096/V1-psd.dat }
psd-fractional-overlap=0.5
post-trigger-duration=2.0
sampling-frequency=4096.0
psd-length=16
""" Plots total number of CPU hours used
To create a "jobstats.txt" run somthing like the following:
> sacct -S 2020-01-01 -E 2021-10-06 -u avajpeyi -X -o "jobname%-40,cputimeraw,start" --parsable2 > jobstats.txt
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from humanize import intword
from matplotlib import ticker
from datetime import timedelta, datetime, date
@avivajpeyi
avivajpeyi / intro-to-jax-part2.ipynb
Last active June 29, 2022 19:19 — forked from dfm/intro-to-jax-part2.ipynb
intro-to-jax-part2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
""" Plots total number of CPU hours used
To create a "jobstats.txt" run somthing like the following:
> sacct -S 2020-01-01 -E 2021-10-06 -u avajpeyi -X -o "jobname%-40,cputimeraw,start" --parsable2 > jobstats.txt
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from humanize import intword
from matplotlib import ticker
#%% md
# Plot signal
#%%
import bilby
import matplotlib.pyplot as plt
import numpy as np
@avivajpeyi
avivajpeyi / publication.mplstyle
Last active June 14, 2021 03:44
Matplotlib publication stylesheet
### FIGURE
figure.facecolor: white
figure.dpi: 300
figure.titlesize: x-large # fontsize of the axes title
figure.titleweight: bold
### LINES
lines.linewidth: 1.5
### PATCHES
"""Demo of Matched Filtering"""
from typing import Callable, Dict, Optional
import matplotlib.pyplot as plt
import numpy as np
import plotly.graph_objects as go
import scipy.signal
from plotly.subplots import make_subplots
N_POINTS = 1000
from typing import List, Optional
import seaborn as sns
def get_colors(num_colors: int, alpha: Optional[float]=1) -> List[List[float]]:
"""Get a list of colorblind colors,
:param num_colors: Number of colors.
:param alpha: The transparency
:return: List of colors. Each color is a list of [r, g, b, alpha].
"""
"""
Completed backtracking code for week11, demonstrating bike-lock combos
Author: Gavin
Modifed by: Avi
"""
import itertools
from typing import List
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits import mplot3d
# Defining the functions and its first derivative
def f(x):
return x ** 3 - 2 * x ** 2 - 11 * x + 12