📄 zern_assoc.pro
字号:
; $Id: zern_assoc.pro,v 1.1.1.1 2002/03/12 11:53:46 riccardi Exp $
;
; A. Riccardi, Dipartimento di Astronomia di Firenze (Italy).
; riccardi@arcetri.astro.it
; Please, send me a message if you modify this code.
pro zern_assoc, filename, unit, var_assoc, UPDATE=update
;+
; NAME:
; ZERN_ASSOC
;
; PURPOSE:
; This procedure opens a file generated by ZERN_SAVE and ASSOCiats
; a variable to it.
;
; CATEGORY:
; Adaptive Optics.
;
; CALLING SEQUENCE:
;
; ZERN_ASSOC, Filename, Unit, Var_assoc
;
; INPUTS:
; Filename: string. Name of file generated by ZERN_SAVE.
;
; Unit: long. Unit number. If undefined variable uses
; unit number from /GET_LUN (see OPENR).
;
; KEYWORDS:
; UPDATE: set it if you want open the file Filename for
; input and output, for input only otherwise (read only).
;
; OUTPUTS:
; Unit: long. If undefined in input, return the unit
; number from /GET_LUN.
;
; Var_assoc: variable returned by ASSOC.
;
; EXAMPLE:
; <???>
;
; MODIFICATION HISTORY:
; Written by: A. Riccardi; July, 1995.
;-
use_get_lun = (n_elements(unit) eq -1)
openr, unit, filename, get_lun=use_get_lun
header = $
{ zern_header, $
sampling : 0, $
ratio : 0.d0, $
jmin : 0, $
jmax : 0, $
is_double : 0 $
}
header_len = n_tags(header, /LEN)
var_assoc = assoc(unit, header)
header1 = var_assoc(0)
close, unit
if (header1.is_double) then $
struct_template = $
{ zern_data, $
j : 0, $
n : 0, $
m : 0, $
ref_symm : [0, 0], $
cen_symm : 0, $
poly : dblarr(header1.sampling/2, header1.sampling/2, /nozero) $
} $
else $
struct_template = $
{ zern_data, $
j : 0, $
n : 0, $
m : 0, $
ref_symm : [0, 0], $
cen_symm : 0, $
poly : fltarr(header1.sampling/2, header1.sampling/2, /nozero) $
}
if (keyword_set(update)) then $
openu, unit, filename, get_lun=use_get_lun $
else $
openr, unit, filename, get_lun=use_get_lun
var_assoc = assoc(unit, struct_template, header_len)
return
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -