61 #define MAX_DATA_CHANNELS 8192
87 if(buf && strlen(buf) > 1)
102 st_fail(
"No connection to OTF client present");
111 st_fail(
"No viable OTF client present");
118 st_fail(
"to_dataserv() called with no buffer");
131 sprintf(tbuf,
"help");
157 st_report(
"Configuring OTF map from Header");
177 st_report(
"fwhm(): Using Non Standard Dish Size: %.2f M", dish);
181 st_report(
"fwhm(): Using Dish Size: %.2f M", dish);
279 char bbuf[1024], tbuf[256];
281 sprintf(bbuf,
"baselines ");
291 sprintf(tbuf,
"-1 -1 ");
308 char tbuf[256], execBuf[256];
349 st_warn(
"otf_map_velocity is Zero!");
358 st_fail(
"otf_map_freqres is Zero!");
367 st_fail(
"otf_map_restfreq is Zero!");
396 sprintf(execBuf,
"helperwait done 30");
401 st_report(
"Skipping OTF Color Selection; 'otf_ignore_color' Non-Zero");
414 st_fail(
"You must start the OTF sub-system first");
444 sprintf(tbuf,
"otfautoconfig 1");
501 st_fail(
"You must start the OTF sub-system first");
515 sprintf(tbuf,
"dl /k otf");
546 char tbuf[256], dir[256], *cp1, *cp2;
559 st_fail(
"otfMovie(): otf_movie_* must not be 0");
568 st_fail(
"otfMovie(): otf_movie_bchan must be less that otf_movie_echan");
593 sprintf(tbuf,
"otfvelrun %d %d %d %s %f %s %s",
615 st_fail(
"otfChanMap(): otf_chan_map_* must not be 0");
652 sprintf(tbuf,
"otf3dcube %d %d %d %.3f %.2f %.2f %.3f",
691 sprintf(tbuf,
"otf3dplot %s %d",
session, interp);
703 int i, b = 0, e = 0,
first = 1;
743 char dbuf[1024], tbuf[512];
747 bzero(dbuf,
sizeof(dbuf));
751 sprintf(tbuf,
"%s ",
args->
tok[i]);
776 char tbuf[256], dbuf[1024];
787 sprintf(dbuf,
"otfgridsum %s", tbuf);
791 strcpy(dbuf,
"otfgridsum");
801 st_report(
"helperBinaryWait() returned %d", ret);
825 bcopy((
char *)&ds->head, (
char *)&im->
head,
sizeof(
struct HEADER));
840 im->
yplot1[i] = ds->ydata[i];
844 im->
nsize = n *
sizeof(float);
857 int i, n, ret=0, dir = 0;
858 char dbuf[1024], dirStr[256];
877 strcpy(dirStr,
"row");
883 strcpy(dirStr,
"col");
888 st_print(
"Missing direction flag\n");
895 sprintf(dbuf,
"otfslice %s %d", dirStr, atoi(
args->
secondArg));
904 st_report(
"helperBinaryWait() returned %d", ret);
922 im->ainfo.scanct = ds->
scanct;
923 im->ainfo.bscan = ds->
bscan;
924 im->ainfo.escan = ds->
escan;
928 im->binfo.rms = ds->
rms;
930 bcopy((
char *)&ds->
head, (
char *)&im->head,
sizeof(
struct HEADER));
932 strncpy(im->head.object, ds->
source, 16);
933 im->head.object[15] =
'\0';
934 strncpy(im->head.coordcd, ds->
coordcd, 8);
935 im->head.coordcd[7] =
'\0';
937 im->head.noint = (double)ds->
noint;
938 im->head.datalen = im->head.noint *
sizeof(
float);
939 im->head.stsys = ds->
tsys;
945 im->yplot1[i] = ds->
ydata[i];
949 im->nsize = n *
sizeof(float);
951 im->xaxisotfoff = dir;
969 char tbuf[256], dbuf[1024];
981 sprintf(dbuf,
"otfsendplot %s", tbuf);
985 strcpy(dbuf,
"otfsendplot");
995 st_report(
"helperBinaryWait() returned %d", ret);
1011 im->ainfo.scanct = ds->
scanct;
1012 im->ainfo.bscan = ds->
bscan;
1013 im->ainfo.escan = ds->
escan;
1015 im->binfo.a = ds->
a;
1016 im->binfo.b = ds->
b;
1017 im->binfo.rms = ds->
rms;
1019 bcopy((
char *)&ds->
head, (
char *)&im->head,
sizeof(
struct HEADER));
1021 strncpy(im->head.object, ds->
source, 16);
1022 im->head.object[15] =
'\0';
1023 strncpy(im->head.coordcd, ds->
coordcd, 8);
1024 im->head.coordcd[7] =
'\0';
1026 im->head.noint = (double)ds->
noint;
1027 im->head.datalen = im->head.noint *
sizeof(
float);
1028 im->head.stsys = ds->
tsys;
1034 im->yplot1[i] = ds->
ydata[i];
1038 im->nsize = n *
sizeof(float);
1055 case 0:
_h0();
break;
1056 case 1:
_h1();
break;
1057 case 2:
_h2();
break;
1058 case 3:
_h3();
break;
1059 case 4:
_h4();
break;
1060 case 5:
_h5();
break;
1061 case 6:
_h6();
break;
1062 case 7:
_h7();
break;
1063 case 8:
_h8();
break;
1064 case 9:
_h9();
break;
1066 default:
st_fail(
"Unknown H value %d", i);
return(1);
break;
1075 int i, j,
noint, ret, old, snum, navg, numSpec;
1076 float *w, *o, *s, *g;
1077 double gscan, oscan,
scan;
1117 numSpec = (
int)
h0->
head.
datalen / (
sizeof(float) * (noint+5));
1154 if(snum < 0 || snum >= numSpec)
1156 st_fail(
"Requected spectra: %d, < 0 or > %d", snum, numSpec);
1172 if(navg < 1 || (snum+navg) >= numSpec)
1174 st_fail(
"Requected average or start+average, %d, < 1 or > %d", snum+navg, numSpec);
1180 st_report(
"Averaging %d samples", navg);
1207 s = &otfData[(snum+j)*noint];
1214 for(i=0;i<
noint;i++, w++, s++, o++, g++)
1216 *w += ( *s - *o) / *o * *g;
1222 for(i=0;i<
noint;i++, w++)
1240 int old_preview = 0, record = 0,
interp = 0, norepaint = 0;
1241 char sysBuf[256], tbuf[256];
1247 st_fail(
"OTF Session Already Running");
1252 st_report(
"Starting Dataserv OTF Process");
1254 sprintf(sysBuf,
"dataserv -sock &");
1266 st_fail(
"OTF Gridder Not Running; type 'otf /s' to start");
1508 sprintf(tbuf,
"otffixbadcells %s", interp);
1535 st_report(
"fwhm(): Using Non Standard Dish Size: %.2f M", dish);
1539 st_report(
"fwhm(): Using Dish Size: %.2f M", dish);
1542 nyquist = (2.997925e8 / (2.0 * dish * (
env->
freq * 1e3))) * 0.2062648;
1550 st_fail(
"Env: Frequency not set");
struct LP_IMAGE_INFO * h0
int hzero(struct LP_IMAGE_INFO *image)
char * strcmprs(char *str)
int _copyImage(struct LP_IMAGE_INFO *i1, struct LP_IMAGE_INFO *i2)
struct PARSE_STACK * args
int interp(double *array, int nx, int ny, double *parray, int npx, int npy)
char * loadChoiceStrings[]
struct BASELINE_INFO binfo
struct DS_IMAGE_INFO ds_image_info
int printH_FlagHelp(char *cmd)
#define LAST_PLOT_OTF_CUT
char tok[MAX_TOKENS][MAX_TOKENS]
int otfLoad(int norepaint)
int otfMovie(int rec, int interp)
int copyEnv2Image(struct LP_IMAGE_INFO *image)
int sock_send(struct SOCK *s, char *message)
int otfGrabSpectralPlot()
int reassembleArgs(char *buf)
int computeXaxis(struct LP_IMAGE_INFO *image, int logit)
void subArgs(int wt, const char *fmt,...)
struct SOCK * sock_connect(char *mbname)
int sendImageStruct(struct LP_IMAGE_INFO *image, int mode)
int baselines[MAX_BASELINES][2]
float ydata[MAX_DATA_CHANNELS]
int to_dataserv(char *buf)