def drz2pet_iraf(inlist, config, opt_extr, back, in_af, out_pet):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    config = axesrc.straighten_string(config)
    in_af = axesrc.straighten_string(in_af)
    out_pet = axesrc.straighten_string(out_pet)

    # transform the IF booleans to python
    if back == iraf.yes:
        back = True
    else:
        back = False
    if opt_extr == iraf.yes:
        opt_extr = True
    else:
        opt_extr = False

    # check for minimal input
    if inlist != None and config != None:
        axesrc.drz2pet(inlist=inlist,
                       config=config,
                       opt_extr=opt_extr,
                       back=back,
                       in_af=in_af,
                       out_pet=out_pet)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 2
0
def petcont_iraf(grism, config, cont_model, model_scale, spec_models,
                 object_models, inter_type, lambda_psf, cont_map, in_af):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    spec_models = axesrc.straighten_string(spec_models)
    object_models = axesrc.straighten_string(object_models)
    in_af = axesrc.straighten_string(in_af)

    # transform the IF booleans to python
    if cont_map == iraf.yes:
        cont_map = True
    else:
        cont_map = False

    # check whether something should be done
    if grism != None and config != None:
        axesrc.petcont(grism=grism,
                       config=config,
                       cont_model=cont_model,
                       model_scale=model_scale,
                       spec_models=spec_models,
                       object_models=object_models,
                       inter_type=inter_type,
                       lambda_psf=lambda_psf,
                       cont_map=cont_map,
                       in_af=in_af)
    else:
        # print the help
        iraf.help(_taskname)
def drzprep_iraf(inlist, configs, opt_extr, back):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    configs = axesrc.straighten_string(configs)

    # transform the IF booleans to python
    if opt_extr == yes:
        opt_extr = True
    else:
        opt_extr = False
    if back == yes:
        back = True
    else:
        back = False

    # check whether something should be done
    if inlist != None and configs != None:
        # call the main function
        axesrc.drzprep(inlist=inlist,
                       configs=configs,
                       opt_extr=opt_extr,
                       back=back)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 4
0
def stamps_iraf(grism,
                config,
                sampling,
                drzpath,
                in_af,
                in_pet,
                out_stp):

    # properly format the strings
    grism   = axesrc.straighten_string(grism)
    config  = axesrc.straighten_string(config)
    in_af   = axesrc.straighten_string(in_af)
    in_pet  = axesrc.straighten_string(in_pet)
    out_stp = axesrc.straighten_string(out_stp)

    # transform the IF booleans to python
    if drzpath == iraf.yes:
        drzpath = True
    else:
        drzpath = False

    # check for minimal input
    if grism != None and config != None:
        axesrc.stamps(grism=grism,
                      config=config,
                      sampling=sampling,
                      drzpath=drzpath,
                      in_af=in_af,
                      in_pet=in_pet,
                      out_stp=out_stp)
    else:
        # print the help
        iraf.help(_taskname)
def sex2gol_iraf(grism, config, in_sex, use_direct, direct, dir_hdu, spec_hdu,
                 out_sex):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    in_sex = axesrc.straighten_string(in_sex)
    direct = axesrc.straighten_string(direct)
    out_sex = axesrc.straighten_string(out_sex)

    # transform the IF booleans to python
    if use_direct == iraf.yes:
        use_direct = True
    else:
        use_direct = False
        direct = None

    # check whether something should be done
    if grism != None and config != None:
        axesrc.sex2gol(grism=grism,
                       config=config,
                       in_sex=in_sex,
                       use_direct=use_direct,
                       direct=direct,
                       dir_hdu=dir_hdu,
                       spec_hdu=spec_hdu,
                       out_sex=out_sex)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 6
0
def af2pet_iraf(grism, config, back, in_af, out_pet):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    in_af = axesrc.straighten_string(in_af)
    out_pet = axesrc.straighten_string(out_pet)

    # transform the IF booleans to python
    if back == iraf.yes:
        back = True
    else:
        back = False

    # check whether there is something to start
    if grism != None and config != None:
        axesrc.af2pet(grism=grism,
                      config=config,
                      back=back,
                      in_af=in_af,
                      out_pet=out_pet)

    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 7
