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