Reducing TSPEC data

50 views
Skip to first unread message

Eilat Glikman

unread,
Feb 23, 2010, 4:04:57 PM2/23/10
to p200-tripl...@googlegroups.com
After a (too) long hiatus spent teaching, I am finally caught up enough to get back to research.  I have a whole bunch of TSPEC data that, once reduced, is dying to be published. 

Can anyone update me on the status of reduction capabilities? 

Thanks!
Eilat

Michael Cushing

unread,
Feb 24, 2010, 11:35:01 AM2/24/10
to p200-tripl...@googlegroups.com

Hi Eilat (and all),

So there isn't great news to report. I have a version that extracts spectra but unfortunately the background subtraction is not working well. And by well I mean not better than before. I am not sure what is causing this and decided to step away from it for a while. Not sure when I can get back to it. If/when I do get things working, I will certainly let you and the group know.

-Mike

> --
> You received this message because you are subscribed to the Google Groups "P200 TripleSpec Users" group.
> To post to this group, send email to p200-tripl...@googlegroups.com.
> To unsubscribe from this group, send email to p200-triplespec-...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/p200-triplespec-users?hl=en.

Eilat Glikman

unread,
Feb 24, 2010, 12:07:54 PM2/24/10
to p200-tripl...@googlegroups.com
What have people been using to reduce (and publish?) their TSpec data? 

Is there anything available right now that will do a decent job on reasonably well-exposed 2MASS sources? 

Thanks!
Eilat

Babs

unread,
Feb 24, 2010, 1:23:50 PM2/24/10
to p200-tripl...@googlegroups.com
Hey Eilat (and all),

I've been using Phil's reduction package ... You can download it from his webpage:

http://astrosun2.astro.cornell.edu/~muirhead/#Downloads

Everything you need to do is explained there BUT if your exposures are of 300s (or more) then probably it would not do a good job removing the background/skylines ... Since my objects are very bright I have no problem with that ... give it a try ...

Cheers,

Babs

--
"Yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the present."
-Oogway
----------------------------------------------------------
Barbara Rojas Ayala                          
208 Space Sciences Building    
Cornell University                      
Ithaca, NY 14853                      
(607)255-5891                        
(607)793-3186
ba...@astro.cornell.edu
----------------------------------------------------------

2010/2/24 Eilat Glikman <eilat....@gmail.com>

--

phildelio

unread,
Mar 14, 2010, 10:22:28 PM3/14/10
to P200 TripleSpec Users
hi everyone. phil here.

i patched together a program today that converts a triplespec image
into a single-order, wavelength vs. slit image. if you use this to
rectify your data, you can then use a simple total() command in IDL to
get a spectrum out. i wrote this because my tedi routines i put
online really only work for tedi-like targets (really bright). this
should work for faint targets. if you want to do further analysis
beyond just the total() command, this could even integrate with the
IRAF long-slit routines, which accept single-order, rectified data.

instructions:

http://astrosun2.astro.cornell.edu/~muirhead/tspec_rectify.pro

you'll also need to put this dat file in the same directory as
tspec_rectify:

http://astrosun2.astro.cornell.edu/~muirhead/tspecdat.idl

and you'll need findex.pro if you don't already have it:

http://hea-www.harvard.edu/PINTofALE/pro/external/findex.pro

take your data, flat-field it, subtract a nod (or subtract the median
of several positions along the slit), save that as a fits, and then do
this:

IDL> tspec_rectify, input='flat_fielded_and_nod_subtracted.fits',
output='rectified.fits', flux_grid=flux_grid, lambda_grid=lambda_grid,
spatial_grid=spatial_grid

that will take about a minute or two. then open 'rectified.fits' in
your favorite fits viewer and find the vertical pixel numbers that
bookend your target. suppose you target is between y = 20 and 50.
then do this:

IDL> plot, lambda_grid[*,0], total(flux_grid[*,20:50],2)

and if you don't like the residual OH lines, you can subtract a nearby
OH spectrum like this:

IDL> plot, lambda_grid[*,0], total(flux_grid[*,20:50],2) -
total(flux_grid[*,51:81],2)

notice i subtracted a nearby region (51 to 81) with the same number of
vertical pixels (31). that is critical. also, don't use pixels that
contain a negative of your target for the OH subtraction! use pixels
that only contain OH lines for a subtraction. i mean..duh.

and if your data still looks like shit you can try smooth() ing it.