0
def pet2spc_iraf(grism,
                 config,
                 use_bpet,
                 adj_sens,
                 weights,
                 do_flux,
                 drzpath,
                 in_af,
                 opet,
                 bpet,
                 out_spc):

    # properly format the strings
    grism   = axesrc.straighten_string(grism)
    config  = axesrc.straighten_string(config)
    in_af   = axesrc.straighten_string(in_af)
    opet    = axesrc.straighten_string(opet)
    bpet    = axesrc.straighten_string(bpet)
    out_spc = axesrc.straighten_string(out_spc)


    # transform the IF booleans to python
    if use_bpet == iraf.yes:
        use_bpet = True
    else:
        use_bpet = False
    if adj_sens == iraf.yes:
        adj_sens = True
    else:
        adj_sens = False
    if weights == iraf.yes:
        weights = True
    else:
        weights = False
    if do_flux == iraf.yes:
        do_flux = True
    else:
        do_flux = False
    if drzpath == iraf.yes:
        drzpath = True
    else:
        drzpath = False

    # check whether something should be done
    if grism != None and config != None:
        axesrc.pet2spc(grism=grism,
                       config=config,
                       use_bpet=use_bpet,
                       adj_sens=adj_sens,
                       weights=weights,
                       do_flux=do_flux,
                       drzpath=drzpath,
                       in_af=in_af,
                       opet=opet,
                       bpet=bpet,
                       out_spc=out_spc)
    else:
        # print the help
        iraf.help(_taskname)
def axecore_iraf(inlist, configs, fconfigs, back, extrfwhm, drzfwhm, backfwhm,
                 orient, slitless_geom, exclude, lambda_mark, cont_model,
                 model_scale, inter_type, lamdbda_psf, np, interp, niter_med,
                 niter_fit, kappa, smooth_length, smooth_fwhm, spectr,
                 adj_sens, weights, sampling):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    configs = axesrc.straighten_string(configs)
    fconfigs = axesrc.straighten_string(fconfigs)

    # transform the IF booleans to python
    if back == yes:
        back = True
    else:
        back = False
    if orient == yes:
        orient = True
    else:
        orient = False
    if slitless_geom == yes:
        slitless_geom = True
    else:
        slitless_geom = False
    if exclude == yes:
        exclude = True
    else:
        exclude = False
    if spectr == yes:
        spectr = True
    else:
        spectr = False
    if adj_sens == yes:
        adj_sens = True
    else:
        adj_sens = False
    if weights == yes:
        weights = True
    else:
        weights = False

    # check whether something should be done
    if inlist != None and configs != None:
        # run the main code
        axesrc.axecore(inlist, configs, fconfigs, back, extrfwhm, drzfwhm,
                       backfwhm, lambda_mark, slitless_geom, orient, exclude,
                       cont_model, model_scale, inter_type, lamdbda_psf, np,
                       interp, niter_med, niter_fit, kappa, smooth_length,
                       smooth_fwhm, spectr, adj_sens, weights, sampling)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 9
0
def axegps_iraf(grism, config, beam_ref, xval, yval):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    beam_ref = axesrc.straighten_string(beam_ref)

    # check whether something should be done
    if grism != None and config != None and beam_ref != None:
        # call the python task
        axesrc.axegps(grism, config, beam_ref, xval, yval)
    else:
        # print the help
        iraf.help(_taskname)
def prepimages_iraf(inlist, model_images=None):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    model_images = axesrc.straighten_string(model_images)

    # check for minimal input
    if inlist == None:
        # print the help
        iraf.help(_taskname)

    # if there is enough input
    else:

        # execute the python function
        axesrc.prepimages(inlist=inlist, model_images=model_images)
Exemplo n.º 11
0
def simdirim_iraf(incat,
                  config,
                  tpass_direct,
                  dirim_name=None,
                  model_spectra=None,
                  model_images=None,
                  nx=None,
                  ny=None,
                  exptime=None,
                  bck_flux=0.0,
                  silent=None):

    # properly format the strings
    dirim_name = axesrc.straighten_string(dirim_name)
    model_spectra = axesrc.straighten_string(model_spectra)
    model_images = axesrc.straighten_string(model_images)
    tpass_direct = axesrc.straighten_string(tpass_direct)

    # stratify the input
    # for the background level
    if bck_flux == None:
        bck_flux = 0.0

    # convert the iraf-value
    # to a true boolean
    if silent != no:
        silent = True
    else:
        silent = False

    if incat == None or config == None or incat == None:
        # print the help
        iraf.help(_taskname)

    else:
        axesrc.simdirim(incat=incat.strip(),
                        config=config.strip(),
                        tpass_direct=tpass_direct.strip(),
                        dirim_name=dirim_name,
                        model_spectra=model_spectra,
                        model_images=model_images,
                        nx=nx,
                        ny=ny,
                        exptime=exptime,
                        bck_flux=bck_flux,
                        silent=silent)
