Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import dask.dataframe as dd
import desc.pserv
import desc.pserv.utils as pserv_utils
import lsst.daf.persistence
def asPandas(cat, cls=None, copy=False, unviewable="copy"):
"""!
Return a pandas dataframe view into this catalog.
@fjaviersanchez
fjaviersanchez / compute_stats.py
Created December 7, 2017 20:34
small function
def compute_stats(x,y,z,bins,cut=[]):
b1, binx, biny, _ = binned_statistic_2d(x[cut],y[cut],z[cut],statistic='sum',bins=bins)
c1, binx, biny, _ = binned_statistic_2d(x[cut],y[cut],z[cut],statistic='count',bins=bins)
b2, binx, biny, _ = binned_statistic_2d(x[cut],y[cut],z[cut]**2,statistic='sum',bins=bins)
bin_center = 0.5*(bin_edges[1:]+bin_edges[:-1])
return b1, c1, b2, bin_center
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fjaviersanchez
fjaviersanchez / gcr_coadd_test.ipynb
Created July 6, 2018 01:04
Test of the GCRCatalog Coadd catalog reader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fjaviersanchez
fjaviersanchez / test_DC2_stellar_density.ipynb
Last active October 30, 2018 08:53
Notebook to check the stellar density in the DC2 area
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fjaviersanchez
fjaviersanchez / Run_1.2p_PSF_checks.ipynb
Created November 15, 2018 03:23
Check Run 1.2p ellipticity
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fjaviersanchez
fjaviersanchez / Run_2.2i_preliminary_validation.ipynb
Last active November 4, 2019 11:56
Preliminary validation tests of 2.2i
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.