JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for STARDEV Archives


STARDEV Archives

STARDEV Archives


STARDEV@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

STARDEV Home

STARDEV Home

STARDEV  September 2004

STARDEV September 2004

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: WCSFRAME no longer creates SKY coordinate frame

From:

David Berry <[log in to unmask]>

Reply-To:

Starlink development <[log in to unmask]>

Date:

Tue, 28 Sep 2004 10:06:57 +0100

Content-Type:

MULTIPART/MIXED

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (74 lines) , fplottest.f (1 lines)

Tim,

> > Is this wcsframe command correct or did you mean:
> >
> >  wcsframe ndf=13_raw frame=pixel
> >
>
> He actually meant neither of these. FRAME=pixel works since it doesn't
> require (presumably) that a WCS frame is created from the fits headers.

Not so. A FrameSet is created from the FITS headers even if you only want
pixel coords.

> If I use FRAME=SKY I get a core dump in cmpframe.c.

Just tried that - no joy, wcsframe still completes succesfully for me.
Did you do anything non-standard when building kappa/ast/kaplibs ?
Like for instance, did you have any CFLAGS or FFLAGS set?

> Note that I also get a core dump from ndftrace, since that is also trying
> to read the FITS headers to create a WCS extension.

ndftrace works OK for me too.


> 0  0x42bff2c4 in Resolve (this_frame=0x81d6990, point1=0x81d7178,
> point2=0xbfff94c8,
>     point3=0x42c415b3, point4=0x42d4e718, d1=0x3, d2=0xbfff9798) at
> cmpframe.c:4820
> 4820       *d1 = AST__BAD;
>
> Here d1=0x3 is the culprit.


Have you re-built kaplibs and ndf? There have been changes to the AST
include files which *may* possible be the cause...


> with
>
>   % ndftrace u20040922_00013_raw
>
> > Not sure what to suggest next. You are *really* sure you have everything
> > updated in CVS?
> >
>
> I've just rebuilt AST and still get the problem

Maybe we should try to ascertain whether its a purely AST problem, or a
problem caused by the integration of AST and KAPPA. I've attached one of
my AST test progs which does not use any kappa stuff. Maybe you could
build it and run it to see if it gives you the same problem. I build it
like:

% g77 -fno-second-underscore -g -o fplottest fplottest.f -L$STAR/lib \
     `chr_link` `ast_link -pgplot -ems` `pgplot_link` `err_link`

To run it, you need first to create a text file containing the fits
headers:

% fitslist u20040922_00013_raw > headers

(then edit headers to remove the non-FITS commentary lines added by
fitslist). Then do:

% fplottest headers

and it should read a FrameSet from the headers and draw an annotated coord
grid (it may ask you for the pixel bounds if your headers do not include
NAXIS1/NAXIS2 values).


David


