Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pvector script cant append #42

Open
olebole opened this issue Jul 1, 2018 · 2 comments
Open

pvector script cant append #42

olebole opened this issue Jul 1, 2018 · 2 comments
Labels
Dist:NOAO Releases distributed by NOAO (up to 2.16.1)

Comments

@olebole
Copy link
Member

olebole commented Jul 1, 2018

This is copied from iraf.net#1469856 by JCP:

Dear IRAF gurus,

I have a script which repeatedly calls pvector and is supposed to put several pvector plots in one output FITS file. It works fine on one of my computers (a laptop), but fails on several other computers. Each computer is running Linux Mint 18.0 (or 18.3) and each has IRAF version 2.16.1.

I want my students to be able to use the script without me so it's been driving me nuts.

Here are the first 3 lines of the script (only two lines are needed to reproduce failure):

pvector N7727Rbsr.fits xc=1090.91 yc=1067.62 width=1 theta=235 length=140 vec_out=RbsrPVs2 out_typ=image
pvector N7727Rbsr.fits xc=1088.91 yc=1067.62 width=1 theta=235 length=140 vec_out=RbsrPVs2 out_typ=image
pvector N7727Rbsr.fits xc=1089.91 yc=1067.62 width=1 theta=235 length=140 vec_out=RbsrPVs2 out_typ=image

Here is the behavior when it fails:

ecl> cl < pveesimgR.cl
ERROR: Error opening output image.
called as: `cl ()'

It does create a FITS file, but it only contains one, 1-D image instead of multiple FITS extensions.

And when it succeeds (on the laptop), it has no error message and produces exactly the kind of multi-extension FITS file I'm expecting. I have tried the script with append=yes on each line and it doesn't help. I also use epar to set append=yes in the pvector pars.

I suspect the issue lies with cfitsio or some other libraries but I don't know. Any ideas?

thanks for any help,
Jason

@olebole
Copy link
Member Author

olebole commented Jul 1, 2018

I can confirm this: On the original 2.16.1, when I run the first two lines interactively, I get no error:

vocl> pvector dev$pix xc=250 yc=250  theta=235  vec_out=pvec out_typ=image
vocl> pvector dev$pix xc=250 yc=251  theta=235  vec_out=pvec out_typ=image
vocl> 

However, when running the test script with the following test:

# plot - Plot package

## pvector - Plot an arbitrary vector in a 2D image

This is a test for [#42](https://github.com/iraf-community/iraf/issues/42)
(originally reported ad [iraf.net](http://iraf.net/forum/viewtopic.php?showtopic=1469841)

```
cl> plot
cl> pvector dev$pix xc=250 yc=250  theta=235  vec_out=pvec out_typ=image
cl> pvector dev$pix xc=250 yc=251  theta=235  vec_out=pvec out_typ=image
```

I get the same error as reported as above. This also happens when I run these lines with the snapshot release (both interactively and non-interactively). The major difference then is the init script.

The output of the first Fits HDU is identical in both cases, so the problem is the re-opening.

@olebole
Copy link
Member Author

olebole commented Jul 2, 2018

There seems to be the "append" mode flag getting lost; the opening fails here:

		    if (FKS_APPEND(fit) != YES && FKS_OVERWRITE(fit) != YES) {
			if (!fnullfile (IM_HDRFILE(im)))
			    call syserrs (SYS_IKICLOB, IM_HDRFILE(im))
		    }

FKS_APPEND(fit) is however several times changed, so this may be difficult to debug...

Horrible code. Why didn't they use (or switch to) cfitsio here?

@olebole olebole changed the title [2.16.1] pvector script cant append pvector script cant append Oct 16, 2018
@olebole olebole added the Dist:NOAO Releases distributed by NOAO (up to 2.16.1) label Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dist:NOAO Releases distributed by NOAO (up to 2.16.1)
Development

No branches or pull requests

1 participant