Skip to content

Instantly share code, notes, and snippets.

View smsharma's full-sized avatar

Siddharth Mishra-Sharma smsharma

View GitHub Profile
This file has been truncated, but you can view the full file.
#Results from heasarc_fermilpsc: Fermi LAT 4-Year Point Source Catalog
#Coordinate system: Galactic
|name |_Lii |_Bii |flux_1_100_gev|flux_1_100_gev_error|spectral_index|spectral_index_error|detection_significance|assoc_name_1 |lii |bii |semi_major_axis_68|semi_minor_axis_68|position_angle_68|semi_major_axis_95|semi_minor_axis_95|position_angle_95|pivot_energy|flux_density|flux_density_error|energy_flux|energy_flux_error|curve_significance|spectrum_type |beta |beta_error|cutoff |cutoff_error|exp_index|exp_index_error|powerlaw_index|flux_30_100_mev|flux_30_100_mev_pos_err|flux_30_100_mev_neg_err|nufnu_30_100_mev|sqrt_ts_30_100_mev|flux_100_300_mev|flux_100_300_mev_pos_err|flux_100_300_mev_neg_err|nufnu_100_300_mev|sqrt_ts_100_300_mev|flux_0p3_1_gev|flux_0p3_1_gev_pos_err|flux_0p3_1_gev_neg_err|nufnu_0p3_1_gev|sqrt_ts_0p3_1_gev|flux_1_3_gev|flux_1_3_gev_pos_err|flux_1_3_gev_neg_err|nufnu_1_3_gev|sqrt_ts_1_3_gev|flux_3_10_gev|flux_3_10_gev_pos_err|flux_3_10_gev_neg_er
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.
#
###############################################################################
# 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
#
###############################################################################
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 *
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
%%cython
import cython
cimport cython
import numpy as np
cimport numpy as np
import warnings
# 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.
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