PROGRAM FPLOTTEST * Usage: * fplottest <fits header file> <device> <plot settings> IMPLICIT NONE INCLUDE 'SAE_PAR' INCLUDE 'AST_PAR' EXTERNAL SOURCE CHARACTER FILE*80, CARD*80, ATTR*80, TEXT*80, JUST*10, DOM*30, : DEV*40, SETTING*80, NAME*20, VALUE*80 INTEGER IC, FC, FS, PL, PGBEG, NAXIS1, NAXIS2, STATUS, CHR_LEN REAL GBOX(4), RANGE, DELTA, ASP, UP(2) DOUBLE PRECISION PBOX(4), INA(2), INB(2), OUTA(2), OUTB(2) LOGICAL MORE, GRID INTEGER ICURR, FRM, I, FR, CUR, WM, FR2, FS2, OPT, BF, CH, IARGC DOUBLE PRECISION X0,Y0,XX,YY,POS(2) * * Create a FitsChan to store the FITS headers. * STATUS = SAI__OK FC = AST_FITSCHAN( AST_NULL, AST_NULL, 'IWC=1', STATUS ) * * Open a text file containing a listy of FITS headers. * IF( IARGC() .GE. 1 ) THEN CALL GETARG( 1, FILE ) ELSE WRITE(*,'(A,$)') 'Enter name of FITS header file: ' READ(*,'(A)') FILE END IF OPEN( UNIT=10, FILE=FILE, STATUS='OLD' ) * * Read each card out of the text file and store it in the FitsChan. * CALL ERR_MARK DO WHILE( .TRUE. .AND. STATUS .EQ. SAI__OK ) READ( 10, '(A)', END = 10 ) CARD CALL AST_PUTFITS( FC, CARD, 0, STATUS ) END DO 10 CLOSE( 10 ) * * See if values were supplied for NAXIS1 and NAXIS2. If not assume a value * of 100 for each. The FitsChan is re-wound before calling AST_FINDFITS so * that the search starts form the beginning. * CALL AST_CLEAR( FC, 'CARD', STATUS ) IF ( AST_FINDFITS( FC, 'NAXIS1', CARD, .TRUE., STATUS ) ) THEN READ(CARD(11:),*) NAXIS1 ELSE NAXIS1 = 100 END IF CALL AST_CLEAR( FC, 'CARD', STATUS ) IF ( AST_FINDFITS( FC, 'NAXIS2', CARD, .TRUE., STATUS ) ) THEN READ(CARD(11:),*) NAXIS2 ELSE NAXIS2 = 100 END IF PBOX(1) = 0.5 PBOX(2) = 0.5 PBOX(3) = DBLE( NAXIS1 ) + 0.5 PBOX(4) = DBLE( NAXIS2 ) + 0.5 c PBOX(1) = 1 c PBOX(2) = 1 c PBOX(3) = 200 c PBOX(4) = 200 * * Read an Object from the contents of the FitsChan. This should be a * FrameSet (this should be tested really, and an error reported if any * other type of Object is obtained). Re-wind the FitsChan first so that * its entire contents are read. Note, this is a destructive read, in that * the cards which are significant to the creation of the FrameSet are * removed from the FitsChan (this is why NAXIS1 and NAXIS2 are read out * earlier - just in case they are significant to the FrameSet). Any * insignificant cards are left as they are. * CALL AST_CLEAR( FC, 'CARD', STATUS ) FS = AST_READ( FC, STATUS ) * * If an error has occurred while reading the file as a FITS file, annul * it. * IF( STATUS .NE. SAI__OK ) CALL ERR_FLUSH( STATUS ) CALL ERR_RLSE * * If we have not read an object try reading the file as an AST file. * IF( FS .EQ. AST__NULL ) THEN * Open the input file. OPEN( UNIT=10, FILE=FILE, STATUS='OLD' ) * Create the Channel and read an Object from it. CH = AST_CHANNEL( SOURCE, AST_NULL, ' ', STATUS ) FS = AST_READ( CH, STATUS ) * Annul the Channel and close the file when done. CALL AST_ANNUL( CH, STATUS ) CLOSE( 10 ) * Get the Base Frame bounds to map to the PGPLOT window. IF( AST_ISAFRAMESET( FS, STATUS ) ) THEN BF = AST_GETFRAME( FS, AST__BASE, STATUS ) ELSE BF = AST_CLONE( FS, STATUS ) END IF DOM = AST_GETC( BF, 'DOMAIN', STATUS ) WRITE(*,'(A,$)') 'Enter plot bounds in '// : DOM( : CHR_LEN( DOM ) )// : ' Frame (x1,y1,x2,y2): ' READ(*,*) PBOX(1), PBOX(2), PBOX(3), PBOX(4) END IF * * Abort if no object could be read from the file either as a FITS file * or as an AST file. * IF( FS .EQ. AST__NULL ) THEN WRITE(*,*) '!!! No object read from file!!!' GO TO 999 END IF * * If all is OK, start up PGPLOT. * IF( STATUS .EQ. 0 ) THEN IF( IARGC() .GE. 3 ) THEN CALL GETARG( 3, SETTING ) ELSE SETTING = ' ' END IF IF( IARGC() .GE. 2 ) THEN CALL GETARG( 2, DEV ) ELSE DEV = '?' END IF IF( PGBEG( 0, DEV, 1, 1 ) .EQ. 1 ) THEN CALL PGPAGE CALL PGWNAD( 0.0, 1.0, 0.0, 1.0 ) * * Create the Plot. The pixel coordinates box (0,0) to (NAXIS1,NAXIS2) is * mapped onto a window which is 10% smaller than the full PGPLOT window. * This gives some space for things like tick marks with negative length * (which stick outside the pixel cooridnates box). * IF( .NOT. AST_ISAPLOT( FS, STATUS ) ) THEN CALL PGQWIN( GBOX(1), GBOX(3), GBOX(2), GBOX(4) ) RANGE = GBOX(3) - GBOX(1) GBOX(1) = GBOX(1) + 0.05*RANGE GBOX(3) = GBOX(3) - 0.05*RANGE RANGE = GBOX(4) - GBOX(2) GBOX(2) = GBOX(2) + 0.05*RANGE GBOX(4) = GBOX(4) - 0.05*RANGE ASP = ABS( REAL( PBOX( 4 ) - PBOX( 2 ) )/ : REAL( PBOX( 3 ) - PBOX( 1 ) ) ) IF( ASP .LT. 0.2 .OR. ASP .GT. 5.0 ) ASP = 1.0 IF( ASP .GT. 1.0 ) THEN DELTA = ( ASP - 1.0 )*( GBOX(3) - GBOX(1) )/ : ( 2.0*ASP ) GBOX(3) = GBOX(3) - DELTA GBOX(1) = GBOX(1) + DELTA ELSE DELTA = ( 1.0 - ASP )*( GBOX(4) - GBOX(2) )/2.0 GBOX(4) = GBOX(4) - DELTA GBOX(2) = GBOX(2) + DELTA END IF PL = AST_PLOT( FS, GBOX, PBOX, SETTING, STATUS ) ELSE CALL PGSWIN( REAL( PBOX(1) ), REAL( PBOX(3) ), : REAL( PBOX(2) ), REAL( PBOX(4) ) ) PL = AST_CLONE( FS, STATUS ) END IF * * No loop round drawing annotated coordinate grids. * MORE = .TRUE. GRID = .TRUE. DO WHILE( STATUS .EQ. 0 .AND. MORE ) IF( GRID ) CALL AST_GRID( PL, STATUS ) IF( IARGC() .GE. 2 ) THEN OPT = 7 ELSE WRITE(*,*) '0 - plot again' WRITE(*,*) '1 - set attributes' WRITE(*,*) '2 - set a single attribute' WRITE(*,*) '3 - get attribute' WRITE(*,*) '4 - clear attribute' WRITE(*,*) '5 - show Plot' WRITE(*,*) '6 - draw text' WRITE(*,*) '7 - change current Frame' WRITE(*,*) '8 - quit' WRITE(*,'(A,$)') 'Option: ' READ( *, * ) OPT END IF GRID = .FALSE. IF( OPT .EQ. 0 ) THEN GRID = .TRUE. ELSE IF( OPT .EQ. 1 ) THEN WRITE(*,'(A,$)') 'Give a list of attribute settings: ' READ( *, '(A)' ) ATTR CALL AST_SET( PL, ATTR, STATUS ) ELSE IF( OPT .EQ. 2 ) THEN WRITE(*,'(A,$)') 'Give an attribute name: ' READ( *, '(A)' ) NAME WRITE(*,'(A,$)') 'Give an attribute value: ' READ( *, '(A)' ) VALUE CALL AST_SETC( PL, NAME, VALUE, STATUS ) ELSE IF( OPT .EQ. 3 ) THEN WRITE(*,'(A,$)') 'Give an attribute name: ' READ( *, '(A)' ) ATTR WRITE(*,*) AST_GETC( PL, ATTR, STATUS ) ELSE IF( OPT .EQ. 4 ) THEN WRITE(*,'(A,$)') 'Give an attribute name: ' READ( *, '(A)' ) ATTR CALL AST_CLEAR( PL, ATTR, STATUS ) ELSE IF( OPT .EQ. 5 ) THEN CALL MYSHOW( PL, STATUS ) ELSE IF( OPT .EQ. 6 ) THEN WRITE(*,'(A,$)') 'Give a text string: ' READ( *, '(A)' ) TEXT WRITE(*,'(A,$)') 'Give physical coordinates: ' READ( *, * ) POS(1),POS(2) WRITE(*,'(A,$)') 'Give up-vector: ' READ( *, * ) UP(1),UP(2) WRITE(*,'(A,$)') 'Give justification string: ' READ( *, '(A)' ) JUST CALL AST_TEXT( PL, TEXT, POS, UP, JUST, STATUS ) ELSE IF( OPT .EQ. 7 ) THEN WRITE(*,'(A,$)') 'Give Domain of new current Frame: ' READ( *, '(A)' ) TEXT ICURR = AST__NOFRAME DO I = 1, AST_GETI( PL, 'NFrame', STATUS ) FRM = AST_GETFRAME( PL, I, STATUS ) DOM = AST_GETC( FRM, 'DOMAIN', STATUS ) IF( DOM .EQ. TEXT ) THEN ICURR = I END IF END DO IF( ICURR .NE. AST__NOFRAME ) THEN CALL AST_SETI( PL, 'CURRENT', ICURR, STATUS ) ELSE WRITE(*,*) 'Cannot find Frame with Domain ',TEXT END IF ELSE MORE = .FALSE. END IF IF( STATUS .NE. 0 ) CALL ERR_FLUSH( STATUS ) IF( GRID ) CALL PGPAGE END DO * * Annul the Plot, and close PGPLOT. * CALL AST_ANNUL( PL, STATUS ) CALL PGEND END IF END IF * * Annul the other objects. * CALL AST_ANNUL( FS, STATUS ) 999 CALL AST_ANNUL( FC, STATUS ) END subroutine myshow( obj, status ) implicit none include 'AST_PAR' integer obj, status, ch, n call err_begin( status ) ch = ast_channel( AST_NULL, AST_NULL, 'Full=1', status ) n = ast_write( ch, obj, status ) call ast_annul( ch, status ) call err_end( status ) end SUBROUTINE SOURCE( STATUS ) INTEGER STATUS CHARACTER * ( 200 ) BUFFER READ( 10, '(A)', END = 99 ) BUFFER CALL AST_PUTLINE( BUFFER, LEN( BUFFER ), STATUS ) RETURN 99 CALL AST_PUTLINE( BUFFER, -1, STATUS ) END

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

December 2023
January 2023
December 2022
July 2022
June 2022
April 2022
March 2022
December 2021
October 2021
July 2021
April 2021
January 2021
October 2020
September 2020
August 2020
May 2020
November 2019
October 2019
July 2019
June 2019
February 2019
January 2019
December 2018
November 2018
August 2018
July 2018
May 2018
April 2018
March 2018
February 2018
December 2017
October 2017
August 2017
July 2017
May 2017
April 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
October 2015
September 2015
August 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
2004
April 2003
2003


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager