From owner-fitsbits at marmoset.cv.nrao.edu  Tue Feb  4 10:11:00 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id KAA20997; Tue, 4 Feb 1997 10:10:28 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id OAA15988; Sat, 1 Feb 1997 14:24:51 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id OAA26347 for <fitsbits at fits>; Sat, 1 Feb 1997 14:24:50 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA18500; Sat, 1 Feb 97 14:24:48 EST
To: fitsbits at fits.cv.nrao.edu
Date: 29 Jan 1997 12:58 EDT
From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger)
Message-Id: <29JAN199712580090 at nssdca.gsfc.nasa.gov>
Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!aruba.odu.edu!news.larc.nasa.gov!lll-winken.llnl.gov!decwrl!pa.dec.com!decuac.dec.com!haven.umd.edu!cs.umd.edu!newsfeed.gsfc.nasa.gov!nssdca.gsfc.nasa.gov!bschlesinger
Reply-To: fits at nssdca.gsfc.nasa.gov
Subject: FITS Support Office move complete
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

The FITS Support Office physical move is now essentially complete.
The new telephone number for the FITS Support Office is 
+1-301-286-2899. The electronic mail address remains the same, 
fits at nssdca.gsfc.nasa.gov.

In an independent development, IP addresses for the FITS Support 
Office servers have changed, while the machine names have remained the 
same.  Links that use the names should be unaffected. The new IP
address for the Unix ftp site, nssdc, is 128.183.101.19.  The new IP
address for the location of the World Wide Web material is
128.183.243.3; however, Web pages should if at all possible link to
ssdoo.gsfc.nasa.gov, as the material may be physically moved at some
time while keeping the same machine name. 

				Barry Schlesinger
				FITS Support Office
				GSFC/ADF 



From owner-fitsbits at marmoset.cv.nrao.edu  Wed Feb  5 10:27:24 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id KAA24104; Wed, 5 Feb 1997 10:27:13 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id GAA23840; Wed, 5 Feb 1997 06:42:19 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id GAA02471 for <fitsbits at fits>; Wed, 5 Feb 1997 06:42:18 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA14981; Wed, 5 Feb 97 06:42:14 EST
To: fitsbits at fits.cv.nrao.edu
Date: 30 Jan 1997 21:11:06 GMT
From: sla at hires.ucolick.org (Steve Allen)
Message-Id: <5cr2pa$37c at darkstar.ucsc.edu>
Organization: UCO/Lick Observatory, Santa Cruz
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!news-relay.ncren.net!newsgate.duke.edu!news.mathworks.com!howland.erols.net!agate!news.ucsc.edu!hires.ucolick.org!sla
Subject: FITS cards and Tcl regexp
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

Whilst massaging more FITS information into and out of databases we
have come upon the need to dissect FITS cards into components using
regular expressions in Tcl.  The tricky parts are the recognition of
strings which may contain quotes and slashes, the the recognition of
integers and floating point values which may contain embedded spaces.

Here's a little tcl code snippet demonstrating the regular expressions.
It attempts to recognize anything legal even if not in FITS fixed format.
I invite FITS cards which might be so pathological as to cause
this code to stumble.

################snip here
#! /path/to/tcl

# matches a FITS card with a recognizable string value
set cre {^(........)= ( *)'(([^']|(''))*)'([^/]*)(/ *(.*))?$}
# matches a FITS card with a recognizable integer value
set ire {^(........)=  *([-+]?[0-9 ]*[0-9]|[-+]) *(/ *(.*))?$}
# matches a FITS card with a recognizable null value
set nre {^(........)= *(/ *(.*))?$}
# matches a FITS card with a recognizable logical value
set lre {^(........)=  *([TF]) *(/ *(.*))?$}
# matches a FITS card with a recognizable floating point value
set fre {^(........)=  *([-+]?[0-9 ]*(\.[0-9 ]*E?|\.*[0-9 ]*E)( *[-+])?([0-9 ]*[0-9])?) *(/ *(.*))?$}

