Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSELECT

 
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF
View previous topic :: View next topic  
Author Message
jacom



Joined: 22 Jul 2011
Posts: 5

PostPosted: Wed Sep 21, 2011 11:01 am    Post subject: PSELECT Reply with quote

Hi,

I have the problem of removing the psf stars from the .nst or .psg files in order to subtract only the neighbouring stars to the psf stars. They are the first stars in each group.

I am creating a script so I want to automate it in stead of removing each psf star manually.
Is it possible, by using the task PSELECT, to compare different records with each other, eg. expr = "GROUP == (previous record/line GROUP)" in order to copy only the non-psf stars to another file.

Or is there maybe a better way of doing something like this which will work in a script?

Thanks
Jaco
Back to top
View user's profile Send private message
azangari



Joined: 09 Jan 2009
Posts: 19

PostPosted: Thu Mar 15, 2012 7:12 pm    Post subject: Reply with quote

I don't know how to use pselect, but I've worked around your problem in other ways.

As it happens, you can put the relevant .pst file in the exclude option for substar, and that solves the problem of having to make another nst file completely.

It's not in the Massey/Davis 1992 document, which is unfortunate, because I figured the whole pst thing out AFTER I wrote some IDL code that does make a new NST file. I'd be happy to give a copy of the code to someone to help them out, but this is what my does:

1. Uses the NASA IDL tools program readcol to read in the NST file. Readcol is a reasonably smart function and will ignore the second line per star, since the format does not mach the first line.
2. Makes a histogram of the column "group". This returns an array with the number of elements in each group, in order, and doesn't care WHAT they are.
3. Gets the number of unique elements of the column group (same as the number of elements in our histogram).
4. Makes a new nst file numbered n+1
5. Reads in the old nst file AGAIN, this time line by line. The first 42 lines are pumped in directly to the new file.
6. Now we loop over the number of groups. First we read the next two lines into a dummy variable.
7. If our histogram tells us there is two or more stars in our group, we read in two lines for each additional star, writing them directly to our new nst file.
8. We loop until we are out of groups and close both nst files.

There may be a better way to do this, but that worked for me. Though seriously knowing about the .pst thing in substar would have saved me hours of time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.09 seconds