示例#1
0
def abba_all(recipe_name, utdate, refdate="20140316", bands="HK",
             starting_obsids=None, #interactive=False,
             config_file="recipe.config"):

    from libs.igrins_config import IGRINSConfig
    config = IGRINSConfig(config_file)

    if not bands in ["H", "K", "HK"]:
        raise ValueError("bands must be one of 'H', 'K' or 'HK'")

    fn = config.get_value('RECIPE_LOG_PATH', utdate)
    from libs.recipes import Recipes #load_recipe_list, make_recipe_dict
    recipe = Recipes(fn)

    if starting_obsids is not None:
        starting_obsids = map(int, starting_obsids.split(","))

    selected = recipe.select(recipe_name, starting_obsids)
    if not selected:
        print "no recipe of with matching arguments is found"

    process_abba_band = ProcessABBABand(utdate, refdate, config).process

    for s in selected:
        obsids = s[0]
        frametypes = s[1]

        for band in bands:
            process_abba_band(recipe_name, band,
                              obsids, frametypes,
                              #do_interactive_figure=interactive
                              )
示例#2
0
def abba_all(recipe_name, utdate, refdate="20140316", bands="HK",
             starting_obsids=None, interactive=False,
             config_file="recipe.config",
             frac_slit=None,
             cr_rejection_thresh=100.,
             debug_output=False,
             wavelength_increasing_order=False,
             fill_nan=None,
             lacosmics_thresh=0,
             subtract_interorder_background=False,
             ):

    from libs.igrins_config import IGRINSConfig
    config = IGRINSConfig(config_file)

    if not bands in ["H", "K", "HK"]:
        raise ValueError("bands must be one of 'H', 'K' or 'HK'")

    fn = config.get_value('RECIPE_LOG_PATH', utdate)
    from libs.recipes import Recipes #load_recipe_list, make_recipe_dict
    recipe = Recipes(fn)

    if starting_obsids is not None:
        starting_obsids = map(int, starting_obsids.split(","))

    selected = recipe.select(recipe_name, starting_obsids)
    if not selected:
        print "no recipe of with matching arguments is found"

    if frac_slit is not None:
        frac_slit = map(float, frac_slit.split(","))
        if len(frac_slit) !=2:
            raise ValueError("frac_slit must be two floats separated by comma")

    kwargs = dict(frac_slit=frac_slit,
                  cr_rejection_thresh=cr_rejection_thresh,
                  debug_output=debug_output,
                  wavelength_increasing_order=wavelength_increasing_order,
                  subtract_interorder_background=subtract_interorder_background,
                  fill_nan=fill_nan)

    process_abba_band = ProcessABBABand(utdate, refdate,
                                        config,
                                        **kwargs).process

    if len(selected) == 0:
        print "No entry with given recipe is found : %s" % recipe_name

    for s in selected:
        obsids = s[0]
        frametypes = s[1]

        for band in bands:
            process_abba_band(recipe_name, band,
                              obsids, frametypes,
                              #do_interactive_figure=interactive
                              )
示例#3
0
def plot_spec(utdate,
              refdate="20140316",
              bands="HK",
              starting_obsids=None,
              interactive=False,
              recipe_name="ALL_RECIPES",
              config_file="recipe.config",
              threshold_a0v=0.2,
              multiply_model_a0v=False,
              html_output=False):

    from libs.igrins_config import IGRINSConfig
    config = IGRINSConfig(config_file)

    if not bands in ["H", "K", "HK"]:
        raise ValueError("bands must be one of 'H', 'K' or 'HK'")

    fn = config.get_value('RECIPE_LOG_PATH', utdate)
    from libs.recipes import Recipes  #load_recipe_list, make_recipe_dict
    recipe = Recipes(fn)

    if starting_obsids is not None:
        starting_obsids = map(int, starting_obsids.split(","))

    # recipe_name = "ALL_RECIPES"
    selected = recipe.select(recipe_name, starting_obsids)
    if not selected:
        print "no recipe of with matching arguments is found"

    for s in selected:
        obsids = s[0]
        frametypes = s[1]
        recipe_name = s[2]["RECIPE"].strip()
        objname = s[2]["OBJNAME"].strip()

        if recipe_name not in [
                "A0V_AB", "STELLAR_AB", "EXTENDED_AB", "EXTENDED_ONOFF"
        ]:
            continue

        for band in bands:
            process_abba_band(recipe_name,
                              utdate,
                              refdate,
                              band,
                              obsids,
                              frametypes,
                              config,
                              do_interactive_figure=interactive,
                              threshold_a0v=threshold_a0v,
                              objname=objname,
                              multiply_model_a0v=multiply_model_a0v,
                              html_output=html_output)
