Skip to content

Commit

Permalink
update examples to include new magnitude array format
Browse files Browse the repository at this point in the history
  • Loading branch information
imedan committed Mar 21, 2022
1 parent 7fb3c86 commit 7437f91
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
18 changes: 12 additions & 6 deletions examples/commissioning_design_example_all_skies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@
" targetdb.Magnitude.g,\n",
" targetdb.Magnitude.r,\n",
" targetdb.Magnitude.i,\n",
" targetdb.Magnitude.z,\n",
" targetdb.Magnitude.bp,\n",
" targetdb.Magnitude.gaia_g,\n",
" targetdb.Magnitude.rp,\n",
" targetdb.Magnitude.j,\n",
" targetdb.Magnitude.h,\n",
" targetdb.Magnitude.k,\n",
" targetdb.Category.label,\n",
" targetdb.Carton.program,\n",
" targetdb.Instrument.label)\n",
Expand All @@ -108,7 +111,7 @@
" (targetdb.Target.cone_search(racen, deccen, r_search))))\n",
"\n",
"# grab the results\n",
"catalogid, ra, dec, target_pk, priority, value, cadences, carton, carton_to_target_pk, g, r, i, bp, gaia_g, rp, h, category, program, instrument = map(list, zip(*list(all_skies.tuples())))\n",
"catalogid, ra, dec, target_pk, priority, value, cadences, carton, carton_to_target_pk, g, r, i, z, bp, gaia_g, rp, j, h, k, category, program, instrument = map(list, zip(*list(all_skies.tuples())))\n",
"catalogid = np.array(catalogid, dtype=np.int64)\n",
"ra = np.array(ra)\n",
"dec = np.array(dec)\n",
Expand All @@ -120,14 +123,17 @@
"category = np.array(category)\n",
"program = np.array(program)\n",
"instrument = np.char.upper(instrument)\n",
"magnitudes = np.zeros((len(g),7))\n",
"magnitudes = np.zeros((len(g),10))\n",
"magnitudes[:, 0] = g\n",
"magnitudes[:, 1] = r\n",
"magnitudes[:, 2] = i\n",
"magnitudes[:, 3] = bp\n",
"magnitudes[:, 4] = gaia_g\n",
"magnitudes[:, 5] = rp\n",
"magnitudes[:, 6] = h"
"magnitudes[:, 3] = z\n",
"magnitudes[:, 4] = bp\n",
"magnitudes[:, 5] = gaia_g\n",
"magnitudes[:, 6] = rp\n",
"magnitudes[:, 7] = j\n",
"magnitudes[:, 8] = h\n",
"magnitudes[:, 9] = k"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,13 @@
" targetdb.Magnitude.g,\n",
" targetdb.Magnitude.r,\n",
" targetdb.Magnitude.i,\n",
" targetdb.Magnitude.z,\n",
" targetdb.Magnitude.bp,\n",
" targetdb.Magnitude.gaia_g,\n",
" targetdb.Magnitude.rp,\n",
" targetdb.Magnitude.j,\n",
" targetdb.Magnitude.h,\n",
" targetdb.Magnitude.k,\n",
" targetdb.Category.label,\n",
" targetdb.Carton.program,\n",
" targetdb.Instrument.label)\n",
Expand All @@ -712,7 +715,7 @@
" (targetdb.Target.cone_search(racen, deccen, r_search))))\n",
"\n",
"# grab the results\n",
"catalogid, ra, dec, target_pk, priority, value, cadences, carton, carton_to_target_pk, g, r, i, bp, gaia_g, rp, h, category, program, instrument = map(list, zip(*list(all_skies.tuples())))\n",
"catalogid, ra, dec, target_pk, priority, value, cadences, carton, carton_to_target_pk, g, r, i, z, bp, gaia_g, rp, j, h, k, category, program, instrument = map(list, zip(*list(all_skies.tuples())))\n",
"catalogid = np.array(catalogid, dtype=np.int64)\n",
"ra = np.array(ra)\n",
"dec = np.array(dec)\n",
Expand All @@ -724,14 +727,17 @@
"category = np.array(category)\n",
"program = np.array(program)\n",
"instrument = np.char.upper(instrument)\n",
"magnitudes = np.zeros((len(g),7))\n",
"magnitudes = np.zeros((len(g),10))\n",
"magnitudes[:, 0] = g\n",
"magnitudes[:, 1] = r\n",
"magnitudes[:, 2] = i\n",
"magnitudes[:, 3] = bp\n",
"magnitudes[:, 4] = gaia_g\n",
"magnitudes[:, 5] = rp\n",
"magnitudes[:, 6] = h"
"magnitudes[:, 3] = z\n",
"magnitudes[:, 4] = bp\n",
"magnitudes[:, 5] = gaia_g\n",
"magnitudes[:, 6] = rp\n",
"magnitudes[:, 7] = j\n",
"magnitudes[:, 8] = h\n",
"magnitudes[:, 9] = k"
]
},
{
Expand Down Expand Up @@ -1240,7 +1246,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.9.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7437f91

Please sign in to comment.