Skip to content

Instantly share code, notes, and snippets.

View smsharma's full-sized avatar

Siddharth Mishra-Sharma smsharma

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jupyter nbconvert --to rst examples/*.ipynb
rm -r docs/Example*
mv examples/*rst examples/*_files docs/
cd docs/
perl -pi -w -e 's/.. code:: ipython3/.. code:: python/g;' *.rst
# define a theano Op for our likelihood function
class LogLikeWithGrad(tt.Op):
itypes = [tt.dvector] # expects a vector of parameter values when called
otypes = [tt.dscalar] # outputs a single scalar value (the log likelihood)
def __init__(self, loglike):
"""
Initialise with various things that the function requires. Below
are the things that are needed in this particular example.
%%cython
import cython
cimport cython
import numpy as np
cimport numpy as np
import warnings
import numpy as np
import sys
sys.path.append("../Lensing-PowerSpectra/Simulations/")
from units import *
import theano.tensor as tt
def deflection_sis(x, y, x0=0, y0=0, b=1.5):
""" Deflection for singular isothermal ellipsoid, from astro-ph/0102341
"""
# Go into shifted coordinats of the potential
import numpy as np
from astropy.cosmology import Planck15
from units import *
import sys, os
if os.environ['DIFF']: # Whether to use Theano version of lensing gradients
from profiles_theano import *
else:
from profiles import *
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
###############################################################################
# run_11bin.py
###############################################################################
#
# Perform scan to obtain best-fit disk and bulge PS population parameters
#
# Here using the 4D efficiency function and the new 11 binning
#
###############################################################################
@smsharma
smsharma / rsub.sh
Created March 6, 2018 01:06
Working rsub script to open files in Sublime Text remotely.
#!/usr/bin/env bash
# rmate
# Copyright (C) 2011-2015 by Harald Lapp <[email protected]>
#
# This program 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 of the License, or
# (at your option) any later version.
#
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.