set file [open FITS.dat r]
while { [gets $file aline] >= 0 } {
  if { [regexp $cre $aline line keyword preblnk value ch qu extrach \
  slashcmnt trimcmnt] } {
    # FITS string
    # If preblnk is not null then the string does not start where
    # the standard requires.
    # If extrach is not null then the card contains extra characters
    # following the string before the comment; this may indicate an error.
    puts sK:$keyword:\tV:$value:\tC:$trimcmnt:\tkv:$preblnk:\tvc:$extrach:
  } elseif { [regexp $ire $aline line keyword value slashcmnt trimcmnt] } {
    # FITS integer
    puts iK:$keyword:\tV:$value:\tC:$trimcmnt:
  } elseif { [regexp $lre $aline line keyword value slashcmnt trimcmnt] } {
    # FITS logical
    puts lK:$keyword:\tV:$value:\tC:$trimcmnt:
  } elseif { [regexp $fre $aline line keyword value edot esg exp \
  slashcmnt trimcmnt] } {
    # FITS floating point
    puts fK:$keyword:\tV:$value:\tC:$trimcmnt:
  } elseif { [regexp $nre $aline line keyword slashcmnt trimcmnt] } {
    # FITS null value
    puts nM:$keyword:\tC:$trimcmnt:
  } else {
    puts NOMATCH
  }
}
close $file
################snip here
--
Steve Allen          UCO/Lick Observatory       Santa Cruz, CA 95064
sla at ucolick.org      Voice: +1 408 459 3046     FAX: +1 408 454 9863
WWW: http://www.ucolick.org/~sla                PGP public keys:  see WWW


From owner-fitsbits at marmoset.cv.nrao.edu  Thu Feb  6 21:51:58 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id VAA29368; Thu, 6 Feb 1997 21:51:36 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id VAA29341; Thu, 6 Feb 1997 21:35:01 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id VAA14226 for <fitsbits at fits>; Thu, 6 Feb 1997 21:35:00 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA29370; Thu, 6 Feb 97 21:34:57 EST
To: fitsbits at fits.cv.nrao.edu
Date: Mon, 03 Feb 1997 15:06:48 -0500
From: Doug Mink <dmink at cfa.harvard.edu>
Message-Id: <32F64558.4F56 at cfa.harvard.edu>
Organization: Harvard University University Information Systems
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!aruba.odu.edu!news.larc.nasa.gov!lll-winken.llnl.gov!fugue.clari.net!su-news-feed4.bbnplanet.com!coopnews.coop.net!frii.com!news.maxwell.syr.edu!news.mathworks.com!howland.erols.net!math.ohio-state.edu!news.cis.ohio-state.edu!nntp.sei.cmu.edu!fs7.ece.cmu.edu!cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!news
References: <32EF130E.16B4 at ast.cam.ac.uk>
Subject: Re: fitsio without file access
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

Martin Beckett wrote:
> 
> I need to read and write fits files without necessarily having
> a random access file, eg. to shared memory or Tcl i/o streams.
> Idealy I would like the fits file to be created as just an
> area in memory.
> 
> Unfortunately CFITSIO needs a real file.  I could create a
> temporary disk file and mmap() it back into memory but that
> seems a bit daft.
> 
> Are there any other C/C++ fits libraries, or a patch to cfitsio
> out there ?  Basically I'm too lazy to reinvent everything

Depending on how much functionality you need, you might be able to use
the FITS software in my WCSTools package.  Most of the FITS subroutines
can work on images and headers in memory.  It is documented at

   http://tdc-www.harvard.edu/software/wcstools

-Doug Mink


From owner-fitsbits at marmoset.cv.nrao.edu  Sat Feb 15 11:05:07 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id LAA25084; Sat, 15 Feb 1997 11:03:23 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id FAA24979; Sat, 15 Feb 1997 05:51:29 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id FAA14308 for <fitsbits at fits>; Sat, 15 Feb 1997 05:51:28 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA01290; Sat, 15 Feb 97 05:51:23 EST
To: fitsbits at fits.cv.nrao.edu
Date: 11 Feb 1997 11:05 EDT
From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger)
Message-Id: <11FEB199711055843 at nssdca.gsfc.nasa.gov>
Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!uunet!in3.uu.net!169.132.11.200!news.idt.net!enews.sgi.com!news.sgi.com!wrdiss1.robins.af.mil!news.monroe.army.mil!arlnews!apgea.army.mil.!info.usuhs.mil!cs.umd.edu!newsfeed.gsfc.nasa.gov!nssdca.gsfc.nasa.gov!bschlesinger
Reply-To: fits at nssdca.gsfc.nasa.gov
Subject: Sources of FITS Information
Newsgroups: sci.astro.fits,sci.answers,news.answers
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

