View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

modifying psfmeasure

craigswenson wrote on Mar 12, 2008

Frank-

We've recently been using psfmeasure more and more in some of our scripts, and would now like to use the 'ignore_sat=yes' feature inside psfmeasure to check to see if a star is saturated while computing the fwhm. Unfortunately if we run psfmeasure on a single saturated star we get a warning that the "star is saturated" (which we want to know), that there is "no input data" and then psfmeasure 'breaks' (because it encountered a "case 0" error), which in turn crashes the script.

We started feeling ambitious today and decided that maybe we would just make a local copy of psfmeasure and modify it so that it wouldn't crash. We would like for it to continue running but simply output some "dummy string" that we could check for and if we came across it we would know the star was saturated on that frame.

Our question is how we would task/call these local versions of psfmeasure (since we're not really sure how to deal with .x files), and would we need to make local copies of all the necessary files (i.e. t_starfocux.x, stfmeasure.x, stfprofile.x, etc.) or just the ones that we were modifying.

Hope that all makes sense. Thanks in advance for any help.

-Craig

Francisco Valdes wrote on Mar 12, 2008

The safest way to make changes to a package, even if it is just one
task, is to copy the entire package tree to another directory. The
advantage of this is that usually changing one environment variable
will replace the installed version with a private version.

There is also one change that generally needs to be made to the package
definitions so that the task is excuted from your executable rather than the
one installed in the top level package (e.g. noao$bin.redhat) and the
parameter files are found. This generally means replacing references to
x_*.e with xx_*.e.

PSFMEASURE is actually structured in a convenient way so that you don't
need to do the whole OBSUTIL package. So I'll give you the details
for making a private development version for just this task.

1. cd <some development directory>
2. cp -rp /iraf/iraf/noao/obsutil/src/starfocus .
3. cd starfocus
4. vi mkpkg
:g/^\$/s//#$/
5. mkpkg

6. cl
7. cl> obsutil
8. cl> reset starfocus=<some development directory>/starfocus/
9. cl> redefine psfmeasure=starfocus$xx_starfocus.e

Notes:
2. You could use some other name for the directory but there is no need.
4&5. This is to comment out the default lines so that "mkpkg" falls
through to standalone. This is for safety. You could just do
"mkpkg standalone"

You can now modify files and recompile with mkpkg and test the
changes.

craigswenson wrote on Mar 12, 2008

Hopefully this will work out for us without too much difficulty. Thanks a lot.

-Craig

craigswenson wrote on Mar 12, 2008

Frank -

In your step 9 of how to make a local version of psfmeasure you said
9. cl> redefine psfmeasure=starfocus$xx_starfocus.e
and earlier in the instructions you mentioned
replacing references to x_*.e with xx_*.e
The only problem is that I don't have any x_*.e files in the 'starfocus' folder. The closest I have is a x_starfocus.x file (I also have a t_starfocus.x and x_starfocus.c). Am I missing a file or is it one of these files I need to rename and then use to redefine psfmeasure.

-Craig

craigswenson wrote on Mar 12, 2008

Frank-

After a short distraction (I needed to graduate), I'm back to trying to modify psfmeasure. If I copy the contents of the starfocus folder, make the modification to the mkpkg and then execute mkpkg, I get the following error

Warning: file `x_starfocus.o' not found
Warning: file `libpkg.a' not found
gcc: libmain.o: No such file or directory
gcc: libex.a: No such file or directory
gcc: libsys.a: No such file or directory
gcc: libvops.a: No such file or directory


I'm not sure where these files are, or if their supposed to be created during mkpkg, but in any event, they aren't there. Any suggestions as how to remedy this?

Thanks

-Craig

Last post on Mar 12, 2008