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
""" | |
Loads in one of John's lightcone halo catalogues and collates | |
a separate property in a separate file. | |
Example config.json: | |
{ | |
"lightcone_cat_base": "/cosma8/data/dp004/flamingo/Runs/L1000N1800/HYDRO_FIDUCIAL/hbt_lightcone_halos/lightcone0/lightcone_halos_SNAPNUM.hdf5", | |
"soap_cat_base": "/cosma8/data/dp004/flamingo/Runs/L1000N1800/HYDRO_FIDUCIAL/SOAP-HBT/halo_properties_SNAPNUM.hdf5", | |
"snap_start": 0, |
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
""" | |
An example script showing how a prefect flow for the TDP pipeline. | |
""" | |
import prefect | |
import pixell | |
from pathlib import Path | |
from pydantic import BaseModel | |
import datetime | |
import numpy as np |
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
""" | |
An example script for setting up a link between two librarians. You will need | |
to run this both on the source and destination librarian. | |
""" | |
from hera_librarian import AdminClient | |
from hera_librarian.exceptions import LibrarianError, LibrarianHTTPError | |
from hera_librarian.models.ping import PingResponse | |
from hera_librarian.authlevel import AuthLevel | |
import string |
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
#include <stdio.h> | |
#include <Accelerate/Accelerate.h> | |
#define N_MAPS 3 | |
#define N_X 32 | |
#define N_Y 32 | |
#define N_RUNS 1024 |
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 matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.lines import Line2D | |
from matplotlib.collections import LineCollection | |
from matplotlib.legend_handler import HandlerLineCollection | |
class HandlerStackedLines(HandlerLineCollection): | |
""" | |
Custom Handler for LineCollection instances. |
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
""" | |
Loads in one of John's lightcone halo catalogues and collates | |
a separate property in a separate file. | |
Example config.json: | |
{ | |
"lightcone_cat_base": "/cosma8/data/dp004/jch/FLAMINGO/lightcone_halos/HYDRO_FIDUCIAL/lightcone_halos/lightcone0/lightcone_halos_SHELLID.hdf5", | |
"vr_cat_base": "/cosma8/data/dp004/flamingo/Runs/L1000N1800/HYDRO_FIDUCIAL/VR/catalogue_SNAPNUM/vr_catalogue_SNAPNUM.properties.0", | |
"shell_start": 0, |
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
""" | |
Schema evolution with MongoDB. | |
This explains and demonstrates why we need to use a | |
Mongo database instead of a SQL database for this project, | |
aside from other concerns about scalability, distribution, | |
etc. | |
The output of this script is: |
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
""" | |
This is a simple demo file to show you how to use beanie and how | |
it can help us represent our data in a structured and searchable way. | |
""" | |
from pydantic import Field | |
from beanie import Document, init_beanie, BackLink, Link | |
from motor.motor_asyncio import AsyncIOMotorClient | |
# We should probably come up with a better name than 'collection' |
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
""" | |
Plots transfer rate from globus log. | |
""" | |
#%% | |
from csv import reader | |
import matplotlib.pyplot as plt | |
import json | |
import datetime | |
from dateutil import parser as dateparser |
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 h5py | |
import numpy as np | |
import sys | |
PARTICLE_TYPES = [0, 1, 2, 3, 4, 5] | |
data = h5py.File(sys.argv[1], "r") | |
for particle_type in PARTICLE_TYPES: | |
nbytes = 0 |
NewerOlder