Archive-name: astronomy/fits/info-sources
Last-modified: 1997/02/10 

--------
		Sources of FITS Information 

Preface 	

This material on sources of Flexible Image Transport System (FITS)
information is posted and updated periodically by the FITS Support
Office at the NASA Goddard Space Flight Center (GSFC).  It discusses
where general FITS information, including some answers to frequently
asked questions, can be found, and provides sources for detailed
information on FITS software and documentation. 

-------

FITS Support Office

The FITS Support Office maintains a library of FITS information
accessible from http://ssdoo.gsfc.nasa.gov/astro/fits/fits_home.html or
ftp://nssdc.gsfc.nasa.gov/pub/fits/.  The material available includes

o	"Definition of FITS", a codification of FITS for the 
	NASA/Science Office of Standards and Technology (NOST),
	available in LaTeX, uncompressed PostScript, compressed 
	PostScript and (often) ASCII text

o	"A User's Guide to FITS", published by the FITS Support Office, 
	in LaTeX, and compressed and uncompressed PostScript 

o	Revisions to version 1.0 of the "Definition of FITS" covering the
	specification of units, which were incorporated 
	into version 1.1 (text)

o	A current list of the extension type (structure) names
	registered with the International Astronomical Union FITS
	Working Group (IAUFWG) (text)

o	Rules for physical blocking on various media adopted by
	the IAUFWG (text)  

In the same directory but accessible directly via 
http://ssdoo.gsfc.nasa.gov/astro/fits/basics_info.html is the FITS
Basics and Information that used to be regularly posted to
sci.astro.fits and sci.data.formats.  It continues to be revised to
reflect current FITS developments.  It contains the following material: 

o	An overview of FITS

o	A list of FITS documents  

o	A list of software packages that support FITS, including 
		FITS <--> image converters for various platforms

o	A list of on-line FITS resources

o	A description of the FITS Support Office 

The hypertext version provides links to many of the documents, 
software, and network locations listed.  The text version provides 
information on how to obtain much of this material.

There is also a hypertext version of the List of Registered Extensions. 

Links from the Web page and subdirectories of the ftp directory contain
	
o	Software developed by the FITS Support Office.  

o	Error test files: primary HDUs useful for testing the ability
	of software designed to read FITS files to cope with files that 
	have errors or are non-standard.  These files should be 
	downloaded in binary form.

Printed copies of the material in the FITS directory can be obtained
from the Coordinated Request and User Support Office (CRUSO):  

(Postal) Coordinated Request and User Support Office
         Code 633
	 National Space Science Data Center
	 NASA Goddard Space Flight Center
	 Greenbelt MD 20771 USA

(Electronic mail) request at nssdca.gsfc.nasa.gov

(Telephone)  +1-301-286-6695 8:00 A. M. - 4:30 P.M. U. S. Eastern Time
(-0500 from the last Sunday in October through the first Saturday in
April; -0400 the remainder of the year) 
	When no one is available, messages can be left on voice mail. 
(FAX) +1-301-286-1635

-------

National Radio Astronomy Observatory (NRAO)

A FITS Archive can be found at URL http://fits.cv.nrao.edu/ or 
at ftp://fits.cv.nrao.edu/fits, located at NRAO.  This machine supports a
WAIS server named nrao-fits which has an index of all of the
FITS-related text files in the archive; the file nrao-fits.src is
available at think.com and at
ftp://fits.cv.nrao.edu/fits/wais-sources/nrao-fits.src.  

Some of the more noteworthy materials in this archive are 

o	Drafts of proposed additions to the FITS standard and other 
	drafts that may in the future be formally proposed

o	Text of any detailed proposals currently being discussed by 
	the FITS committees

o	A collection of documents on World Coordinate Systems, 
	including the current draft proposal

o	Conventions specific to particular projects or disciplines

o 	Software for various environments and Usenet postings about
	code 

o	Sample data and special test files designed to measure the
        ability of a FITS reader to handle a wide variety of FITS files

