This file contains 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
for filename in IMG_38*; do heif-convert $filename ${filename}.png; done | |
for filename in IMG_38*.png; do mogrify -resize 50% $filename; done |
This file contains 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 matplotlib.pyplot as plt | |
from synthesizer.filters import Filter, FilterCollection | |
filter_codes = ["JWST/NIRCam.F444W", "JWST/NIRCam.F480M"] | |
filtcoll = FilterCollection(filter_codes=filter_codes) | |
fig, ax = filtcoll.plot_transmission_curves(show=False, linestyle='solid') |
This file contains 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
""" | |
PCA visualisation based on the example here: | |
https://gist.github.com/anonymous/7d888663c6ec679ea65428715b99bfdd | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
plt.style.use('dark_background') |
This file contains 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
from swiftsimio import Writer | |
from swiftsimio.units import cosmo_units | |
import unyt | |
import numpy as np | |
import h5py | |
import glob | |
files = glob.glob('ics*.hdf5') |
This file contains 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 sys | |
import os | |
import numpy as np | |
import matplotlib | |
# matplotlib.use('agg') | |
from matplotlib import pyplot as plt | |
# from IPython.display import clear_output | |
import tensorflow as tf | |
# physical_devices = tf.config.experimental.list_physical_devices('GPU') | |
# assert len(physical_devices) > 0, "Not enough GPU hardware devices available" |
This file contains 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
def weighted_quantile(values, quantiles, sample_weight=None, | |
values_sorted=False, old_style=False): | |
""" | |
Taken from From https://stackoverflow.com/a/29677616/1718096 | |
Very close to numpy.percentile, but supports weights. | |
NOTE: quantiles should be in [0, 1]! | |
:param values: numpy.array with data | |
:param quantiles: array-like with many quantiles needed |
This file contains 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
""" | |
Script for creating subsets of particles from gizmo sims | |
Authors: | |
- Sydney Lower | |
- Chris Lovell | |
""" | |
import h5py | |
import caesar |
This file contains 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
""" | |
A tutorial introduction to Schwimmbad | |
https://github.com/adrn/schwimmbad | |
To install the requirements: | |
> cat requirements.txt | xargs pip install | |
""" |
This file contains 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 | |
import glob | |
files = glob.glob('snap*') | |
coods = [None] * len(files) | |
ages = [None] * len(files) | |
metals = [None] * len(files) |
This file contains 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 | |
# dimensions (age,metallicity,wavelength) | |
a = 2 | |
Z = 3 | |
wl = 4 | |
weights = np.random.rand(a,Z,1) | |
grid = np.random.randint(1,10,(a,Z,wl)) |
NewerOlder