Exemplo n.º 12
0
def axeprep_iraf(inlist,
                 configs,
                 backgr,
                 backims,
                 backped,
                 mfwhm,
                 norm,
                 gcorr):

    # properly format the strings
    inlist  = axesrc.straighten_string(inlist)
    configs = axesrc.straighten_string(configs)
    backims = axesrc.straighten_string(backims)
    backped = axesrc.straighten_string(backped)


    # transform the IF booleans to python
    if backgr == yes:
        backgr = True
    else:
        backgr = False
    if norm == yes:
        norm = True
    else:
        norm = False
    if gcorr == yes:
        gcorr = True
    else:
        gcorr = False

    # check whether something should be done
    if inlist != None and configs != None:
        # call the main function
        axesrc.axeprep(inlist=inlist,
                       configs=configs,
                       backgr=backgr,
                       backims=backims,
                       backped=backped,
                       mfwhm=mfwhm,
                       norm=norm,
                       gcorr=gcorr)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 13
0
def petff_iraf(grism, config, back, ffname):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    ffname = axesrc.straighten_string(ffname)

    # transform the IF booleans to python
    if back == iraf.yes:
        back = True
    else:
        back = False

    # check whether something should be done
    if grism != None and config != None:
        axesrc.petff(grism=grism, config=config, back=back, ffname=ffname)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 14
0
def gol2af_iraf(grism, config, mfwhm, back, orient, slitless_geom, exclude,
                lambda_mark, dmag, out_af, in_gol):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    out_af = axesrc.straighten_string(out_af)
    in_gol = axesrc.straighten_string(in_gol)

    # transform the IF booleans to python
    if back == iraf.yes:
        back = True
    else:
        back = False
    if orient == iraf.yes:
        orient = True
    else:
        orient = False
    if slitless_geom == iraf.yes:
        slitless_geom = True
    else:
        slitless_geom = False
    if exclude == iraf.yes:
        exclude = True
    else:
        exclude = False

    # check whether something should be done
    if grism != None and config != None:
        axesrc.gol2af(grism=grism,
                      config=config,
                      mfwhm=mfwhm,
                      back=back,
                      orient=orient,
                      slitless_geom=slitless_geom,
                      exclude=exclude,
                      lambda_mark=lambda_mark,
                      dmag=dmag,
                      out_af=out_af,
                      in_gol=in_gol)
    else:
        # print the help
        iraf.help(_taskname)
def prepspectra_iraf(inlist, incat, tpass_flux, model_spectra=None):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    incat = axesrc.straighten_string(incat)
    model_spectra = axesrc.straighten_string(model_spectra)

    # check whether there is enough input
    if inlist == None or incat == None or tpass_flux == None:

        # print the help if not
        iraf.help(_taskname)

    else:

        # execute the python function
        axesrc.prepspectra(inlist=inlist.strip(),
                           incat=incat.strip(),
                           tpass_flux=tpass_flux.strip(),
                           model_spectra=model_spectra)
Exemplo n.º 16
0
def iolprep_iraf(mdrizzle_image, input_cat, dim_info, useMdriz):

    # properly format the strings
    mdrizzle_image = axesrc.straighten_string(mdrizzle_image)
    input_cat = axesrc.straighten_string(input_cat)
    dim_info = axesrc.straighten_string(dim_info)

    if useMdriz == iraf.no:
        useMdriz = False
    else:
        useMdriz = True

    # check whether something should be done
    if mdrizzle_image != None and input_cat != None and dim_info != None:
        # call the main function
        axesrc.iolprep(mdrizzle_image=mdrizzle_image,
                       input_cat=input_cat,
                       dim_info=dim_info,
                       useMdriz=useMdriz)
    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 17
0
def backest_iraf(grism, config, np, interp, niter_med, niter_fit, kappa,
                 smooth_length, smooth_fwhm, old_bck, mask, in_af, out_back):

    # properly format the strings
    grism = axesrc.straighten_string(grism)
    config = axesrc.straighten_string(config)
    in_af = axesrc.straighten_string(in_af)
    out_back = axesrc.straighten_string(out_back)

    # transform the IF booleans to python
    if old_bck == iraf.yes:
        old_bck = True
    else:
        old_bck = False
    if mask == iraf.yes:
        mask = True
    else:
        mask = False

    # check whether there is something to start
    if grism != None and config != None:
        axesrc.backest(grism=grism,
                       config=config,
                       np=np,
                       interp=interp,
                       niter_med=niter_med,
                       niter_fit=niter_fit,
                       kappa=kappa,
                       smooth_length=smooth_length,
                       smooth_fwhm=smooth_fwhm,
                       old_bck=old_bck,
                       mask=mask,
                       in_af=in_af,
                       out_bck=out_back)

    else:
        # print the help
        iraf.help(_taskname)
