diff --git a/drivers/Driver.py b/drivers/Driver.py deleted file mode 100644 index 7cff886..0000000 --- a/drivers/Driver.py +++ /dev/null @@ -1,40 +0,0 @@ -import os, time, logging -import MOSFIRE -from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, Rectify, Wavelength -from MOSFIRE.MosfireDrpLog import info, debug, warning, error -logger = logging.getLogger(__name__) -import numpy as np -from matplotlib import pyplot as pl -try: - from astropy.io import fits as pf -except: - 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 mosfiredrp@gmail.com, 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) - diff --git a/drivers/K_driver.py b/drivers/K_driver.py deleted file mode 100644 index 50fff75..0000000 --- a/drivers/K_driver.py +++ /dev/null @@ -1,52 +0,0 @@ -import os, time, logging -import MOSFIRE -from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, Rectify, Wavelength -from MOSFIRE.MosfireDrpLog import info, debug, warning, error -logger = logging.getLogger(__name__) -import numpy as np -from matplotlib import pyplot as pl -try: - from astropy.io import fits as pf -except: - import pyfits as pf -np.seterr(all='ignore') -flatops = Options.flat -waveops = Options.wavelength - -#Driver file automatically generated on Sat Jul 25 17:46:43 2015 -#For questions and comments, email mosfiredrp@gmail.com, 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,lampOffList='FlatThermal.txt') - -Wavelength.imcombine(obsfiles, maskname, band, waveops) -# if you have Ar -Wavelength.imcombine('Ar.txt', maskname, band, waveops) -# if you have Ne -Wavelength.imcombine('Ne.txt', maskname, band, waveops) -Wavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops, noninteractive=noninteractiveflag) - -Wavelength.apply_interactive(maskname, band, waveops, apply=obsfiles, to='Ar.txt', argon=True) -Wavelength.apply_interactive(maskname, band, waveops, apply=obsfiles, to='Ne.txt', neon=True) - -Wavelength.fit_lambda(maskname, band, obsfiles, obsfiles,waveops) -Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt',waveops, wavenames2='Ar.txt') -LROI = [[21000,22800]]*1 -LROIs = Wavelength.check_wavelength_roi(maskname, band, obsfiles, 'Ne.txt', LROI, waveops) - -Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops) -Wavelength.apply_lambda_sky_and_arc(maskname, band, obsfiles, 'Ne.txt', LROIs, waveops) - -Wavelength_file = 'merged_lambda_solution_wave_stack_K_*.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) - diff --git a/drivers/Long2pos.py b/drivers/Long2pos.py deleted file mode 100644 index 7d1d0f9..0000000 --- a/drivers/Long2pos.py +++ /dev/null @@ -1,78 +0,0 @@ -import os, time, logging -import MOSFIRE -from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, Rectify, Wavelength -from MOSFIRE.MosfireDrpLog import info, debug, warning, error -logger = logging.getLogger(__name__) -import numpy as np -from matplotlib import pyplot as pl -try: - from astropy.io import fits as pf -except: - import pyfits as pf -np.seterr(all='ignore') -flatops = Options.flat -waveops = Options.wavelength - -#Driver file automatically generated on Wed Jul 29 15:04:02 2015 -#For questions and comments, email mosfiredrp@gmail.com, submit a ticket on the ticketing system, or contact Luca Rizzi @ WMKO - -# THIS DRIVER IS SETUP TO REDUCE A STAR CALLED HIP85871_7.25, change this string on the entried below - - - -maskname = 'long2pos_specphot (align)' -band = 'H' - -#Set noninteractive to True to autofit wavelenth solution instead of manually fitting. -noninteractiveflag=False - -# these are the narrow slits -obsfiles_posCnarrow = ['Offset_-21_HIP85871_7.25_PosC.txt', 'Offset_-7_HIP85871_7.25_PosC.txt'] -target_posCnarrow = "HIP85871_7.25_POSC_NARROW" -IO.fix_long2pos_headers(obsfiles_posCnarrow) -obsfiles_posAnarrow = ['Offset_7_HIP85871_7.25_PosA.txt', 'Offset_21_HIP85871_7.25_PosA.txt'] -target_posAnarrow = "HIP85871_7.25_POSA_NARROW" -IO.fix_long2pos_headers(obsfiles_posAnarrow) -# these are the wide slits, comment out if you are not using specphot -obsfiles_posCwide = ['Offset_-14_HIP85871_7.25_PosC.txt', 'Offset_-7_HIP85871_7.25_PosC.txt'] -target_posCwide = "HIP85871_7.25_POSC_WIDE" -IO.fix_long2pos_headers(obsfiles_posCwide) -obsfiles_posAwide = ['Offset_14_HIP85871_7.25_PosA.txt', 'Offset_21_HIP85871_7.25_PosA.txt'] -target_posAwide = "HIP85871_7.25_POSA_WIDE" -IO.fix_long2pos_headers(obsfiles_posAwide) - -# Note: for long2pos, the row position is ignored, and the middle point of the slit is used -longslit = {'yrange': [[1062,1188],[887,1010]], 'row_position': 0, 'mode':'long2pos'} -Flats.handle_flats('Flat.txt', maskname, band, flatops,longslit=longslit) - -# in this case, we are using the argon lines. -# replace this with neon=['Ne.txt'] if you prefer to use Ne, and edit the following lines accordingly -argon = ['Ar.txt'] -Wavelength.imcombine(argon, maskname, band, waveops) -Wavelength.fit_lambda_interactively(maskname, band, argon,waveops,longslit=longslit, argon=True, noninteractive=noninteractiveflag) -Wavelength.fit_lambda(maskname, band, argon,argon,waveops,longslit=longslit) -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) - diff --git a/drivers/Long2pos_K_driver.py b/drivers/Long2pos_K_driver.py deleted file mode 100644 index 6a40be7..0000000 --- a/drivers/Long2pos_K_driver.py +++ /dev/null @@ -1,163 +0,0 @@ - -# Help, bugs to: http://mosfire.googlecode.com -# -# Instructions -# 1. edit band = '' to band = 'Y' or 'J' or 'H' or 'K' -# e.g. band = 'J' -# 2. edit [709, 1350] to be the pixel values at the beginning and end -# of the long slit. Look at the raw data. -# 3. edit row_position to be a location where the standard star is not. -# 4. Decide if you want to use sky lines or Neon lamps for lambda calibration -# 5. Uncomment one line at a time and run mospy on the driver file -# - -import os, time -import MOSFIRE - -from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, Rectify -from MOSFIRE import Wavelength, Longslit - -import numpy as np -from matplotlib import pyplot as pl -try: - from astropy.io import fits as pf -except: - import pyfits as pf - -np.seterr(all="ignore") - -maskname = 'long2pos' -band = 'K' - -flatops = Options.flat -waveops = Options.wavelength - -# Note: for long2pos, the row position is ignored, and the middle point of the slit is used -longslit = {'yrange': [[1062,1188],[887,1010]], 'row_position': 0, 'mode':'long2pos'} - - -# SETUP FILES FOR DATES before June 10, 2015 - -#obsfiles_posC_narrow = ['Offset_-21_HIP85871_7.25.txt', 'Offset_-7_HIP85871_7.25.txt'] -#targetCnarrow = "HIP85871_posC_narrow" - -#obsfiles_posA_narrow = ['Offset_7_HIP85871_7.25.txt', 'Offset_21_HIP85871_7.25.txt'] -#targetAnarrow = "HIP85871_posA_narrow" - -#obsfiles_posC_wide = ['Offset_-14_HIP85871_7.25.txt','Offset_-7_HIP85871_7.25.txt'] -#targetCwide = "HIP85871_posC_wide" - -#obsfiles_posA_wide = ['Offset_14_HIP85871_7.25.txt','Offset_21_HIP85871_7.25.txt'] -#targetAwide = "HIP85871_posA_wide" - -# SETUP FILES for DATES after June 10,2015 - -obsfiles_posC_narrow = ['Offset_7_FS134_posC.txt','Offset_-7_FS134_PosC.txt'] -targetCnarrow = "FS134_posC_narrow" -obsfiles_posA_narrow = ['Offset_7_FS134_posA.txt','Offset_-7_FS134_PosA.txt'] -targetAnarrow = "FS134_posA_narrow" - - -# Argon files -argon = ['Ar.txt'] - -#Flats.handle_flats('Flat.txt', maskname, band, flatops, longslit = longslit) -#Flats.handle_flats('Flat.txt', maskname, band, flatops,lampOffList='FlatThermal.txt', longslit=longslit) - -# Uses the argon calibration taken in the afternoon with long2pos for the wavelength calibration - -#Wavelength.imcombine(argon, maskname, band, waveops) -#Wavelength.fit_lambda_interactively(maskname, band, argon, waveops, longslit=longslit, argon=True) -#Wavelength.fit_lambda(maskname, band, argon, argon, waveops, longslit=longslit) -#Wavelength.apply_lambda_simple(maskname, band, argon, waveops, longslit=longslit, smooth=True) - - -########### NARROW SLITS ############ - -# Long2POS: NARROW SLITS: use the -7 and -21 for posC and 7 and 21 for posA - -obsfiles = obsfiles_posC_narrow -target = targetCnarrow - -#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) - - -obsfiles = obsfiles_posA_narrow -target = targetAnarrow - -#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) - -#obsfiles = obsfiles_posA_wide -#target = targetAwide - -#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) - - - - - - -# 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', -# waveops, longslit, extension='/Volumes/PromiseRAID/MOSFIRE/DRP_CODE/DATA/2015jan12/m150112_0199.fits') - - - diff --git a/drivers/Longslit_driver.py b/drivers/Longslit_driver.py deleted file mode 100644 index b794d34..0000000 --- a/drivers/Longslit_driver.py +++ /dev/null @@ -1,46 +0,0 @@ -import os, time, logging -import MOSFIRE -from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, Rectify, Wavelength -from MOSFIRE.MosfireDrpLog import info, debug, warning, error -logger = logging.getLogger(__name__) -import numpy as np -from matplotlib import pyplot as pl -try: - from astropy.io import fits as pf -except: - import pyfits as pf -np.seterr(all='ignore') -flatops = Options.flat -waveops = Options.wavelength - -#Driver file automatically generated on Wed Jul 29 15:11:22 2015 -#For questions and comments, email mosfiredrp@gmail.com, submit a ticket on the ticketing system, or contact Luca Rizzi @ WMKO - -maskname = 'LONGSLIT-3x0.7' -band = 'H' - -#Set noninteractive to True to autofit wavelenth solution instead of manually fitting. -noninteractiveflag=False -# modify the target name to match your observations -obsfiles=['Offset_5_HIP17971.txt','Offset_-5_HIP17971.txt'] -target="HIP17971" - - -# modify the yrange to match the size of your longslit -# row position is the extraction line used for the initial wavelength solution. It should be away from your target -longslit = {'yrange':[968,1100],'row_position':1034,'mode':'longslit'} -Flats.handle_flats('Flat.txt', maskname, band, flatops,longslit=longslit) - -Wavelength.imcombine(obsfiles, maskname, band, waveops) -Wavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops,longslit=longslit, noninteractive=noninteractiveflag) -Wavelength.fit_lambda(maskname, band, obsfiles, obsfiles,waveops,longslit=longslit) -Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) - -# make sure you use the file generated on the previous step -Wavelength_file = 'lambda_solution_wave_stack_H_m121227_0162-0311.fits' - -Background.handle_background(obsfiles,Wavelength_file,maskname,band,waveops,target=target) - -redfiles = ["eps_" + file + ".fits" for file in obsfiles] -Rectify.handle_rectification(maskname, redfiles,Wavelength_file,band,obsfiles,waveops, target=target) - diff --git a/manual/docs/MOSFIRE_DRP_Manual.pdf b/manual/docs/MOSFIRE_DRP_Manual.pdf index 87c55aa..9ec1631 100644 Binary files a/manual/docs/MOSFIRE_DRP_Manual.pdf and b/manual/docs/MOSFIRE_DRP_Manual.pdf differ diff --git a/manual/docs/autodriver.md b/manual/docs/autodriver.md index 5e5ec63..a573c25 100644 --- a/manual/docs/autodriver.md +++ b/manual/docs/autodriver.md @@ -1,3 +1,9 @@ +# The Driver File + +The pipeline is run via a "driver" file which sets the sequence of steps which will be run and defines the inputs, outputs, and options for each. + +In the past, users could copy one of several template files included with the DRP or use an auto-generated one (see the AutoDriver section below). With this latest version, we are removing the template files and only supporting the AutoDriver process to avoid confusion and conflicts. + # AutoDriver The pipeline is able to produce a driver file automatically for most cases, thus removing the need to copy one of the standard files and manually edit it. diff --git a/manual/docs/driver.md b/manual/docs/driver.md deleted file mode 100644 index 7669ce0..0000000 --- a/manual/docs/driver.md +++ /dev/null @@ -1,78 +0,0 @@ -# The driver.py File - -The driver file controls all the pipeline steps, and in the drivers sub-directory, you will find a number of driver files: `Driver.py`, `K_Driver.py`, `Long2pos_driver.py`, and `Longslit_Driver.py`. The `Driver` and `K_Driver` will reduce your science data for bands Y,J, and H (this includes the sample data set). The K band requires a special approach because there are too few bright night-sky emission lines at the red end and so the `K_Driver` synthesizes arclamps and night sky lines. The `Long2pos_driver.py` handles `long2pos` and `long2pos_specphot` observations, while the `Longslit_driver.py` deals with observations of single objects using a longslit configuration. - -The driver.py files included with the code download contains execution lines that are commented out. For this example, we will run the driver file one line at a time, but as you become familiar with the DRP process, you will develop your own driver file execution sequencing. Although in the future we hope to further automate the driver file, currently some steps require you to update the inputs with filenames created from previous steps. - -Below is a driver.py file: - - import os, time - import MOSFIRE - - from MOSFIRE import Background, Combine, Detector, Flats, IO, Options, \ - Rectify - from MOSFIRE import Wavelength - - import numpy as np, pylab as pl, pyfits as pf - - np.seterr(all="ignore") - - #Update the insertmaskname with the name of the mask - #Update S with the filter band Y,J,H,or K - maskname = 'insertmaskname' - band = 'S' - - flatops = Options.flat - waveops = Options.wavelength - - obsfiles = ['Offset_1.5.txt', 'Offset_-1.5.txt'] - - #Flats.handle_flats('Flat.txt', maskname, band, flatops) - #Wavelength.imcombine(obsfiles, maskname, band, waveops) - #Wavelength.fit_lambda_interactively(maskname, band, obsfiles, - #waveops) - #Wavelength.fit_lambda(maskname, band, obsfiles, obsfiles, - #waveops) - - #Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops) - #Background.handle_background(obsfiles, - #'lambda_solution_wave_stack_H_m130429_0224-0249.fits', - #maskname, band, waveops) - - redfiles = ["eps_" + file + ".fits" for file in obsfiles] - #Rectify.handle_rectification(maskname, redfiles, - # "lambda_solution_wave_stack_H_m130429_0224-0249.fits", - # band, - # "/scr2/npk/mosfire/2013apr29/m130429_0224.fits", - # waveops) - # - -To set up your driver file do the following: - -1. Navigate to the desired output directory created by handle: `cd ~/Data/reducedMOSFIRE_DRP_MASK/2012sep10/H` -2. Copy the appropriate driver file: `cp ~/MosfireDRP-master/drivers/Driver.py .` NOTE: If you are observing a K band mask you’ll want to copy the `K_driver.py` file over. -3. Edit driver.py (see bold text in driver file example) - * Update maskname - * Update band to be Y,J,H - * Update the `Offset_#.txt` name. Handle creates offset files with names that are specific to the nod throw. The default driver file uses 1.5 arcsec offsets in the file name. - -In the sections that follow, we will describe the function and outputs of the commented lines found in the driver file starting with the creation of flats. - -If you prefer to override the standard naming convention of the output files, you can specify - - target = “targetname” - -at the beginning of the driver file. If you do so, remember to also add target=target to both the Background and Rectify steps. Example: - - Background.handle_background(obsfiles, - 'lambda_solution_wave_stack_H_m150428_0091-0091.fits', - maskname, band, waveops, target=target) - - - - - - - - - diff --git a/manual/docs/generate_pdf b/manual/docs/generate_pdf index c2cff4f..5587a50 100755 --- a/manual/docs/generate_pdf +++ b/manual/docs/generate_pdf @@ -1 +1 @@ -pandoc -o MOSFIRE_DRP_Manual.pdf manual.md changes.md preface.md installing.md retrieve.md handle.md autodriver.md driver.md flats.md wavelengthYJH.md wavelengthK.md background.md rectify.md extract.md long2pos.md longslit.md headercomments.md hints.md example.md +pandoc -o MOSFIRE_DRP_Manual.pdf manual.md changes.md preface.md installing.md retrieve.md handle.md autodriver.md flats.md wavelengthYJH.md wavelengthK.md background.md rectify.md extract.md long2pos.md longslit.md headercomments.md hints.md example.md diff --git a/manual/docs/installing_2015A.md b/manual/docs/installing_2015A.md deleted file mode 100644 index d676d67..0000000 --- a/manual/docs/installing_2015A.md +++ /dev/null @@ -1,161 +0,0 @@ -As of version 2015A, the pipeline can be installed as Ureka package. If you prefer to use this installation procedure, download the pipeline tar file and unpack it. Then execute: - - ur_setup - -Go to the mosfire python directory where the setup.py file is located (it is the main directory above the MOSFIRE and apps directories). Run: - - python setup.py install - -This will copy the MOSFIRE pipeline as a python package located into your ureka enviornment. - -Alternatively, if you would like to modify the MOSFIRE pipeline files, run the following instead: - - python setup.py develop - -This will make symoblic links to the MOSFIRE files instead of copying them. Your changes to the pipeline file will now automatically be used when loading the MOSFIRE package. - -Directories created by you - -* DATA – sub directory in which you can store your data. This is not a necessary sub-directory but may help you manage files. Raw data may be stored in other areas on your disk. -* REDUX – sub directory where reductions will be stored. Also not critical, but helpful. - -From now on, if you want to run any pipeline commands, you will always execute “mospy” as seen in our first step in section 5 below. Remember to run ur_setup before running the MOSFIRE pipleine. - -## Alternate Installation Method - -If you prefer the previous installation method, follow these instructions: - -**1) Install Ureka** - -The pipeline relies on the Ureka Python distribution produced by STScI and Gemini Observatory: [http://ssb.stsci.edu/ureka/](http://ssb.stsci.edu/ureka/) - -The DRP was developed using UREKA version 1.0. Navigate to the 1.0 distribution using the url listed above. Follow the instructions at the links to install the package. The UREKA instructions indicate that you need to run `ur_setup` to put ureka in the path. This is automatically completed when you run the drp and it is found in the mospy code. However, if you want to test the ureka package yourself, you will need to run ur_setup manually. The latest version of Ureka that is confirmed to work with the pipeline is 1.5.1 - -**2) Download the pipeline** - -1. Start an xterm session on your local machine -2. Run “cd” to navigate to the home directory -3. Download either the .zip file, or the .tar.gz file from the website [https://keck-datareductionpipelines.github.io/MosfireDRP/](https://keck-datareductionpipelines.github.io/MosfireDRP/). Note that this is the stable and supported version of the pipeline. Alternatively, if you are a github user, you can just clone the repository using: `https://github.com/keck-DataReductionPipelines/MosfireDRP.git`. This is the development version, and it is NOT supported. -4. Expand the zip or tar file and rename the resulting directory. For example: - -``` - mkdir ~/MOSFIRE - mv MosfireDRP-1.1 ~/MOSFIRE/DRP_CODE - cd ~/MOSFIRE/DRP_CODE # to navigate to that directory -``` - - -**3) Create Data Directories** - -Create sub directories for raw data, and reduced data. These sub directories are not specific. You can set up sub directories any way you would like. For the purposes of this manual, we have choosen generic directory names. You may choose to store the raw and reduced data using andy directory structure you would prefer. For our example, we created a raw data directory in the code repository: - -mkdir ~/MOSFIRE/DRP_CODE/DATA - -and a reduction directory in the code repository that will store reduced data: - -mkdir ~/MOSFIRE/DRP_CODE/REDUX - - -**4) Copy the mospy file into your bin dir** - -Navigate to the newly creted bin dir: - - cd ~/MOSFIRE/DRP_CODE/bin - -Copy the mospy executeable to the bin dir - - cp ../apps/mospy . - -**5) edit mospy in your bin dir and update a few lines of code** - -Using your favorite editor (emacs ../bin/mospy), update the path for the `ur_setup`. Replace `/home/npk/.ureka/ur_setup` with your `/your_full_path_name/.ureka/ur_setup` full path. - -Update the path for the `ur_forget`. Replace `/home/npk/.ureka/ur_setup` with `/your_full_path_name/.ureka/ur_forget` - -Update the MOSPATH with the full path to the source code directory. Replace `/src2/mosfire/DRP/mosfire` with `/your_full_path_name/MOSFIRE/DRP_CODE` - -As an example, the original file might look like the following: - - #Update the full path to the ureka install for the - # two aliases below. - alias ur_setup 'eval `/home/npk/.ureka/ur_setup -csh \!*`' - alias ur_forget 'eval `/home/npk/.ureka/ur_forget -csh \!*`' - - # If pythonpath is not previously defined, define it so that - # the setenv works below.. - if (! $?PYTHONPATH ) setenv PYTHONPATH - - #Update the full path to the mosfire DRP code repository - # example: /src2/mosfire/DRP/mosfire change to /Users/myname/MOSFIRE/DRP_CODE - # in which the sub dirs drivers, apps, badpixel, etc. live - setenv MOSPATH /scr2/mosfire/DRP/mosfire - setenv PYTHONPATH ${PYTHONPATH}:${MOSPATH} - -And the modified version for an observers particular setup may look something like this: - - #Update the full path to the ureka install for the - # two aliases below. - alias ur_setup 'eval `/Users/mkassis/.ureka/ur_setup -csh \!*`' - alias ur_forget 'eval `/Users/mkassis/.ureka/ur_forget -csh \!*`' - - # If pythonpath is not previously defined, define it so that - # the setenv works below.. - if (! $?PYTHONPATH ) setenv PYTHONPATH - - # Update the full path to the mosfire DRP code repository - # example: /src2/mosfire/DRP/mosfire - # in which the sub dirs drivers, apps, badpixel, etc. live - setenv MOSPATH /Users/mkassis/Documents/KeckInstrs/MOSFIRE/DRP_CODE_March2014/ - setenv PYTHONPATH ${PYTHONPATH}:${MOSPATH} - -**6) Ensure that mospy is executable** - - chmod +x mospy - -**7) Update your .cshrc file** - -Update your `.cshrc` file with the code bin dir in the path. Add the following line to your `.cshrc` file: - - set path = ( #mosfire_drp_bin_dir# $path ) - -for example: - - set path = ( ~/MOSFIRE/DRP_CODE/bin $path ) - -If you do not normally run csh or tcsh, you may not have a `.cshrc` file. You will need to create one or download an example file like this one: [http://www2.keck.hawaii.edu/inst/mosfire/.cshrc](http://www2.keck.hawaii.edu/inst/mosfire/.cshrc). The `.cshrc` file must be in your home directory. By default, MacOSX does not show files that start with a `.` But you can access them via the terminal. - -For a bash shell: - - # Adding MOSFIRE pipeline - PATH="/pathtomosfiredrp/MOSFIRE/DRP_CODE/bin:${PATH}" - export PATH - -**8) Now source your .cshrc file** - - source ~/.cshrc - -This will put your bin dir into your executable path. - -The installation is now complete. Take a moment to inventory your directory structure. - -DRP_CODE – Main Code Directory containing all sub-dirs for executeable code and in our example the raw and reduced sub-directories. - -* MOSFIRE – directory containing the reduction code -* apps – directory containing a few additional applications: -* what – useful pretty printer for files -* handle – the entry point for creating driver files (more later) -* badpixels – directory containing badpixel maps. -* Drivers – directory containing example driver files. These files are used to initiate the redution process and you will modify them for your specific data sets. This will be discussed in more detail later. -* Driver.py – used for YJH reductions -* K_driver.py – Contains code specific to K band observations -* Longslit_driver.py – Longslit reductions -* Long2pos_driver.py – long2pos and long2pos_specphot reductions -* Platescale – contains a file that describes the detector plate scale - -Directories created by you - -* DATA – sub directory in which you can store your data. This is not a necessary sub-directory but may help you manage files. Raw data may be stored in other areas on your disk. -* REDUX – sub directory where reductions will be stored. Also not critical, but helpful. -* bin – has the modified mospy executable command - -From now on, if you want to run any pipeline commands, you will always execute “mospy” as seen in our first step in section 5 below. diff --git a/manual/docs/installing_2016.md b/manual/docs/installing_2016.md deleted file mode 100644 index 0cef165..0000000 --- a/manual/docs/installing_2016.md +++ /dev/null @@ -1,81 +0,0 @@ -# Installation - -## Requirements - -The 2016 version of the pipeline no longer requires IRAF/PyRAF, so the installation should be simpler than previous versions. - -The pipeline requires the following python modules: - -* numpy -* astropy -* ccdproc -* scipy - -## Installing Python - -### Using Anaconda Cloud and Conda Environments - -Install Anaconda as per the instructions on the [Anaconda web site](https://www.continuum.io/downloads). - -Now we will create a conda [environment](https://conda.io/docs/user-guide/tasks/manage-environments.html) specifically for the MOSFIRE DRP. Rather than specify everything on the command line, we will get the specification for the environment from the Anaconda Cloud service. There are two specifications, one for linux (tested on a CentOS 7 system) and one for macOS (tested on macOS 10.12.6). Get the one appropriate for your system using one of the commands below: - - conda env create KeckObservatory/mospy_2016_linux - -or - - conda env create KeckObservatory/mospy_2016_macOS - -Now we will invoke that environment: - - source activate mospy_2016_linux - -or - - source activate mospy_2016_macOS - -Now we will install the DRP itself. From now on, if you want to run the DRP, first invoke the appropriate environment using `source activate mospy_2016_linux` or `source activate mospy_2016_macOS`. - - -## Download and Install the DRP - -Download the zip file of the released version from [GitHub](https://github.com/Keck-DataReductionPipelines/MosfireDRP/releases/download/Release2016A/MosfireDRP-2016release.zip). - -Move the zip file to a location on your computer where you want the source code to reside, then unzip the file: - - unzip MosfireDRP-2016release.zip - -Change in to the resulting ```MosfireDRP-2016release/``` directory: - - cd MosfireDRP-2016release - -Run the install program: - - python setup.py install - -The executable `mospy` should now be in your path. If you used the Anaconda based install, it will be in the Anaconda bin directory (e.g. `~/anaconda2/bin/mospy`). - - -## Alternate Methods of Installing Python - -Note, these are no longer the recommended methods of installing the DRP as they do not gauranttee that the various package versions are compatible with the DRP. - -### Using the Anaconda Distribution - -Install Anaconda as per the instructions on the [Anaconda web site](https://www.continuum.io/downloads). The pipeline currently (2016 release) only runs on python 2.7, so download and install that version, not the python 3.x version. - -To generate an environment similar to the one in the recommended anaconda cloud based install, you can use the following command: - -``` -conda create --no-default-packages -c astropy -n mospy_2016 python=2.7.13 astropy=2.0.2 ccdproc=1.3.0 ipython=5.4.1 numpy=1.11.2 scipy=0.18.1 PyQt=5.6.0 -``` - -You should now have all the requirements to run the MOSFIRE DRP. This should work on any anaconda install, even if the pre-packaged linux and macOS environments are incompatible with your machine. - -### Using Other Python Install Methods - -The DRP support group recommends the anaconda python install and has tested the DRP using that installer, but if an appropriate version of python (e.g. python 2.7) is installed via some other package manager (e.g. apt-get, brew, yum, etc.), then you should be able to install the python package dependencies using either that package manager (if they are available via that package manager) or using `pip`. For example: - - pip install numpy - pip install astropy - pip install ccdproc - diff --git a/manual/docs/manual.md b/manual/docs/manual.md index 8da3c3b..64a146b 100644 --- a/manual/docs/manual.md +++ b/manual/docs/manual.md @@ -6,18 +6,17 @@ 4. [Retrieve Your Data](retrieve) 5. [DRP First Reduction Step: Handle](handle) 6. [Automatic Generation of the Driver File](autodriver) -7. [The driver.py File](driver) -8. [Flats](flats) -9. [Wavelength Calibration – Y, J, and H Bands](wavelengthYJH) -10. [Wavelength Calibration – K Band](wavelengthK) -11. [Background Subtraction](background) -12. [Rectify](rectify) -13. [Spectral Extraction](extract) -14. [Long2pos Reductions](long2pos) -15. [Longslit Reductions](longslit) -16. [A Word About Header Comments](headercomments) -17. [Some Hints](hints) -18. [Examples](example) +7. [Flats](flats) +8. [Wavelength Calibration – Y, J, and H Bands](wavelengthYJH) +9. [Wavelength Calibration – K Band](wavelengthK) +10. [Background Subtraction](background) +11. [Rectify](rectify) +12. [Spectral Extraction](extract) +13. [Long2pos Reductions](long2pos) +14. [Longslit Reductions](longslit) +15. [A Word About Header Comments](headercomments) +16. [Some Hints](hints) +17. [Examples](example) The manual is also available in pdf form: [MOSFIRE_DRP_Manual.pdf](MOSFIRE_DRP_Manual.pdf) diff --git a/manual/mkdocs.yml b/manual/mkdocs.yml index eeedbca..b2efc57 100644 --- a/manual/mkdocs.yml +++ b/manual/mkdocs.yml @@ -1,6 +1,6 @@ site_name: MOSFIRE DRP Documentation theme: readthedocs -pages: +nav: - 'Home': index.md - 'DRP Manual': - 'Contents': manual.md @@ -10,7 +10,6 @@ pages: - 'Retrieve Your Data': retrieve.md - 'Handle': handle.md - 'Automatic Generation of the Driver File': autodriver.md - - 'The driver.py File': driver.md - 'Flats': flats.md - 'Wavelength Calibration – Y, J, and H Bands': wavelengthYJH.md - 'Wavelength Calibration – K Band': wavelengthK.md