def make_scheduler(scale_down=False, max_dither=0.7, nexp=1):
    nside = 32
    per_night = True  # Dither DDF per night

    camera_ddf_rot_limit = 75.

    extra_info = {}
    exec_command = ''
    for arg in sys.argv:
        exec_command += ' ' + arg
    extra_info['exec command'] = exec_command
    try:
        extra_info['git hash'] = subprocess.check_output(
            ['git', 'rev-parse', 'HEAD'])
    except subprocess.CalledProcessError:
        extra_info['git hash'] = 'Not in git repo'

    extra_info['file executed'] = os.path.realpath(__file__)

    fileroot = 'baseline_nexp%i_' % nexp
    file_end = 'v1.6_'

    if scale_down:
        footprints = nes_light_footprints(nside=nside)
        fileroot = fileroot + 'scaleddown_'
    else:
        footprints = standard_goals(nside=nside)

    # Set up the DDF surveys to dither
    dither_detailer = detailers.Dither_detailer(per_night=per_night,
                                                max_dither=max_dither)
    details = [
        detailers.Camera_rot_detailer(min_rot=-camera_ddf_rot_limit,
                                      max_rot=camera_ddf_rot_limit),
        dither_detailer
    ]
    ddfs = generate_dd_surveys(nside=nside, nexp=nexp, detailers=details)

    greedy = gen_greedy_surveys(nside, nexp=nexp, footprints=footprints)
    blobs = generate_blobs(nside, nexp=nexp, footprints=footprints)
    surveys = [ddfs, blobs, greedy]
    scheduler = Core_scheduler(surveys, nside=nside)
    return scheduler
Ejemplo n.º 2
0
    if scale_down:
        footprints_hp = nes_light_footprints(nside=nside)
        fileroot = fileroot + 'scaleddown_'
    else:
        footprints_hp = standard_goals(nside=nside)

    observatory = Model_observatory(nside=nside)
    conditions = observatory.return_conditions()
    footprints = Footprint(conditions.mjd_start,
                           sun_RA_start=conditions.sun_RA_start,
                           nside=nside)
    for i, key in enumerate(footprints_hp):
        footprints.footprints[i, :] = footprints_hp[key]

    # Set up the DDF surveys to dither
    dither_detailer = detailers.Dither_detailer(per_night=per_night,
                                                max_dither=max_dither)
    details = [
        detailers.Camera_rot_detailer(min_rot=-camera_ddf_rot_limit,
                                      max_rot=camera_ddf_rot_limit),
        dither_detailer
    ]
    ddfs = generate_dd_surveys(nside=nside, nexp=nexp, detailers=details)

    greedy = gen_greedy_surveys(nside, nexp=nexp, footprints=footprints)
    blobs = generate_blobs(nside, nexp=nexp, footprints=footprints)
    surveys = [ddfs, blobs, greedy]
    run_sched(surveys,
              survey_length=survey_length,
              verbose=verbose,
              fileroot=os.path.join(outDir, fileroot + file_end),
              extra_info=extra_info,