示例#4
0
def abba_all(recipe_name,
             utdate,
             refdate="20140316",
             bands="HK",
             starting_obsids=None,
             interactive=False,
             config_file="recipe.config",
             frac_slit=None):

    from libs.igrins_config import IGRINSConfig
    config = IGRINSConfig(config_file)

    if not bands in ["H", "K", "HK"]:
        raise ValueError("bands must be one of 'H', 'K' or 'HK'")

    fn = config.get_value('RECIPE_LOG_PATH', utdate)
    from libs.recipes import Recipes  #load_recipe_list, make_recipe_dict
    recipe = Recipes(fn)

    if starting_obsids is not None:
        starting_obsids = map(int, starting_obsids.split(","))

    selected = recipe.select(recipe_name, starting_obsids)
    if not selected:
        print "no recipe of with matching arguments is found"

    if frac_slit is not None:
        frac_slit = map(float, frac_slit.split(","))
        if len(frac_slit) != 2:
            raise ValueError("frac_slit must be two floats separated by comma")

    process_abba_band = ProcessABBABand(utdate,
                                        refdate,
                                        config,
                                        frac_slit=frac_slit).process

    for s in selected:
        obsids = s[0]
        frametypes = s[1]

        for band in bands:
            process_abba_band(
                recipe_name,
                band,
                obsids,
                frametypes,
                #do_interactive_figure=interactive
            )
示例#5
0
def plot_spec(utdate, refdate="20140316", bands="HK",
              starting_obsids=None, interactive=False,
              recipe_name = "ALL_RECIPES",
              config_file="recipe.config",
              threshold_a0v=0.2,
              multiply_model_a0v=False,
              html_output=False):

    from libs.igrins_config import IGRINSConfig
    config = IGRINSConfig(config_file)

    if not bands in ["H", "K", "HK"]:
        raise ValueError("bands must be one of 'H', 'K' or 'HK'")

    fn = config.get_value('RECIPE_LOG_PATH', utdate)
    from libs.recipes import Recipes #load_recipe_list, make_recipe_dict
    recipe = Recipes(fn)

    if starting_obsids is not None:
        starting_obsids = map(int, starting_obsids.split(","))

    # recipe_name = "ALL_RECIPES"
    selected = recipe.select(recipe_name, starting_obsids)
    if not selected:
        print "no recipe of with matching arguments is found"

    selected.sort()
    for s in selected:
        obsids = s[0]
        frametypes = s[1]
        recipe_name = s[2]["RECIPE"].strip()
        objname = s[2]["OBJNAME"].strip()

        target_type = recipe_name.split("_")[0]

        if target_type not in ["A0V", "STELLAR", "EXTENDED"]:
            print "Unsupported recipe : %s" % recipe_name
            continue

        for band in bands:
            process_abba_band(recipe_name, utdate, refdate, band,
                              obsids, frametypes, config,
                              do_interactive_figure=interactive,
                              threshold_a0v=threshold_a0v,
                              objname=objname,
                              multiply_model_a0v=multiply_model_a0v,
                              html_output=html_output)
示例#6
0
 def get_recipes(self, utdate):
     fn = self.get_recipe_name(utdate)
     from libs.recipes import Recipes #load_recipe_list, make_recipe_dict
     return Recipes(fn)