File: getsky.x

package info (click to toggle)
iraf-rvsao 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 16,456 kB
  • sloc: ansic: 963; lisp: 651; fortran: 397; makefile: 27
file content (84 lines) | stat: -rw-r--r-- 2,509 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File rvsao/Util/getsky.x
# March 27, 2015
# By Jessica Mink, Harvard-Smithsonian Center for Astrophysics

# Copyright(c) 1994-2015 Smithsonian Astrophysical Observatory
# You may do anything you like with this file except remove this copyright.
# The Smithsonian Astrophysical Observatory makes no representations about
# the suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
 
#  GETSKY opens the image specified by specfile and returns pointers
#  to the sky data and the image descriptor.
 
#  Notes:	Shares data in "rvsao.com"
 
###########################################################################
 
include <imhdr.h>
include <smw.h>
include	"../lib/rvsao.h"
 
procedure getsky (specfile, sspec, sband, spectrum, specim, skysh)
 
char	specfile[ARB]	# Data file name
int	sspec		# Number of spectrum to read from multispec file
int	sband		# Band of spectrum to read from multispec file
pointer	spectrum	# Spectrum data (returned)
pointer	specim		# Image header structure (returned)
pointer	skysh		# Spectrum header structure (returned)
 
int	npix
int	nline
 
include	"../lib/rvsao.com"
 
begin
	nline = sspec
	if (debug) {
	    call printf ("GETSKY: %s ap %d band %d\n")
		call pargstr (specfile)
		call pargi (nline)
		call pargi (sband)
	    }
	call getimage (specfile,mext,nline,sband,spectrum,specim,skysh,npix,
		       skyname,READ_ONLY)
	if (specim == ERR) {
	    call printf ("GETSKY:  Error reading %s[%d,%d]\n")
		call pargstr (specfile)
		call pargi (nline)
		call pargi (sband)
	    return
	    }
 
# redefine common variables
	specpix = npix
	specdc = DC(skysh)

end

# Apr 22 1992	Modify to handle multispec spectra

# Jun  4 1993	Modify to handle MWCS spectra
# Jul  7 1993	Add spectrum header to getimage arguments

# Apr 12 1994	Keep sky name separate from spectrum name; fix debug code
# Apr 12 1994	Return MWCS header pointer
# Jun 15 1994	Set SPECDC from DC(SKYSH), not DCFLAG
# Jun 23 1994	Keep mWCS pointer in SHDR structure
# Aug  3 1994	Change common and header from fquot to rvsao

# Jul 13 1995	Add DEBUG to COMPBCV calls

# Aug  7 1996	Use smw instead of shdr

# Aug 27 1997	Add argument for multispec band

# Apr 22 1998	Drop use of getim.com; extracted needed parameters from  header locally
# Apr 22 1998	Do not set velocity corrections in this subroutine

# Aug  1 2003	Add image extension argument to getimage()

# Aug 22 2013	Drop local variable mext

# Mar 27 2015	Link to header and common files in lib/