Example #1
0
#IO.fix_long2pos_headers(obsfiles)

#Background.handle_background(obsfiles,
#    'lambda_solution_wave_stack_K_m150610_0168-0170.fits',
#    maskname, band, waveops, plan=[["A","B"]], target=target)

redfiles = ["eps_" + file + ".fits" for file in obsfiles]
#update the "lambda_solution_wave_stack_K*.fits" file name
#  to the output file name from the apply_lambda process above.
# Update the name of the first file in the offset file (use the full path name.
#   e.g.    "/Users/user1/MOSFIRE/DRP_CODE/DATA/2014may08/m130114_0451.fits",

Rectify.handle_rectification(
    maskname,
    redfiles,
    "lambda_solution_wave_stack_K_m150610_0168-0170.fits",
    band,
    obsfiles,
    waveops,
    target=target)

########### WIDE SLITS ############

# SPECTROPHOTOMETRIC Long2POS: THIS SECTION IS FOR THE REDUCTION OF THE WIDE SLITS.

#obsfiles = obsfiles_posC_wide
#target = targetCwide

#IO.fix_long2pos_headers(obsfiles)

#Background.handle_background(obsfiles,
#    'lambda_solution_wave_stack_H_m150428_0091-0091.fits',
Example #2
0
                             band,
                             waveops,
                             target=target_posAwide)
Background.handle_background(obsfiles_posCwide,
                             Wavelength_file,
                             maskname,
                             band,
                             waveops,
                             target=target_posCwide)

# narrow
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posAnarrow]
Rectify.handle_rectification(maskname,
                             redfiles,
                             Wavelength_file,
                             band,
                             obsfiles_posAnarrow,
                             waveops,
                             target=target_posAnarrow)
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posCnarrow]
Rectify.handle_rectification(maskname,
                             redfiles,
                             Wavelength_file,
                             band,
                             obsfiles_posCnarrow,
                             waveops,
                             target=target_posCnarrow)
# wide
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posAwide]
redfiles = [redfiles[0]]
Rectify.handle_rectification(maskname,
Example #3
0
    import pyfits as pf
np.seterr(all='ignore')
flatops = Options.flat
waveops = Options.wavelength

#Driver file automatically generated on Sat Jul 25 17:33:42 2015
#For questions and comments, email [email protected], submit a ticket on the ticketing system, or contact Luca Rizzi @ WMKO

maskname = 'maskname'
band = 'band'

#Set noninteractive to True to autofit wavelenth solution instead of manually fitting.
noninteractiveflag=False
obsfiles=['Offset_1.25.txt','Offset_-1.25.txt']

Flats.handle_flats('Flat.txt', maskname, band, flatops)

Wavelength.imcombine(obsfiles, maskname, band, waveops)
Wavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops, noninteractive=noninteractiveflag)
Wavelength.fit_lambda(maskname, band, obsfiles, obsfiles,waveops)
Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops)

# modify this variable to point to the correct wavelength file created on the previous step
Wavelength_file = 'lambda_solution_wave_stack_H_m141130_0323-0338.fits'

Background.handle_background(obsfiles,Wavelength_file,maskname,band,waveops)

redfiles = ["eps_" + file + ".fits" for file in obsfiles]
Rectify.handle_rectification(maskname, redfiles,Wavelength_file,band,obsfiles,waveops)

Example #4
0
Wavelength.apply_lambda_simple(maskname, band, argon, waveops, longslit=longslit, smooth=True)

# make sure you use the correct wavelength file generated before
Wavelength_file = "lambda_solution_wave_stack_H_m150428_0091-0091.fits"

# narrow
Background.handle_background(obsfiles_posAnarrow, Wavelength_file, maskname, band, waveops, target=target_posAnarrow)
Background.handle_background(obsfiles_posCnarrow, Wavelength_file, maskname, band, waveops, target=target_posCnarrow)
# wide
Background.handle_background(obsfiles_posAwide, Wavelength_file, maskname, band, waveops, target=target_posAwide)
Background.handle_background(obsfiles_posCwide, Wavelength_file, maskname, band, waveops, target=target_posCwide)

