Skip to content

Commit

Permalink
Merge branch 'document-target-measures' of github.com:LSSTDESC/Blendi…
Browse files Browse the repository at this point in the history
…ngToolKit into document-target-measures
  • Loading branch information
thuiop committed Jul 28, 2021
2 parents c648417 + 054ef80 commit bc35590
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions notebooks/scarlet-measure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@
" if len(catalog) == 0:\n",
" t = astropy.table.Table()\n",
" t[\"ra\"], t[\"dec\"] = wcs_ref.pixel_to_world_values(catalog[\"x\"], catalog[\"y\"])\n",
" return {\"catalog\":t,\"segmentation\":None,\"deblended_images\":{s.name: [np.zeros((len(s.filters),batch[\"blend_images\"][s.name][idx].shape[1],\n",
" batch[\"blend_images\"][s.name][idx].shape[1]))] for s in surveys}}\n",
" if multiresolution:\n",
" return {\"catalog\":t,\"segmentation\":None,\"deblended_images\":{s.name: np.array([np.zeros((len(s.filters),batch[\"blend_images\"][s.name][idx].shape[1],\n",
" batch[\"blend_images\"][s.name][idx].shape[1]))]) for s in surveys}}\n",
" else:\n",
" s = surveys[0]\n",
" return {\"catalog\":t,\"segmentation\":None,\"deblended_images\":np.array([np.zeros((len(s.filters),batch[\"blend_images\"][idx].shape[1],\n",
" batch[\"blend_images\"][idx].shape[1]))])}\n",
" \n",
"\n",
" \n",
Expand Down Expand Up @@ -195,13 +200,16 @@
" except AssertionError: #If the fitting fails\n",
" t = astropy.table.Table()\n",
" t[\"ra\"], t[\"dec\"] = wcs_ref.pixel_to_world_values(catalog[\"x\"], catalog[\"y\"])\n",
" deblended_images={s.name: np.array([np.zeros((len(s.filters),batch[\"blend_images\"][s.name][idx].shape[1],\n",
" batch[\"blend_images\"][s.name][idx].shape[1])) for c in catalog]) for s in surveys}\n",
" if multiresolution:\n",
" deblended_images={s.name: np.array([np.zeros((len(s.filters),batch[\"blend_images\"][s.name][idx].shape[1],\n",
" batch[\"blend_images\"][s.name][idx].shape[1])) for c in catalog]) for s in surveys}\n",
" else:\n",
" deblended_images={s.name: np.array([np.zeros((len(s.filters),batch[\"blend_images\"][idx].shape[1],\n",
" batch[\"blend_images\"][idx].shape[1])) for c in catalog]) for s in surveys}\n",
" print(\"failed\")\n",
" \n",
" if len(surveys) == 1:\n",
" deblended_images = deblended_images[surveys[0].name]\n",
" \n",
" return {\"catalog\":t,\"segmentation\":None,\"deblended_images\":deblended_images}"
]
},
Expand Down

0 comments on commit bc35590

Please sign in to comment.