Skip to content

Commit

Permalink
remove doBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoughlin committed Jun 5, 2024
1 parent 0349b41 commit e64d45b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 57 deletions.
5 changes: 0 additions & 5 deletions gwemopt/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ def parse_args(args):
parser.add_argument("--Ncores", default=4, type=int)
parser.add_argument("--parallelBackend", default="threading")

parser.add_argument("--doBlocks", action="store_true", default=False)
parser.add_argument("--Nblocks", default=4, type=int)

parser.add_argument("--absmag", default=-15.0, type=float)

parser.add_argument(
"--galactic_limit", help="Galactic limit.", default=0.0, type=float
)
Expand Down
55 changes: 3 additions & 52 deletions gwemopt/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ def powerlaw(params, map_struct, tile_structs, previous_coverage_struct=None):
)

if params["doAlternatingFilters"]:
if params["doBlocks"]:
tile_struct = eject_tiles(params, telescope, tile_struct)

params_hold = copy.copy(params)
config_struct_hold = copy.copy(config_struct)

Expand Down Expand Up @@ -411,55 +408,9 @@ def timeallocation(params, map_struct, tile_structs, previous_coverage_struct=No
if params["treasuremap_token"] is not None and not previous_coverage_struct:
print("\nNo previous observations were ingested.\n")

if params["doBlocks"]:
exposurelists = {}
scheduled_fields = {}
for jj, telescope in enumerate(params["telescopes"]):
config_struct = params["config"][telescope]
exposurelist_split = np.array_split(
config_struct["exposurelist"], params["Nblocks"]
)
exposurelists[telescope] = exposurelist_split
scheduled_fields[telescope] = []
tile_structs_hold = copy.copy(tile_structs)
coverage_structs = []

for ii in range(params["Nblocks"]):
params_hold = copy.copy(params)
params_hold["scheduled_fields"] = scheduled_fields
for jj, telescope in enumerate(params["telescopes"]):
exposurelist = segments.segmentlist()
for seg in exposurelists[telescope][ii]:
exposurelist.append(segments.segment(seg[0], seg[1]))
params_hold["config"][telescope]["exposurelist"] = exposurelist

tile_structs_hold[telescope] = gwemopt.tiles.powerlaw_tiles_struct(
params_hold,
config_struct,
telescope,
map_struct,
tile_structs_hold[telescope],
)

tile_structs_hold, coverage_struct = gwemopt.coverage.powerlaw(
params_hold,
map_struct,
tile_structs_hold,
previous_coverage_struct,
)

coverage_structs.append(coverage_struct)
for ii in range(len(coverage_struct["moc"])):
telescope = coverage_struct["telescope"][ii]
scheduled_fields[telescope].append(
coverage_struct["data"][ii, 5]
) # appends all scheduled fields to appropriate list

coverage_struct = combine_coverage_structs(coverage_structs)
else:
tile_structs, coverage_struct = gwemopt.coverage.powerlaw(
params, map_struct, tile_structs, previous_coverage_struct
)
tile_structs, coverage_struct = gwemopt.coverage.powerlaw(
params, map_struct, tile_structs, previous_coverage_struct
)

elif params["timeallocationType"] == "manual":
print("Generating manual schedule...")
Expand Down

0 comments on commit e64d45b

Please sign in to comment.