o	Archives of traffic on FITS-related newsgroups and exploders

A separate NRAO site, http://www.cv.nrao.edu/~bcotton/fitsview.html,
provides information on the FITSview family of software packages for
display of FITS images on Microsoft Windows 3.1 and Windows 95, Apple
Macintosh, and Unix/X-Windows, with links to the software. It also links to
a number of sources of astronomical FITS images.                                                 

-------

HEASARC

The NASA/Goddard High Energy Astrophysics Science Archive Research
Center (HEASARC) Web server at 
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits.html and the anonymous
ftp access through ftp://heasarc.gsfc.nasa.gov/fits_info/ provide FITS
material.  HEASARC has developed the FITSIO package of software routines
for easily reading and writing FITS files, with FORTRAN and C versions
available, portable to a wide variety of machines.  There is also the
FTOOLS collection of software tools and the VERIFITS FITS conformance
verifier. HEASARC software is available directly through 
http://heasarc.gsfc.nasa.gov/docs/heasarc/tech_res_software.html or
ftp://heasarc.gsfc.nasa.gov/fits_info/software/ . 

The HEASARC server also provides information from the HEASARC FITS
Working Group, (HFWG) the internal legislative body on FITS-related
matters within the Office of Guest Investigator Programs (OGIP) at
NASA/GSFC, at 
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/ofwg_intro.html or at
ftp://heasarc.gsfc.nasa.gov/fits_info/ in the directories ofwg_minutes
and ofwg_recomm.  The HFWG has developed a number of FITS conventions
that are more specific than the requirements of the FITS standards.
Proposed conventions are publicized to the FITS community as a whole,
with the goal of collaborative development of a set of conventions
that will be accepted throughout the community as well as within
OGIP/HEASARC. 

-------

Direct questions about this posting to 
				Barry M. Schlesinger
				Coordinator,
				FITS Support Office

Electronic mail: fits at nssdca.gsfc.nasa.gov
Telephone:       +1-301-286-2899		

The FITS Support Office is operated under the guidance of the
NASA/GSFC Astrophysics Data Facility.


From owner-fitsbits at marmoset.cv.nrao.edu  Thu Feb 20 13:32:16 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id NAA08385; Thu, 20 Feb 1997 13:31:06 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id BAA03874; Thu, 20 Feb 1997 01:28:34 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id BAA06901 for <fitsbits at fits>; Thu, 20 Feb 1997 01:28:33 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA25822; Thu, 20 Feb 97 01:28:31 EST
To: fitsbits at fits.cv.nrao.edu
Date: Wed, 19 Feb 1997 14:14:19 -0800
From: owen at astro.washington.edu (Russell E. Owen)
Message-Id: <owen-ya023080001902971414190001 at news.u.washington.edu>
Organization: University of Washington
Path: solitaire.cv.nrao.edu!out2.nntp.cais.net!in1.nntp.cais.net!korpc!newsfeed.dacom.co.kr!arclight.uoregon.edu!su-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.maxwell.syr.edu!news.mathworks.com!uunet!in3.uu.net!140.142.64.3!news.u.washington.edu!owen
Subject: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

Did the FITS committee ever come up with a standard for handling 16-bit
unsigned images correctly?

If not, has any large organization come up with their own private standard?

I have great antipathy to converting all my data as its written, and then
converting it again as it's read out. Like most night-time astronomical
applications, our cameras all produce 16-bit unsigned data. It is a huge
advantage to be able to read and write this data in a single operation
w/out converting it first.

-- Russell


From owner-fitsbits at marmoset.cv.nrao.edu  Thu Feb 20 13:32:19 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id NAA08391; Thu, 20 Feb 1997 13:32:03 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id NAA08349; Thu, 20 Feb 1997 13:07:05 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id NAA12191 for <fitsbits at fits>; Thu, 20 Feb 1997 13:07:04 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA19520; Thu, 20 Feb 97 13:07:00 EST
To: fitsbits at fits.cv.nrao.edu
Date: 20 Feb 1997 11:15:28 GMT
From: sla at hires.ucolick.org (Steve Allen)
Message-Id: <5ehbog$jc1 at darkstar.ucsc.edu>
Organization: UCO/Lick Observatory, Santa Cruz
Path: solitaire.cv.nrao.edu!out2.nntp.cais.net!in1.nntp.cais.net!news.monmouth.com!uunet!in3.uu.net!144.212.100.12!news.mathworks.com!howland.erols.net!agate!news.ucsc.edu!hires.ucolick.org!sla
References: <owen-ya023080001902971414190001 at news.u.washington.edu>
Subject: Re: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