anyway, it's not a perfect interpolation, since it uses a fixed
solution for the detector. you'll prob notice your oh lines don't
become perfectly vertical, nevertheless i think this should work for
most science applications. *maybe* in the future i will add something
to recalibrate with the oh lines, but that will have to wait.

feel free to report bugs.

cheers,
phil


On Feb 24, 2:23 pm, Babs <barbara.ro...@gmail.com> wrote:
> Hey Eilat (and all),
>
> I've been using Phil's reduction package ... You can download it from his
> webpage:
>

> http://astrosun2.astro.cornell.edu/~muirhead/#Downloads<http://astrosun2.astro.cornell.edu/%7Emuirhead/#Downloads>


>
> Everything you need to do is explained there BUT if your exposures are of
> 300s (or more) then probably it would not do a good job removing the
> background/skylines ... Since my objects are very bright I have no problem
> with that ... give it a try ...
>
> Cheers,
>
> Babs
>
> --
> "Yesterday is history, tomorrow is a mystery, but today is a gift. That is
> why it is called the present."
> -Oogway
> ----------------------------------------------------------
> Barbara Rojas Ayala
> 208 Space Sciences Building
> Cornell University
> Ithaca, NY 14853
> (607)255-5891
> (607)793-3186

> b...@astro.cornell.edu
> ----------------------------------------------------------
>
> 2010/2/24 Eilat Glikman <eilat.glik...@gmail.com>


>
> > What have people been using to reduce (and publish?) their TSpec data?
>
> > Is there anything available right now that will do a decent job on
> > reasonably well-exposed 2MASS sources?
>
> > Thanks!
> > Eilat
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "P200 TripleSpec Users" group.
> > To post to this group, send email to
> > p200-tripl...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > p200-triplespec-...@googlegroups.com<p200-triplespec-users%2Bunsu...@googlegroups.com>

Babs

unread,
Mar 15, 2010, 1:45:33 PM3/15/10
to p200-tripl...@googlegroups.com
Hi guys,

once you have the rectified data then you can also (instead of iraf) use the idl package REDSPEC

http://www2.keck.hawaii.edu/inst/nirspec/redspec.html

Babs

2010/3/14 phildelio <philip....@gmail.com>
To unsubscribe from this group, send email to p200-triplespec-...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/p200-triplespec-users?hl=en.


--
"Yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the present."
-Oogway
----------------------------------------------------------
Barbara Rojas Ayala                          
208 Space Sciences Building    
Cornell University                      
Ithaca, NY 14853                      
(607)255-5891                        
(607)793-3186
ba...@astro.cornell.edu
----------------------------------------------------------

Ori Fox

unread,
Mar 24, 2010, 8:32:22 PM3/24/10
to P200 TripleSpec Users
Ok, this looks great. Unfortunately, after I run tspec_rectify on my
flat-fielded and nod-subtracted image (http://www.astro.virginia.edu/
~odf4n/triplespec/OCTOBER07/fspec1102.fits), I get something that
looks like this (http://www.astro.virginia.edu/~odf4n/triplespec/
OCTOBER07/rspec1102.fits). It doesn't look like the flux array
corresponds to any of the flux values correspond to any spectrum. In
fact, it doesn't look like anything. I may be misinterpreting what
I'm looking at, but I partially worry that these files are part of a
really old engineering data set (October 2007) and the detector's
fixed solution somehow changed. Any ideas?

On Mar 15, 1:45 pm, Babs <barbara.ro...@gmail.com> wrote:
> Hi guys,
>
> once you have the rectified data then you can also (instead of iraf) use the
> idl package REDSPEC
>
> http://www2.keck.hawaii.edu/inst/nirspec/redspec.html
>
> Babs
>

> 2010/3/14 phildelio <philip.muirh...@gmail.com>


>
>
>
>
>
> > hi everyone.  phil here.
>
> > i patched together a program today that converts a triplespec image
> > into a single-order, wavelength vs. slit image.  if you use this to
> > rectify your data, you can then use a simple total() command in IDL to
> > get a spectrum out.  i wrote this because my tedi routines i put
> > online really only work for tedi-like targets (really bright).  this
> > should work for faint targets.  if you want to do further analysis
> > beyond just the total() command, this could even integrate with the
> > IRAF long-slit routines, which accept single-order, rectified data.
>
> > instructions:
>

> >http://astrosun2.astro.cornell.edu/~muirhead/tspec_rectify.pro<http://astrosun2.astro.cornell.edu/%7Emuirhead/tspec_rectify.pro>


>
> > you'll also need to put this dat file in the same directory as
> > tspec_rectify:
>

