Skip to content

Instantly share code, notes, and snippets.

View avivajpeyi's full-sized avatar
🦥

Avi Vajpeyi avivajpeyi

🦥
View GitHub Profile
@avivajpeyi
avivajpeyi / deploy-pages.yml
Last active April 28, 2023 03:01
Example github workflow to build and deploy a hugo website
name: Deploy GitHub Pages
on:
push:
branches:
- main # Set a branch name to trigger deployment
pull_request:
jobs:
deploy:
@avivajpeyi
avivajpeyi / upload_sandbox.sh
Created March 8, 2023 02:35
Upload to zenodo
#!/bin/bash
# Upload big files to sandbox.zenodo.
#
# usage: ./sandbox_zenodo_upload.sh [deposition id] [filename]
#
set -e
DEPOSITION=$( echo $1 | sed 's+^http[s]*://sandbox.zenodo.org/deposit/++g' )
FILEPATH="$2"
import bilby
import numpy as np
from bilby.gw.result import CompactBinaryCoalescenceResult
import matplotlib.pyplot as plt
import time
import os
from tqdm.auto import tqdm
import pandas as pd
VALID_EXTENSIONS = ["hdf5", "json", "pkl"]
@avivajpeyi
avivajpeyi / gpflow_demo.ipynb
Created January 27, 2023 00:10
GPFlow testing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@avivajpeyi
avivajpeyi / dnn_regression.ipynb
Created January 9, 2023 23:38
DNN regression example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@avivajpeyi
avivajpeyi / image_regression.ipynb
Created December 6, 2022 00:59
NN regression with image data example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@avivajpeyi
avivajpeyi / demo.md
Created November 14, 2022 04:23
COMPAS py interface demo

installing

To install COMPAS, it would be nice if all the user needs to do is:

pip install compas

This can be configured to not only install COMPAS python code, but also the CPP code. It can also be confiugured to find user's boost libs etc (no need to manually edit the make-file).

running

Then a user can run COMPAS with:

@avivajpeyi
avivajpeyi / get_GW150914_data.py
Created November 3, 2022 00:21
GW Data downloader
import logging
import os
from gwpy.timeseries import TimeSeries
TRIGGER_TIME = 1126259462.4
GPS_START_TIME = TRIGGER_TIME - 2
DATA_DURATION = 4
EXTRA_DATA = 10
DATA_START_TIME = int(GPS_START_TIME) - EXTRA_DATA
@avivajpeyi
avivajpeyi / GW150914_pbilby_example.ini
Created November 3, 2022 00:18
Example GW150914 ini
ntasks-per-node = 48
time = 10:30:00
nodes = 4
mem-per-cpu="2GB"
extra-lines = "module --force purge && module load git/2.18.0 git-lfs/2.4.0 gcc/9.2.0 openmpi/4.0.2 numpy/1.19.2-python-3.8.5 mpi4py/3.0.3-python-3.8.5 && module unload zlib && source /fred/oz980/avajpeyi/envs/sstar_venv/bin/activate"
# The following are the same as bilby_pipe
label = GW150914
outdir = outdir_GW150914
trigger-time = 1126259462.391
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