In article <owen-ya023080001902971414190001 at news.u.washington.edu>,
Russell E. Owen <owen at astro.washington.edu> wrote:
>I have great antipathy to converting all my data as its written, and then
>converting it again as it's read out. Like most night-time astronomical
>applications, our cameras all produce 16-bit unsigned data. It is a huge
>advantage to be able to read and write this data in a single operation
>w/out converting it first.

Only two steps are necessary.

1) flip the high order bit of each pixel
	(if your CCD controller has DSP capability this can be done as
	part of the data pipeline so that you incur no delay)
2) set BZERO in the FITS header.

Then you have standard BITPIX=16 FITS images.
No modification to existing standard is required.
--
Steve Allen          UCO/Lick Observatory       Santa Cruz, CA 95064
sla at ucolick.org      Voice: +1 408 459 3046     FAX: +1 408 454 9863
WWW: http://www.ucolick.org/~sla                PGP public keys:  see WWW


From owner-fitsbits at marmoset.cv.nrao.edu  Fri Feb 21 10:47:27 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id KAA12486; Fri, 21 Feb 1997 10:47:06 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id AAA09079; Fri, 21 Feb 1997 00:33:24 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id AAA17760 for <fitsbits at fits>; Fri, 21 Feb 1997 00:33:23 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA17397; Fri, 21 Feb 97 00:33:19 EST
To: fitsbits at fits.cv.nrao.edu
Date: Thu, 20 Feb 1997 10:09:08 +0100
From: Bringfried Stecklum <stecklum at tls-tautenburg.de>
Message-Id: <330C14B4.276AC37F at tls-tautenburg.de>
Organization: Friedrich-Schiller-University Jena, Germany
Path: solitaire.cv.nrao.edu!out2.nntp.cais.net!news2.cais.com!in1.nntp.cais.net!world2.bellatlantic.net!newsin.iconnet.net!www.nntp.primenet.com!nntp.primenet.com!enews.sgi.com!news.sgi.com!news.mathworks.com!fu-berlin.de!news-ber1.dfn.de!news-lei1.dfn.de!news.uni-jena.de!news
Subject: wcstools: Segmentation faults with Linux
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

I downloaded wcstools-1.2.2 and compiled them under linux-pre2.0.4.
Compilation went fine (with both supplied makefiles) but various
routines (e.g. imgsc, imsize) end up with segmentation faults when
applied to different FITS files.

Any suggestion to circumvent the problem?

         regards,


+--------------------------------------------------------+
|  Bringfried Stecklum                                   |
|  stecklum at tls-tautenburg.de                            |
|  Th"uringer Landessternwarte Tautenburg                |
|  Sternwarte 5                                          |
|  D - 07778 Tautenburg                                  |
|  Phone: +49-36427-863-54                               |
|  FAX: +49-36427-863-29                                 |
|  mailto://stecklum at tls-tautenburg.de                   |
|  http://www.astro.uni-jena.de/Users/stecklum           |
+--------------------------------------------------------+


From owner-fitsbits at marmoset.cv.nrao.edu  Sun Feb 23 01:29:59 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id BAA16609; Sun, 23 Feb 1997 01:29:28 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id NAA15966; Sat, 22 Feb 1997 13:12:23 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id NAA04083 for <fitsbits at fits>; Sat, 22 Feb 1997 13:12:22 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA25852; Sat, 22 Feb 97 13:12:20 EST
To: fitsbits at fits.cv.nrao.edu
Date: 21 Feb 1997 18:09:43 GMT
From: wmo at wansor.jpl.nasa.gov (Bill Owen)
Message-Id: <5ekod7$17m at netline-fddi.jpl.nasa.gov>
Organization: Jet Propulsion Laboratory, NASA/Caltech
Path: solitaire.cv.nrao.edu!out2.nntp.cais.net!in1.nntp.cais.net!mr.net!newsfeeds.sol.net!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!newsout1.alt.net!news1.alt.net!nntp1.jpl.nasa.gov!netline-fddi.jpl.nasa.gov!wansor.jpl.nasa.gov!wmo
References: <owen-ya023080001902971414190001 at news.u.washington.edu> <5ehbog$jc1 at darkstar.ucsc.edu> <owen-ya023080002002971216070001 at news.u.washington.edu>
Subject: Re: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

