init_healpix.pro
3.02 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
; -----------------------------------------------------------------------------
;
; Copyright (C) 1997-2008 Krzysztof M. Gorski, Eric Hivon, Anthony J. Banday
;
;
;
;
;
; This file is part of HEALPix.
;
; HEALPix is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; HEALPix is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with HEALPix; if not, write to the Free Software
; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
;
; For more information about HEALPix see http://healpix.jpl.nasa.gov
;
; -----------------------------------------------------------------------------
pro init_healpix, verbose=verbose
;+
; defines the (structure) system variable Healpix
;
; 2006-05-22: print caution message in version 5.5a which has touchy expand_path
; 2006-oct : v 2.10, enabled nside > 8192
; 2008-oct: v2.11, use getenv
;-
; system variable name
healpix_sysvar = '!HEALPIX'
; Healpix version
version = '2.12a'
; release data
date = '2009-08-06'
; Healpix directory
sv = 'HEALPIX'
;dsv = '$'+sv
; if (!version.release eq '5.5a') then message,'testing existence of '+sv+' environnement variable',/info
; directory = expand_path(dsv)
; directory = strtrim(directory,2)
; if (directory eq dsv or directory eq '') then begin
; print,' system variable '+sv+' not found '
; directory = ''
; endif
directory = getenv(sv)
if (strtrim(directory,2) eq '') then begin
print,' system variable '+sv+' not found '
directory = ''
endif
; list of possible Nside's
nside = 2L^lindgen(30) ; 1, 2, 4, 8, ..., 8192, ..., 2^29 = 0.54e9
; flag for missing values
bad_value = -1.6375e30
comment = ['This system variable contains some information on Healpix :', $
healpix_sysvar+'.VERSION = current version number,', $
healpix_sysvar+'.DATE = date of release,',$
healpix_sysvar+'.DIRECTORY = directory containing Healpix package,',$
healpix_sysvar+'.NSIDE = list of all valid values of Nside parameter,',$
healpix_sysvar+'.BAD_VALUE = value of flag given to missing pixels in FITS files,',$
healpix_sysvar+'.COMMENT = this description.']
; create structure
stc = {version:version, date:date, directory:directory, nside:nside, bad_value:bad_value, comment:comment}
; fill variable out
defsysv, healpix_sysvar, exists = exists
if (exists) then begin
!Healpix = stc
endif else begin
defsysv, healpix_sysvar, stc
endelse
if (keyword_set(verbose)) then begin
print,'Initializing '+healpix_sysvar+' system variable'
print
print,comment,form='(a)'
print
; help,/st,healpix_sysvar
; print
endif
return
end