> >http://astrosun2.astro.cornell.edu/~muirhead/tspecdat.idl<http://astrosun2.astro.cornell.edu/%7Emuirhead/tspecdat.idl>

> > > > p200-triplespec-...@googlegroups.com<p200-triplespec-users%2B unsub...@googlegroups.com>
> > <p200-triplespec-users%2Bunsu...@googlegroups.com<p200-triplespec-users %252Buns...@googlegroups.com>


>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/p200-triplespec-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "P200 TripleSpec Users" group.
> > To post to this group, send email to
> > p200-tripl...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > p200-triplespec-...@googlegroups.com<p200-triplespec-users%2B unsub...@googlegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/p200-triplespec-users?hl=en.
>
> --

Philip Muirhead

unread,
Mar 25, 2010, 11:25:06 AM3/25/10
to p200-tripl...@googlegroups.com
oh, yeah. that was a bug. should be fixed:

http://astrosun2.astro.cornell.edu/~muirhead/tspec_rectify.pro

-phil

> To unsubscribe from this group, send email to p200-triplespec-...@googlegroups.com.

Ori Fox

unread,
Apr 13, 2010, 5:04:19 PM4/13/10
to P200 TripleSpec Users
Ok, we finally got everything working, although the bug was never
determined! In any case, I have a beautiful spectrum now...thanks
all!

Now, I want to use a standard star for telluric corrections. I know
the rough method for doing this, but I have been using SpecTool up
until now. Before I reinvent the wheel for one night of data reduced
with tspec_rectify, I was hoping that somebody might have a piece of
pre-written code. Can anyone help?

Thanks,
Ori

On Mar 25, 11:25 am, Philip Muirhead <muirh...@astro.cornell.edu>
wrote:

Kelle Cruz

unread,
Apr 13, 2010, 5:10:52 PM4/13/10
to p200-tripl...@googlegroups.com
I'm pretty sure you can use xtellcor (from within the spextool package) as a standalone.  I looked for a good link for this particular functionality but didn't find one....here's the standard instead: http://irtfweb.ifa.hawaii.edu/~cushing/Spextool.html

kelle

Michael Cushing

unread,
Apr 13, 2010, 5:14:20 PM4/13/10
to p200-tripl...@googlegroups.com

Hi Ori,

How many sources have you observed? If not too many, you can use xtellcor_general in the standard Spextool package (as Kelle's email just said). The only draw back is that currently it can only take a single order at a time. So you would input two text files, with columns of wavelength, flux, error, for each order separately.

The new version of Spextool that I have half working with Tspec data will take multi-order data, but it isn't ready to be released yet.

-Mike

Ori Fox

unread,
Apr 13, 2010, 6:15:02 PM4/13/10
to P200 TripleSpec Users
Yes, I have xtellcor and use it regularly with the APO TSpec data, but
I'm not sure its working on the data output from tspec_rectify.pro.
The output from this program is 10136 by 101 by 3 array (see program
details). Xtellcor crashes with this input file. The same is true
with xcombspec. So, right now, I have a bunch of individual
observations that can be combined using a simple averaging command,
but again, this doesn't create a usable format for xtellcor.

Ori Fox

unread,
Apr 13, 2010, 6:58:19 PM4/13/10
to P200 TripleSpec Users
Mike,

Well, doesn't look like xtellcor_general is liking what I'm giving
it. I've attached my two data files.
http://www.astro.virginia.edu/~odf4n/triplespec/OCTOBER07/SN2007gr/mHD18881.dat
http://www.astro.virginia.edu/~odf4n/triplespec/OCTOBER07/SN2007gr/mSN2007gr.dat

When I try to run xtellcor_general, I keep getting this error. Maybe
having all orders together is throwing it off?

% Tag name STDNAPS is undefined for structure <Anonymous>.
% Error occurred at: XTELLCOR_GENERAL_EVENT 82
/data/odf4n/triplespec/spextool/Spextool2/pro/xtellcor_general.pro
% WIDGET_PROCESS_EVENTS
% $MAIN$
% Execution halted at: $MAIN$

-Ori

On Apr 13, 5:14 pm, Michael Cushing <michael.cush...@gmail.com> wrote:

Eilat Glikman

unread,
May 6, 2010, 4:10:45 PM5/6/10
to p200-tripl...@googlegroups.com
Hi Phil,  

This is working great!

Quick question:

I ran tspec_rectify on my spectrum and produced a nice output spectrum, which I save into a fits file.  But since tspec_rectify takes a few minutes to run, can I just readfits the output image?  and is the output image array the same as flux_grid?

Thanks!
Eilat

Philip Muirhead

unread,
May 6, 2010, 4:45:30 PM5/6/10
to p200-tripl...@googlegroups.com
I ran tspec_rectify on my spectrum and produced a nice output spectrum, which I save into a fits file.  But since tspec_rectify takes a few minutes to run, can I just readfits the output image?  and is the output image array the same as flux_grid?

Yeah, it should be.

You might do a test and check that they are the same.  I'd do that myself, but I'm seriously swamped.

-Phil

Eilat Glikman

unread,
May 6, 2010, 4:47:35 PM5/6/10
to p200-tripl...@googlegroups.com
thanks.  ill do that.

-E

Eilat Glikman

unread,
May 20, 2010, 11:18:32 AM5/20/10
to p200-tripl...@googlegroups.com
Hi, 

Ori -- Were you able to figure out the telluric correction for your objects?  I am getting a similar error for my objects which I extracted after applying tspec_rectify.

Mike -- Is there a latest version of Spextool (or its TSpec counterpart) that I might be able to get?

Thanks!
Eilat

Michael Cushing

unread,
May 21, 2010, 6:29:14 PM5/21/10
to p200-tripl...@googlegroups.com

Hi,

Unfortunately I would go with xtellcor_general for the moment.  In this case, you have to give it data on an order by order basis.  

-Mike

Nathaniel Ross

unread,
Apr 29, 2013, 8:01:55 PM4/29/13
to p200-tripl...@googlegroups.com, muir...@astro.cornell.edu
Hello,

I am a UCLA grad student and just got some great TSpec data. I'm trying to use the tspec_rectify.pro script on my flattened 2-d spectra, and I am encountering the following error:
IDL> tspec_rectify, "tspec0026.fits"     

                                 /normalize))
                                  ^
