You are here: IRS>SmartDoc Web>LoResStaring (30 Oct 2008, WikiGuest)

SMART Cook Book

IRS Low-Res Staring AOR - instrumental column with sky subtraction options

Usage

This recipe assumes that you have IRS low resolution data (From either of short low or long low modules) taken in staring mode. (IE. Single point observations.)
It further assumes that there were multiple exposures taken in each of the two nod positions.
The result will be a full end-to-end low resolution spectra output into a text or ".fits" file that can be imported into a different plotting or text processing program for publication.

|Note : |SMART has a large number of buttons, reflecting its multiple functionality. This recipe only specifically refers to those buttons actually used for this particular processing.
Any buttons not referred to do not need to be used here and may be safely ignored. |

To extract an observation do the following :

  1. SMART must be installed or accessible on the machine you are using. This machine must have a windowing system (eg. X-windows) running.
    (Check with your system administrator if you need either SMART and/or windowing installed.)
  2. Invoke SMART. This can be by typing "smart" or "smart-cvs" at the prompt.
    (Check with your system administrator which configuration of SMART you have installed and how you need to invoke it.)
    Some messages will scroll past the prompt. This is normal. Then the Project Manager window will appear, headed "SMART Project".
  3. All work in SMART is organized into "Projects". You can start a new project (step 4) or add to an existing one (step 5).
  4. To start a new project :

    1. Click on "Project" and then select "New" on the drop-down menu that appears.
    2. A box appears called "New Project".
    3. At "New Project Name:" type in a new project name (eg. "Project1") and click "OK".
    4. The new project window will disappear and a new project will be created in SMART.
    5. An entry "Dataset1" will appear in the "Project Manager" box.
  5. To add to an existing project :

    1. Click on "Project" and then select "Load" on the drop-down menu that appears.
    2. A selection window will appear headed "Please Select a File".
    3. You can navigate between different directories using the "Directories" and "Filter" boxes.
    4. To select a file click on it. It will highlight. All SMART projects have a ".smp" extension.
    5. Then click "OK" on the selection window.
    6. The selection window will disappear and the selected project will be loaded into SMART.

      Note : Depending on the project size SMART may take 1-2 minutes to load it. Messages will scroll at the prompt during loading. This is normal.

    7. The Project Manager will display a list of current datasets in the project. Click on the one you want to add data to and it will highlight.
    8. Alternatively you can add a new, empty dataset by clicking on the "Add Dataset" button at the bottom of the Project Manager.
      A pop-up window will appear headed "New Dataset". Type in a name (eg. "Dataset42") and click "OK".

    Note : Within SMART you can only work on one dataset at a time.

  6. Click on the dataset you want to work with and it will highlight.
    If this is the first time since starting SMART that a dataset has been highlighted then another row of buttons will appear at the bottom of the window.
  7. Click the "Add Records/Edit Dataset" button. A new window will appear headed "Dataset:Dataset1".
  8. On "Dataset:Dataset1" click "Browse". A selection window will appear headed "Please Select a File".

    |Note : | File naming conventions and locations for SIRTF/Spitzer data are not controlled or explained by SMART. SMART can accommodate any file naming convention applied.
    Users may obtain data files directly from SSC, from the SIRTF/Spitzer Public Archive of from their own site specific data storage.
    Please see your own site or system administrator for help with this. |

  9. Select the data file(s) for processing. You can navigate between different directories using the "Directories" and "Filter" boxes.
    To select a single file click on it. It will highlight. Then click "OK" on the selection window.
    Multiple entries may be selected from the list in several different ways :

    1. Continuous block - click on the first required entry to highlight it and then drag the cursor arrow downwards
      with the mouse button still pressed until the last required entry is reached. The entire block will highlight. Then click "OK" on the selection window.
    2. Continuous block (alternative) - click on the first required entry to highlight it and then scroll down with the "down arrow" key while the "Shift" button is pressed.
      Keep scrolling down until the last required entry is reached. The entire block will highlight. Then click "OK" on the selection window.
    3. Continuous block (alternative) - click on the first required entry to highlight it then move the mouse pointer down and click on last required entry
      while the "Shift" button is pressed. This will select whole block and may be faster than using the down arrow in some cases. Then click "OK" on the selection window.
    4. Discontinuous block - First use one of the above methods to highlight the entire range from first to last.
      Then de-select unwanted entries by moving the cursor to them and clicking the mouse with the "Ctrl" (control) key pressed.
      Multiple entries within a block selection may be de-selected by either :
      1. Multiple individual clicks with the mouse button and "Ctrl" still pressed. (Useful for removing scattered individual entries.)
      2. Dragging the cursor arrow downwards with the mouse button and "Ctrl" still pressed until the last required entry is reached. (Useful for removing blocks.)
      Then click "OK" on the selection window.
    5. Discontinuous individual entries - Select one by one by clicking with the mouse with the "Ctrl" (control) key pressed. Then click "OK" on the selection window.
  10. The selected file(s) will appear listed in the "Dataset:Dataset1" window.
  11. If necessary you can change any file name (within SMART) by clicking on it to highlight it. Then click the "Rename" button at the bottom of the "Dataset:Dataset1" window.
    A small window headed "Rename" appears. Enter the new file name in the "Rename" window and then click "OK".
    This will return you to the "Dataset:Dataset1" window with the file renamed.
  12. Click on the (first) file to be extracted. It will highlight.

    |Note : | For some of the options below you need to select more than one file for extraction at the same time.
    Eg. Both nod positions of a given observation. First few times through just pick one file and try the simple case combinations of parameters for extraction.
    Then return to this point and select multiple files. Familiarize yourself with SMART first before trying anything too ambitious. |

  13. Each dataset can contain several different exposure ID's and DCE numbers.
    If you need reminders as to which exposures are at the same nod positions on the slit, click on the relevant file in the "Dataset:Dataset1" window to highlight it
    and then click on the "View" button below it. You can then select one of SMTV/ISAP, IDP3/ISAP or Quickview/ISAP to see an image of the spectrum.
    This will show you which images are in different nod positions.
  14. Click on the "Extract" button. (Bottom row of buttons on the "Dataset:Dataset1" window.)
  15. A new window appears headed "Extraction ...".
  16. Under "Select Extraction Type:" click on "Interactive Point Source". Then click "OK".
  17. A window will appear headed "SMART Manual Source Finder".
  18. At the top left hand corner is a drop-down list labeled "Select BCD". Double click on it. This will show the name and co-ordinates of the selected data at the top right.
    A view of the image will appear in the upper center and a cross sectional plot will display in the central box.
  19. Below the co-ordinate display is a selection list headed "Short-Low Orders" for an SL observation or "Long-Low Orders" for a LL one.
    Click on the relevant radio button to display the order (1,2 or 3) you want to work with first. The source is in only one of the orders.
    If you do not see an obvious profile in the central box, you probably do not have the right order button selected.
  20. The central box shows the flux data for the selected order co-added (collapsed) together and plotted as a cross section across the array.
    (The cross dispersion direction, effectively a cross section across the relevant array pixels.)
    The intensity scale is a normalized scale of nominal meaning only. The box upper rubric lists the order number and wavelength range.
  21. Below the central box, at the left are three radio buttons. Select one of them to choose how SMART attempts to fit the data in the cross dispersion direction :

    1. "Gaussian" - (This is the default) Attempts to fit a Gaussian distribution.
    2. "Column" - Attempts to fit a column which tapers with wavelength corresponding to the data's own taper with wavelength.
      (As wavelength decreases so does order width as short wavelengths spread less in the spatial direction.)
    3. "Fixed column" - Attempts to fit a fixed width column. That is, the column width does not change with wavelength.
      This is meaningful only for extended sources, but flux calibration of extended sources is not included in this version. Calibrations only apply for unresolved sources.
  22. Click on "Define Source". Move the mouse pointer onto the central display box and click on the points which you regard as suitable for defining the width of the fitting region.
    That is, the spatial width of the source for which you wish to extract a spectrum. Once the second point is clicked the "fit" region will be outlined in red.
    By default the rest of the display will be regarded as "background" and outlined in yellow.
    If you proceed to extract, the background underneath the source will be fitted by extrapolating from the outlined background regions on either side of the source.
  23. More than one fit region may be chosen. Click "Define Source" again and select another pair of points. This can be repeated for each required region.
    "Undo Last" will remove the last region selected. "Undo All" will remove all selected regions.
  24. Normally "background" is assumed by default to be all parts of the region not selected as "source". However you can define background manually.
    Click on "Man-Define Sky". The yellow marked background will disappear leaving the red marked source. Then select and click two points to define background.
    These will be marked in yellow.
  25. More than one background region may be chosen. Click "Man-Define Sky" again and select another pair of points. This can be repeated for each required region.
    "Undo Last" will remove the last region selected. "Undo All" will remove all selected regions.
  26. Once source and background have been defined to your satisfaction click on the "this order" and "this BCD" radio buttons in the lower center of the window.
  27. Click "Apply Selection".
  28. There are five buttons at the bottom of the "SMART Manual Source Finder" window. Exit by clicking one of them :

    1. "Exit/!NoSkySub" - Extracts data with no sky subtraction at all.
    2. "Exit/!AutoSky 0" - Extracts data with sky subtraction as a zero order polynomial (ie. a constant) based on the defined sky.
    3. "Exit/!AutoSky 1" - Extracts data with sky subtraction as a first order polynomial (ie. a straight line) based on the defined sky.
    4. "Exit/!QuerySky" - Extracts data with sky subtraction selected by the user during extraction. (See below)
    5. "QUIT/NO-SAVE" - Quits with no extraction and discards all input to this window.

    Note : For normal use of low resolution data "Exit/Autosky 1" is recommended.

  29. During extraction the following windows will appear showing SMART's attempt to fit the data :

    1. "Exit/!NoSkySub" - One plot of the fit labeled "DN vs X-dispersion Distance (pixels)".
    2. "Exit/!AutoSky 0" - One plot of the fit labeled "DN vs X-dispersion Distance (pixels)".
    3. "Exit/!AutoSky 1" - Two plots, one of the fit, the other of the straight line sky subtraction, both labeled "DN vs X-dispersion Distance (pixels)".
    4. "Exit/!QuerySky" - A window will appear headed "SMART SKY SUBTRACTION - CAUTION".(See below)
    5. "QUIT/NO-SAVE" - No plot or window appears.
  30. If the "Exit/!QuerySky" option is taken then a window will appear headed "SMART SKY SUBTRACTION - CAUTION".
    This allows the user to choose the type of sky subtraction performed. At the top of the window is the file name. Then comes "Sky Type".
    This has four options selected by radio button. These are intended for use in a later release(s) of SMART.
    Currently select the "None" option (the default) and click "Exit" to continue the extraction.
  31. While extraction is running messages will scroll at the prompt. This is normal.
    If you are extracting more than one file at once and using the "Exit/!QuerySky" option then the "SMART SKY SUBTRACTION - CAUTION" window will appear for each file.
    Options must be chosen separately for each one. They do not need to be the same as the options chosen for other data files/orders in the same extraction.
  32. A large window will appear titled "SMART-ISAP:ISO/SIRTF Spectral Analysis Package". This is the IDEA window.
    At its center is the display box where extracted data is displayed and can be worked on.
  33. Above the display box are a group of radio button lists titled "BCD:", "Order:", "Slit Pos:" and "Module". For the "Order:" list click on "All".
    (Or if only one number is shown by "Order:" click on that.)
  34. Then click the "Plot" button on the left hand side of the IDEA window. The extracted spectrum of the source, with background subtracted, will appear in the display box as a set of data points with flux calibration in Janskys applied using the point source calibration derived from the pipeline data products.
  35. Click on the "Style" button on the left hand side of the display box. A new window will appear called "Plot Style Preferences". In the top line of this ("Line Style:") click on "Connected".
    Then click on the "Apply" button at the bottom left hand corner. The "Plot Style Preferences" window will disappear.
  36. WARNING : If you decide not to use or leave a particular window, (here "Plot Style Preferences"),
    always leave by clicking on its "Cancel" or "Quit" button and NOT by clicking on the "X" in the upper right hand corner.
    Clicking the "X" can cause unpredictable results.
  37. OPTIONAL STEP - Color.
    Some users find it helpful to have the different orders displayed in different colors. To do this click on the "Style" button on the left hand side of the display box.
    A new window will appear called "Plot Style Preferences". In the second line of this ("Color Coding Preference:") click on "Order Number".
    Then click on the "Apply" button at the bottom left hand corner. The "Plot Style Preferences" window will disappear.
  38. Extracted data now appears in the IDEA window display box as connected data points.
    (Each order will also be colored differently if you have selected this above.

    Note : NOTE : If your data suddenly has one order missing it may be that one of your default colors is black. See your system administrator to change this.)

  39. The full spectrum can appear very ragged due to poor calibrations at the edges of each order.
    Any part of the spectrum can be enlarged for examination by holding down the left mouse button and drawing a box around the area for examination.
    When finished click "Plot" again to return to the full spectrum.
  40. On the IDEA window left hand side click the "Store" button.
  41. A new window will display headed "Stored Data Sets".
    This displays a radio buttoned list of all currently extracted datasets, in order of extraction.
  42. For a low resolution image there will be two entries listed for each image you extract. One will be the extracted spectrum of the source.
    The other, suffixed "_off", is an "extraction" of empty orders and can be deleted. To delete select the "_off" entry by clicking on the radio button next to it.
    Then click on "Apply Function to :[filename_off]" at the top of the "Stored Data Sets" window.
    A sub-menu will appear, click on "Delete". A warning message will appear "Are You Sure ?" Click on it.
    The "Stored Data Sets" window will then disappear and the "_off" entry will be deleted.
  43. It is often helpful to trim the edges of each order as the first and last few data points of each order may be poorly calibrated and misleading.
    To do this first go to the "Orders" list on the IDEA window above the main display box. Unselect "All" and select the first order only.
    Then click "Plot" on the left hand side of the IDEA window.
  44. This will display just the first order. If there is significant rise or drop at either/both edges of the order it can be masked out.
  45. With the right mouse button draw a box around the portion of the edge of the spectrum you want to mask out. A window headed "Applications" will appear. Click on "Mask".
    The "Applications" window will disappear and in the main display box selected portion of the order will be masked out. Repeat for the other edge of the order if needed.

    Note : The data may be automatically re-scaled to best fill the display box. IE. Its appearance may change. This is normal.

  46. If you do not like a particular box you have selected click on "Cancel" at the right hand side of the "Applications" window (which will disappear)
    then click "Replot" at the bottom right of the IDEA window. This will remove the box you have drawn and you can draw another.
  47. At any time you can recover data points that have been masked. To do this on the IDEA window click "All" on the "Orders" list, then "Plot".
    This ensures that all the data is displayed. Then with the right mouse key draw a box around the entire display box area within the displayed axes.
    When the "Applications" window appears click "!UnMask". This will restore the masked data to the display box.
  48. For each order, (orders 1,2, 3 or some combination thereof), repeat steps 42-46 until all unwanted order edges have been removed.
  49. To co-add this data with the other nod position data first click on the relevant corresponding nod position file in the "Dataset:Dataset1" window.

    |Note : |NOTE: In most cases it is considered more accurate to extract two spectra from different images at the same nod position first and then co-add them.
    Co-adding images before extraction may introduce errors as it cannot be certain that two different images fall on exactly the same pixels in a given array.
    This is mainly true for high resolution data though can also be true for low resolution data as well. |

  50. For this image from the other nod position then repeat extraction (see above, steps 12-31).
    A small pop-up window headed "Acknowledge" will appear announcing "Updating stored data sets with newly extracted data". Click "OK".
  51. On the IDEA window left hand side click the "Store" button.
  52. The "Stored Data Sets" window will display. This shows a radio buttoned list of all currently extracted datasets, in order of extraction.
    For the newly extracted spectra delete the "_off" entry as in step 41 above.
  53. Select the new spectra. Then click on "Apply Function to :[filename]" at the top of the "Stored Data Sets" window.
    A sub-menu will appear, click on "Make Prime Data Set". The "Stored Data Sets" window will then disappear.
  54. On the main IDEA window click "All" on the "Orders" list, then "Plot".
    This will display the second extracted spectra in the main display box.
  55. If you need to trim the edges of each order from this second spectra repeat steps 42-46 as necessary.
  56. Once any unwanted edge effects have been removed the two datasets can be co-added. Click on "Store" on the IDEA window to display the "Stored Data Sets" window.
  57. Select the first spectra. Then click on "Apply Function to :[filename]" A small sub-menu will appear. Click on "Use as Reference Data Set".
  58. Click the "Store" button again to display "Stored Data Sets".
  59. Select the second spectra. Then click on "Apply Function to :[filename]" A small sub-menu will appear. Click on "Make Prime Data Set".
  60. On the "Order" list select "All" (this may be already selected) and then "Plot" to display the data.
  61. With the right-hand mouse key draw a box around the displayed data.
  62. The "Applications" window will appear. This allows various ways of comparing or combining the two datasets.
  63. OPTIONAL STEP - Comparison.
    If you wish a comparison of the two spectra, click on the button "Oplot data to ref". A window appears headed "Oplot (plot prime with reference)".
    At the top this window lists the two datasets as "Primary" (left) and "Reference" (right).
    The same order(s) must be selected (by clicking radio buttons) on both the primary and reference sides of the window.
    The left hand side box headed "Reference flux axis re-scale:" allows rescaling as desired. Then click on "Plot Now" to see the over plotted spectra in the display box.
    Clicking on "Set Plot Style" displays another window "Plot Style Preferences" which allows you set different line styles for the primary and reference spectra.

    Note : You cannot return to the IDEA window until you have clicked "Quit".

  64. If you leave an application and return to the IDEA window you may be left with an outline box on the IDEA window display box. To remove this click on "Plot".
    Then to re-display the "Applications" window draw another box around the data (using the right mouse key) and "Applications" window will re-appear.
  65. If you want to combine the spectra then in the "Applications" window click on the "Arithm2(Ref) button.
  66. A new window will appear headed "arithm2(apply the reference to the prime)".
  67. Select the "Order" option then under "operation to perform:" select the "mean" radio button.
  68. Then click "Apply (Keep)" at the bottom left hand corner of the window.
  69. The resultant data displayed in the IDEA window is the result of co-adding the data from the two different nod positions.
  70. At the top left hand corner of the IDEA window is a small box labeled "Prime". This will now display "arithm2:[filename1]".
  71. Click on "Store-Prime" on the top row of buttons on the IDEA window.
  72. Then click "Store". The resultant window will now have a three entry list. The last entry will be called "arithm2:[filename1]".
  73. Select this entry then click on "Apply function to...". On the sub-menu click on "Change Name".
  74. A new window will appear with an entry line "New Title:". Enter a new name, eg: "Extracted_co-added_1". Click "OK".
  75. Click "Store". The last entry of the list will be re-named.
  76. Select this re-named entry and click on "Apply function to...".
  77. On the sub-menu click "Write to disk in...".
  78. Another sub menu will appear with three options :

    1. FITS format - the standard ".fits" table format.
    2. ASCII format - This leads to 2 further options :
      1. Write the header + All the data An ASCII file of data in column format containing all data in the dataset.
      2. Write the header + wave flux stdev and flag data An ASCII file of data in column format containing the minimum data needed for re-loading into the IDEA window at a later time.
    3. ISAP-XDR format - The IDL "XDR" format. Only use this to save data you intend to further process ONLY with other IDL programs.
  79. Select one of the save options. The choice of format will be determined by the input requirements of any piece of software you intend to use next.
    A small pop-up window will appear. At "Name for [type] file" the default name displayed is the current name for the dataset within the IDEA window.
    The default directory is the one from which SMART was invoked. You can change either of these by typing in "/directory/file".
    (Please use absolute path names for directories.) Then click "OK". The entry window and the "Stored Data Sets" window will then disappear.
  80. At this point you have extracted and stored the first spectra.
  81. You can make a postscript file of the data displayed in the IDEA window display box. Click the "Hard Copy" button at the bottom right of the IDEA window.
    This will display a small pop-up window allowing you to set various print options.
    Set the options : "Color or B/W", the output filename, (including directory, please use absolute path names), title, X and Y labels.
    (The default output filename is "hardcopy.ps" which is seldom meaningful.) Then click "OK".
    A postscript file will be generated and written to the directory you specified in the "Filename" option.
  82. You can make postscript output of any other dataset by displaying that in the IDEA window and clicking on "Hard Copy".
    To display any dataset first click on "Store" then select the dataset you want, then make it the prime dataset. (See step 36.)
  83. If you have further data in the form of pairs of images (on source and nod positions) you can extract and store them in exactly the same way as the first pair described above.
  84. Click the "QUIT" button at the bottom left of the IDEA Window.
  85. A small window will appear headed "ISAP Exit", displaying the text "Do you really want to exit?". Click "Yes".
  86. A small window will appear headed "Update Project", displaying the text "Do you want to save your spectral data to the SMART Project Manager?". Click "Yes".
  87. In the "Dataset:Dataset1" window a new entries will appear in the file list, with the names they had while in the IDEA window.
  88. On the "Dataset:Dataset1" window click "Close".
  89. On the Project Manager" window click "Exit".
  90. A small pop-up window headed "Question" will appear asking "Save Project ? [project name]. Click "Yes".
    If you have loaded an existing project this will re-save it with the additional extracted and co-added data.
  91. You have now left SMART.
  92. IDL is still invoked at the prompt. Type "exit" at the prompt to leave IDL.

 
This site is powered by FoswikiCopyright © 2002-2009 by the Cornell IRS Team.
Send feedback. We use Foswiki.