ascl_id
stringclasses
752 values
repo_url
stringclasses
737 values
file_path
stringlengths
4
194
content
large_stringlengths
1
1M
language
stringclasses
29 values
license_type
stringclasses
24 values
size
int64
1
1M
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Parallel_Framework/reports/read_4dc.pro
PRO read_4d, file,data OPENU, 13,file, /f77_unformatted n1 = 0L n2 = 0L n3 = 0L n4 = 0L readu,13, n1 readu,13, n2 readu,13, n3 readu,13, n4 data = dcomplexarr(n1,n2,n3,n4) readu,13, data close, 13 END
IDL
Unknown
214
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Parallel_Framework/reports/assemble_cube.pro
spawn, 'ls workspace/*initial', ifiles ni = N_ELEMENTS(ifles) cube = dblarr(64,100,32,1) for i = 0, ni -1 DO BEGIN read_4d,dat,ifiles[i], lims = lims rstart = lims.rstart rend = lims.rend tstart = lims.tstart tend = lims.tend cube[*,istart:iend,tstart:tend,0] = dat endfor end
IDL
Unknown
284
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Parallel_Framework/reports/read_sr.pro
PRO read_sr, file,res OPENU, 13,file, /f77_unformatted np = 0L readu,13, np sc = lonarr(np) sd = lonarr(np) rc = lonarr(np) rd = lonarr(np) readu,13, sc readu,13, sd readu,13, rc readu,13, rd close, 13 res = {np:np, scount:sc,sdisp:sd,rcount:rc,rdisp:rd} END
IDL
Unknown
274
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Test_Suite/TestSuite.F90
! ! Copyright (C) 2018 by the authors of the RAYLEIGH code. ! ! This file is part of RAYLEIGH. ! ! RAYLEIGH is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) ! any lat...
Fortran
Unknown
1,490
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Test_Suite/Test_Cheby.F90
! ! Copyright (C) 2018 by the authors of the RAYLEIGH code. ! ! This file is part of RAYLEIGH. ! ! RAYLEIGH is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) ! any lat...
Fortran
Unknown
13,793
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
src/Test_Suite/Test_SHT.F90
! ! Copyright (C) 2018 by the authors of the RAYLEIGH code. ! ! This file is part of RAYLEIGH. ! ! RAYLEIGH is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) ! any lat...
Fortran
Unknown
22,972
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
job_scripts/NASA_Pleiades/pleiades_script.sh
#PBS -S /bin/bash #PBS -q long # 'long' queue allows jobs up to 5 days (use 'normal' for 8 hours or less). #PBS -j oe #PBS -W group_list=s1234 # account number #PBS -m e #PBS -N nrho5_ff_5 # job name #PBS -l walltime=120:00:00 # run for 120 hours #PBS -l select=74:ncpus=28:mpiprocs=28:model=...
Shell
Unknown
2,320
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
job_scripts/TACC_Stampede3/stampede3_jobscript.sh
#!/bin/bash #SBATCH -J geodynamo-test # Job name #SBATCH -o log.o%j # Name of stdout output file #SBATCH -e error.e%j # Name of stderr error file #SBATCH -p skx-dev # Queue (partition) name; skx-dev for testing; skx, icx, or spr for production. #SBATCH -N 1 # Total # of nodes. 1-4 f...
Shell
Unknown
964
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
.github/dependabot.yml
# Set update schedule for GitHub Actions version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: # Check for updates to GitHub Actions every week interval: "weekly"
YAML
Unknown
216
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
.github/workflows/main.yml
name: continuous-integration on: pull_request concurrency: group: ${{ github.actor }}-${{ github.ref }} cancel-in-progress: true env: OMPI_MCA_btl_base_warn_component_unused: 0 OMPI_MCA_mpi_yield_when_idle: 1 OMPI_MCA_rmaps_base_oversubscribe: 1 OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM:...
YAML
Unknown
4,357
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
.github/workflows/docker.yml
name: github-docker on: push: branches: - 'main' release: types: [created] concurrency: group: docker-build cancel-in-progress: true permissions: contents: read packages: write jobs: build-docker: runs-on: ubuntu-latest if: github.repository == 'geodynamics/rayleigh' steps:...
YAML
Unknown
3,100
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
.github/workflows/black.yml
name: Lint on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: psf/black@stable with: src: "./post_processing/rayleigh.py"
YAML
Unknown
216
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
spack-repo/repo.yaml
repo: namespace: rayleigh
YAML
Unknown
28
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
spack-repo/packages/rayleigh/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class Rayleigh(MakefilePackage): __doc__ = 'Rayleigh is a 3-D convection code designed ...
Python
Unknown
2,550
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
docker/rayleigh-tacc/Readme.md
This is a docker container that can be used to run Rayleigh on the set of TACC supercomputers, in particular Frontera and Stampede3, without having to manually compile the code. Steps to use this container on Stampede3/Frontera are described on https://rayleigh-documentation.readthedocs.io/en/latest/doc/source/User_Gu...
Markdown
Unknown
346
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
docker/rayleigh-tacc/build.sh
#!/bin/bash # This script generates a docker image from the latest Rayleigh development version. # It requires a docker installation on the local machine, and the ability to # communicate with the docker daemon without root user privileges (see the docker # webpage for an explanation). # Note: This container is build ...
Shell
Unknown
546
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
docker/rayleigh/README.md
This container hosts a built version of Rayleigh.
Markdown
Unknown
50
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
docker/rayleigh-devel-jammy/entrypoint.sh
#!/bin/sh export HOME=/work cd "$HOME" if [ -n "$HOSTGID" -a -n "$HOSTUSER" -a -n "$HOSTUID" ] then # only create user if all options are provided # This only creates the group if a group with that GID does not already exist. getent group $HOSTGID > /dev/null || groupadd -g $HOSTGID $HOSTUSER useradd -u $HOSTUID...
Shell
Unknown
1,094
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
docker/rayleigh-buildenv-jammy/README.md
Build environment for Rayleigh using the Ubuntu Jammy Docker container.
Markdown
Unknown
72
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/chi_scalar/test_output.py
#!/usr/bin/env python3 from rayleigh_diagnostics import G_Avgs, build_file_list import numpy as np import os import sys vals = { "kesgav" : 401, "Tsgav" : 501, "Tpsgav" : 503, "Tmsgav" : 505, "Tdrsgav" : 507, "Tpdrsgav" : 509, "...
Python
Unknown
3,109
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/chi_scalar/run_test.sh
#!/usr/bin/env bash cd tests/chi_scalar #cd bench #mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg #cd .. # generate initial conditions ../../pre_processing/rayleigh_spectral_input.py -ar 0.35 -sd 1.0 -nt 64 -nr 48 -o bench_t_init \ -e 'import numpy as np; x = 2*radius - rmin - rmax; rmax*rmin/ra...
Shell
Unknown
970
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/coupled_bcs/test_output.py
#!/usr/bin/env python3 from rayleigh_diagnostics import Shell_Slices, main_input import numpy as np import sys, os error = False def test_bcs(case): """ For a given case check if the values contained in the shell slices match the expected values based on the coefficients in main_input """ error = False ...
Python
Unknown
3,146
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/coupled_bcs/run_test.sh
#!/usr/bin/env bash cd tests/coupled_bcs # we run a const case, where the bcs on the field that everything is coupled to are just constant cd const PYTHONPATH=../../../pre_processing:$PYTHONPATH python3 generate_input.py mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg cd .. # after running, we test ...
Shell
Unknown
432
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/coupled_bcs/const/generate_input.py
### Use rayleigh_spectral_input.py to generate generic input. from rayleigh_spectral_input import * rmin = 0.5; rmax = 1.0 si = SpectralInput(n_theta=1,n_r=48) si.transform_from_rtp_function(lambda radius: 2.0 - (rmax/radius)*(radius - rmin)/(rmax - rmin), rmin=rmin, rmax=rmax) si.write('radial_prof_init') si = Spe...
Python
Unknown
390
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/custom_reference/run_test.sh
#!/usr/bin/env bash cd tests/custom_reference # Run a test where the full reference state is specified cd basic cp ../../../post_processing/reference_tools.py . python3 gen_case0.py mpirun -np 4 ../../../bin/rayleigh.dbg # Augment the usual case 0 with heating and higher Ra cd .. cd augment cp ../../../post_process...
Shell
Unknown
403
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/custom_reference/augment/augment.py
import reference_tools as rt import numpy # Grid Parameters nr = 128 # Number of radial points #aspect ratio #beta=ri/ro beta = 0.35e0 # shell depth d=1.e0 #outer radial boundary ro=d/(1-beta) #inner radial boundary ri=beta*ro #radial grid radius=numpy.linspace(ri,ro,nr) # Initialize an equation_coeffi...
Python
Unknown
1,071
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/custom_reference/basic/gen_case0.py
import reference_tools as rt import numpy # Grid Parameters nr = 128 # Number of radial points #aspect ratio #beta=ri/ro beta = 0.35e0 # shell depth d=1.e0 #outer radial boundary ro=d/(1-beta) #inner radial boundary ri=beta*ro #radial grid radius=numpy.linspace(ri,ro,nr) # Initialize an equation_coeffi...
Python
Unknown
1,711
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/generic_input/run_test.sh
#!/usr/bin/env bash cd tests/generic_input # first we run the "base" case, this just sets up and runs Rayleigh for one time-step with hard-coded initial conditions # for the Christensen et al., 2001 benchmark case 1 cd base mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg ../../../post_processing/con...
Shell
Unknown
2,966
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/generic_input/test_output.py
#!/usr/bin/env python3 from rayleigh_diagnostics import Spherical_3D_multi, Shell_Slices from rayleigh_spectral_input import SpectralInput, radial_extents import numpy as np import sys import vtk error = False # test using the raw data imported from the output files base = Spherical_3D_multi('00000001_0501', path='b...
Python
Unknown
5,494
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/generic_input/script/generate_magnetic_input.py
### Use rayleigh_spectral_input.py to generate generic input. ### Christensen Benchmark case 1. from rayleigh_spectral_input import * ar = 0.35; sd=1.0 rmin, rmax = radial_extents(aspect_ratio=ar, shell_depth=sd) ### Poloidal magnetic potential BC. si_BC = SpectralInput(n_theta=64,n_r=48) def func_BC(theta,phi,radiu...
Python
Unknown
1,393
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/generic_input/radial_sparse/generate_input.py
### Use rayleigh_spectral_input.py to generate generic input. ### Christensen Benchmark case 1. from rayleigh_spectral_input import * rmin = 0.5; rmax = 1.0 si = SpectralInput(n_theta=1,n_r=48) si.transform_from_rtp_function(lambda radius: 1.0 - (rmax/radius)*(radius - rmin)/(rmax - rmin), rmin=rmin, rmax=rmax) si.w...
Python
Unknown
342
[ascl:2401.002]
https://github.com/geodynamics/Rayleigh
tests/generic_input/radial_dense/generate_input.py
### Use rayleigh_spectral_input.py to generate generic input. ### Christensen Benchmark case 1. from rayleigh_spectral_input import * rmin = 0.5; rmax = 1.0 si = SpectralInput(n_theta=64,n_r=48) si.transform_from_rtp_function(lambda radius: 1.0 - (rmax/radius)*(radius - rmin)/(rmax - rmin), rmin=rmin, rmax=rmax) si....
Python
Unknown
343
[ascl:2405.003]
https://github.com/wdpozzo/raynest
DESCRIPTION.rst
A parallel nested sampler (C) 2023-2025 Walter Del Pozzo, John Veitch
reStructuredText
MIT
76
[ascl:2405.003]
https://github.com/wdpozzo/raynest
README.rst
raynest ====== Parallel nested sampling in python ---- © 2015-2021 Walter Del Pozzo, John Veitch .. image:: https://img.shields.io/badge/license-MIT-blue.svg :alt: MIT license :target: https://github.com/wdpozzo/raynest/blob/master/LICENSE walter.delpozzo@ligo.org, john.veitch@ligo.org raynest is a python m...
reStructuredText
MIT
899
[ascl:2405.003]
https://github.com/wdpozzo/raynest
INSTALL.txt
The simplest way to install cpnest is via pip pip install raynest It is also available from conda-forge conda install -c conda-forge cpnest -- Install this package from source using setuptools: python3 setup.py install Tests can be run with: python3 setup.py test For developers, local install with: pyth...
Text
MIT
438
[ascl:2405.003]
https://github.com/wdpozzo/raynest
setup.py
import os import platform import numpy from setuptools import setup, Extension, find_packages from Cython.Build import cythonize WINDOWS = platform.system().lower() == "windows" # set extension libraries = [] if WINDOWS else ["m"] ext_modules = [Extension("raynest.parameter", sources=[os.path...
Python
MIT
1,035
[ascl:2405.003]
https://github.com/wdpozzo/raynest
pyproject.toml
[build-system] requires = [ "setuptools>=61.0", "wheel", "cython", "numpy" ] build-backend = "setuptools.build_meta" [project] name = "raynest" description = "raynest: Parallel nested sampling based on ray" version = "1.1.2" requires-python = ">=3.9" readme = {file = "README.rst", content-type = "text/plain"} ...
TOML
MIT
780
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/ackley.py
import unittest import numpy as np import raynest.model from numpy import log class AckleyModel(raynest.model.Model): """ Ackley problem from https://en.wikipedia.org/wiki/Test_functions_for_optimization """ names=['x','y'] bounds=[[-5,5],[-5,5]] data = None def log_likelihood(self,x): ...
Python
MIT
1,062
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/gaussianmixture.py
import warnings import numpy as np import raynest.model from scipy.stats import norm from scipy.special import logsumexp def hypertriangulate(x, bounds=(0, 1)): """ Transform a vector of numbers from the hypercube to the hypertriangle. The hypercube is the space the samplers usually work in; the comp...
Python
MIT
10,942
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/profiling.py
import pstats, cProfile s = pstats.Stats("prof_sampler.prof") s.strip_dirs().sort_stats("time").print_stats() s = pstats.Stats("prof_nested_sampling.prof") s.strip_dirs().sort_stats("cumulative").print_stats()
Python
MIT
212
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/test_50d.py
import unittest import numpy as np import raynest.model from scipy import stats class GaussianModel(raynest.model.Model): """ An n-dimensional gaussian """ def __init__(self,dim=50): self.distr = stats.norm(loc=0,scale=1.0) self.dim=dim self.names=['{0}'.format(i) for i in range...
Python
MIT
2,259
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/diagnose_trajectory.py
import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt import sys, os np.seterr(all='raise') def log_likelihood(x): return np.sum([-0.5*x[n]**2-0.5*np.log(2.0*np.pi) for n in range(x.shape[0])]) mode = sys.argv[1] if mode == 'delete': allfiles = os.listdir('.') toremove = [a for a ...
Python
MIT
1,089
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/rosenbrock.py
#!/bin/usr/env python import numpy as np import raynest.model class RosenbrockModel(raynest.model.Model): """ The n-dimensional Rosenbrock function See: https://arxiv.org/pdf/1903.09556.pdf """ def __init__(self, ndims=2): self.ndims = ndims self.names = ['x' + str(i) for i in ran...
Python
MIT
1,260
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/burst.py
import numpy as np import raynest.model def sine_gaussian(x,t): e = (t-x['t0'])/x['tau'] return x['A']*np.exp(-e**2)*np.cos(2*np.pi*x['f']*t + x['phi']) class BurstModel(raynest.model.Model): """ A Burst like search model """ def __init__(self, time, data, sigma = 1.0): self.time = t...
Python
MIT
2,057
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/eggbox.py
import unittest import numpy as np import raynest.model class EggboxModel(raynest.model.Model): """ Eggbox problem from https://arxiv.org/pdf/0809.3437v1.pdf """ names=['1','2','3','4','5'] bounds=[[0,10.0*np.pi],[0,10.0*np.pi],[0,10.0*np.pi],[0,10.0*np.pi],[0,10.0*np.pi]] data = None ...
Python
MIT
729
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/memory_footprint.py
from __future__ import print_function from sys import getsizeof, stderr from itertools import chain from collections import deque try: from reprlib import repr except ImportError: pass def total_size(o, handlers={}, verbose=False): """ Returns the approximate memory footprint an object and all of its conte...
Python
MIT
2,293
[ascl:2405.003]
https://github.com/wdpozzo/raynest
examples/eggbox_profile.py
import unittest import numpy as np import raynest.model """ Once run this example, use pyprof2calltree -i <profile report file> -k for detail call tree information """ from eggbox import EggboxModel if __name__=='__main__': work=raynest.raynest(EggboxModel(),verbose=2,nthreads=4,nlive=1000,maxmcmc=5000) wo...
Python
MIT
365
[ascl:2405.003]
https://github.com/wdpozzo/raynest
docs/index.rst
.. CPNest documentation master file, created by sphinx-quickstart on Thu Dec 7 13:57:03 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. toctree:: :maxdepth: 2 :caption: Contents: Welcome to CPNest's documentation! ===============...
reStructuredText
MIT
4,077
[ascl:2405.003]
https://github.com/wdpozzo/raynest
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CPNest documentation build configuration file, created by # sphinx-quickstart on Thu Dec 7 13:57:03 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
Python
MIT
5,836
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/model.py
from abc import ABCMeta,abstractmethod,abstractproperty from numpy import inf import numpy as np from .parameter import LivePoint import logging LOGGER = logging.getLogger('raynest.model') # <--- for module-level logging class Model(object): """ Base class for user's model. User should subclass this and...
Python
MIT
4,886
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/proposal.py
from __future__ import division from functools import reduce import numpy as np from math import log,sqrt,fabs,exp from abc import ABCMeta,abstractmethod from scipy.stats import multivariate_normal from scipy.special import logsumexp from .nest2pos import acl import ray def update_mean_covariance(ensemble): """ ...
Python
MIT
30,702
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/NestedSampling.py
from __future__ import division, print_function from asyncio import tasks import sys import os import pickle import time import logging import bisect import numpy as np from numpy import logaddexp from numpy import inf from scipy.stats import kstest from math import isnan from . import nest2pos from .nest2pos import lo...
Python
MIT
21,565
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/plot.py
import os import matplotlib as mpl from matplotlib import pyplot as plt import numpy as np def init_plotting(): """ utility function to set up the plotting environment """ plt.rcParams['figure.figsize'] = (3.4, 3.4) plt.rcParams['font.size'] = 11 plt.rcParams['font.family'] = 'DejaVu Sans' ...
Python
MIT
4,826
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/sampler.py
from __future__ import division import sys import os import logging import numpy as np from math import log from collections import deque from . import parameter from .proposal import DefaultProposalCycle, EnsembleProposal, update_mean_covariance import numpy.lib.recfunctions as rfn import array from .nest2pos import ...
Python
MIT
14,049
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/utils.py
import os import gc import logging import psutil # Default formats and level names FORMATTER = logging.Formatter( '%(asctime)s - %(name)-38s: %(message)s', datefmt='%Y-%m-%d, %H:%M:%S' ) LEVELS = ['CRITICAL', 'WARNING', 'INFO', 'DEBUG'] LOGGER = logging.getLogger('raynest.utils') class _Handler(logging.Handl...
Python
MIT
3,178
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/raynest.py
# coding: utf-8 import numpy as np import os import sys import signal import logging import dill from .utils import LogFile # module logger takes name according to its path LOGGER = logging.getLogger('raynest.raynest') import ray from ray.util import ActorPool from ray.util.scheduling_strategies import PlacementGrou...
Python
MIT
21,721
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/__init__.py
import logging from .utils import StreamHandler, LEVELS # Configure base logger for the raynest package - inherited by all loggers with # names prefixed by 'raynest' logger = logging.getLogger('raynest') logger.setLevel(LEVELS[-1]) # maximum verbosity recorded to base logger logger.addHandler(logging.NullHandler()) c...
Python
MIT
1,048
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/figaro_gradient.py
try: from figaro.mixture import DPGMM from figaro._likelihood import log_norm except: print("FIGARO not available! Hamiltonian Monte Carlo sampling not supported!") pass import numpy as np from tqdm import tqdm from scipy.stats import multivariate_normal as mn class ADPGMM(DPGMM): def __init__(sel...
Python
MIT
1,878
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/nest2pos.py
import logging import numpy as np from numpy import logaddexp, vstack from numpy.random import uniform from functools import reduce from scipy.signal import correlate # if not logging.Logger.manager.loggerDict: # LOGGER = logging.getLogger('raynest.nest2pos') # else: # LOGGER = logging.getLogger('raynest.raynes...
Python
MIT
8,031
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_gaussian.py
import unittest import numpy as np import raynest.model class GaussianModel(raynest.model.Model): """ A simple gaussian model with parameters mean and sigma """ names=['mean','sigma'] bounds=[[-5,5],[0.05,1]] data = np.array([x for x in np.random.normal(0.5,0.5,size=10)]) analyticZ = np.log...
Python
MIT
1,183
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_half_gaussian.py
import sys import unittest import numpy as np from scipy import integrate,stats import raynest import raynest.model import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt class HalfGaussianModel(raynest.model.Model): """ A simple gaussian model with parameters mean and sigma """ d...
Python
MIT
2,122
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_ring_slice.py
import unittest import numpy as np import raynest.model class RingModel(raynest.model.Model): """ A circular ring in parameter space logZ ~ -2.31836 """ names=['x','y'] bounds=[[-2,2],[-2,2]] data = None analytic_log_Z = -2.31836 @staticmethod def log_likelihood(x): retu...
Python
MIT
1,526
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_verbosity.py
import unittest import numpy as np import raynest.model class GaussianModel(raynest.model.Model): """ A simple gaussian model with parameters mean and sigma """ names=['mean','sigma'] bounds=[[-5,5],[0.05,1]] data = np.array([x for x in np.random.normal(0.5,0.5,size=10)]) analyticZ = np.log...
Python
MIT
1,299
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_2d_slice.py
import unittest import numpy as np import raynest.model class GaussianModel(raynest.model.Model): """ A simple 2 dimensional gaussian """ def __init__(self): pass names=['x','y'] bounds=[[-10,10],[-10,10]] analytic_log_Z=0.0 - np.log(bounds[0][1]-bounds[0][0]) - np.log(bounds[1][1]-...
Python
MIT
1,334
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_2d_hmc.py
import unittest import numpy as np import raynest.model class GaussianModel(raynest.model.Model): """ A simple 2 dimensional gaussian """ def __init__(self): pass names=['x','y'] bounds=[[-10,10],[-10,10]] analytic_log_Z=0.0 - np.log(bounds[0][1]-bounds[0][0]) - np.log(bounds[1][1]-...
Python
MIT
1,439
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_ring.py
import unittest import numpy as np import raynest.model class RingModel(raynest.model.Model): """ A circular ring in parameter space logZ ~ -2.31836 """ names=['x','y'] bounds=[[-2,2],[-2,2]] data = None analytic_log_Z = -2.31836 @staticmethod def log_likelihood(x): retu...
Python
MIT
1,537
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_1d.py
import unittest import numpy as np from scipy import integrate,stats import raynest import raynest.model import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt class GaussianModel(raynest.model.Model): """ A simple gaussian model with parameters mean and sigma """ def __init__(sel...
Python
MIT
2,354
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/test_2d.py
import unittest import numpy as np import raynest.model class GaussianModel(raynest.model.Model): """ A simple 2 dimensional gaussian """ def __init__(self): pass names=['x','y'] bounds=[[-5,5],[-5,5]] analytic_log_Z=0.0 - np.log(bounds[0][1]-bounds[0][0]) - np.log(bounds[1][1]-boun...
Python
MIT
1,508
[ascl:2405.003]
https://github.com/wdpozzo/raynest
raynest/tests/__init__.py
__all__=['test_1d','test_2d','test_gaussian']
Python
MIT
46
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
README.md
# Creating updated, scientifically-calibrated mosaics for the RC3 Catalogue The Third Reference Catalogue of Bright Galaxies (RC3) is a reasonably complete listing of 23,010 large, bright galaxies. Using the latest Sloan Digital Sky Survey’s Data Release 10 (SDSS DR10) data, we provide color composite images and scient...
Markdown
null
3,052
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
database/database.py
import sqlite3 def create_table(db_name,table_name,sql): #sql statement that you want to take with sqlite3.connect(db_name) as db: #open db and do stuff within function. If crashes then connection automatically closed. cursor = db.cursor() #give latest info about navigate around database cursor.exec...
Python
null
1,421
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
database/rc3_database.py
# Remember to remove rc3.db everytime you rerun this. Database files (.db) can only be instantiated once. import sqlite3 conn = sqlite3.connect("rc3.db") c = conn.cursor() def tableCreate(): #this can only be done once # create table and specify column, primary key is auto incremnting ID number c.execute("CREATE TAB...
Python
null
4,776
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/list_rc3_in_sdss.sh
for i in */ do if [ -d $i/sdss/ ]; then echo $i echo $i | cut -f1 -d'/'>> rc3_in_sdss.txt fi done
Shell
null
117
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/rename.py
# Script for renaming all the data poduct (FITS and TIFF) import glob import os # print [f for f in os.listdir('.') if os.path.isfile(f)] for i in os.walk('.').next()[1]: print ("Working on PGC {} ".format(i)) os.chdir("{}/sdss".format(i)) #directory name is pgc number try: os.rename(glob.glob...
Python
null
1,351
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/SCcount.py
import numpy as np ra= [] dec = [] radius=[] pgc=[] rc3= {} with open("rc3_ra_dec_diameter_pgc.txt",'r') as f: for line in f: a = str(line)[0] if a[0] =="@": start=True continue if (start): rai = float(line.split()[0]) deci=float(line.split()[1]) radi=float(line.split()[2])/2. ra.append(rai) ...
Python
null
931
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/readfile.py
#Run in Python2 output = open("rc3_ra_dec_only(Final).txt", "w") #output.write("ra |") #output.write("dec |") #output.write("radius \n") for line in file('rc3.txt'): x = float(line[0:2]) y = float(line[2:4]) z = float(line[4:8]) sign = line[9] decval = float(line[10:12])...
Python
null
1,088
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/ipython_log.py
# IPython log file get_ipython().magic(u'logon ') get_ipython().magic(u'logstart ') ra = [] for i in rc3.values(): ra.append(i[1]) ra for i in rc3.values(): ra.append(i[1]) a = [1,2] a.indexOf() a.indexOf(2) a.index(2)
Python
null
238
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/list_pgc.sh
for i in RUN* do echo "Working on $i" cd $i rm -r r/ ls -d */ | cut -f1 -d'/' >> ../pgc_done.txt cd .. done
Shell
null
132
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/thumbnail_process.py
#Keep only BEST images and convert all TIFF color images to .gif import os import glob os.chdir("Mosaic") bests = glob.glob("*_BEST.tiff") for i in bests: print (i) os.system("gm convert -resize 128x128\! {} {}.gif".format(i,i[:-5])) os.system("rm *.tiff") os.chdir("..") os.rename("Mosaic", "img")
Python
null
302
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/survey_merge.py
''' This script merges the data product output [pgc_number]-->[files] from each survey to the general catalog format [pgc_number]-->dss,sdss,2mass..etc-->[files] ''' import os import glob import shutil ADDITIONAL_NUM_DSS_COUNT = 0 # for i in os.listdir("dss_data/"): # eliminate weird files like .DSStore and other php a...
Python
null
1,907
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/other_rc3.py
import sqlcl import numpy as np with open("rc3_ra_dec_diameter_pgc.txt",'r') as f: for line in f: ra = float(line.split()[0]) dec = float(line.split()[1]) radius = float(line.split()[2])/2. #radius = diameter/2' margin = 3*radius pgc=str(line.split()[3]).replace(' ', '') ...
Python
null
1,818
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/nersc/qsub_everything.sh
for i in $( ls -d RUN* );do qsub $i/run.pbs ;done
Shell
null
50
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/nersc/insert_start.py
import sys print sys.argv n=int(sys.argv[1]) linenumber=int(sys.argv[2]) print n print linenumber f = open("rc3_ra_dec_diameter_pgc.txt".format(n),'r') contents = f.readlines() contents.insert(linenumber, "@ \n") contents = "".join(contents) #print contents f.close() f = open("rc3_ra_dec_diameter_pgc.txt".format(n),'...
Python
null
352
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/nersc/getserialscript.py
import sys #nproc is not npric here, it is a dummy for just the number of run counts for arg in sys.argv: nproc=arg nproc = int(nproc) #print "#PBS -q thruput" print "#PBS -q serial" print "#PBS -l walltime=48:00:00" print "#PBS -N RC3_RUN{}".format(nproc) print "#PBS -e test.$PBS_JOBID.err" print "#PBS -o test.$P...
Python
null
592
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
script/nersc/serial_submit.sh
source /project/projectdirs/cmb/modules/hpcports_NERSC.sh hpcports shared_gnu module load astromatic-hpcp module load python line=2612 #starting from line 2612 step=730 #Estimated number of lines that the pipeline goes thorugh in 48 hour runs (!= to # of galaxy mosaiced!) for (( i=1; i <=28; i++ )) do line=$[$line...
Shell
null
699
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/mosaic.sh
mImgtbl projdir images.tbl mOverlaps images.tbl diffs.tbl mDiffExec -p projdir diffs.tbl template.hdr diffdir mFitExec diffs.tbl fits.tbl diffdir mBgModel images.tbl fits.tbl corrections.tbl mBgExec -p projdir images.tbl corrections.tbl corrdir mAdd -p corrdir images.tbl template.hdr mosaic.fits mJPEG -gray mosaic.fits...
Shell
null
356
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/sdss.py
from survey import * class SDSS(Survey): def __init__(self): self.name='SDSS' self.bands=['u','g','r','i','z'] self.color_bands=['g','r','i'] self.best_band='r' self.data_server=Survey._initServer(self) self.pixel_scale = 0.396 #(arcsec/pix) # Mosaic Program ...
Python
null
677
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/bulk_run_dss.py
from rc3Catalog import RC3Catalog from dss import DSS from rc3 import RC3 rc3cat = RC3Catalog() dss = DSS() rc3cat.mosaicAll(dss)
Python
null
130
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/dss.py
# Survey Class for the Digitized Sky Survey (Digitized Palomar Observatory Sky Survey) from survey import * class DSS(Survey): def __init__(self): self.name = 'DSS' self.bands=['1b','1r','2b','2r','2ir'] self.color_bands=['2b','2r','2ir'] self.best_band ='2r' self.data_server...
Python
null
1,088
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/catalog.py
from abc import ABCMeta , abstractmethod class Catalog(object): ''' Class for Catalog objects ''' __metaclass__= ABCMeta def __init__(self): self.name= 'Catalog' self.frame= 'fk5' self.equinox = 'J2000' self.allObj=_initAllObj() @abstractmethod def _initAllObj(self): ''' Create a list of all obje...
Python
null
667
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/rc3.py
#!PATH=/usr/bin/:/data/small/des/montage/montage/Montage_v3.3/bin/:/bin from rc3Catalog import RC3Catalog from sdss import SDSS from twoMass import TwoMass import montage_wrapper as montage from astropy.io import fits as pyfits import os import shutil from math import trunc import glob import sqlcl import sys import f...
Python
null
24,293
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/bulk_run.py
from rc3Catalog import RC3Catalog from sdss import SDSS from rc3 import RC3 rc3cat = RC3Catalog() sloan = SDSS() rc3cat.mosaicAll(sloan)
Python
null
138
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/survey.py
from dssServer import DSSServer from gator import Gator from skyserver import SkyServer from server import Server class Survey(object): def __init__(self): self.name=name # Preset defaults for the specific survey self.bands = [] self.color_bands= [] self.best_band='@' ...
Python
null
1,025
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/skyserver.py
# Class for interacting with SDSS's SkyServer from server import Server import sqlcl import abc import os import time DEBUG = False class SkyServer(Server): #Default constructor def __init__ (self): if (DEBUG):print("SkyServer constructor") super(SkyServer,self).__init__() self.name = 'SkyServe...
Python
null
2,941
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/server.py
''' The Server object is an abstract class for accessing raw data from survey and feeds it into program in the appropraite format. ''' import astropy.units as u from astroquery.vizier import * #from astropy.coordinates import SkyCoord from astropy.coordinates import FK5 from astropy import coordinates from abc import ...
Python
null
2,827
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/rc3Catalog.py
import os from catalog import Catalog class RC3Catalog(Catalog): ''' Class for RC3 Catalog objects ''' def __init__(self): self.name= 'RC3 Catalog' self.frame= 'fk5' self.equinox = 'J2000' self.allObj=self._initAllObj() def _initAllObj(self): ''' Create a list of all objects inside the catalog ''' ...
Python
null
3,025
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/bulk_run_twoMass.py
from rc3Catalog import RC3Catalog from twoMass import TwoMass from rc3 import RC3 rc3cat = RC3Catalog() tm = TwoMass() rc3cat.mosaicAll(tm)
Python
null
140
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/__init__.py
Python
null
1
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/gator.py
# Class for interacting with IPAC's Gator API from astropy import * from astroquery.vizier import * from astroquery.irsa import Irsa import astropy.units as u from astropy import coordinates from astropy.coordinates import FK5 #from astropy.coordinates import SkyCoord from server import Server import abc import re i...
Python
null
3,775
[ascl:1411.006]
https://github.com/ProfessorBrunner/rc3-pipeline
pipeline/catalogSubset.txt
ID PGC_number ra dec radius new_ra new_dec new_radius in_SDSS_footprint clean error 9295 28630 148.889583333 69.0666666667 0.22951905907 148.888495 69.0654192 0.0897604255636 1 1 0 11134 34697 170.067916667 13.5894444444 0.123259032594 170.0670631 13.59372 0.0872663485941 1 1 0 12812 39346 184.180833333 69.4655555556 0...
Text
null
1,509