File: mira-test2.i

package info (click to toggle)
yorick-mira 0.9.9+dfsg1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,280 kB
  • ctags: 3
  • sloc: makefile: 90
file content (47 lines) | stat: -rw-r--r-- 1,776 bytes parent folder | download | duplicates (2)
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
/*
 * mira-test2.i -
 *
 *	Example of image reconstruction session with MIRA
 *	(Multi-aperture Image Reconstruction Algorithm) using the
 *	second dataset from the "The 2004 Optical/IR Interferometry
 *	Imaging Beauty Contest" (Lawson et al., 2004).
 */

if (is_void(MIRA_HOME)) {
  /* Load MIRA software (make sure that Yeti, then MIRA get loaded). */
  if (! is_func(setup_package)) {
    include, "yeti.i", 1;
    //pause, 1;
  }
  //setup_package;
  include, "mira.i", 1;
  //pause, 1;
}

/* Load OI-FITS data file (DB will be your MIRA instance for this data
   file; if there are several spectral channels in the data file, you
   must choose one with keyword EFF_WAVE or choose a spectral range
   with keywords EFF_WAVE and EFF_BAND): */
db2 = mira_new("data2.oifits");

/* Configure data instance for image reconstruction parameters (DIM is
   the number of pixels along the width and height of the restored
   image; FOV is the size of the corresponding field of view in
   radians; XFORM is the name of the method to approximate the Fourier
   transform, can be "exact" or "fft", default is "exact"): */
mira_config, db2, dim=100, pixelsize=0.5*MIRA_MILLIARCSECOND, xform="fft";

/* Choose a suitable regularization method: */
rgl = rgl_new("smoothness");

/* Attempt an image reconstruction (from scratch): */
img0 = array(double, db2.dim, db2.dim);
img0(db2.dim/2, db2.dim/2) = 1.0;
img2 = mira_solve(db2, img0, maxeval=500, verb=1, xmin=0.0, normalization=1,
                  regul=rgl, mu=1e6);

/* Iterate until convergence. */
img2 = mira_solve(db2, img2, maxeval=500, verb=1, xmin=0.0, normalization=1,
                  regul=rgl, mu=1e6);
img2 = mira_solve(db2, img2, maxeval=500, verb=1, xmin=0.0, normalization=1,
                  regul=rgl, mu=1e6);