In article <owen-ya023080002002971216070001 at news.u.washington.edu>, owen at astro.washington.edu (Russell E. Owen) writes:
> In article <5ehbog$jc1 at darkstar.ucsc.edu>, sla at hires.ucolick.org (Steve
> Allen) wrote:
> 
> >In article <owen-ya023080001902971414190001 at news.u.washington.edu>,
> >Russell E. Owen <owen at astro.washington.edu> wrote:
[snips at various places]
> >1) flip the high order bit of each pixel
> >        (if your CCD controller has DSP capability this can be done as
> >        part of the data pipeline so that you incur no delay)
> 
> Saving that, does anyone know an ANSI standard portable method of toggling
> the sign bit on a large array of 16-bit integers? I looked into it a bit
> and am embarrassed to say that I ran into a brick wall.

In ANSI Fortran, no *efficient* way.  Many compilers offer extensions such as
IBSET or MVBITS that will let you access pieces of a 16-bit integer.  VAX
has a bitwise exclusive OR, IEOR, that will do the trick:
      VALUE(I) = IEOR (VALUE(I), -32768)

You can always use addition and subtraction if you really want to keep it
ANSI standard.  This is undoubtedly less efficient, though:

      IF (VALUE(I) .GE. 0) THEN
         VALUE(I) = VALUE(I) - 32768
      ELSE
         VALUE(I) = VALUE(I) + 32768
      END IF

Just make sure the test is written as above so that 0 becomes -32768.


In ANSI C, however, the problem is trivial.  Use the bitwise exclusive OR
operator, and the one statement
      value[i] ^= 0x8000;
will flip the sign bit and leave the rest alone.  (Yes, I realize that one
would probably code it up using a pointer instead of a subscript.)  The bit
pattern 0x8000 -- sign bit on, others off -- is -32768 on two's complement
machines.


No matter how you do it, BZERO should be set to +32768.

-- Bill Owen, wmo at wansor.jpl.nasa.gov


From owner-fitsbits at marmoset.cv.nrao.edu  Sun Feb 23 17:11:13 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id RAA17445; Sun, 23 Feb 1997 17:11:05 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id MAA17283; Sun, 23 Feb 1997 12:31:26 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id MAA14394 for <fitsbits at fits>; Sun, 23 Feb 1997 12:31:24 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA12031; Sun, 23 Feb 97 12:31:22 EST
To: fitsbits at fits.cv.nrao.edu
Date: Fri, 21 Feb 1997 09:31:41 +0100
From: Michael Olberg <olberg at oso.chalmers.se>
Message-Id: <330D5D6D.405E684E at oso.chalmers.se>
Organization: Chalmers University of Technology
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!portal.gmu.edu!news.sprintlink.net!news-dc-9.sprintlink.net!news-pull.sprintlink.net!news.sprintlink.net!news-peer.sprintlink.net!news.maxwell.syr.edu!news-feed.inet.tele.dk!sn.no!nntp-oslo.UNINETT.no!nntp-trd.UNINETT.no!newsfeed.sunet.se!news99.sunet.se!news.chalmers.se!usenet
References: <owen-ya023080001902971414190001 at news.u.washington.edu> <5ehbog$jc1 at darkstar.ucsc.edu> <owen-ya023080002002971216070001 at news.u.washington.edu>
Subject: Re: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

Russell E. Owen wrote:
> 
> 
> Saving that, does anyone know an ANSI standard portable method of toggling
> the sign bit on a large array of 16-bit integers? I looked into it a bit
> and am embarrassed to say that I ran into a brick wall.
> 
> -- Russell

I think, the following code is ANSI compliant:

int i;
short data[DATALEN];

for (i = 0; i < DATALEN; i++) {
    data[i] ^= (1<<15);
}

Or is it the size of the data array (under DOS perhaps) that you are
having 
problems with?

