kkwitter |
06/09/2006 08:28PM (Read 6797 times)
|
|
|
Status: offline
Registered: 01/19/2006
Posts: 42
|
I am having trouble with the syntax for plotting 2 column sof a 4-column table with sgraph. I want to plot column 2 on the x-axis and 3 on the y axis, but several attempts with various suggested and implied formats have been unsuccessful.Thanks!
|
|
|
|
fitz |
06/09/2006 08:28PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Hi Karen,Is this a text table? If so then something like[code:1:da10b91b24]
cl> fields mytab.txt "2,3" | sgraph STDIN
[/code:1:da10b91b24]should do it. For FITS binary tables and .tab files the TPRINT task will dump the requested columns in the same way.Otherwise, what specifically have you tried so far that isn't working?Cheers,
-Mike
|
|
|
|
kkwitter |
06/09/2006 08:28PM
|
|
|
Status: offline
Registered: 01/19/2006
Posts: 42
|
It's a Spitzer .tbl file. It's got a long header and then 5 columns of data: order #, wavelength, flux, flux error and campaign #. I'd like to plot flux vs. wavelength. The filename is xxxxxx.tbl - I tried xxxxx.tbl[c:2,3] which didn't work. Help for sgraph gives an example of "tablefile x_col ycol" so I tried "xxxxxx.tbl 2 3" which also didn't work. Is there another task that will do this more easily?Thanks, Mike!
|
|
|
|
fitz |
06/09/2006 08:28PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
I'm afraid I don't know the details of a Spitzer .tbl file. If it is an ascii FITS header followed by text columns the FIELDS trick will still work if you set the 'lines' param to skip the header. You could also (with such a format) use RTEXTIMAGE to create an image (assuming none of the columns are strings, or perhaps STRFITS to create a table you can plot. If an image the you can LISTPIX the columns and pipe that to SGRAPH.Feel free to send a sample table and I can be more specific. I think some of the example syntaxes you posted refer to TABLES .tab files only.Cheers,
-Mike
|
|
|
|
fitz |
06/09/2006 08:28PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Hi Karen,Thanks for the sample data file. It wasn't quite what I was expecting but it can be made to work at least for the limited question you asked, for more detailed analysis with this data obviously some way to convert this to a FITS file with a proper spectral WCS would be better. In any case, for simply plotting all of col2 vs col3 something like[code:1:6d6dd42aa0]
cl> match "[\\\|]" spitz.tbl stop+ | fields "2,3" "STDIN" | sgraph
[/code:1:6d6dd42aa0]will do it. The MATCH command effectively skips the headers (which begins with a backslash or vertical pipe, the multiple backslashes are needed to escape through to the CL). The FIELDS selects the columns for plotting.However, I notice column 1 is the spectral order so plotting everything might not make sense in all cases (and for your sample produced stray lines on the plot). So to select only say order 20 for plotting try[code:1:6d6dd42aa0]
cl> match "\^20" spitz.tbl stop- | fields "2,3" "STDIN" | sgraph
[/code:1:6d6dd42aa0]In this case the backslash escapes the ^ from being interpreted by the ECL (if you use the latest 2.13BETA2), and disabling the 'stop' param passes through the lines beginning with a '20' instead of blocking lines beginning with a backslash as above.I'm not sure what software there is for converting this to FITS, but I'd be surprised if you couldn't easily find something. When you do, the earlier syntaxes for selecting the colums should work. Hope this helps.Cheers,
-Mike[quote:6d6dd42aa0]
\wavsamp version 5.1 (Wed Apr 20 08:45:04 PDT 2005)
\processing time 13:38:55 PST 04/26/2005
\character channelID = 1
\char HISTORY ========== Parameters supplied to RIDGE program below ==========
\char HISTORY PROCESS 2005/06/07 16:47:26
\char HISTORY ridge v1.10 (nl_and_params v1.5)
\char HISTORY WAVSAMP_FILE = ./cal/wavsamp.tbl
\char HISTORY PROFILE_FILE = profile.tbl
\char HISTORY PCT_LO = 5.0 percent
\char HISTORY PCT_HI = 95.0 percent
:
:
\char HISTORY INFILE = extract.tbl
\char HISTORY INFILE = ./cal/fluxcon.tbl
\char HISTORY UP_DOWN_MODE = tune_down
\char HISTORY APPLY = 3,
\char HISTORY NAMELIST_FILE = ./cdf/irs_tune.nl
|order |wavelength |flux |error |bit-flag |
|int |real |real |real |int |
| | |Jy |Jy | |
20 9.89273 1.314922 0.020078 0
20 9.90034 2.239789 0.021470 0
20 9.90796 2.233152 0.017576 0
20 9.91559 2.205115 0.015844 0
20 9.92322 2.196686 0.017692 0
20 9.93085 2.331467 0.013768 0
:
:
[/quote:6d6dd42aa0]
|
|
|
|