Welcome to iraf.net Tuesday, April 30 2024 @ 04:48 PM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Plotting and doing calculations on text files.
   
FSBoyden
 05/16/2007 02:58PM (Read 5392 times)  
++++-
Regular Member

Status: offline


Registered: 06/07/2006
Posts: 95
Hi all.The differential photometry pipeline I'm building is basically done. Now I would like to do some extra "stuff"When the psf photometry task has run, I use a script to dump the neccesary fields with the help of "txdump" to a text file. Example.filter, UT, airmass, x, y, mag, merr, msky
[code:1:0602877a0a]
C 21.7125 1.1263 123.504 168.433 17.818 0.105 99.14249
C 21.97889 1.0943 129.220 168.887 17.592 0.197 98.11974
C 22.06083 1.0856 126.199 167.901 17.868 0.079 95.80301
C 22.06944 1.0847 123.981 168.482 17.596 0.053 96.85553
C 22.07889 1.0838 125.041 168.080 17.726 0.078 96.39429
C 22.10028 1.0816 126.438 168.281 17.590 0.062 96.6115
C 22.10944 1.0807 130.006 167.818 17.469 0.096 95.07929
C 22.11889 1.0798 128.163 167.668 17.587 0.086 94.79146
[/code:1:0602877a0a]What I would like to do is correct the mag for atmospheric cond.
"v = v0 - k'X" X = airmass, k' = constWhat I would also like to do is plot a lightcurve, mag vs UT with errorbars, and save it, to print later.Thus! What packages can I use to accomplish the above mentioned?Thanx
Pat.

 
Profile Email
 Quote
fitz
 05/16/2007 02:58PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Pat,As a first pass, see the SGRAPH task in the TABLES.TBPLOT package. You can view the help page from the menubar above.Cheers,
-Mike

 
Profile Email
 Quote
FSBoyden
 05/16/2007 02:58PM  
++++-
Regular Member

Status: offline


Registered: 06/07/2006
Posts: 95
Hi MikeBeen studying the TABLES package today. Modified stardump so that it now uses TABLES.TTOOLS.TCREATE to also create tables for the stars being dumped. I.e get a text/data file a.w.a. table file. Smile(Text file is for those who prefer to use external data analysis software)TPRINT is also a handy tool. Big GrinUsing TCALC to calculate the airmass corrected magnitudes using the instumental from the star#.tab tables. :wink: Also figured out how to plot data a.w.a the errorbars for data from the star#.tab tables using SGRAPH task.Only problem now is - How can I save the image/plot. Also I expect that to print the plot, just pipe the sgraph to STDOUT?? Confused: Thanx
Pat

 
Profile Email
 Quote
fitz
 05/16/2007 02:58PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Pat,To save the plot (I assume you mean a Postscript version of it?) you would simply set the dvpar.device parameter to be something like 'psdump', likewise you would set it to 'lpr' to have it print. Note your script should include a 'gflush' after doing this to flush the graphics buffer.Note the 'psdump' device creates a file /tmp/irafdmpXXX.ps where the XXX is some process ID. There isn't a way to create a file with a specific name unless you create a private graphcap entry for it.-Mike

 
Profile Email
 Quote
FSBoyden
 05/16/2007 02:58PM  
++++-
Regular Member

Status: offline


Registered: 06/07/2006
Posts: 95
Hi MikeThe pipeline is now up and running. Big Grin
The psdump works, wrote a small script to go and catch it from the tmp/ dir and rename to the appropreate filename. I expect that the same can be done for eps files? :wink: The pipeline now only has to be calibrated, will be done with a full data set that I will be aquiring early next month.It does the reductions, psf photometry, atmospheric corrections, and plots lightcurves. Smile Nice!Thanx for all the help. Will stay in touch. Still has a lot to do i.t.o. photometry research! :wink: Regards
Pat

 
Profile Email
 Quote
fitz
 05/16/2007 02:58PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Pat,Glad to hear you've made such good progress![quote:816add99e7]
The psdump works, wrote a small script to go and catch it from the tmp/ dir and rename to the appropreate filename. I expect that the same can be done for eps files?
[/quote:816add99e7]It can, except by default the 'eps' device name writes a file called 'sgiXXX.eps' in the current directory instead of /tmp like 'psdump'. Note that in neither case are the files removed unless you do it so you need to be sure you're getting the latest file from your script and there aren't conflicts with other scripts running simultaneously. One way to do this is to create a special entry for the plot that overwrites the same file (except for the simultaneous case) such as[code:1:816add99e7]
eps|Encapsulated Postscript file (portrait) UNIX:\
:XO#300:XW#1950:YO#1000:YW#1300:PW#1.2:\
:DD=eps,tmp$sgk,!{ sgidispatch sgi2ueps $F -l$(XO) \
-w$(XW) -b$(YO) -h$(YW) -p$(PW) > epsdump.eps; rm $F; }&:tc=sgi_apl:psdump|UNIX generic interface to PS file dump:\
:DD=psdump,tmp$sgk,!{ sgidispatch sgi2uapl $F -l$(XO) -w$(XW) \
-b$(YO) -h$(YW) -p$(PW) > psdump.ps ; rm $F;}&:tc=sgi_apl:
[/code:1:816add99e7]This defines two entries, 'eps' and 'psdump' respectively, that create a specific file, 'epsdump.eps' and 'psdump.ps' respectively, in the current directory. If you edit the dev$graphcap file and put these in near the top of the file you can use these device names to get predictable output filenames. The sizes and resolutions can also be tweaked using this technique.Cheers,
-Mike

 
Profile Email
 Quote
   
Content generated in: 0.18 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login