Skip to content

Commit

Permalink
fix skyportal galaxies
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoughlin committed Jun 26, 2024
1 parent d8f9f32 commit 7279ce6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions gwemopt/skyportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from mocpy import MOC
from regions import CircleSkyRegion, PolygonSkyRegion, RectangleSkyRegion

import gwemopt.moc
import gwemopt.tiles
from gwemopt.tiles import angular_distance, get_rectangle, powerlaw_tiles_struct

Expand Down Expand Up @@ -172,20 +173,19 @@ def create_galaxy_from_skyportal(params, map_struct, catalog_struct, regions=Non
catalog_struct_new["Smass"] = new_Smass
catalog_struct_new["galaxies"] = galaxies

moc_struct = {}
cnt = 0
for ra, dec, Sloc, S, Smass, galaxies in zip(
catalog_struct_new["ra"],
catalog_struct_new["dec"],
catalog_struct_new["Sloc"],
catalog_struct_new["S"],
catalog_struct_new["Smass"],
catalog_struct_new["galaxies"],
):
moc_struct[int(cnt)] = gwemopt.moc.Fov2Moc(
params, config_struct, telescope, ra, dec, nside
tesselation = np.vstack(
(
np.arange(len(catalog_struct_new["ra"])),
catalog_struct_new["ra"],
catalog_struct_new["dec"],
)
moc_struct[int(cnt)]["galaxies"] = galaxies
).T
moc_struct = gwemopt.moc.construct_moc(
params, config_struct, telescope, tesselation
)
cnt = 0
for _, row in catalog_struct_new.iterrows():
moc_struct[cnt]["galaxies"] = row["galaxies"]
cnt = cnt + 1

tile_struct = powerlaw_tiles_struct(
Expand Down

0 comments on commit 7279ce6

Please sign in to comment.