# narrow
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posAnarrow]
Rectify.handle_rectification(
    maskname, redfiles, Wavelength_file, band, obsfiles_posAnarrow, waveops, target=target_posAnarrow
)
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posCnarrow]
Rectify.handle_rectification(
    maskname, redfiles, Wavelength_file, band, obsfiles_posCnarrow, waveops, target=target_posCnarrow
)
# wide
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posAwide]
redfiles = [redfiles[0]]
Rectify.handle_rectification(
    maskname, redfiles, Wavelength_file, band, obsfiles_posAwide, waveops, target=target_posAwide
)
redfiles = ["eps_" + file + ".fits" for file in obsfiles_posCwide]
redfiles = [redfiles[0]]
Rectify.handle_rectification(
    maskname, redfiles, Wavelength_file, band, obsfiles_posCwide, waveops, target=target_posCwide
#IO.fix_long2pos_headers(obsfiles)

#Background.handle_background(obsfiles,
#    'lambda_solution_wave_stack_K_m150610_0168-0170.fits',
#    maskname, band, waveops, plan=[["A","B"]], target=target)

redfiles = ["eps_" + file + ".fits" for file in obsfiles]
#update the "lambda_solution_wave_stack_K*.fits" file name
#  to the output file name from the apply_lambda process above.
# Update the name of the first file in the offset file (use the full path name.
#   e.g.    "/Users/user1/MOSFIRE/DRP_CODE/DATA/2014may08/m130114_0451.fits",

Rectify.handle_rectification(maskname, redfiles,
    "lambda_solution_wave_stack_K_m150610_0168-0170.fits",
    band, 
    obsfiles,
   waveops, target=target)

########### WIDE SLITS ############

# SPECTROPHOTOMETRIC Long2POS: THIS SECTION IS FOR THE REDUCTION OF THE WIDE SLITS.

#obsfiles = obsfiles_posC_wide
#target = targetCwide

#IO.fix_long2pos_headers(obsfiles)

#Background.handle_background(obsfiles,
#    'lambda_solution_wave_stack_H_m150428_0091-0091.fits',
#    maskname, band, waveops, plan=[["A","B"]], target=target)
#    'lambda_solution_wave_stack_....fits',
#    waveops, longslit)

#Background.handle_background(obsfiles,
#    'lambda_solution_wave_stack_H_m150112_0199-0201.fits',
#    maskname, band, waveops)

redfiles = ["eps_" + file + ".fits" for file in obsfiles]
#update the "lambda_solution_wave_stack_K*.fits" file name
#  to the output file name from the apply_lambda process above.
# Update the name of the first file in the offset file (use the full path name.
#   e.g.    "/Users/user1/MOSFIRE/DRP_CODE/DATA/2014may08/m130114_0451.fits",

Rectify.handle_rectification(maskname, redfiles,
    "lambda_solution_wave_stack_H_m150112_0199-0201.fits",
    band, 
    obsfiles,
    waveops)


# NEON
# Use neon for wavelength calibrations
#Wavelength.imcombine('Ne.txt', maskname, band, waveops)
#Wavelength.fit_lambda_interactively(maskname, band, 'Ne.txt', waveops, longslit=longslit, neon=True)
#Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, longslit=longslit)
#Wavelength.apply_lambda_simple(maskname, band, 'Ne.txt', waveops, longslit=longslit, smooth=True)
#print redfiles
#obsfiles = ['eps_off_-10.txt', 'eps_off_10.txt']
# Update the following line after the apply_lambda_simple step
#Longslit.go(maskname, band, obsfiles,
#    'lambda_solution_wave_stack_H_m150112_0199-0201.fits',
# Change the bad pixel mask path
# Options.path_bpm = "/scr2/mosfire/badpixels/badpix_18may2012.fits"

# Change if False to if True when you want to execute that step
# On interactive step, make sure you attempt to quit&save after fitting one
# slit!
if False: Flats.handle_flats(flatnames, maskname, band, flatops)
if False: Wavelength.imcombine(wavenames1, maskname, band, wavlops)
if False: Wavelength.imcombine(wavenames2, maskname, band, wavlops)

# only one interactive fit is needed
if False: Wavelength.fit_lambda_interactively(maskname, band, wavenames1,
        wavlops)

#                               mask     band  to fit       guess      options
if False: Wavelength.fit_lambda(maskname, band, wavenames1, wavenames1, wavlops)
if False: Wavelength.fit_lambda(maskname, band, wavenames2, wavenames1, wavlops)

if False: Wavelength.apply_lambda_simple(maskname, band, wavenames1, wavlops)
if False: Wavelength.apply_lambda_simple(maskname, band, wavenames2, wavlops)

As = As1[:]
Bs = Bs1[:]
As.extend(As2)
Bs.extend(Bs2)
if True: Background.handle_background(As, Bs, wavenames1, maskname, band, wavlops)
if True: Rectify.handle_rectification(maskname, ["A", "B"], wavenames1, band,
        wavlops)