Regards,

---------------------------------------------------------------------------
Michael Olberg           | e-mail: olberg at oso.chalmers.se
Onsala Space Observatory | tel: +46-31-7725507 (work) +46-300-10778
(home) 
S-43992 Onsala, SWEDEN   | fax: +46-31-7725590
-------------------- This quote left blank intentionally
------------------


From owner-fitsbits at marmoset.cv.nrao.edu  Mon Feb 24 02:18:07 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id CAA19649; Mon, 24 Feb 1997 02:17:44 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id BAA17683; Mon, 24 Feb 1997 01:58:19 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id BAA20425 for <fitsbits at fits>; Mon, 24 Feb 1997 01:58:18 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA13380; Mon, 24 Feb 97 01:58:16 EST
To: fitsbits at fits.cv.nrao.edu
Date: Fri, 21 Feb 1997 13:00:57 +0100
From: Nicolas Devillard <ndevilla at eso.org>
Message-Id: <Pine.SOL.3.95.970221125323.8253A-100000 at mc14>
Organization: ESO - European Southern Observatory, Garching by Munich
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!uunet!in3.uu.net!204.71.1.48!newsfeed.internetmci.com!howland.erols.net!Frankfurt.Germany.EU.net!Munich.Germany.EU.net!eso.org!mc14!ndevilla
References: <owen-ya023080001902971414190001 at news.u.washington.edu> <5ehbog$jc1 at darkstar.ucsc.edu> <owen-ya023080002002971216070001 at news.u.washington.edu> <330D5D6D.405E684E at oso.chalmers.se>
Subject: Re: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

On Fri, 21 Feb 1997, Michael Olberg wrote:
[...]
> I think, the following code is ANSI compliant:
> 
> int i;
> short data[DATALEN];
> for (i = 0; i < DATALEN; i++) {
>     data[i] ^= (1<<15);
> }
[...]

ANSI, but not portable. If on your machine (and compiler) 'int i' means
'short int i', you may well run into trouble when addressing more than 32
kpixels. Furthermore, when declaring 'short data[DATALEN]', nothing
ensures that 'data' contains 16 bit integers, nor should any assumption be
made on the its sign. Portability...

Have a look in C FAQ's about portability and machine endian-ness. You may
well find answers to your problem there, together with simple source codes
for data conversion.

Hope it helps,
--Nicolas
 ____________________________________________________________________
/\                                                                   \
\_| Nicolas Devillard               |    E-mail:  nDevil at eso.org      |
  | European Southern Observatory,  |    http://www.eso.org/~ndevilla |
  | Karl-Schwarzschild-Str. 2,      |    Phone:  +49 89 320-06-340    |
  | D-85748 Garching, Germany       |    Fax  :  +49 89 320-06-358    |
  |   ________________________________________________________________|_
  \_/__________________________________________________________________/



From owner-fitsbits at marmoset.cv.nrao.edu  Mon Feb 24 17:16:57 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id RAA21189; Mon, 24 Feb 1997 17:16:36 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id QAA20775; Mon, 24 Feb 1997 16:38:46 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id QAA00710 for <fitsbits at fits>; Mon, 24 Feb 1997 16:38:44 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA11248; Mon, 24 Feb 97 16:38:42 EST
To: fitsbits at fits.cv.nrao.edu
Date: 23 Feb 1997 10:29:05 +0100
From: pausch at electra.saaf.se (Paul Schlyter)
Message-Id: <5ep2l1$nko at electra.saaf.se>
Organization: Svensk Amat|rAstronomisk F|rening
Path: solitaire.cv.nrao.edu!out2.nntp.cais.net!news2.cais.com!news.intr.net!news.charm.net!news-dc-10.sprintlink.net!news.sprintlink.net!news-hub.sprintlink.net!news.sprintlink.net!news-dc-9.sprintlink.net!news.maxwell.syr.edu!nntp.uio.no!news.kth.se!tybalt.admin.kth.se!merope.saaf.se!electra.saaf.se!not-for-mail
References: <owen-ya023080001902971414190001 at news.u.washington.edu> <5ehbog$jc1 at darkstar.ucsc.edu> <owen-ya023080002002971216070001 at news.u.washington.edu> <5ekod7$17m at netline-fddi.jpl.nasa.gov>
Subject: Re: unsigned images
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

