Skip to main content

Generate random points within SDSS DR8 to DR16 footprint.

Project description


PyPI version RandomSDSS Coverage Status Documentation Status License: MIT

Generate random points in the Sloan Digital Sky Survey (SDSS) DR8 to DR16 footprints.

This is a small wrapper around the package pymangle that facilitates the creation of random points in the SDSS fields. I included SDSS polygons for its diferent data releases (DR8 to DR16).

Basic Usage

import matplotlib.pyplot as plt
import randomsdss

dr12 = randomsdss.DR12(catalog="BOSS")
ra, dec = dr12.sky_random(size=10_000)

plt.scatter(ra, dec, s=1)
plt.xlabel('RA [deg]')
plt.ylabel('DEC [deg]')

DR12 example

Alternatively you can get the same result without the need to instantiate an object using:

ra, dec = randomsdss.sky_random(dr="DR12", catalog="BOSS", size=10_000)

If you also need a random redshift distribution you can provide a sample of redshifts and a random set will be generated from the underlying Probability Density Function (PDF):

z = randomsdss.z_random(z_array, size=10_000)

The z_random is a complementary function since it doesn't use any information from the SDSS catalogs, only the provided redshift array.


Martin Chalela - email:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

randomsdss-0.5.0.tar.gz (12.5 MB view hashes)

Uploaded source

Built Distribution

randomsdss-0.5.0-py3-none-any.whl (13.0 MB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page