[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: H*e*l*p Needed
Rob,
What Tom needs to do is so simple he could use a search/replace
function in a standard text editor if the editor allowed files
without line terminators. Perl's 's/foo/goo/g' does just
that. For more complex FITS hacking I'd use IRAF's "hedit".
See
http://iraf.noao.edu/scripts/irafhelp?hedit
the command
hedit *.fits CRREF1 1000
would set CRREF1 to 1000 in all files. More example are in the
above URL. If you are going to write software time is best
spent writing stuff that does not already exist.
Lacking a working
IRAF installation I'd go for getting "FTOOLS" from
http://heasarc.gsfc.nasa.gov/lheasoft/ftools/
--- "Creager, Robert S" <CreagRS@LOUISVILLE.STORTEK.COM> wrote:
>
> Tom,
>
> I'd be happy to help you, and send you some code. But, you will have
> to
> install CFITSIO first
> (http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html).
> Then
> preferablly, you would also install CFITSIO.pm
> (http://search.cpan.org/search?mode=module&query=CFITSIO).
>
> Then I can easily help you write C or Perl code which will do what
> you want.
>
> Cheers,
> Rob
>
> > -----Original Message-----
> > From: Tom Droege [mailto:tdroege2@earthlink.net]
> > Sent: Wednesday, June 05, 2002 9:34 AM
> > To: tass@listserv.wwa.com
> > Subject: H*e*l*p Needed
> >
> >
> > I keep forgetting that the server won't let you use certain
> > words in the
> > subject line. I don't see why. It is a pain.
> >
> > I have a bunch of data where I wrote the wrong values into CRVAL1
> and
> > CRVAL2. I need to do a global edit on the files.
> >
> > OK, I have learned some things about perl and shell scripts.
> > So I can
> > march the files through a process.
> >
> > Last time I needed to do this, perl -p -i -e 's/foo/goo/g'
> > *.fits did the job. This is because I needed to change
> > one specific
> > thing to another specific thing. Now I need to change CRVALs
> > which may
> > have any value to a specific value. OK this is no doubt 1st
> > grade perl but
> > I am still in kindergarten. Someone who knows will save me
> > spending a
> > couple of days trying to decode sequences like ./*\a@\n&$/
> > which seem to
> > make perl programmers very proud when they write them.
> >
> > Tom Droege
> >
> >
>
=====
Chris Albertson
Home: 310-376-1029 chrisalbertson90278@yahoo.com
Cell: 310-990-7550
Office: 310-336-5189 Christopher.J.Albertson@aero.org
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com