In article <5ekod7$17m at netline-fddi.jpl.nasa.gov>,
Bill Owen <wmo at wansor.jpl.nasa.gov> wrote:
 
Article: 1563 of sci.astro.fits
 
> In article <owen-ya023080002002971216070001 at news.u.washington.edu>, owen at astro.washington.edu (Russell E. Owen) writes:
> 
>> Saving that, does anyone know an ANSI standard portable method of toggling
>> the sign bit on a large array of 16-bit integers? I looked into it a bit
>> and am embarrassed to say that I ran into a brick wall.
> 
> In ANSI Fortran, no *efficient* way.  Many compilers offer extensions such as
> IBSET or MVBITS that will let you access pieces of a 16-bit integer.  VAX
> has a bitwise exclusive OR, IEOR, that will do the trick:
>       VALUE(I) = IEOR (VALUE(I), -32768)
> 
> You can always use addition and subtraction if you really want to keep it
> ANSI standard.  This is undoubtedly less efficient, though:
> 
>       IF (VALUE(I) .GE. 0) THEN
>          VALUE(I) = VALUE(I) - 32768
>       ELSE
>          VALUE(I) = VALUE(I) + 32768
>       END IF
 
This is non-portable, since it assumes integers are stored as
2-complement binary numbers, and ANSI FORTRAN has no such requirements
on integers.  Your code will fail on platforms using 1-complement
or sign-magnitude integer representations - not to mention BCD
representation..... yes, there are FORTRAN implementations using
BCD for integers.


 
-- 
----------------------------------------------------------------
Paul Schlyter,  Swedish Amateur Astronomer's Society (SAAF)
Grev Turegatan 40,  S-114 38 Stockholm,  SWEDEN
e-mail:  pausch at saaf.se     psr at net.ausys.se    paul at inorbit.com
WWW:     http://www.raditex.se/~pausch/    http://spitfire.ausys.se/psr/


From owner-fitsbits at marmoset.cv.nrao.edu  Wed Feb 26 11:33:31 1997
Received: (from majdom at localhost) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) id LAA31199; Wed, 26 Feb 1997 11:32:24 -0500
Received: from fits.cv.nrao.edu (fits.cv.nrao.edu [192.33.115.8]) by marmoset.cv.nrao.edu (8.7.6/8.7.3: $Revision: 1.1 $) with ESMTP id LAA31099; Wed, 26 Feb 1997 11:30:28 -0500
Received: from solitaire.cv.nrao.edu (news at solitaire.cv.nrao.edu [192.33.115.79]) by fits.cv.nrao.edu (8.8.5/8.8.0/CV-2.2) with SMTP id LAA05982 for <fitsbits at fits>; Wed, 26 Feb 1997 11:30:24 -0500 (EST)
Received: by solitaire.cv.nrao.edu (4.1/DDN-CV/1.10)
	id AA09142; Wed, 26 Feb 97 11:30:15 EST
To: fitsbits at fits.cv.nrao.edu
Date: Tue, 25 Feb 1997 12:09:08 +0100
From: octavi <octavi at fajnm1.am.ub.es>
Message-Id: <3312C854.2D177800 at fajnm1.am.ub.es>
Organization: Universitat Autonoma de Barcelona
Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!uunet!in3.uu.net!199.94.215.18!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!howland.erols.net!surfnet.nl!news.belnet.be!news.rediris.es!news.upc.es!lilith.uab.es!newsmgr
Subject: FITS I/O classes for GSC viewer
Newsgroups: sci.astro.fits
Sender: owner-fitsbits at marmoset.cv.nrao.edu
Precedence: bulk

I'm trying to develop an application able to display and process images
written in FITS format. This one is not very popular outside of the
Astronomy world.
This application should read and write as many as possible FITS
subextensions (image, ASCII table, binary table,...), specially the
ASCII table.
Once this classes would be implemented, I expect to be able to represent
visually (as more realistic as possible) any sky region that is compiled
in GSC (Guide Stars Catalog). This one is written in FITS ASCII table
format.

Does anybody know some classes for Visual C++ able to read and write
this kind of image format? Or, even better, does anybody know some
source code that could help me into develop this GSC viewer.