% Syntax error.
  At: /data/TripleSpec2013April/20130424/proc/tspec_rectify.pro, Line 209

                                    /normalize))
                                     ^
% Syntax error.
  At: /data/TripleSpec2013April/20130424/proc/tspec_rectify.pro, Line 236

                                    /normalize))
                                     ^
% Syntax error.
  At: /data/TripleSpec2013April/20130424/proc/tspec_rectify.pro, Line 241
% Compiled module: TSPEC_RECTIFY.
% Attempt to call undefined procedure/function: 'TSPEC_RECTIFY'.

% Execution halted at: $MAIN$         

Any idea what I am missing?

Thanks,
Nate Ross

>> > > > p200-triplespec-users+unsub...@googlegroups.com<p200-triplespec-users%2B unsub...@googlegroups.com>


>> > <p200-triplespec-users%2Bunsu...@googlegroups.com<p200-triplespec-users %252Buns...@googlegroups.com>
>>
>> > > > .
>> > > > For more options, visit this group at
>> > > >http://groups.google.com/group/p200-triplespec-users?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "P200 TripleSpec Users" group.
>> > To post to this group, send email to
>> > p200-tripl...@googlegroups.com.
>> > To unsubscribe from this group, send email to

>> > p200-triplespec-users+unsub...@googlegroups.com<p200-triplespec-users%2B unsub...@googlegroups.com>


>> > .
>> > For more options, visit this group at
>> >http://groups.google.com/group/p200-triplespec-users?hl=en.
>>
>> --
>> "Yesterday is history, tomorrow is a mystery, but today is a gift. That is
>> why it is called the present."
>> -Oogway
>> ----------------------------------------------------------
>> Barbara Rojas Ayala
>> 208 Space Sciences Building
>> Cornell University
>> Ithaca, NY 14853
>> (607)255-5891
>> (607)793-3186
>> b...@astro.cornell.edu
>> ----------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups "P200 TripleSpec Users" group.
> To post to this group, send email to p200-tripl...@googlegroups.com.

> To unsubscribe from this group, send email to p200-triplespec-users+unsub...@googlegroups.com.

Babs

unread,
Apr 29, 2013, 9:01:39 PM4/29/13
to p200-tripl...@googlegroups.com, Philip Muirhead

Hi Nate,

I do not have my mac with me but probably it is a function were the "/normalize" option does not exist. Did you check the lines where the error appears? Check if it happens each time the same function is called.

Babs

To unsubscribe from this group and stop receiving emails from it, send an email to p200-triplespec-...@googlegroups.com.

To post to this group, send email to p200-tripl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages