Content moved to this repo!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Simon Mutch <[email protected]> | |
# Date: 2018-08-14 | |
set -e # error on exit | |
get_log_dir() { | |
echo "$JOBFS/log_mps-$1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import h5py as h5 | |
import matplotlib.pyplot as plt | |
from pathlib import Path | |
DATA_PATH = Path("tree_images.h5") | |
ID = "619000000001104" | |
with h5.File(DATA_PATH, "r") as fp: | |
image = fp[f"{ID}/mass"][:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"schemaVersion":1,"label":"coverage","message":"84%","color":"green"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
bstat=( $(pmset -g batt | grep -Eo '[0-9]+%.*' | awk '{print($1,$2)}' | tr -d ";") ) | |
percentage=$(echo "${bstat[0]}" | tr -d "%") | |
case $(( | |
(percentage >= 0 && percentage < 25) ? 1 : | |
(percentage >= 25 && percentage < 50) ? 2 : | |
(percentage >= 50 && percentage < 75) ? 3 : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- | |
# jupyter: | |
# jupytext: | |
# formats: ipynb,py:percent | |
# text_representation: | |
# extension: .py | |
# format_name: percent | |
# format_version: '1.3' | |
# jupytext_version: 1.11.3 | |
# kernelspec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import xarray as xa | |
import h5py as h5 | |
from pathlib import Path | |
from tqdm import tqdm | |
GRIDS_DIR = Path("PATH_GOES_HERE") | |
def grid_path(snapshot: int, sub: int): | |
return GRIDS_DIR / f"snapshot_{snapshot:03d}.den.{sub}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import xarray as xa | |
import h5py as h5 | |
PATH_IN = "/fred/oz078/smutch/intensity_mapping/baseline/imapping_testrun/HIMass_grids.h5" | |
SNAPSHOT = 250 # z=0 | |
with h5.File(PATH_IN, "r") as fp: | |
ds = fp[f"Snap{SNAPSHOT:03d}"] | |
box_size = ds.attrs["box_size"][:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Test the Genesis grids totals against cosmology. This is to help K Ren (see email 2020-03-17).""" | |
__author__ = "Simon Mutch" | |
__date__ = "2020-03-18" | |
from pathlib import Path | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Testing of blackbox package. How well does it work and making sure I understand its use. | |
""" | |
import sys | |
sys.path.insert(0, "../3rd_party/blackbox") # noqa: E402 | |
import blackbox as bb | |
from scipy import stats |
NewerOlder