00001 #include "sadie.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 void
00013 CHIRP (short nlin,
00014 short npix,
00015 double period,
00016 IMAGE ** out
00017
00018 )
00019 {
00020 register short j, k;
00021 char msg[SLEN];
00022 double x, y;
00023
00024 if (TIMES)
00025 TIMING (T_CHIRP);
00026 if (NAMES)
00027 {
00028 MESSAGE ('I', "");
00029 MESSAGE ('I', "CHIRP");
00030 MESSAGE ('I', "");
00031 sprintf (msg, " Image size: lines: %d", nlin);
00032 MESSAGE ('I', msg);
00033 sprintf (msg, " pixels: %d", npix);
00034 MESSAGE ('I', msg);
00035 sprintf (msg, " Period: %12.4e", period);
00036 MESSAGE ('I', msg);
00037 MESSAGE ('I', " ...............");
00038 }
00039
00040
00041 if (!CHECKIMG (*out))
00042 GETMEM (1, nlin, npix, out);
00043
00044
00045 period = PI / period;
00046 for (j = 0; j < nlin; j++)
00047 {
00048 y = (double) (j - nlin / 2) * (j - nlin / 2);
00049 for (k = 0; k < npix; k++)
00050 {
00051 x = sqrt ((double) (k - npix / 2) * (double) (k - npix / 2) + y);
00052 (*out)->data[0][j][k] = (PIXEL) cos (x * x * period);
00053 }
00054 }
00055
00056 the_end:
00057 if (TIMES)
00058 TIMING (T_EXIT);
00059 }