3 This is the TRMM Office Radar Software Library.
4 Copyright (C) 1992 Dennis F. Flanigan Jr. of Applied Research Corporation,
5 Landover, Maryland, a NASA/GSFC on-site contractor.
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the Free
19 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 /* toga/old sigmet/Darwin access routines
22 * V1.0 12/15/93 by John Merritt.
24 * 1. Use CFLAGS = -DUSE_PLOG if you want to use the PLOG library.
25 *----------------------------------------------------------------------
27 * Dennis Flanigan, Jr.
28 * Applied Research Corp.
29 * NASA GSFC Code 910.1
33 * Added tg_prt_head function
39 * Added tg_open function ...Mike
42 * Modified tg_read_ray and created tg_decode_ray_data .
43 * tg_read_ray now returns decoded real-valued ray data in a
44 * tg_ray_data structure instead of toga-format-encoded ray data
45 * in a rp_ray structure. Mike
48 * Made changes so that code can be generated in library routines.
49 * Library will be called libtg.a
52 * Routines to access toga data from Darwin. These routines work
53 * with the old sigmet data format that was used in Darwin from 87
63 #include <sys/types.h>
75 void swab(const void *from, void *to, size_t n);
77 int tg_open(char *,tg_file_str *);
78 int tg_read_map_head(tg_file_str *);
79 float tg_make_ang(unsigned short);
80 int tg_read_map_bytes(tg_file_str *,void *,int);
81 int tg_read_rec_bytes(tg_file_str *,char *,int);
82 int tg_read_map_rec(tg_file_str *);
83 void tg_decode_ray_data(tg_file_str *,short *);
84 int tg_read_ray(tg_file_str *);
85 void tg_prt_head(tg_map_head_str *,int);
87 FILE *uncompress_pipe (FILE *fp);
90 int tg_open(char *filename,tg_file_str *tg_file)
92 /* open the toga data file */
93 if (filename == NULL) tg_file->fd = STDIN_FILENO; /* Stdin */
95 if ((tg_file->fd=open(filename,O_RDONLY)) == -1)
98 plog("tg_open: Error opening toga data file\n",PLOG_P);
102 /* Unfortunately, there is no tg_close to modularize the following
103 * pipe close. Shouldn't be any problems anyway.
105 (void) uncompress_pipe(fdopen(tg_file->fd, "r")); /* Redirect through gunzip. */
106 /* initialize buffer pointers, flags */
107 tg_file->buf_ind = 32769;
108 tg_file->buf_end = 32769;
109 tg_file->first_rec = TRUE;
110 tg_file->data_ind = 2044;
112 /* read the map header from the toga file into the tg_file
114 if (tg_read_map_head(tg_file) < 0)
116 return(-1); /* Can't read toga map header */
124 int tg_read_map_head(tg_file_str *tg_file)
129 if((n = read(tg_file->fd,&buf,TG_HDSIZE)) != TG_HDSIZE)
133 fprintf(stderr,"tg_read_map_head: (%d)%s \n",errno,strerror(errno));
137 fprintf(stderr,"tg_read_map_head: Didn't read entire file header.\n\007");
138 fprintf(stderr,"tg_read_map_head: Bytes read: %d \n",n);
143 /* Do we need to swap bytes ?
144 * Test for byte swapping is done by checking the storm year.
145 * If less then 2050 then bytes are in correct order, otherwise
148 if((buf.strm_year < 2050) && (buf.strm_year > 1960))
150 memcpy(&(tg_file->map_head),&buf,sizeof(tg_map_head_str));
151 tg_file->swap_bytes = FALSE;
155 swab(&buf,&(tg_file->map_head),sizeof(tg_map_head_str));
156 tg_file->swap_bytes = TRUE;
159 /* The file header has now been written into tg_file->map_head .
160 Check for reasonable strm_year and strm_mon. If not reasonable,
161 we assume the file is garbled beyond legibility, or perhaps this
162 is not a TOGA format data file. */
163 if ((tg_file->map_head.strm_year < 2050) &&
164 (tg_file->map_head.strm_year > 1960))
166 if ((tg_file->map_head.strm_mon > 0) &&
167 (tg_file->map_head.strm_mon < 13))
169 /* file header OK, reset pointers into buffer */
170 tg_file->buf_ind = 32769;
171 tg_file->buf_end = 32769;
176 /* If we've reached this point, we can't read the file header. */
178 plog("tg_read_map_head: Can't read TOGA file header\n",PLOG_P);
184 float tg_make_ang(unsigned short binang)
186 float maxval = 65536.0;
188 return(360.0 * ((float)binang/maxval));
191 int tg_read_map_bytes(tg_file_str *tg_file,void *buf,int size)
198 /* Copy the pointer to buf to wbuf. wbuf stands for working buf */
201 /* size is size in bytes. wsize is size in words. */
206 /* Do we need to decompress more data? */
207 if((tg_file->buf_ind + wsize - 1) > tg_file->buf_end)
209 /* Yes we do, but first make sure that we don't need any data
212 if((tg_file->buf_end - tg_file->buf_ind) > 0)
214 /* There is data in buffer that we need, before we decompress
215 * next string of data.
217 memcpy(wbuf,&(tg_file->dec_buf[tg_file->buf_ind]),
218 (tg_file->buf_end - tg_file->buf_ind + 1) * 2);
219 wsize = wsize - (tg_file->buf_end - tg_file->buf_ind + 1);
220 wbuf = (wbuf + ((tg_file->buf_end - tg_file->buf_ind + 1) * 2));
221 ret_val = ret_val + ((tg_file->buf_end - tg_file->buf_ind + 1)*2);
224 /* Is this data or is this length of zeros */
225 if((n = tg_read_rec_bytes(tg_file,(char *)&dec_key,2)) <= 0)
227 tg_file->buf_ind = tg_file->buf_end;
231 n = (0x1 & (dec_key >> 15));
234 /* No, it is not length of zeros.
236 n = dec_key & 0x7FFF;
238 if((m = tg_read_rec_bytes(tg_file,(char *)&(tg_file->dec_buf),
243 tg_file->buf_ind = 0;
244 tg_file->buf_end = n - 1;
248 /* Is this end of data ? */
252 tg_file->buf_ind = 32769;
253 tg_file->buf_end = 32769;
256 /* Is this end of ray? */
257 else if(dec_key == 1)
259 /* plog("End of ray\n",LOG); */
260 tg_file->buf_ind = tg_file->buf_end;
263 /* Fill decompress buffer with 0's */
266 memset(&(tg_file->dec_buf),(char)0,dec_key * 2);
267 tg_file->buf_ind = 0;
268 tg_file->buf_end = dec_key - 1;
273 /* Is decompressed data enough to fill request ? */
274 if((tg_file->buf_end - tg_file->buf_ind + 1) < wsize)
276 /* Will need to decompress more data */
277 memcpy(wbuf,&(tg_file->dec_buf[tg_file->buf_ind]),
278 (tg_file->buf_end - tg_file->buf_ind + 1) * 2);
279 wsize = wsize - (tg_file->buf_end - tg_file->buf_ind + 1);
281 wbuf = (wbuf + ((tg_file->buf_end - tg_file->buf_ind + 1) * 2));
283 ret_val = ret_val + ((tg_file->buf_end - tg_file->buf_ind + 1) * 2);
284 tg_file->buf_ind = tg_file->buf_end;
288 /* There is enough decompressed data for request */
289 memcpy(wbuf,&(tg_file->dec_buf[tg_file->buf_ind]),wsize * 2);
290 tg_file->buf_ind = tg_file->buf_ind + wsize;
291 ret_val = ret_val + (wsize * 2);
298 int tg_read_rec_bytes(tg_file_str *tg_file,char *buf,int size)
300 /* Return size number of bytes in buf. Read in new record
301 * if needed. Check to make sure missing records with
302 * record number variable found in record header.
310 /* Is there enough data in recbuf for request */
311 if((tg_file->data_ind + wsize - 1) > 2043)
313 /* No there is not enough data for this request, but before
314 * we read the next buffer, we should copy what we have into
315 * the buffer pointed to by buf.
317 if(tg_file->data_ind < 2044)
319 memcpy(wbuf,&(tg_file->recbuf.data[tg_file->data_ind]),
320 (2043 - tg_file->data_ind + 1) * 2);
321 wsize = wsize - (2043 - tg_file->data_ind + 1);
322 wbuf = (wbuf + ((2043 - tg_file->data_ind + 1) * 2));
325 /* New record has to be read in */
326 tg_file->data_ind = 0;
327 if((n = tg_read_map_rec(tg_file)) < TG_RECSIZE)
335 fprintf(stderr,"tg_read_map_rec: %d \n",n);
339 if(tg_file->first_rec)
341 tg_file->recnum = tg_file->recbuf.rec_num;
342 tg_file->first_rec = FALSE;
346 if((tg_file->recnum + 1) != tg_file->recbuf.rec_num)
348 tg_file->recnum = tg_file->recbuf.rec_num;
349 /* Set index to next ray */
350 tg_file->data_ind = tg_file->recbuf.first_ray - 5;
351 return(TG_REC_NOSEQ);
355 tg_file->recnum = tg_file->recbuf.rec_num;
358 tg_file->data_ind = 0;
361 memcpy(wbuf,&(tg_file->recbuf.data[tg_file->data_ind]),wsize*2);
362 tg_file->data_ind = tg_file->data_ind + wsize;
367 int tg_read_map_rec(tg_file_str *tg_file)
370 static char buf[TG_RECSIZE];
372 if((n = read(tg_file->fd,buf,TG_RECSIZE)) < 0)
374 fprintf(stderr,"tg_read_map_rec: Error while reading data record.\n");
375 fprintf(stderr,"tg_read_map_rec: (%d)%s\n",errno,strerror(errno));
379 /* assume end of file */
381 else if(n != TG_RECSIZE)
383 fprintf(stderr,"tg_read_map_rec: Did not read all of data record.\n\007");
384 fprintf(stderr,"tg_read_map_rec: Bytes read: %d \n",n);
388 if(tg_file->swap_bytes)
390 /* record read in correctly */
391 swab(buf,&(tg_file->recbuf),TG_RECSIZE);
395 memcpy(&(tg_file->recbuf),buf,TG_RECSIZE);
403 void tg_decode_ray_data(tg_file_str *tg_file,short ray_buf[])
406 short dbval,vel,temp1,temp2;
410 k = 0; /* intialize ray->data index */
411 switch (tg_file->ray_head.type)
414 /* TOGA record type 1 contains uncorrected & corrected
415 reflectivity data, velocity, and spectrum width values. */
416 tg_file->ray.da_inv[TG_DM_IND] = TRUE;
417 tg_file->ray.da_inv[TG_DZ_IND] = TRUE;
418 tg_file->ray.da_inv[TG_VR_IND] = TRUE;
419 tg_file->ray.da_inv[TG_SW_IND] = TRUE;
421 tg_file->ray.num_bins[TG_DM_IND] = tg_file->ray_head.srngkill - 1;
422 tg_file->ray.num_bins[TG_DZ_IND] = tg_file->ray_head.srngkill - 1;
423 tg_file->ray.num_bins[TG_VR_IND] = tg_file->ray_head.srngkill - 1;
424 tg_file->ray.num_bins[TG_SW_IND] = tg_file->ray_head.srngkill - 1;
426 tg_file->ray.start_km[TG_DM_IND] = tg_file->ray_head.strt_rng/40.0;
427 tg_file->ray.start_km[TG_DZ_IND] = tg_file->ray_head.strt_rng/40.0;
428 tg_file->ray.start_km[TG_VR_IND] = tg_file->ray_head.strt_rng/40.0;
429 tg_file->ray.start_km[TG_SW_IND] = tg_file->ray_head.strt_rng/40.0;
431 tg_file->ray.interval_km[TG_DM_IND] = tg_file->map_head.rnginc/1000.0;
432 tg_file->ray.interval_km[TG_DZ_IND] = tg_file->map_head.rnginc/1000.0;
433 tg_file->ray.interval_km[TG_VR_IND] = tg_file->map_head.rnginc/1000.0;
434 tg_file->ray.interval_km[TG_SW_IND] = tg_file->map_head.rnginc/1000.0;
436 for (j=0; j<tg_file->ray.num_bins[TG_DM_IND]; j++)
438 /* check OK flag bit to see if this is valid data */
439 if ((ray_buf[j*3] & 0x8000) == 0)
441 /* bad data, store no_data flag into each field */
442 tg_file->ray.data[TG_DM_IND][k] = TG_NO_DATA;
443 tg_file->ray.data[TG_DZ_IND][k] = TG_NO_DATA;
444 tg_file->ray.data[TG_VR_IND][k] = TG_NO_DATA;
445 tg_file->ray.data[TG_SW_IND][k] = TG_NO_DATA;
447 else /* good data, uncode and store into tg_ray_data struct */
449 /******* do corrected dbz value *********/
450 dbval = ray_buf[j*3 + 1] & 0x0FFF;
451 /* The dbz data are signed 12 bit values. Check sign bit
453 if ((dbval & 0x0800) == 0)
455 /* store unscaled positive dbz value */
456 tg_file->ray.data[TG_DZ_IND][k] = dbval/16.0;
458 else /* 12 bit negative value */
460 /* make 12 bit value a 16 bit word by extending sign bit */
461 dbval = (dbval | ~0x0FFF);
462 if (dbval == -2048) /* -2048 indicates bad data */
464 tg_file->ray.data[TG_DZ_IND][k] = TG_NO_DATA; /* bad data */
468 /* store unscaled negative dbz value */
469 tg_file->ray.data[TG_DZ_IND][k] = dbval/16.0;
474 /******* do uncorrected dbz value *********/
475 dbval = ray_buf[j*3 + 2] & 0x0FFF;
476 /* The dbz data are signed 12 bit values. Check sign bit
478 if ((dbval & 0x0800) == 0)
480 /* store unscaled positive dbz value */
481 tg_file->ray.data[TG_DM_IND][k] = dbval/16.0;
483 else /* 12 bit negative value */
485 /* make 12 bit value a 16 bit word by extending sign bit */
486 dbval = (dbval | ~0x0FFF);
487 if (dbval == -2048) /* -2048 indicates bad data */
489 tg_file->ray.data[TG_DM_IND][k] = TG_NO_DATA; /* bad data */
493 /* store unscaled negative dbz value */
494 tg_file->ray.data[TG_DM_IND][k] = dbval/16.0;
498 /* compute the nyquist velocity for subsequent scaling
499 of velocity and spectrum width values. */
500 /* nyquist velocity = wavelength/(4*pulse repetition period) */
501 nyq_vel = (tg_file->map_head.wavelen/10000.0) /
502 (4.0*(1.0/tg_file->map_head.prf)); /*m/s*/
504 /******** do velocity value **********/
505 /* toga velocity values are 10 bits long and range from
507 vel = ray_buf[j*3] & 0x03FF; /* strip off leading 6 bits */
508 /* This is a signed 10 bit value. Check sign bit */
509 if ((vel & 0x0200) == 0) /* sign bit set? */
511 /* no, store positive velocity value */
512 tg_file->ray.data[TG_VR_IND][k] = vel/511.0*nyq_vel;
514 else /* 10 bit negative value */
516 /* make 10 bit value a 16 bit word by extending sign bit */
518 /* store negative velocity value */
519 tg_file->ray.data[TG_VR_IND][k] = vel/512.0*nyq_vel;
522 /******** do spectrum width ***********/
523 /* toga spectrum width values are 8 bits and range from
524 zero to 1/2 . see toga documentation */
525 /* get the low order 4 bits into their correct positions */
526 temp1 = (ray_buf[j*3 + 1] >> 12) & 0x000F;
527 /* get the high order 4 bits into correct positions */
528 temp2 = (ray_buf[j*3 + 2] >> 8) & 0x00F0;
529 /* store the spectrum width value into tg_ray_data struct */
530 tg_file->ray.data[TG_SW_IND][k] = ((temp1 | temp2)/512.0)*nyq_vel;
537 case 19: /* uncorrected reflectivity data */
538 /* TOGA record type 19 contains only uncorrected reflectivity values */
539 tg_file->ray.da_inv[TG_DM_IND] = TRUE;
540 tg_file->ray.da_inv[TG_DZ_IND] = FALSE;
541 tg_file->ray.da_inv[TG_VR_IND] = FALSE;
542 tg_file->ray.da_inv[TG_SW_IND] = FALSE;
543 tg_file->ray.num_bins[TG_DM_IND] = tg_file->ray_head.srngkill - 1;
544 tg_file->ray.start_km[TG_DM_IND] = tg_file->ray_head.strt_rng/40.0;
545 tg_file->ray.interval_km[TG_DM_IND] = tg_file->map_head.rnginc/1000.0;
547 for (j=0; j<tg_file->ray.num_bins[TG_DM_IND]; j++)
549 /* check OK flag bit to see if this is valid data */
550 if ((ray_buf[j] & 0x8000) == 0)
552 tg_file->ray.data[TG_DM_IND][k] = TG_NO_DATA; /* bad data, store flag */
554 else /* good data, uncode it and store into ray->data */
556 dbval = ray_buf[j] & 0x7FFF; /* strip off OK flag */
557 /* This is a signed 15 bit dbz value. Check sign bit */
558 if ((dbval & 0x4000) == 0) /* sign bit set? */
560 /* no, positive db value. Unscale by factor of 16 and store */
561 tg_file->ray.data[TG_DM_IND][k] = dbval/16.0;
563 else /* 15 bit negative value */
565 /* make 15 bit value a 16 bit word by extending sign bit,
566 unscale by factor of 16 and store. */
567 tg_file->ray.data[TG_DM_IND][k] = (dbval | ~0x7FFF)/16.0;
573 break; /* case 19: */
576 fprintf(stderr,"tg_decode_ray_data: found unknown toga data type\n");
577 fprintf(stderr,"tg_decode_ray_data: ignore this ray\n");
578 /* return TG_RAY_NOTYPE; */
587 int tg_read_ray(tg_file_str *tg_file)
593 /* bin_size is size in bytes of data from one bin */
595 n = tg_read_map_bytes(tg_file,&(tg_file->ray_head),sizeof(tg_ray_head_str));
599 /* plog("tg_read_ray: TG_END_DATA for ray_head\n",LOG); */
602 /* plog("tg_read_ray: TG_REC_NOSEQ for ray_head\n",LOG); */
606 /* plog("tg_read_ray: zero bytes for ray_head\n",LOG); */
609 /* plog("tg_read_ray: error for ray_head\n",LOG); */
612 tg_file->ray.azm = tg_make_ang(tg_file->ray_head.azm);
613 tg_file->ray.elev = tg_make_ang(tg_file->ray_head.elev);
615 switch(tg_file->ray_head.type)
618 /* plog("tg_read_ray:doppler data\n",LOG); */
619 bin_size = 6 * (tg_file->map_head.numbin);
622 /* plog("tg_read_ray:reflectivity data\n",LOG); */
623 bin_size = 2 * (tg_file->map_head.numbin);
626 /* plog("tg_read_ray:undefined data type\n",PRINT); */
627 return TG_RAY_NOTYPE;
631 /* read ray contents from disk file into ray_buf */
632 if((o = tg_read_map_bytes(tg_file,ray_buf,bin_size)) == bin_size)
634 /* decode the raw ray data in ray_buf[] and place into
635 the tg_file ray structure */
636 tg_decode_ray_data(tg_file,ray_buf);
640 fprintf(stderr,"*** wrong number of bytes read from ray ***\n");
641 fprintf(stderr,"\n,number_bytes read:%d\n",o);
642 return TG_RAY_READ_ERR;
645 /* read end_of_ray flag from disk file */
648 while((o != TG_END_RAY) && (a < 100))
650 o=tg_read_map_bytes(tg_file,ray_buf,2);
655 fprintf(stderr,"tg_read_ray: Could not find TG_END_RAY\n");
656 return TG_RAY_READ_ERR;
664 void tg_prt_head(tg_map_head_str *head,int verbose)
666 /* print out the contents of a file map header */
670 plog("strm_year: %d\n",PLOG_L,head->strm_year);
671 plog("strm_mon: %d\n",PLOG_L,head->strm_mon);
672 plog("strm_day: %d\n",PLOG_L,head->strm_day);
673 plog("strm_num: %d\n",PLOG_L,head->strm_num);
674 plog("map_num: %d\n",PLOG_L,head->map_num);
676 plog("scan_year: %d\n",PLOG_L,head->scan_year);
677 plog("scan_mon: %d\n",PLOG_L,head->scan_mon);
678 plog("scan_day: %d\n",PLOG_L,head->scan_day);
679 plog("scan_hour: %d\n",PLOG_L,head->scan_hour);
680 plog("scan_min: %d\n",PLOG_L,head->scan_min);
681 plog("scan_sec: %d\n",PLOG_L,head->scan_sec);
682 plog("data_set: %d\n",PLOG_L,head->data_set);
686 plog("tp1_ar: %d\n",PLOG_L,head->tp1_ar);
687 plog("tp1_occw: %d\n",PLOG_L,head->tp1_occw);
688 plog("tp1_dibit: %d\n",PLOG_L,head->tp1_dibit);
689 plog("tp1_debit: %d\n",PLOG_L,head->tp1_debit);
691 plog("tp2_ar: %d\n",PLOG_L,head->tp2_ar);
692 plog("tp2_occw: %d\n",PLOG_L,head->tp2_occw);
693 plog("tp2_dibit: %d\n",PLOG_L,head->tp2_dibit);
694 plog("tp2_debit: %d\n",PLOG_L,head->tp2_debit);
696 plog("status: %d\n",PLOG_L,head->status);
697 plog("strng: %d\n",PLOG_L,head->strng);
698 plog("numbin: %d\n",PLOG_L,head->numbin);
699 plog("rnginc: %d\n",PLOG_L,head->rnginc);
700 plog("rngjit: %d\n",PLOG_L,head->rngjit);
701 plog("numcbin: %d\n",PLOG_L,head->numcbin);
703 plog("strtcal1: %d\n",PLOG_L,head->strtcal1);
704 plog("strtcal2: %d\n",PLOG_L,head->strtcal2);
705 plog("stepcal: %d\n",PLOG_L,head->stepcal);
707 plog("azmleft: %d\n",PLOG_L,head->azmleft);
708 plog("azmrght: %d\n",PLOG_L,head->azmrght);
709 plog("elev_low: %d\n",PLOG_L,head->elev_low);
710 plog("elev_hgh: %d\n",PLOG_L,head->elev_hgh);
712 plog("at_angres: %d\n",PLOG_L,head->at_angres);
713 plog("numfix_ang: %d\n",PLOG_L,head->numfix_ang);
718 plog("angfix[%2d]: %d\n",PLOG_L,a,head->angfix[a]);
721 plog("rlparm: %d\n",PLOG_L,head->rlparm);
722 plog("signois: %d\n",PLOG_L,head->signois);
723 plog("sigcltr: %d\n",PLOG_L,head->sigcltr);
724 plog("thrsh_flg: %d\n",PLOG_L,head->thrsh_flg);
726 plog("numdsp: %d\n",PLOG_L,head->numdsp);
727 plog("numwrd: %d\n",PLOG_L,head->numwrd);
729 plog("scanmod: %d\n",PLOG_L,head->scanmod);
730 plog("filename: %s\n",PLOG_L,head->filename);
732 plog("prf: %d\n",PLOG_L,head->prf);
733 plog("transiz: %d\n",PLOG_L,head->transiz);
734 plog("spconf: %d\n",PLOG_L,head->spconf);
735 plog("sufchar: %d\n",PLOG_L,head->sufchar);
736 plog("recsat1: %d\n",PLOG_L,head->recsat1);
737 plog("recsat2: %d\n",PLOG_L,head->recsat2);
739 plog("dsp1cor_log: %d\n",PLOG_L,head->dsp1cor_log);
740 plog("dsp1cor_iad: %d\n",PLOG_L,head->dsp1cor_iad);
741 plog("dsp1cor_qad: %d\n",PLOG_L,head->dsp1cor_qad);
742 plog("dsp1crr_log: %d\n",PLOG_L,head->dsp1crr_log);
743 plog("dsp1crr_iad: %d\n",PLOG_L,head->dsp1crr_iad);
744 plog("dsp1crr_qad: %d\n",PLOG_L,head->dsp1crr_qad);
746 plog("dsp2cor_log: %d\n",PLOG_L,head->dsp2cor_log);
747 plog("dsp2cor_iad: %d\n",PLOG_L,head->dsp2cor_iad);
748 plog("dsp2cor_qad: %d\n",PLOG_L,head->dsp2cor_qad);
749 plog("dsp2crr_log: %d\n",PLOG_L,head->dsp2crr_log);
750 plog("dsp2crr_iad: %d\n",PLOG_L,head->dsp2crr_iad);
751 plog("dsp2crr_qad: %d\n",PLOG_L,head->dsp2crr_qad);
754 plog("wavelen: %d\n",PLOG_L,head->wavelen);
755 plog("pulsewd: %d\n",PLOG_L,head->pulsewd);
756 plog("hortran_pow: %d\n",PLOG_L,head->hortran_pow);
757 plog("vertran_pow: %d\n",PLOG_L,head->vertran_pow);
761 plog("high_zero: %d\n",PLOG_L,head->high_zero);
763 plog("sitelat: %d\n",PLOG_L,head->sitelat);
764 plog("sitelong: %d\n",PLOG_L,head->sitelong);
765 plog("time_zone: %d\n",PLOG_L,head->time_zone);
769 plog("zm_dsp1_mas: %d\n",PLOG_L,head->zm_dsp1_mas);
770 plog("zm_dsp1_slv: %d\n",PLOG_L,head->zm_dsp1_slv);
771 plog("zm_dsp2_mas: %d\n",PLOG_L,head->zm_dsp2_mas);
772 plog("zm_dsp2_slv: %d\n",PLOG_L,head->zm_dsp2_slv);
774 plog("minz_dsp1_mas: %d\n",PLOG_L,head->minz_dsp1_mas);
775 plog("minz_dsp1_slv: %d\n",PLOG_L,head->minz_dsp1_slv);
776 plog("minz_dsp2_mas: %d\n",PLOG_L,head->minz_dsp2_mas);
777 plog("minz_dsp2_slv: %d\n",PLOG_L,head->minz_dsp2_slv);
779 plog("num_pol: %d\n",PLOG_L,head->num_pol);
780 plog("exinfo_rayhd: %d\n",PLOG_L,head->exinfo_rayhd);
781 plog("len_exhd: %d\n",PLOG_L,head->len_exhd);
784 plog("lat_deg: %d\n",PLOG_L,head->lat_deg);
785 plog("lat_hun_min: %d\n",PLOG_L,head->lat_hun_min);
786 plog("lon_deg: %d\n",PLOG_L,head->lon_deg);
787 plog("lon_hun_min: %d\n",PLOG_L,head->lon_hun_min);
791 plog("alt_atn: %d\n",PLOG_L,head->alt_atn);
792 plog("alt_grn: %d\n",PLOG_L,head->alt_grn);
794 plog("vel_plat: %d\n",PLOG_L,head->vel_plat);
795 plog("vel_cor: %d\n",PLOG_L,head->vel_cor);
796 plog("head_plat: %d\n",PLOG_L,head->head_plat);
797 plog("head_dsp: %d\n",PLOG_L,head->head_dsp);
799 plog("set_plat: %d\n",PLOG_L,head->set_plat);
800 plog("drift_plat: %d\n",PLOG_L,head->drift_plat);
801 plog("ok_plat: %d\n",PLOG_L,head->ok_plat);
803 plog("comments: %s\n",PLOG_L,head->comments);
806 fprintf(stderr, "You must link with -lplog and compile the toga library with -DUSE_PLOG to get a printout of the header.\n");