Exemplo n.º 18
0
def fcubeprep_iraf(grism_image,
                   segm_image,
                   filter_info,
                   AB_zero,
                   dim_info,
                   interpol,
                   useMdriz):

    # properly format the strings
    grism_image = axesrc.straighten_string(grism_image)
    segm_image  = axesrc.straighten_string(segm_image)
    filter_info = axesrc.straighten_string(filter_info)
    dim_info    = axesrc.straighten_string(dim_info)

    # transform the IF booleans to python
    if AB_zero == yes:
        AB_zero = True
    else:
        AB_zero = False

    if useMdriz == no:
        useMdriz = False
    else:
        useMdriz = True
        
    # check whether something should be done
    if grism_image != None and segm_image != None and filter_info != None:
        # call the main function
        axesrc.fcubeprep(grism_image=grism_image,
                         segm_image=segm_image,
                         filter_info=filter_info,
                         AB_zero=AB_zero,
                         dim_info=dim_info,
                         interpol=interpol, 
                         useMdriz=useMdriz)
    else:
        # print the help
        iraf.help(_taskname)
def simdispim_iraf(incat,
                   config,
                   dispim_name=None,
                   lambda_psf=None,
                   model_spectra=None,
                   model_images=None,
                   nx=None,
                   ny=None,
                   exptime=None,
                   bck_flux=None,
                   extraction=None,
                   extrfwhm=None,
                   orient=None,
                   slitless_geom=None,
                   adj_sens=None,
                   silent=None):

    # properly format the strings
    dispim_name = axesrc.straighten_string(dispim_name)
    model_spectra = axesrc.straighten_string(model_spectra)
    model_images = axesrc.straighten_string(model_images)

    # stratify the input
    # for the real numbers
    if bck_flux == None:
        bck_flux = 0.0
    if extrfwhm == None:
        extrfwhm = 0.0

    # convert the iraf-value
    # to a true boolean
    if extraction != no:
        extraction = True
    else:
        extraction = False
    if orient != no:
        orient = True
    else:
        orient = False
    if slitless_geom != no:
        slitless_geom = True
    else:
        slitless_geom = False
    if adj_sens != no:
        adj_sens = True
    else:
        adj_sens = False
    if silent != no:
        silent = True
    else:
        silent = False

    if (incat == None or len(incat) < 1) or (config == None
                                             or len(config) < 1):
        # print the help
        iraf.help(_taskname)

    else:
        axesrc.simdispim(incat=incat.strip(),
                         config=config.strip(),
                         lambda_psf=lambda_psf,
                         dispim_name=dispim_name,
                         model_spectra=model_spectra,
                         model_images=model_images,
                         nx=nx,
                         ny=ny,
                         exptime=exptime,
                         bck_flux=bck_flux,
                         extraction=extraction,
                         extrfwhm=extrfwhm,
                         orient=orient,
                         slitless_geom=slitless_geom,
                         adj_sens=adj_sens,
                         silent=silent)
