Giter Club home page Giter Club logo

mastcasjobs's Introduction

This provides a simple interface to the MAST CasJobs server (home of GALEX, Kepler, the Hubble Source Catalog, PanSTARRS, etc.) using Dan Foreman-Mackey's casjobs interface.

Usage

Install current versions of both modules:

pip install git+git://github.com/dfm/casjobs@master
pip install git+git://github.com/rlwastro/mastcasjobs@master

Note that this uses some features that are not in the standard pip version of the casjobs module, so it will probably not work using a simple 'pip install casjobs'.

An example query that does a cone search for PS1 objects within 50 arc-sec of coordinates RA=187.706, Dec=12.391 (in degrees):

from __future__ import print_function
import mastcasjobs

query = """select o.objID, o.raMean, o.decMean,
o.nDetections, o.ng, o.nr, o.ni, o.nz, o.ny,
m.gMeanPSFMag, m.rMeanPSFMag, m.iMeanPSFMag, m.zMeanPSFMag, m.yMeanPSFMag
from fGetNearbyObjEq(187.706,12.391,50.0/60.0) nb
inner join ObjectThin o on o.objid=nb.objid and o.nDetections>1
inner join MeanObject m on o.objid=m.objid and o.uniquePspsOBid=m.uniquePspsOBid
"""

# get your WSID from from <http://mastweb.stsci.edu/ps1casjobs/changedetails.aspx> after you login to Casjobs
# pwd is your Casjobs password
# These can also come from the CASJOBS_WSID and CASJOBS_PW environment variables
wsid = 265306138
pwd = "My super secret password"

jobs = mastcasjobs.MastCasJobs(userid=wsid, password=pwd, context="PanSTARRS_DR1")
results = jobs.quick(query, task_name="python cone search")
print(results)

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.