Skip to content

Commit 0ced01d

Browse files
committed
Initial upload of files.
0 parents  commit 0ced01d

File tree

4 files changed

+566
-0
lines changed

4 files changed

+566
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.ipynb_checkpoints

LSST/PlotAllSources.ipynb

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"metadata": {
3+
"name": "",
4+
"signature": "sha256:7a8de02674ab6f58688ad9040542fc61a83da9c33f4ea142a9c29abd996b2f2f"
5+
},
6+
"nbformat": 3,
7+
"nbformat_minor": 0,
8+
"worksheets": [
9+
{
10+
"cells": [
11+
{
12+
"cell_type": "code",
13+
"collapsed": false,
14+
"input": [
15+
"import os\n",
16+
"import lsst.daf.persistence as dafPersist\n",
17+
"import lsst.afw.image as afwImage\n",
18+
"import lsst.afw.display.ds9 as ds9"
19+
],
20+
"language": "python",
21+
"metadata": {},
22+
"outputs": [],
23+
"prompt_number": 1
24+
},
25+
{
26+
"cell_type": "code",
27+
"collapsed": false,
28+
"input": [
29+
"# Create a butler instance to provide access to the data\n",
30+
"DATA_DIR = os.environ.get('DATA_DIR')\n",
31+
"butler = dafPersist.Butler(DATA_DIR)\n",
32+
"\n",
33+
"# Fetch the r-band exposure for the specified run/field/camcol/filter\n",
34+
"dataId = dict(run=6377, field=399, filter='r', camcol=4)\n",
35+
"exposure = butler.get('calexp', dataId)\n",
36+
"\n",
37+
"# display the exposure, with mask overlay\n",
38+
"settings = {'scale':'linear', 'zscale':'', 'zoom': 1, 'mask' : 'transparency 40'}\n",
39+
"title = \"SDSS r-band; Run: 6377, Field: 399\"\n",
40+
"# Need to have ds9 running or this breaks.\n",
41+
"ds9.mtv(exposure, frame=1, title=title, settings=settings)"
42+
],
43+
"language": "python",
44+
"metadata": {},
45+
"outputs": [],
46+
"prompt_number": 2
47+
},
48+
{
49+
"cell_type": "code",
50+
"collapsed": false,
51+
"input": [
52+
"FILTER_MAP = {'u': 0, 'g':1, 'r': 2, 'i': 3, 'z': 4, 'y': 5}\n",
53+
"MARKER_COLORS = (ds9.MAGENTA, ds9.GREEN, ds9.RED, ds9.YELLOW, ds9.WHITE)\n",
54+
"MARKER_SIZES = (4, 5, 6, 7, 8)\n",
55+
"\n",
56+
"run = 6377\n",
57+
"field = 399\n",
58+
"filters='ugriz'\n",
59+
"\n",
60+
"for j, filter in enumerate(filters):\n",
61+
" # Fetch the exposure from the run/field/filter/camcol:\n",
62+
" dataId = dict(run=run, field=field, filter=filter, camcol=4)\n",
63+
" exposure = butler.get('calexp', dataId)\n",
64+
" idx = FILTER_MAP[filter]\n",
65+
"\n",
66+
" # Now get the catalog and over-plot the sources\n",
67+
" sources = butler.get('src', dataId)\n",
68+
" with ds9.Buffering():\n",
69+
" for i, source in enumerate(sources):\n",
70+
" symbol = \"o\"\n",
71+
" \n",
72+
" ds9.dot(symbol, source.getX(), source.getY(), ctype=MARKER_COLORS[idx],\n",
73+
" size=MARKER_SIZES[idx], frame=1, silent=True)\n",
74+
"\n"
75+
],
76+
"language": "python",
77+
"metadata": {},
78+
"outputs": [],
79+
"prompt_number": 3
80+
},
81+
{
82+
"cell_type": "code",
83+
"collapsed": false,
84+
"input": [],
85+
"language": "python",
86+
"metadata": {},
87+
"outputs": []
88+
}
89+
],
90+
"metadata": {}
91+
}
92+
]
93+
}

0 commit comments

Comments
 (0)