AutoDriver
+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.
To generate the driver file, go to the directory where your Offset files live, and where the reduction is going to happen and type:
mospy AutoDriver
@@ -200,7 +202,7 @@ AutoDriver
diff --git a/background/index.html b/background/index.html
index f6a4a46..bf63154 100644
--- a/background/index.html
+++ b/background/index.html
@@ -87,10 +87,6 @@
- The driver.py File
-
-
-
Flats
diff --git a/changes/index.html b/changes/index.html
index 45babf3..b1e6167 100644
--- a/changes/index.html
+++ b/changes/index.html
@@ -103,10 +103,6 @@
- The driver.py File
-
-
-
Flats
diff --git a/driver/index.html b/driver/index.html
deleted file mode 100644
index e3b715c..0000000
--- a/driver/index.html
+++ /dev/null
@@ -1,294 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- The driver.py File - MOSFIRE DRP Documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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:
-
-- Navigate to the desired output directory created by handle:
cd ~/Data/reducedMOSFIRE_DRP_MASK/2012sep10/H
-- 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.
-- 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)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- « Previous
-
-
- Next »
-
-
-
-
-
-
-
-
-
diff --git a/example/index.html b/example/index.html
index 723a02e..84a12c3 100644
--- a/example/index.html
+++ b/example/index.html
@@ -87,10 +87,6 @@
- The driver.py File
-
-
-
Flats
diff --git a/extract/index.html b/extract/index.html
index 516ab26..909750e 100644
--- a/extract/index.html
+++ b/extract/index.html
@@ -87,10 +87,6 @@
- The driver.py File
-
-
-
Flats
diff --git a/flats/index.html b/flats/index.html
index 058eb75..956d0b9 100644
--- a/flats/index.html
+++ b/flats/index.html
@@ -84,10 +84,6 @@
Automatic Generation of the Driver File
-
-
-
- The driver.py File
@@ -261,7 +257,7 @@ K-band flats
Next
- Previous
+ Previous
K-band flats
- « Previous + « Previous Next » diff --git a/generate_pdf b/generate_pdf index c2cff4f..5587a50 100644 --- a/generate_pdf +++ b/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/handle/index.html b/handle/index.html index ae91378..47b9899 100644 --- a/handle/index.html +++ b/handle/index.html @@ -93,10 +93,6 @@MOSFIRE DRP
diff --git a/installing/index.html b/installing/index.html index b42bf32..29bfd60 100644 --- a/installing/index.html +++ b/installing/index.html @@ -105,10 +105,6 @@Requirements
Installing Python
Using Anaconda Cloud and Conda Environments
-Install Anaconda as per the instructions on the Anaconda web site.
+Install Anaconda as per the instructions on the Anaconda web site.
Now we will create a conda environment 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_2018_linux
diff --git a/installing_2015A/index.html b/installing_2015A/index.html
deleted file mode 100644
index 953e223..0000000
--- a/installing_2015A/index.html
+++ /dev/null
@@ -1,330 +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/
-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
--
-
- Start an xterm session on your local machine -
- Run “cd” to navigate to the home directory -
- Download either the .zip file, or the .tar.gz file from the website 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.
- - 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. 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.
- -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.
-Now we will create a conda environment 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.
-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. 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
-
-
-