From fitsbits-request Thu Oct 5 14:05:34 1995 X-VM-Message-Order: (1 3 10 5 6 13 2 4 7 12 8 14 15 11 9 16) X-VM-Summary-Format: "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c %I\"%s\"\n" X-VM-Labels: nil X-VM-VHeader: ("Resent-" "From:" "Sender:" "To:" "Apparently-To:" "Cc:" "Subject:" "Date:") nil X-VM-Bookmark: 16 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["2277" "Thu" "5" "October" "1995" "14:05:34" nil "fitsbits-request" "fitsbits-request" "<6396253 at toto.iv>" "67" "" nil nil nil "10" "1995100514:05:34" "" (number " " mark " fitsbits-request Oct 5 67/2277 " thread-indent "\"\"\n") nil] nil) content-length: 2275 This broadcast is to announce a new version of the paper describing the coordinates proposal by Mark Calabretta and myself. The paper is available as wcs.all.ps (or wcs.all.ps.Z) and wcs.none.ps.Z (only) from the fits ftp/WWW site (fits.cv.nrao.edu) in the fits/documents/wcs directory. The 'all' has all figures, the 'none' has vskips instead of figures and will print much faster. There have been a lot of changes in the paper since the last posted version of about one year ago. I have attempted to run 'diff' to find out what they are, but expect that I have missed some. What I found, in order through the paper, is listed below: 1. The paper has been converted to A & A format with suitable style changes, re-arranging of long equations, dropping excess figures, etc. 2, The subject of default coordinate types (there is none now), and general longitude and latitude types is addressed. 3. The finding of the native North pole from the reference point (when it is not the North pole itself) required a lengthy generalization and discussion and the introduction of the LATPOLE keyword. 4. AIR projection mathematics corrected. 5. CYL now called CYP. 6. CEA definition of lambda corrected. 7. Conical projections reference pixels now at the central Native latitude and PROJP1 gives the central latitude and PROJP2 gives 1/2 of the difference of the 2 latitudes of the projection. All conical projections required a little change, mostly in Y_0, in the math. 8. COP - add an alternate form of Rtheta. 9. COO - change symbols. 10. BON - simpler formulation. 11. GLS - correct formula for phi. 12. PAR - correct units. 13. QSC - better symbols, corrected formulae 14. TSC - extra form for x_f, y_f 15. Added appendix defining Pixel regularization image. 16. Added references to Calabretta's software package known as wcslib (version 2.0 now in preparation). This seems like a lot - I guess #15 is the biggest change which should get wide discussion. #2, 3, 7 are significant as well, while #1 was surprisingly easy and mostly cosmetic. Please let us know what you think. Eric Greisen (egreisen at nrao.edu) Mark Calabretta (mcalabre at atnf.csiro.au) From fitsbits-request Wed Oct 18 10:40:23 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["2005" "Wed" "18" "October" "1995" "10:40:17" "-0400" "Arnold Rots" "arots at xebec.gsfc.nasa.gov" "<199510181440.KAA20122 at xebec.gsfc.nasa.gov>" "50" "Re: WCS Proposal" "^From:" nil nil "10" "1995101814:40:17" "WCS Proposal" (number " " mark " Arnold Rots Oct 18 50/2005 " thread-indent "\"Re: WCS Proposal\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA20650; Wed, 18 Oct 1995 10:40:23 -0400 Return-Path: Message-Id: <199510181440.KAA20122 at xebec.gsfc.nasa.gov> X-Mailer: ELM [version 2.4 PL24beta] Content-Type: text content-length: 2003 From: Arnold Rots Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Cc: arots at xebec.gsfc.nasa.gov (Arnold Rots) Subject: Re: WCS Proposal Date: Wed, 18 Oct 1995 10:40:17 -0400 (EDT) The WCS proposal has been floating around now for quite a while. I hope we can finish this business soon. But I have three comments. 1. (typographical) P. 3, halfway through the right hand column, it says "haV", instead of "have". 2. (for background information only; I do not suggest any changes in the proposal) On the issue of defining the location of a pixel to be its center: for time series data we have found it necessary to allow (for the time axis _only_) the location to be defined elsewhere in the pixel, usually at the start. I won't repeat the arguments here, but let me note that we (OGIP/HEASARC) have adopted a convention to signal this, using the keyword TIMEPIXR. 3. (this is the only substantative comment) On p. 6, G&C propose the use of the new keyword MJD-OBS to specify the time of observation in the TAI time system, for increased accuracy. One should be aware that in some circles it has become customary to indicate the start and stop time of an observation by way of the four keywords DATE-OBS, TIME-OBS, DATE-END, TIME-END. (the TIME-xxx keywords are floats, either in seconds or days, depending on the value of TIMEUNIT). There are three issues here: a. Though MJD-REF seems a sensible definition for the time of observation, does one really want to define a second convention for specifying it? b. What does "time of observation" mean? The start, the middle, the end, a weighted mean? c. It is unwise to implicitly assume a particular time system. G&C assume TAI; I am sure many would interpret it as UTC. The point is that JD (and, by extension, MJD) only provides a day counting system; to get absolute time, one has to provide the time system in which the days are counted. Consequently, at the present moment: MJD(TAI) - MJD(UTC) = 29 s MJD(TT) - MJD(TAI) = 32.184 s I would urge al FITS file creators to include, whenever time is important, the TIMESYS keyword, with one of thesuggested values of "TT", "TAI", "UTC", ("TDB"), ... - Arnold Rots From fitsbits-request Fri Oct 20 01:42:03 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["319" "" "19" "October" "1995" "18:17:43" "+0100" "Jean-Pierre Veran" "veran at hplyot.obspm.fr" "<46617n$1nv at hplyot.obspm.fr>" "12" "Reading FITS format images" "^From:" nil nil "10" "1995101917:17:43" "Reading FITS format images" (number " " mark " Jean-Pierre Veran Oct 19 12/319 " thread-indent "\"Reading FITS format images\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA09172; Fri, 20 Oct 1995 01:42:03 -0400 Return-Path: Message-Id: <46617n$1nv at hplyot.obspm.fr> Organization: DESPA - Observatoire de Paris - Meudon - France Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!caen!spool.mu.edu!usenet.eel.ufl.edu!news.mathworks.com!tank.news.pipex.net!pipex!oleane!jussieu.fr!u-psud.fr!not-for-mail Newsgroups: comp.soft-sys.matlab,sci.astro.fits content-length: 317 From: veran at hplyot.obspm.fr (Jean-Pierre Veran) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Reading FITS format images Date: 19 Oct 1995 18:17:43 +0100 I'm trying to use Matlab to process some astronomical images. As usual in astronomy, these images are in FITS (Flexible Image Transport System) format. Does anybody have a Matlab routine able to read/write files in this format, that he/she would like to share ? Many thanks. Jean-Pierre Veran Observatoire de Paris From fitsbits-request Fri Oct 20 07:34:41 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["1312" "" "18" "October" "1995" "23:25:07" "GMT" "Steve Allen" "sla at umbra.ucolick.org" "<4642cj$g29 at darkstar.UCSC.EDU>" "29" "Re: WCS and time" "^From:" nil nil "10" "1995101823:25:07" "WCS and time" (number " " mark " Steve Allen Oct 18 29/1312 " thread-indent "\"Re: WCS and time\"\n") "<4639pg$4ki at noao.edu>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA12474; Fri, 20 Oct 1995 07:34:41 -0400 Return-Path: Message-Id: <4642cj$g29 at darkstar.UCSC.EDU> Organization: UCO/Lick Observatory, Santa Cruz Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!caen!msunews!uwm.edu!chi-news.cic.net!simtel!news.kei.com!news.mathworks.com!newsfeed.internetmci.com!miwok!bdt.com!hal.COM!darkstar.UCSC.EDU!umbra.ucolick.org!sla References: <199510181440.KAA20122 at xebec.gsfc.nasa.gov> <4639pg$4ki at noao.edu> Newsgroups: sci.astro.fits content-length: 1310 From: sla at umbra.ucolick.org (Steve Allen) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: WCS and time Date: 18 Oct 1995 23:25:07 GMT In article <4639pg$4ki at noao.edu>, Rob Seaman wrote: >In article <199510181440.KAA20122 at xebec.gsfc.nasa.gov>, Arnold Rots > [apparently, article never got here] wrote: [concerns about reference system for time] >> days are counted. Consequently, at the present moment: >> >> MJD(TAI) - MJD(UTC) = 29 s Repeating a bit, the WCS draft convention for keyword MJD-OBS states that it shall be measured in TAI. The difference between UTC and TAI changes when leap seconds are inserted into UTC. It is a relatively straightforward matter for an observatory to keep track of UTC because there are many different *automated* providers of this info. It is not so easy to keep track of TAI, or to correlate an arbitrary past UTC with TAI because of the leap seconds. Are there any observatories with functional schemes which perform automated maintenance of such a database? If so, how is it done? I would be pleased to hear that NIST or BIH are providing these data over the internet. -- Steve Allen UCO/Lick Observatory Santa Cruz, CA 95064 sla at ucolick.org Voice: +1 408 459 3046 FAX: +1 408 454 9863 http://www.ucolick.org/~sla -> my work, my PGP public keys, & my daughter Santa Cruz -- home to Seabright Morris, Mr. Twister, and UNIX From fitsbits-request Fri Oct 20 08:23:10 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["1007" "Fri" "20" "October" "1995" "08:22:58" "-0400" "Arnold Rots" "arots at xebec.gsfc.nasa.gov" "<199510201222.IAA21523 at xebec.gsfc.nasa.gov>" "32" "Re: WCS and time" "^From:" nil nil "10" "1995102012:22:58" "WCS and time" (number " " mark " Arnold Rots Oct 20 32/1007 " thread-indent "\"Re: WCS and time\"\n") "<4642cj$g29 at darkstar.UCSC.EDU>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA12816; Fri, 20 Oct 1995 08:23:10 -0400 Return-Path: Message-Id: <199510201222.IAA21523 at xebec.gsfc.nasa.gov> In-Reply-To: <4642cj$g29 at darkstar.UCSC.EDU> from "Steve Allen" at Oct 18, 95 11:25:07 pm X-Mailer: ELM [version 2.4 PL24beta] Content-Type: text content-length: 1005 From: Arnold Rots Sender: fitsbits-request at fits.cv.nrao.edu To: sla at umbra.ucolick.org (Steve Allen) Cc: fitsbits at NRAO.EDU Subject: Re: WCS and time Date: Fri, 20 Oct 1995 08:22:58 -0400 (EDT) > > In article <4639pg$4ki at noao.edu>, Rob Seaman wrote: > >In article <199510181440.KAA20122 at xebec.gsfc.nasa.gov>, Arnold Rots > > [apparently, article never got here] wrote: > [concerns about reference system for time] What's going on? I never got Rob's article! > > >> days are counted. Consequently, at the present moment: > >> > >> MJD(TAI) - MJD(UTC) = 29 s > > Repeating a bit, the WCS draft convention for keyword MJD-OBS states > that it shall be measured in TAI. Not knowing what Rob Seaman wrote, let me repeat that I was arguing in favor of making that assumption explicit by requiring the time system used to be specified in a keyword. > Are there any observatories with functional schemes which perform > automated maintenance of such a database? If so, how is it done? > I would be pleased to hear that NIST or BIH are providing these > data over the internet. Try: ftp://maia.usno.navy.mil/ser7/tai-utc.dat - Arnold Rots From fitsbits-request Fri Oct 20 10:03:56 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["849" "Fri" "20" "October" "1995" "10:03:48" "-0400" "William Pence" "pence at tetra.gsfc.nasa.gov" "<199510201403.KAA13748 at tetra.gsfc.nasa.gov>" "21" "WCS keywords for alternate image representations" "^From:" nil nil "10" "1995102014:03:48" "WCS keywords for alternate image representations" (number " " mark " William Pence Oct 20 21/849 " thread-indent "\"WCS keywords for alternate image representations\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA13601; Fri, 20 Oct 1995 10:03:56 -0400 Return-Path: Message-Id: <199510201403.KAA13748 at tetra.gsfc.nasa.gov> content-length: 847 From: William Pence Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: WCS keywords for alternate image representations Date: Fri, 20 Oct 1995 10:03:48 -0400 This is to announce that a revised version of the paper that describes a WCS keyword convention for images that are stored in FITS tables is now available at ftp site legacy.gsfc.nasa.gov in the files /software/fitsio/wcs_keywords.tex and /software/fitsio/wcs_keywords.ps This short document is intended to be a companion to the main WCS proposal by Eric Greisen and Mark Calabretta, and describes the analogous set of WCS keywords for images stored either as a 2-D vector element in a binary table, or as a list of pixel coordinates in a table (similar to the IRAF QPOE format). This convention has been used for some time now within the high energy astrophysics community, so we hope that this proposal can be reviewed and acted on more or less in parallel with the Greisen and Calabretta paper. -Bill Pence HEASARC/GSFC From fitsbits-request Fri Oct 20 10:03:31 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["6939" "" "17" "October" "1995" "12:07" "EDT" "Barry M. Schlesinger" "bschlesinger at nssdca.gsfc.nasa.gov" "<17OCT199512071952 at nssdca.gsfc.nasa.gov>" "168" "Sources of FITS Information" "^From:" nil nil "10" "1995101716:07:00" "Sources of FITS Information" (number " " mark " Barry M. Schlesin Oct 17 168/6939 " thread-indent "\"Sources of FITS Information\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA13594; Fri, 20 Oct 1995 10:03:31 -0400 Return-Path: Message-Id: <17OCT199512071952 at nssdca.gsfc.nasa.gov> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!portal.gmu.edu!europa.chnt.gtegsc.com!news.kreonet.re.kr!news.kigam.re.kr!xpat.postech.ac.kr!usenet.kornet.nm.kr!ames!newsfeed.gsfc.nasa.gov!nssdca.gsfc.nasa.gov!bschlesinger Reply-To: fits at nssdca.gsfc.nasa.gov Newsgroups: sci.astro.fits,news.answers,sci.answers content-length: 6937 From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Sources of FITS Information Date: 17 Oct 1995 12:07 EDT Archive-name:astronomy/fits/info-sources Last modified: 1995/10/16 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://www.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, PostScript, and (usually) ASCII text (The ASCII text version may not be available for a short while after the announcement of a new version.) 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.1 of the "Definition of FITS" covering the specification of units (text), that have been incorporated into the Proposed 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://www.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 under the heading of FITS Basics and Information. 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 some 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. 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. The documents subdirectory of the fits directory contains a number of subdirectories. The BINTABLE draft for Astronomy and Astrophysics is, in various formats, in files bintable_aa.*. A proposals subdirectory is reserved for detailed proposals currently being considered by the FITS committees. A drafts subdirectory contains drafts of designs not yet submitted. The wcs subdirectory contains the current proposal for world coordinate system conventions now under community review and earlier documents and presentations on world coordinates. Other subdirectories include sample FITS files -- both actual data files and files specially constructed to test the ability of software to read all kinds of FITS structures, some code for particular environments, pointers to other code, and an archive of Usenet postings related to FITS. This machine supports a WAIS server named nrao-fits (URL wais://fits.cv.nrao.edu/nrao-fits; also see ftp://fits.cv.nrao.edu/fits/wais-sources/nrao-fits.src) which has an index of all of the FITS-related text files in the archive. 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 Conventions specific to particular projects or disciplines o Some code 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 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 a the FITSIO package of software routines for easily reading and writing FITS files, in FORTRAN with a C interface 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 OGIP/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/heasarc/ofwg/ofwg_intro.html or ftp://heasarc.gsfc.nasa.gov/fits_info/ . 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 material to Barry M. Schlesinger Coordinator, FITS Support Office Electronic mail: fits at nssdca.gsfc.nasa.gov Telephone: +1-301-441-4205 The FITS Support Office is operated under the guidance of the NASA/GSFC Astrophysics Data Facility. From fitsbits-request Sun Oct 22 21:44:23 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["2400" "" "18" "October" "1995" "16:25:20" "GMT" "Rob Seaman" "seaman at noao.edu" "<4639pg$4ki at noao.edu>" "57" "Re: WCS Proposal" "^From:" nil nil "10" "1995101816:25:20" "WCS Proposal" (number " " mark " Rob Seaman Oct 18 57/2400 " thread-indent "\"Re: WCS Proposal\"\n") "<199510181440.KAA20122 at xebec.gsfc.nasa.gov>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA09685; Sun, 22 Oct 1995 21:44:23 -0400 Return-Path: Message-Id: <4639pg$4ki at noao.edu> Organization: National Optical Astronomy Observatories, Tucson, AZ, USA Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!news-server.ncren.net!concert!gatech!news.eas.asu.edu!noao!seaman References: <199510181440.KAA20122 at xebec.gsfc.nasa.gov> Newsgroups: sci.astro.fits content-length: 2398 From: seaman at noao.edu (Rob Seaman) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: WCS Proposal Date: 18 Oct 1995 16:25:20 GMT In article <199510181440.KAA20122 at xebec.gsfc.nasa.gov>, Arnold Rots writes: > a. Though MJD-REF seems a sensible definition for the time of > observation, does one really want to define a second convention for > specifying it? > > b. What does "time of observation" mean? The start, the middle, the > end, a weighted mean? > > c. It is unwise to implicitly assume a particular time system. G&C > assume TAI; I am sure many would interpret it as UTC. The point is > that JD (and, by extension, MJD) only provides a day counting system; > to get absolute time, one has to provide the time system in which the > days are counted. Consequently, at the present moment: > > MJD(TAI) - MJD(UTC) = 29 s > MJD(TT) - MJD(TAI) = 32.184 s > > I would urge al FITS file creators to include, whenever time is > important, the TIMESYS keyword, with one of thesuggested values of > "TT", "TAI", "UTC", ("TDB"), ... I'll add to this list if I might: d. One issue is more overt when dealing with Julian date than with other time keywords (other than the siderial time, I suppose). That is the underlying positional frame of reference for the observation. Julian dates may be heliocentric or geocentric, as well as being topocentric (telescope or spacecraft centered). The natural default for raw data is most likely topocentric - the MJD-OBS keyword should contain the modified Julian date at the moment that the photons reached the detector. This would apply whether the "timestamp" of the observation were the beginning, middle, or end. (I don't see how a coherent weighted mean could be defined for all purposes, see b.) This is not nearly so obvious for reduced data. The time base for photometric data is very often (perhaps universally) converted to heliocentric values. Other types of data, or other stages in their reduction or analysis, may use geocentric or even galactocentric or planet-or-other-location centered times. Should section 3 of the proposal explicitly state that MJD-OBS is a topocentric value? ("Topocentric" is not the best word to describe spacecraft data, of course.) Other keywords would convey heliocentric (for example, "HJD" or "HJD-OBS") and other Julian dates. Rob Seaman -- seaman at noao.edu, http://iraf.noao.edu/~seaman NOAO, 950 N Cherry Ave, Tucson AZ 85719, 520-318-8248 PGP: 98 8D 8B 49 74 9A 41 88 3A 43 87 54 51 BF 30 4B From fitsbits-request Mon Oct 23 00:40:45 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["1950" "" "19" "October" "1995" "18:51:45" "GMT" "William Thompson" "thompson at orpheus.nascom.nasa.gov" "<4666o1$p1u at post.gsfc.nasa.gov>" "48" "Re: WCS and time" "^From:" nil nil "10" "1995101918:51:45" "WCS and time" (number " " mark " William Thompson Oct 19 48/1950 " thread-indent "\"Re: WCS and time\"\n") "<4642cj$g29 at darkstar.UCSC.EDU>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA10888; Mon, 23 Oct 1995 00:40:45 -0400 Return-Path: Message-Id: <4666o1$p1u at post.gsfc.nasa.gov> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!maui.cc.odu.edu!news.larc.nasa.gov!news.msfc.nasa.gov!pendragon.jsc.nasa.gov!ames!newsfeed.gsfc.nasa.gov!orpheus.nascom.nasa.gov!thompson References: <199510181440.KAA20122 at xebec.gsfc.nasa.gov> <4639pg$4ki at noao.edu> <4642cj$g29 at darkstar.UCSC.EDU> Newsgroups: sci.astro.fits content-length: 1948 From: thompson at orpheus.nascom.nasa.gov (William Thompson) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: WCS and time Date: 19 Oct 1995 18:51:45 GMT sla at umbra.ucolick.org (Steve Allen) writes: >In article <4639pg$4ki at noao.edu>, Rob Seaman wrote: >>In article <199510181440.KAA20122 at xebec.gsfc.nasa.gov>, Arnold Rots >> [apparently, article never got here] wrote: > [concerns about reference system for time] >>> days are counted. Consequently, at the present moment: >>> >>> MJD(TAI) - MJD(UTC) = 29 s >Repeating a bit, the WCS draft convention for keyword MJD-OBS states >that it shall be measured in TAI. The difference between UTC and TAI >changes when leap seconds are inserted into UTC. >It is a relatively straightforward matter for an observatory to keep >track of UTC because there are many different *automated* providers of >this info. It is not so easy to keep track of TAI, or to correlate an >arbitrary past UTC with TAI because of the leap seconds. >Are there any observatories with functional schemes which perform >automated maintenance of such a database? If so, how is it done? >I would be pleased to hear that NIST or BIH are providing these >data over the internet. For the SOHO project, we are keeping track of the difference between TAI and UTC. We get the announcements of new leap seconds from the International Earth Rotation Service in Paris France. These announcements can be ftp'd from ftp : 145.238.2.21 (or mesiom.obspm.fr) with login : anonymous and password : name/organization/country We use the perl script mirror in a Unix cron job to automatically check for new circulars once a month. We also get this announcements mailed to us. You can also check out the following URLs: ftp://maia.usno.navy.mil/ser7/ser7.dat ftp://maia.usno.navy.mil/ser7/tai-utc.dat Leap seconds are also announced in the IAU circulars. The process isn't really automated since each new leap second has to be entered by hand into our database, but that only happens once or twice a year. Bill Thompson From fitsbits-request Tue Oct 24 05:53:44 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["2258" "" "23" "October" "1995" "13:39" "EDT" "Barry M. Schlesinger" "bschlesinger at nssdca.gsfc.nasa.gov" "<23OCT199513394568 at nssdca.gsfc.nasa.gov>" "60" "Re: Reading FITS format images" "^From:" nil nil "10" "1995102317:39:00" "Reading FITS format images" (number " " mark " Barry M. Schlesin Oct 23 60/2258 " thread-indent "\"Re: Reading FITS format images\"\n") ""] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA24955; Tue, 24 Oct 1995 05:53:44 -0400 Return-Path: Message-Id: <23OCT199513394568 at nssdca.gsfc.nasa.gov> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!caen!reeve.research.aa.wl.com!decwrl!lll-winken.llnl.gov!ames!newsfeed.gsfc.nasa.gov!nssdca.gsfc.nasa.gov!bschlesinger References: <46617n$1nv at hplyot.obspm.fr> Newsgroups: comp.soft-sys.matlab,sci.astro.fits content-length: 2256 From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: Reading FITS format images Date: 23 Oct 1995 13:39 EDT Just a couple of notes for purposes of precision. In article , abraham at ast.cam.ac.uk (Roberto Abraham) writes... > >(3) Since FITS keywords can be in any order... The order of SIMPLE, BITPIX, NAXIS, (NAXISn,n=1, ..., value of NAXIS) is fixed. This point is noted later in the package description. >how many Header Definition Units (HDUs) are used to store the header >in your file. If you don't tell it this the function has to read each >header line and use pattern matching to find the END keyword in order >to figure out where the header stops and the data starts. So you're >almost always better off explicitly telling it how big the header is. >(A hint: most data I've played with from the Space Telescope Science >Institute has 6 HDUs, >% >% "Header Data Unit" or "HDU" = a set of 36 "cards". Note >% that FITS files must have an integer number of HDUs >% (typically between 1 and 6, depending on how much >% header information is stored in the file.) The above nomenclature is incorrect. The HDU, Header Data Unit, consists of the entire header and the data it describes. What the writer is labeling HDU is the 23040-bit (2880 8-bit byte) logical record size that is standard for FITS. > >%The first few cards of the first HDU must give certain information >%in a pre-defined order (eg. the data format, number of axes, >%size etc) but after that the header keywords can come in any >%order. The end of the last card giving information is flagged by >%the keyword END, after which blank lines are added to pad the >%last HDU so it also contains 36 cards. After the last card >%the data begins, in a format specified by the BITPIX keyword. >%The dimensions of the data are specified by the NAXIS1 and >%NAXIS2 keywords. >% >%Reference: NASA/Science Office of Standards and Technology >% "Definition of the Flexible Image Transport System" >% NOST 100-1.0 >% >% This and other FITS documents are available on-line at: >% http://www.gsfc.nasa.gov/astro/fits/basics_info.html Version 1.1 was just announced. Barry Schlesinger FITS Support Office GSFC/ADF (Posting from ADASS) From fitsbits-request Tue Oct 24 18:40:46 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["2444" "" "20" "October" "1995" "17:53:14" "GMT" "Steve Allen" "sla at umbra.ucolick.org" "<468nma$lol at darkstar.UCSC.EDU>" "49" "Re: WCS Proposal" "^From:" nil nil "10" "1995102017:53:14" "WCS Proposal" (number " " mark " Steve Allen Oct 20 49/2444 " thread-indent "\"Re: WCS Proposal\"\n") "<199510181440.KAA20122 at xebec.gsfc.nasa.gov>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA00722; Tue, 24 Oct 1995 18:40:46 -0400 Return-Path: Message-Id: <468nma$lol at darkstar.UCSC.EDU> Organization: UCO/Lick Observatory, Santa Cruz Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!portal.gmu.edu!solaris.cc.vt.edu!enterprise!news.uoregon.edu!hunter.premier.net!uunet!in2.uu.net!news.sprintlink.net!howland.reston.ans.net!agate!darkstar.UCSC.EDU!umbra.ucolick.org!sla References: <199510181440.KAA20122 at xebec.gsfc.nasa.gov> Newsgroups: sci.astro.fits content-length: 2442 From: sla at umbra.ucolick.org (Steve Allen) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: WCS Proposal Date: 20 Oct 1995 17:53:14 GMT In article <199510181440.KAA20122 at xebec.gsfc.nasa.gov>, Arnold Rots wrote: >The WCS proposal has been floating around now for quite a while. >3. (this is the only substantative comment) On p. 6, G&C propose the >use of the new keyword MJD-OBS to specify the time of observation in >the TAI time system, for increased accuracy. >c. It is unwise to implicitly assume a particular time system. G&C >assume TAI; I am sure many would interpret it as UTC. Upon reflection I wish to amplify Arnold Rots' comments about the specification of TAI. Through various means it is possible to extend TAI backwards to about 1955. Before that there were no atomic clocks and no atomic time scale. To specify a time in TAI before that would require extrapolated use of TDT and/or ET and the value of $\Delta T$. This is at least a cumbersome process if not also error prone. This WCS draft specification could hinder correct FITS storage of much astronomical data. If archival plates were scanned and made available digitally it would be difficult to provide correct time/date information for them. For such archival data Rots' suggestion of the TIMESYS keyword would likely best have the value 'UT' implying the best available estimate of 'UT1' at the time of plate exposure. One could argue that the temporal precision of older astronomical data typically does not merit this distinction, but it is better to provide archivally correct information whenever possible. For old data 'TAI' is a fiction and 'UT' is archivally more correct. Leaving the default as TAI would tend to leave future investigators wondering whether the persons who digitally encoded such data had bothered to attempt the TAI-UT correction or not. There is an example of this problem outside of astronomy. In the commercial database Sybase it is impossible to use the provided date/time datatype to encode any dates from before the US converted to Gregorian Calendar in 1752. This is not a problem for most databases. However there are certain universities on the east coast of the US which find that they cannot encode their entire historical records in Sybase. -- Steve Allen UCO/Lick Observatory Santa Cruz, CA 95064 sla at ucolick.org Voice: +1 408 459 3046 FAX: +1 408 454 9863 http://www.ucolick.org/~sla -> my work, my PGP public keys, & my daughter Santa Cruz -- home to Seabright Morris, Mr. Twister, and UNIX From fitsbits-request Tue Oct 24 20:46:18 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["1955" "" "20" "October" "1995" "17:47" "EDT" "Barry M. Schlesinger" "bschlesinger at nssdca.gsfc.nasa.gov" "<20OCT199517472432 at nssdca.gsfc.nasa.gov>" "39" "ANNOUNCE: Version 1.1 Definition of FITS (NOST)" "^From:" nil nil "10" "1995102021:47:00" "ANNOUNCE: Version 1.1 Definition of FITS (NOST)" (number " " mark " Barry M. Schlesin Oct 20 39/1955 " thread-indent "\"ANNOUNCE: Version 1.1 Definition of FITS (NOST)\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA01585; Tue, 24 Oct 1995 20:46:18 -0400 Return-Path: Message-Id: <20OCT199517472432 at nssdca.gsfc.nasa.gov> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!maui.cc.odu.edu!news.larc.nasa.gov!night.primate.wisc.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!newsfeed.gsfc.nasa.gov!nssdca.gsfc.nasa.gov!bschlesinger Newsgroups: sci.astro.fits content-length: 1953 From: bschlesinger at nssdca.gsfc.nasa.gov (Barry M. Schlesinger) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: ANNOUNCE: Version 1.1 Definition of FITS (NOST) Date: 20 Oct 1995 17:47 EDT On September 29, 1995, the NASA/Science Office of Standards and Technology (NOST) Accreditation Panel approved version 1.1 of the Definition of FITS as a NOST standard. The substantive change between versions 1.0 and 1.1 is a more detailed specification of recommendations and requirements regarding units in version 1.1. In particular, it requires use of decimal degrees as the unit for celestial coordinate angles, and recommends use of decimal degrees for angular measure in all other cases. These changes were developed by a NOST Technical Panel, made available to the astronomical community for review and presented for discussion at the January WGAS meeting in Tucson. The Accreditation Panel review verified that adequate opportunity had been given to the community to review the changes and that the Technical Panel had incorporated the community comments into its deliberations. The new text thus represents the community consensus reached through this process. Copies of version 1.1 are available in LaTeX, PostScript, and compressed PostScript at ftp://nssdc.gsfc.nasa.gov/fits/(fits_standard.tex, fits_standard.ps, fits_standard_ps.Z) replacing the copies of version 1.0 that used to be at that site. Style and index files for the LaTeX version are available in the same directory. A flat ASCII copy will be available in November or December. The text of the substantive changes remains available for those who are using flat ASCII copies. The FITS Support Office FITS Basics and Information page at http://www.gsfc.nasa.gov/astro/fits/basics_info.html has been been revised to discuss and link to the new version. (There new Web page may not be up immediately; however the old web page links to the new files, and the new basics and information can be found in text form at ftp://nssdc.gsfc.nasa.gov/pub/fits/basics_info.txt. Barry Schlesinger FITS Support Office GSFC/ADF Secretary, NOST Technical Panel From fitsbits-request Wed Oct 25 01:23:35 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["759" "Mon" "23" "October" "1995" "16:04:52" "GMT" "Donald H. Gudehus" "gudehus at papilio.is.net" "" "15" "SAD to FITS; FITS to SAD available" "^From:" nil nil "10" "1995102316:04:52" "SAD to FITS; FITS to SAD available" (number " " mark " Donald H. Gudehus Oct 23 15/759 " thread-indent "\"SAD to FITS; FITS to SAD available\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA03546; Wed, 25 Oct 1995 01:23:35 -0400 Return-Path: Message-Id: Organization: The Internet Connection Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!caen!hookup!multiverse!ragnarok.oar.net!malgudi.oar.net!news.sprintlink.net!howland.reston.ans.net!swrinde!tank.news.pipex.net!pipex!news.mathworks.com!newsfeed.internetmci.com!news1.i1.net!news1.is.net!news1!gudehus Newsgroups: sci.astro.fits content-length: 757 From: gudehus at papilio.is.net (Donald H. Gudehus) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: SAD to FITS; FITS to SAD available Date: Mon, 23 Oct 95 16:04:52 GMT Two subroutines, EXPORT.FOR which converts from SAD (Standard Astronomical Data) to FITS, and IMPORT.FOR which converts from FITS to SAD, are available via anonymous ftp from vms.ucc.okstate.edu in DUA4:[MIIPS.FOR]. SAD supports FITS-like keywords and multiple images (maps) per file. Currently code only exists for OpenVMS. The above subroutines call several subroutines which can be found in the same subdirectory and other subdirectories under [MIIPS]. SAD was created in the late '70s at Mt. Stromlo and is in use at various sites around the globe. It is the native file format of Pandora and MIIPS. Donald H. Gudehus dgudehu at emrycc.cc.emory.edu gudehus at chara.gsu.edu gudehus at papilio.is.net (home) From fitsbits-request Wed Oct 25 03:22:05 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["11681" "Sat" "21" "October" "1995" "18:16:58" "+0000" "Roberto Abraham" "abraham at ast.cam.ac.uk" "" "371" "Re: Reading FITS format images" "^From:" nil nil "10" "1995102118:16:58" "Reading FITS format images" (number " " mark " Roberto Abraham Oct 21 371/11681 " thread-indent "\"Re: Reading FITS format images\"\n") "<46617n$1nv at hplyot.obspm.fr>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA04332; Wed, 25 Oct 1995 03:22:05 -0400 Return-Path: Message-Id: Organization: Cambridge University, Institute of Astronomy Path: solitaire.cv.nrao.edu!hearst.acc.Virginia.EDU!maui.cc.odu.edu!news.larc.nasa.gov!news.msfc.nasa.gov!newsfeed.internetmci.com!tank.news.pipex.net!pipex!dispatch.news.demon.net!demon!sunsite.doc.ic.ac.uk!lyra.csx.cam.ac.uk!mac7.ast.cam.ac.uk!user References: <46617n$1nv at hplyot.obspm.fr> Newsgroups: comp.soft-sys.matlab,sci.astro.fits content-length: 11679 From: abraham at ast.cam.ac.uk (Roberto Abraham) Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Subject: Re: Reading FITS format images Date: Sat, 21 Oct 1995 18:16:58 +0000 In article <46617n$1nv at hplyot.obspm.fr>, veran at hplyot.obspm.fr (Jean-Pierre Veran) wrote: > I'm trying to use Matlab to process some astronomical images. > As usual in astronomy, these images are in FITS (Flexible Image > Transport System) format. Does anybody have a Matlab routine > able to read/write files in this format, that he/she would like > to share ? > Many thanks. > > Jean-Pierre Veran > Observatoire de Paris Hi Jean-Pierre, Here are a set of functions to deal with FITS files. Cut in the appropriate places and save in separate files and I hope they will work for you. The three functions are as follows: fitsread.m - reads a fits image fitsheader.m - gets keyword header or prints full header to screen parse_card.m - used internally by the above programs. Some huge caveats: (0) Like you I'm an astronomer, not a programmer. I put these together in an afternoon a while back and I don't plan on spending massively more time supporting these functions. They work on my data, and if they don't work on your data let me know and I'll eventually try and fix things, but no promises! Feel free to hack these functions to death in whatever way you want. (1) These have only been tested on my PowerMac, and use the big-endian switch on the data reading functions. I bet this will also be OK for UNIX, but I haven't checked this. For DOS/Windows I think you'll have to remove the 'b' switch from the various fread statements. (2) These are only designed to work with FITS images, not 1-D spectra or binary tables. Generalizing to these should be straightforward. (3) Since FITS keywords can be in any order, the fitsheader routine uses string matching and is very slow. Feel free to improve this! (4) The fitsread function operates much more quickly if you tell it how many Header Definition Units (HDUs) are used to store the header in your file. If you don't tell it this the function has to read each header line and use pattern matching to find the END keyword in order to figure out where the header stops and the data starts. So you're almost always better off explicitly telling it how big the header is. (A hint: most data I've played with from the Space Telescope Science Institute has 6 HDUs, so I've predefined this as a keyword, i.e. you can for example go: foo=fitsread('fred.fits','stsci') instead of foo=fitsread('fred.fits',6) or the much slower foo=fitsread('fred.fits'). (5) If the data file ends in '.fits' you need only give the root of the filename ie. yo=fitsread('fred') instead of yo=fitsread('fred.fits'). (6) I've only tried the functions on 32 bit real and 16 bit integer data, but it should work for all the official FITS data types (it picks out the data type from the 'bitpix' keyword). (7) I've tried to make the on-line help comprehensive, and to put lots of comments in the source. Bon chance, Bob Abraham Institute of Astronomy, Cambridge University ---------------- Three MATLAB functions below: ---------------- ------------------------- cut here ---------------------------- function output_image=fitsread(filename,n_hdu) %FITSREAD reads a FITS image into a Matlab variable. % % data=fitsread(filename) % data=fitsread(filename,n_hdu) % % The second form explicitly indicates the number of Header Data % Units (HDUs) present in the file. Explicitly telling % FITSREAD how many HDUs are present greatly speeds up the file % access, since in this case the function does not need to % parse each header line to determine where the header ends % and the data begins. % % The following syntax is also acceptible: % % data=fitsread(filename,'hst') % data=fitsread(filename,'stsci') % % where the 'hst' and 'stsci' keywords indicate FITSREAD % should use the number of HDUs (=6) in typical FITS files % originating from the Space Telescope Science Institute. % % % Useful FITS Definitions: % % "card" = 80 byte line of ASCII data in a file. This % contains keyword/value pairs and/or comments. % % "Header Data Unit" or "HDU" = a set of 36 "cards". Note % that FITS files must have an integer number of HDUs % (typically between 1 and 6, depending on how much % header information is stored in the file.) % Version 2.0 % Dr. R. G. Abraham, Institute of Astronomy, Cambridge University %The first few cards of the first HDU must give certain information %in a pre-defined order (eg. the data format, number of axes, %size etc) but after that the header keywords can come in any %order. The end of the last card giving information is flagged by %the keyword END, after which blank lines are added to pad the %last HDU so it also contains 36 cards. After the last card %the data begins, in a format specified by the BITPIX keyword. %The dimensions of the data are specified by the NAXIS1 and %NAXIS2 keywords. % %Reference: NASA/Science Office of Standards and Technology % "Definition of the Flexible Image Transport System" % NOST 100-1.0 % % This and other FITS documents are available on-line at: % http://www.gsfc.nasa.gov/astro/fits/basics_info.html %Set flag indicating unknown number of HDUs if nargin<2 n_hdu='unknown'; end; if isstr(n_hdu) n_hdu=upper(n_hdu); end; %Allow user to specify a few keywords to indicate number of HDUs if strmatch(n_hdu,'HST') | strmatch(n_hdu,'STSCI') | strmatch(n_hdu,'MDS') n_hdu=6; end if strmatch(n_hdu,'FREI') n_hdu=2; end %Open the file fid=-1; if ~isstr(filename) filename=setstr(filename); end; if (isempty(findstr(filename,'.'))==1) filename=[filename,'.fits']; end [file,message] = fopen(filename,'r','l'); if file == -1 error(message); end %First five cards must contain specific information [d,simple,d]=parse_card(setstr(fread(file,80,'uchar')')); [d,bitpix,d]=parse_card(setstr(fread(file,80,'uchar')')); [d,naxis,d]=parse_card(setstr(fread(file,80,'uchar')')); [d,naxis1,d]=parse_card(setstr(fread(file,80,'uchar')')); [d,naxis2,d]=parse_card(setstr(fread(file,80,'uchar')')); if n_hdu=='UNKNOWN' %Keep reading cards until one turns up with the keyword 'END'. n_card=5; keyword=[]; while(~strmatch(upper(keyword),'END')) n_card=n_card+1; card=setstr(fread(file,80,'uchar')'); [keyword,value,comment]=parse_card(card); end; %Go past the blank lines of padding before the start of the data n_blanks = 36 - rem(n_card,36); dummy=fread(file,n_blanks*80,'uchar'); else dummy=fread(file,((n_hdu*36)-5)*80,'uchar'); end; %Read the data. Note big-endian switch is used (Mac and UNIX!) if bitpix==-64 X=fread(file,naxis1*naxis2,'float32','b'); elseif bitpix==-32 X=fread(file,naxis1*naxis2,'float','b'); elseif bitpix==8 X=fread(file,naxis1*naxis2,'uint8','b'); elseif bitpix==16 X=fread(file,naxis1*naxis2,'short','b'); elseif bitpix==32 X=fread(file,naxis1*naxis2,'long','b'); else error('data type specified by BITPIX keyword is not -64, -32, 8, 16, or 32'); end; %Clean up and output data fclose(file); output_image=reshape(X,naxis1,naxis2); -------------------------- cut here --------------------------- function out=fitsheader(filename,verbose) %FITSHEADER returns a keyword value or size of HDU or prints the FITS header % FITSHEADER determines the value of a keyword or the number % of Header Data Units (HDUs) in a FITS file. As a side effect % the function can display all of the header information in the file % onto the screen. % % n_hdu=fitsheader(filename) % value=fitsheader(filname,'keyword') % n_hdu=fitsheader(filename,'silent_mode') % % The first form displays all header information on the % screen and returns the number of HDUs in the file. % % The second form displays only the value corresponding to % a specified keyword. % % The third form does not display any header information, but % returns the number of HDUs in the file. % % Useful FITS Definitions: % % "card" = 80 byte line of ASCII data in a file. This % contains keyword/value pairs and/or comments. % % "Header Data Unit" or "HDU" = a set of 36 "cards". Note % that FITS files must have an integer number of HDUs % (typically between 1 and 6, depending on how much % header information is stored in the file.) % Version 1.0 % Dr. R. G. Abraham, Institute of Astronomy, Cambridge University % % For FITS Info, check out the following document: % % NASA/Science Office of Standards and Technology % Definition of the Flexible Image Transport System" % NOST 100-1.0 % % This and other FITS documents are available on-line at: % http://www.gsfc.nasa.gov/astro/fits/basics_info.html if nargin<2 verbose='FULL'; else verbose=upper(verbose); end; %Open the file fid=-1; if ~isstr(filename) filename=setstr(filename); end; if (isempty(findstr(filename,'.'))==1) filename=[filename,'.fits']; end [file,message] = fopen(filename,'r','l'); if file == -1 error(message); end %Read the header information n_card=0; keyword=[]; while(~strcmp(upper(keyword),'END')) n_card=n_card+1; card=setstr(fread(file,80,'uchar')'); [keyword,value,comment]=parse_card(card); if strcmp(verbose,'FULL') disp(card) elseif strcmp(keyword,verbose) out=value; return end end; %Clean up and output data fclose(file); if (strcmp(verbose,'FULL') | strcmp(verbose,'SILENT_MODE')) out=ceil(n_card/36); %Return number of HDUs else disp('Keyword not found.'); out=[]; end --------------------------- cut here ------------------------ function [keyword,value,comment] = parse_card(s) %Parses a FITS header card. %Reference: % NASA/Science Office of Standards and Technology % "Definition of the Flexible Image Transport System (FITS)" % NOST 100-1.0 June 19, 1993 %Set defaults keyword=[];value=[];comment=[]; %Get keyword in bytes 1 - 8 keyword=s(1:8); %If keyword is blank then the line is a comment if strmatch(keyword,' ') keyword=[]; value=[]; comment=deblank(s(11:80)); return; end; %Keyword is non-blank. Check if there is a corresponding value/comment. %If not then the only possibilities are that bytes 11:80 are a comment %or that they are blank if ~strmatch(s(9:10),'= ') keyword=deblank(keyword); value=[]; comment=deblank(s(11:80)); return; end; %Card is a standard keyword/value/comment structure. Break the value/comment %string (bytes 11 - 80) into separate strings by tokenizing on "/" character. %Remove the leading and trailing blanks on the value and the trailing blanks %on the comment. keyword=deblank(keyword); [value,comment]=strtok(s(11:80),'/'); comment=deblank(comment); value=fliplr(deblank(fliplr(deblank(value)))); %Now figure out whether to output the value as a string or as a number. %The FITS standard requires all values that are strings to be in single %quotes like this: 'foo bar', so I can simply look for occurences of a %single quote to flag a string. However, logical variables can take the %values T or F without having any single quotes, so I'll have to look %out for those also. %Test for logical. Return logical as a string. if strmatch(upper(value),'T') | strmatch(upper(value),'F') return; end; %Test for string. Return string unconverted. if length(findstr('''',value)) ~= 0 return; end; %Only thing left is a number. Convert string to number. value=str2num(value); --------------------- end of Matlab stuff -------------------- -- Roberto Abraham Institute of Astronomy Cambridge University Madingley Road Cambridge CB3 0HA United Kingdom From fitsbits-request Thu Oct 26 03:29:57 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["1509" "Thu" "26" "October" "1995" "17:27:58" "+1000" "Mark Calabretta" "mcalabre at atnf.csiro.au" "<9510260727.AA04917 at grus.rp.CSIRO.AU>" "39" "Re: WCS Proposal " "^From:" nil nil "10" "1995102607:27:58" "WCS Proposal" (number " " mark " Mark Calabretta Oct 26 39/1509 " thread-indent "\"Re: WCS Proposal \"\n") "<199510181440.KAA20122 at xebec.gsfc.nasa.gov>"] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA14737; Thu, 26 Oct 1995 03:29:57 -0400 Return-Path: Message-Id: <9510260727.AA04917 at grus.rp.CSIRO.AU> In-Reply-To: Your message of Wed 1995/10/18 10:40:17 -0400 <199510181440.KAA20122 at xebec.gsfc.nasa.gov> content-length: 1507 From: Mark Calabretta Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at NRAO.EDU Subject: Re: WCS Proposal Date: Thu, 26 Oct 1995 17:27:58 +1000 On Wed 1995/10/18 10:40:17 -0400, Arnold Rots wrote in a message to: fitsbits at fits.cv.nrao.edu >b. What does "time of observation" mean? The start, the middle, the >end, a weighted mean? As stated in section 3, it's an average. In the context of section 3, MJD-OBJ is provided as a timestamp for the observation as a whole, in particular for the calculation of proper motion in maps taken at two epochs. Depending on the timescale of the observation, it could also be relevant to such effects as parallax, precession, nutation, aberration, and gravitational deflection. As such the precision of MJD-OBS depends on the duration of the observation - if the observation lasted 1 sec then MJD-OBJ would have comparable precision. Putting it another way, effects which vary significantly during the course of an observation (for example, a long exposure on a planet) should be accounted for in the observing process (sharp planet + smeared stars), or otherwise will result in some sort of blurring in the image (smeared planet + sharp stars). I'm not arguing that start/stop times may not be needed (in the general case you could have multiple starts/stops), only that definition of the required keywords is outside the scope of the paper - that being the representation of celestial coordinates. >c. It is unwise to implicitly assume a particular time system. G&C >assume TAI; I am sure many would interpret it as UTC. The point is G&C doesn't assume TAI, it prescribes it. Mark Calabretta ATNF From fitsbits-request Tue Oct 31 11:06:26 1995 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["5317" "Tue" "31" "October" "1995" "11:06:19" "-0500" "William Pence" "pence at tetra.gsfc.nasa.gov" "<199510311606.LAA20020 at tetra.gsfc.nasa.gov>" "115" "FTOOLS Version 3.4" "^From:" nil nil "10" "1995103116:06:19" "FTOOLS Version 3.4" (number " " mark " William Pence Oct 31 115/5317 " thread-indent "\"FTOOLS Version 3.4\"\n") nil] nil) Received: by fits.cv.nrao.edu (5.x/S2.3/NRAO-CV/2.4) id AA21207; Tue, 31 Oct 1995 11:06:26 -0500 Return-Path: Message-Id: <199510311606.LAA20020 at tetra.gsfc.nasa.gov> content-length: 5315 From: William Pence Sender: fitsbits-request at fits.cv.nrao.edu To: fitsbits at fits.cv.nrao.edu Cc: pence at tetra.gsfc.nasa.gov Subject: FTOOLS Version 3.4 Date: Tue, 31 Oct 1995 11:06:19 -0500 FTOOLS Version 3.4 Oct 30, 1995 A new version of the FTOOLS package of programs to manipulate FITS data files is now available. FTOOLS may be built either as a set of stand-alone executable programs or as a package of tasks under IRAF. Installers also have the option to build only the "core" set of FTOOLS that perform generic operations on FITS files, or the entire set of FTOOLS that includes more specialized tasks for X-ray and Gamma-ray data analysis. FTOOLS is available on the WWW at http://heasarc.gsfc.nasa.gov/docs/software/ftools/ftools_menu.html FTOOLS is also available via Anonymous FTP from legacy.gsfc.nasa.gov in the software/ftools/release/FTools_3.4 directory. The source code and and reference data files are located in: ftools.v3.4.tar.gz - Source Code Distribution for all platforms refdata.v3.4.tar.gz - Minimal subset of Calibration Database (not needed for the 'core' FTOOLS) The compressed postscript documentation files are located in the software/ftools/release/doc directory: develop.v3.4.ps.gz - Developer's Guide install.v3.4.ps.gz - Installation Guide users.v3.4.ps.gz - User's Guide techref.v3.4.ps.gz - Complete User's Guide and help pages (long) Xselect_1.3.ps.gz - Xselect Users Guide Supported Platforms: (See Installation Guide for details) unix ALPHA/OSF, DEC/ULTRIX, SUN/SunOS (incl. Solaris) SGI/IRIX, HP/HP-UX vms ALPHA/VMS, VAX/VMS A major change in FTOOLS v3.4 is that a configure script has been implemented to ease the installation process. Please refer to the FTOOLS Installation Guide for detailed instructions. The FTOOLS package has been developed and is supported by programmers and scientists at the High Energy Astrophysics Science Archive Research Center (HEASARC) at NASA/GSFC. Any questions or comments regarding FTOOLS should be directed to ftoolshelp at athena.gsfc.nasa.gov. Questionnaire: So that we can better serve the user community in the future we have prepared a short questionnaire. Your cooperation in filling it out and emailing it back to us will be greatly appreciated! *******************************CUT HERE****************************** FTOOLS Questionnaire (v3.4, 10/23/95) 1. What type of machine are you currently running FTOOLS on? 2. What operating system is it running? (Please be as specific as possible) 3. Are you running the Host/Standalone version or the IRAF version? Please explain your choice. 4. Is there an architecture/OS that you'd like to see supported? Please return to ftoolshelp at athena.gsfc.nasa.gov under the Subject heading: Questionnaire *******************************CUT HERE****************************** Sample of some of the programs available in FTOOLS: fappend - Append a FITS extension onto another FITS file fcalc - Calculates values for a column using an arithmetic expression fcatdiff - Compares columns of a fits file and reports row differences fcreate - Create a FITS table from ASCII input files fcurve - Make a light curve histogram from a column in a table fdump - Dump contents of a FITS table to an ASCII file fextract - Copy a FITS extension from a file into a new file fhisto - Make a histogram of a column in a table fkeyprint - Display keyword(s) in FITS header(s) flcol - List column information in a FITS table extension flist - List contents of a FITS table to an ASCII file fmemsort - Fast memory sort of a FITS table fmerge - Merge rows from several FITS tables into one FITS table fmodhead - Modify the header keywords in a FITS file fplot - Plot columns in a FITS file using QDP/PLT package fselect - Create a new table from selected rows of a table fsort - Sort a FITS table in place fstatistic - Calculate mean, standard deviation, min, and max for a column fstruct - List a description of the structure of a FITS file ftabcopy - Copy specified columns of a FITS table to a new table fverify - Verify that a FITS file conforms to the FITS Standard fadapt - Convolve a FITS image with an adaptive top hat filter farith - Perform arithmetic on 2 FITS images fboxcar - Convolve a FITS image with a rectangular boxcar filter fcarith - Perform arithmetic on FITS image with a constant fgauss - Convolve a FITS image with an elliptical Gaussian function fimgbin - Rebin a FITS image using a rectangular bin size fimconcat - Take 2 images and place them side by side as single image fimgdmp - Dump contents of a FITS image to an ASCII file fim2lst - Convert a 2D image to a pixel list (inverse of f2dhisto) florentz - Convolve a FITS image with an elliptical Lorentzian function fmrgmsk - Merge 2 or more spatial masks fvec2img - Create an image from a column of vectors f2dhisto - Make a 2-D image from 2 columns in a table -------------------------------------------------------------------------------