Exemplo n.º 20
0
def simdata_iraf(incat,
                 config,
                 output_root=None,
                 silent=None,
                 inlist_spec=None,
                 tpass_flux=None,
                 inlist_ima=None,
                 lambda_psf=None,
                 nx_disp=None,
                 ny_disp=None,
                 exptime_disp=None,
                 bck_flux_disp=0.0,
                 extraction=None,
                 extrfwhm=None,
                 orient=None,
                 slitless_geom=None,
                 adj_sens=None,
                 tpass_direct=None,
                 nx_dir=None,
                 ny_dir=None,
                 exptime_dir=None,
                 bck_flux_dir=0.0,
                 version=None):

    # properly format the strings
    output_root = axesrc.straighten_string(output_root)
    inlist_spec = axesrc.straighten_string(inlist_spec)
    tpass_flux = axesrc.straighten_string(tpass_flux)
    inlist_ima = axesrc.straighten_string(inlist_ima)
    tpass_direct = axesrc.straighten_string(tpass_direct)

    # stratify the input
    # for the background level
    if bck_flux_disp == None:
        bck_flux_disp = 0.0
    if bck_flux_dir == None:
        bck_flux_dir = 0.0
    if extrfwhm == None:
        extrfwhm = 0.0

    # convert the iraf-value
    # to true booleans
    if extraction != no:
        extraction = True
    else:
        extraction = False
    if orient != no:
        orient = True
    else:
        orient = False
    if slitless_geom != no:
        slitless_geom = True
    else:
        slitless_geom = False
    if adj_sens != no:
        adj_sens = True
    else:
        adj_sens = False

    if silent != no:
        silent = True
    else:
        silent = False

    if incat == None or config == None:
        # print the help
        iraf.help(_taskname)

    else:
        axesrc.simdata(incat=incat.strip(),
                       config=config.strip(),
                       output_root=output_root,
                       silent=silent,
                       inlist_spec=inlist_spec,
                       tpass_flux=tpass_flux,
                       inlist_ima=inlist_ima,
                       lambda_psf=lambda_psf,
                       nx_disp=nx_disp,
                       ny_disp=ny_disp,
                       exptime_disp=exptime_disp,
                       bck_flux_disp=bck_flux_disp,
                       extraction=extraction,
                       extrfwhm=extrfwhm,
                       orient=orient,
                       slitless_geom=slitless_geom,
                       adj_sens=adj_sens,
                       tpass_direct=tpass_direct,
                       nx_dir=nx_dir,
                       ny_dir=ny_dir,
                       exptime_dir=exptime_dir,
                       bck_flux_dir=bck_flux_dir)
Exemplo n.º 21
0
def axedrzcrr_iraf(inlist, configs, infwhm, outfwhm, back, driz_separate,
                   clean, combine_type, combine_maskpt, combine_nsigmas,
                   combine_nlow, combine_nhigh, combine_lthresh,
                   combine_hthresh, combine_grow, blot_interp, blot_sinscl,
                   driz_cr_snr, driz_cr_grow, driz_cr_scale, makespc, adj_sens,
                   opt_extr):

    # properly format the strings
    inlist = axesrc.straighten_string(inlist)
    configs = axesrc.straighten_string(configs)

    # transform the IF booleans to python
    if back == yes:
        back = True
    else:
        back = False
    if clean == yes:
        clean = True
    else:
        clean = False
    if driz_separate == yes:
        driz_separate = True
    else:
        driz_separate = False
    if makespc == yes:
        makespc = True
    else:
        makespc = False
    if adj_sens == yes:
        adj_sens = True
    else:
        adj_sens = False
    if opt_extr == yes:
        opt_extr = True
    else:
        opt_extr = False

    # check whether something should be done
    if inlist != None and configs != None:

        # check for FULL multidrizzle
        if driz_separate:

            # make an empty dict
            mult_drizzle_par = {}

            # fill with input parameters
            mult_drizzle_par['combine_maskpt'] = combine_maskpt
            mult_drizzle_par['combine_type'] = combine_type
            mult_drizzle_par['combine_nsigma1'] = float(
                combine_nsigmas.split()[0])
            mult_drizzle_par['combine_nsigma2'] = float(
                combine_nsigmas.split()[1])
            mult_drizzle_par['combine_nlow'] = combine_nlow
            mult_drizzle_par['combine_nhigh'] = combine_nhigh
            mult_drizzle_par['combine_lthresh'] = combine_lthresh
            mult_drizzle_par['combine_hthresh'] = combine_hthresh
            mult_drizzle_par['combine_grow'] = combine_grow
            mult_drizzle_par['blot_interp'] = blot_interp
            mult_drizzle_par['blot_sinscl'] = blot_sinscl
            mult_drizzle_par['driz_cr_snr'] = driz_cr_snr
            mult_drizzle_par['driz_cr_grow'] = driz_cr_grow
            mult_drizzle_par['driz_cr_scale'] = driz_cr_scale

            # call the main function
            axesrc.axeddd(inlist=inlist,
                          configs=configs,
                          mult_drizzle_par=mult_drizzle_par,
                          infwhm=infwhm,
                          outfwhm=outfwhm,
                          back=back,
                          clean=clean,
                          makespc=makespc,
                          opt_extr=opt_extr,
                          adj_sens=adj_sens)
        else:
            # do a simple, traditional aXedrizzle run
            axesrc.axecrr(inlist=inlist,
                          configs=configs,
                          infwhm=infwhm,
                          outfwhm=outfwhm,
                          back=back,
                          clean=clean,
                          makespc=makespc,
                          opt_extr=opt_extr,
                          adj_sens=adj_sens)
    else:
        # print the help
        iraf.help(_taskname)