Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xgraphic.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <signal.h>
#include <time.h>
#include <termios.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include "observing_par.h"
#include "cactus.h"
#include "sex.h"
#include "global.h"
#include "gaussian.h"
#include "image.h"
#include "flux.h"
#include "accum.h"
#include "focus.h"
#include "object.h"
#include "lp_fft.h"
#include "strings_and_things.h"
#include "histogram.h"
#include "tsys.h"
#include "scan_sum.h"
#include "loglib.h"
#include "colors.h"
#include "caclib_proto.h"
#include "linuxlib_proto.h"
#include "proto.h"

Go to the source code of this file.

Macros

#define DEFINE_COLORS_STRINGS
 
#define TRUE   1
 
#define FALSE   0
 
#define LAST_IMAGE_INFO   1
 
#define LAST_FLUX_INFO   2
 
#define LAST_ACCUM_RESULTS   3
 
#define LAST_FLUX_HISTORY   4
 
#define LAST_CONTINUUM_PLAIN   5
 
#define LAST_CONTINUUM_SPTIP   6
 
#define LAST_OBJECT_HISTORY   7
 
#define LAST_FFT_INFO   8
 
#define LAST_HISTO_INFO   9
 
#define LAST_TSYS_INFO   10
 
#define LAST_SSS_INFO   11
 
#define LAST_FOCUS_HISTORY   12
 
#define PLOT   1
 
#define PRINT   2
 
#define SINGLE   1
 
#define MULTI   2
 
#define SAVE_DEM_FILE   1
 
#define NEW_MAKE   1
 
#define MAX_BUF_SIZE   (sizeof(last_image)+256)
 
#define MAX_GNUPLOT_INITS   13
 

Functions

int computeXaxis (struct LP_IMAGE_INFO *image, int logit)
 
int setColor (int c)
 
int gnuplot_init (char *term)
 
int closeGnuplot ()
 
int writeGnuplot (char *buf, int delay)
 
int readGnuplot (char *buf)
 
int isBadChan (struct LP_IMAGE_INFO *image, int bad)
 
char * makeDate (double d)
 
char * makeFrStr (double freqres)
 
int makeLineHeader (struct LP_IMAGE_INFO *image, char *buf)
 
int makeFFTHeader (struct FFT_INFO *fft, char *buf)
 
int makeSSSHeader (struct SCAN_SUM_SEND *ss, char *buf)
 
int makeHistoHeader (struct HISTO_INFO *histo, char *buf)
 
int makeContHeader (struct HEADER *h, struct ACCUM_RESULTS_SEND *a, char *buf)
 
int displayFFT (struct FFT_INFO *fft, int how)
 
int displayHisto (struct HISTO_INFO *histo, int how)
 
int logImageInfo (struct LP_IMAGE_INFO *image)
 
int makeOSB (struct HEADER *h)
 
int placeGauss (struct LP_IMAGE_INFO *image, FILE *fp, int print)
 
int placeLabels (struct LP_IMAGE_INFO *image, FILE *fp, int print)
 
int placeTBlock (struct LP_IMAGE_INFO *image, FILE *fp, int print)
 
int placeBadChans (struct LP_IMAGE_INFO *image, FILE *fp)
 
int placeChanMarkers (struct LP_IMAGE_INFO *image, FILE *fp)
 
int placeMarkers (struct LP_IMAGE_INFO *image, FILE *fp)
 
int placeHlines (struct LP_IMAGE_INFO *image, FILE *fp)
 
int placeForks (struct LP_IMAGE_INFO *image, FILE *fp, int how)
 
int placeDate (struct LP_IMAGE_INFO *image, FILE *fp)
 
int getSize (int s)
 
int placePstamps (struct LP_IMAGE_INFO *image, FILE *fp)
 
int placeBmark (struct LP_IMAGE_INFO *image, FILE *fp)
 
int setPaperSize (double w, double h, char *psize, char *fsize)
 
int makeGfile (struct LP_IMAGE_INFO *image, char *gname, FILE *fp)
 
int makeBfile (struct LP_IMAGE_INFO *image, char *bshape, FILE *fp)
 
int makeBshow (struct LP_IMAGE_INFO *image, char *bname, FILE *fp)
 
int makeZline (struct LP_IMAGE_INFO *image, char *zname, FILE *fp)
 
int makeHeaderAndLabels (struct LP_IMAGE_INFO *image, FILE *fp, int mode, int how)
 
int linePlot_1 (struct LP_IMAGE_INFO *image, int how)
 
int linePlot_2 (struct LP_IMAGE_INFO *image, int how)
 
int linePlot_4 (struct LP_IMAGE_INFO *image, int how)
 
int plotXcor (struct LP_IMAGE_INFO *image, int how)
 
int find_ticks (struct LP_IMAGE_INFO *image)
 
int fluxPlot (struct FLUX_INFO *flux, int how)
 
int accumPlot (struct ACCUM_RESULTS_SEND *a, int how)
 
int contPlot (struct CONTINUUM_PLAIN *cp, int how)
 
int plotFluxHistory (struct FLUX_HISTORY *f, int how)
 
int plotFocusHistory (struct FOCUS_HISTORY_SEND *f, int how)
 
int contSptipPlot (struct CONTINUUM_SPTIP *cs, int how)
 
int displayObjHistory (struct OBJECT *obj, int how)
 
int displayTsys (struct TSYS_SEND *tsys, int how)
 
int displayScanSum (struct SCAN_SUM_SEND *ss, int how)
 
int startGnuPlot ()
 
int sendPlotRange (double xmin, double xmax, double ymin, double ymax)
 
int sendMousePosition (double x, double y, double x2, double y2)
 
int sendMapAngle (double ang1, double ang2)
 
int parseGnuplot (char *buf)
 
int make ()
 
int main (int argc, argv)
 

Variables

char * firstArg = "H0"
 
char * kp_sideband [] = { "H-LSB", "H-USB", "V-LSB", "V-USB" }
 
char * mg_sideband [] = { "H-LSB", "H-USB", "V-LSB", "V-USB" }
 
char * sideband [] = { "LSB", "USB", "LSB", "USB" }
 
char * prompt = "Xgraphics >>"
 
char * papersize = "10, 7.5"
 
char fsize [256]
 
char psize [256]
 
char * mouse_str = "print \"MOUSE: \", MOUSE_X, \" \", MOUSE_X2, \" \", MOUSE_Y, \" \", MOUSE_Y2"
 
char * map_ang_str = "print \"MAP_ANGLE: \", GPVAL_VIEW_ROT_X, \" \", GPVAL_VIEW_ROT_Z"
 
char * get_range_str = "print \"PLOT_RANGE: \", GPVAL_X_MIN, \" \", GPVAL_X_MAX, \" \", GPVAL_Y_MIN, \" \", GPVAL_Y_MAX"
 
char session [80]
 
char * focus_axis_str [] = { "AX", "NS", "EW" }
 
struct SOCK * master
 
int gnuplot_pid
 
int lastPlot = LAST_IMAGE_INFO
 
int displayW = 1920
 
int displayH = 1080
 
int startx = 1920-800
 
double plot_interval
 
FILE * errPrint_fp = NULL
 
struct LP_IMAGE_INFO last_image
 
struct ACCUM_RESULTS_SEND ars
 
struct FLUX_INFO last_flux
 
struct FLUX_HISTORY fh
 
struct CONTINUUM_PLAIN last_plain_send
 
struct CONTINUUM_SPTIP last_sptip_send
 
struct OBJECT last_obj
 
struct FFT_INFO last_fft
 
struct HISTO_INFO last_histo
 
struct STRINGS_AND_THINGS sat
 
struct TSYS_SEND last_tsys
 
struct SCAN_SUM_SEND sss
 
struct XGRAPHIC_SEND xsend
 
struct FOCUS_HISTORY_SEND focus_send
 
char * plotStyleStrs []
 
FILE * gpout
 
FILE * gpin
 
int stquiet
 
int recursiveLevel
 
int verboseLevel
 
int lp_logging
 
char osbStr [32]
 
char * gnuplot_inits []
 
char gpfifo [256]
 

Macro Definition Documentation

#define DEFINE_COLORS_STRINGS

Definition at line 32 of file xgraphic.c.

#define FALSE   0

Definition at line 40 of file xgraphic.c.

#define LAST_ACCUM_RESULTS   3

Definition at line 44 of file xgraphic.c.

#define LAST_CONTINUUM_PLAIN   5

Definition at line 46 of file xgraphic.c.

#define LAST_CONTINUUM_SPTIP   6

Definition at line 47 of file xgraphic.c.

#define LAST_FFT_INFO   8

Definition at line 49 of file xgraphic.c.

#define LAST_FLUX_HISTORY   4

Definition at line 45 of file xgraphic.c.

#define LAST_FLUX_INFO   2

Definition at line 43 of file xgraphic.c.

#define LAST_FOCUS_HISTORY   12

Definition at line 53 of file xgraphic.c.

#define LAST_HISTO_INFO   9

Definition at line 50 of file xgraphic.c.

#define LAST_IMAGE_INFO   1

Definition at line 42 of file xgraphic.c.

#define LAST_OBJECT_HISTORY   7

Definition at line 48 of file xgraphic.c.

#define LAST_SSS_INFO   11

Definition at line 52 of file xgraphic.c.

#define LAST_TSYS_INFO   10

Definition at line 51 of file xgraphic.c.

#define MAX_BUF_SIZE   (sizeof(last_image)+256)

Definition at line 110 of file xgraphic.c.

#define MAX_GNUPLOT_INITS   13

Definition at line 148 of file xgraphic.c.

#define MULTI   2

Definition at line 59 of file xgraphic.c.

#define NEW_MAKE   1

Definition at line 63 of file xgraphic.c.

#define PLOT   1

Definition at line 55 of file xgraphic.c.

#define PRINT   2

Definition at line 56 of file xgraphic.c.

#define SAVE_DEM_FILE   1

Definition at line 61 of file xgraphic.c.

#define SINGLE   1

Definition at line 58 of file xgraphic.c.

#define TRUE   1

Definition at line 39 of file xgraphic.c.

Function Documentation

int accumPlot ( struct ACCUM_RESULTS_SEND *  a,
int  how 
)

Definition at line 2754 of file xgraphic.c.

int closeGnuplot ( void  )

Definition at line 268 of file xgraphic.c.

int computeXaxis ( struct LP_IMAGE_INFO *  image,
int  logit 
)

Definition at line 70 of file xaxis.c.

int contPlot ( struct CONTINUUM_PLAIN *  cp,
int  how 
)

Definition at line 3211 of file xgraphic.c.

int contSptipPlot ( struct CONTINUUM_SPTIP *  cs,
int  how 
)

Definition at line 3674 of file xgraphic.c.

int displayFFT ( struct FFT_INFO *  fft,
int  how 
)

Definition at line 654 of file xgraphic.c.

int displayHisto ( struct HISTO_INFO *  histo,
int  how 
)

Definition at line 729 of file xgraphic.c.

int displayObjHistory ( struct OBJECT *  obj,
int  how 
)

Definition at line 3850 of file xgraphic.c.

int displayScanSum ( struct SCAN_SUM_SEND *  ss,
int  how 
)

Definition at line 4385 of file xgraphic.c.

int displayTsys ( struct TSYS_SEND *  tsys,
int  how 
)

Definition at line 4292 of file xgraphic.c.

int find_ticks ( struct LP_IMAGE_INFO *  image)

Definition at line 2588 of file xgraphic.c.

int fluxPlot ( struct FLUX_INFO *  flux,
int  how 
)

Definition at line 2685 of file xgraphic.c.

int getSize ( int  s)

Definition at line 1342 of file xgraphic.c.

int gnuplot_init ( char *  term)

Definition at line 171 of file xgraphic.c.

int isBadChan ( struct LP_IMAGE_INFO *  image,
int  bad 
)

Definition at line 353 of file xgraphic.c.

int linePlot_1 ( struct LP_IMAGE_INFO *  image,
int  how 
)

Definition at line 1816 of file xgraphic.c.

int linePlot_2 ( struct LP_IMAGE_INFO *  image,
int  how 
)

Definition at line 2108 of file xgraphic.c.

int linePlot_4 ( struct LP_IMAGE_INFO *  image,
int  how 
)

Definition at line 2250 of file xgraphic.c.

int logImageInfo ( struct LP_IMAGE_INFO *  image)

Definition at line 826 of file xgraphic.c.

int main ( int  argc,
argv   
)

Definition at line 4696 of file xgraphic.c.

int make ( )

Definition at line 4671 of file xgraphic.c.

int makeBfile ( struct LP_IMAGE_INFO *  image,
char *  bshape,
FILE *  fp 
)

Definition at line 1578 of file xgraphic.c.

int makeBshow ( struct LP_IMAGE_INFO *  image,
char *  bname,
FILE *  fp 
)

Definition at line 1607 of file xgraphic.c.

int makeContHeader ( struct HEADER *  h,
struct ACCUM_RESULTS_SEND *  a,
char *  buf 
)

Definition at line 604 of file xgraphic.c.

char* makeDate ( double  d)

Definition at line 370 of file xgraphic.c.

int makeFFTHeader ( struct FFT_INFO *  fft,
char *  buf 
)

Definition at line 481 of file xgraphic.c.

char* makeFrStr ( double  freqres)

Definition at line 410 of file xgraphic.c.

int makeGfile ( struct LP_IMAGE_INFO *  image,
char *  gname,
FILE *  fp 
)

Definition at line 1529 of file xgraphic.c.

int makeHeaderAndLabels ( struct LP_IMAGE_INFO *  image,
FILE *  fp,
int  mode,
int  how 
)

Definition at line 1668 of file xgraphic.c.

int makeHistoHeader ( struct HISTO_INFO *  histo,
char *  buf 
)

Definition at line 564 of file xgraphic.c.

int makeLineHeader ( struct LP_IMAGE_INFO *  image,
char *  buf 
)

Definition at line 431 of file xgraphic.c.

int makeOSB ( struct HEADER *  h)

Definition at line 938 of file xgraphic.c.

int makeSSSHeader ( struct SCAN_SUM_SEND *  ss,
char *  buf 
)

Definition at line 523 of file xgraphic.c.

int makeZline ( struct LP_IMAGE_INFO *  image,
char *  zname,
FILE *  fp 
)

Definition at line 1638 of file xgraphic.c.

int parseGnuplot ( char *  buf)

Definition at line 4611 of file xgraphic.c.

int placeBadChans ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1147 of file xgraphic.c.

int placeBmark ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1435 of file xgraphic.c.

int placeChanMarkers ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1175 of file xgraphic.c.

int placeDate ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1315 of file xgraphic.c.

int placeForks ( struct LP_IMAGE_INFO *  image,
FILE *  fp,
int  how 
)

Definition at line 1249 of file xgraphic.c.

int placeGauss ( struct LP_IMAGE_INFO *  image,
FILE *  fp,
int  print 
)

Definition at line 955 of file xgraphic.c.

int placeHlines ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1224 of file xgraphic.c.

int placeLabels ( struct LP_IMAGE_INFO *  image,
FILE *  fp,
int  print 
)

Definition at line 999 of file xgraphic.c.

int placeMarkers ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1200 of file xgraphic.c.

int placePstamps ( struct LP_IMAGE_INFO *  image,
FILE *  fp 
)

Definition at line 1397 of file xgraphic.c.

int placeTBlock ( struct LP_IMAGE_INFO *  image,
FILE *  fp,
int  print 
)

Definition at line 1106 of file xgraphic.c.

int plotFluxHistory ( struct FLUX_HISTORY *  f,
int  how 
)

Definition at line 3380 of file xgraphic.c.

int plotFocusHistory ( struct FOCUS_HISTORY_SEND *  f,
int  how 
)

Definition at line 3446 of file xgraphic.c.

int plotXcor ( struct LP_IMAGE_INFO *  image,
int  how 
)

Definition at line 2479 of file xgraphic.c.

int readGnuplot ( char *  buf)

Definition at line 309 of file xgraphic.c.

int sendMapAngle ( double  ang1,
double  ang2 
)

Definition at line 4590 of file xgraphic.c.

int sendMousePosition ( double  x,
double  y,
double  x2,
double  y2 
)

Definition at line 4569 of file xgraphic.c.

int sendPlotRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Definition at line 4550 of file xgraphic.c.

int setColor ( int  c)

Definition at line 151 of file xgraphic.c.

int setPaperSize ( double  w,
double  h,
char *  psize,
char *  fsize 
)

Definition at line 1484 of file xgraphic.c.

int startGnuPlot ( void  )

Definition at line 4529 of file xgraphic.c.

int writeGnuplot ( char *  buf,
int  delay 
)

Definition at line 289 of file xgraphic.c.

Variable Documentation

struct ACCUM_RESULTS_SEND ars

Definition at line 96 of file xgraphic.c.

int displayH = 1080

Definition at line 88 of file xgraphic.c.

int displayW = 1920

Definition at line 87 of file xgraphic.c.

FILE* errPrint_fp = NULL

Definition at line 93 of file xgraphic.c.

struct FLUX_HISTORY fh

Definition at line 98 of file xgraphic.c.

char* firstArg = "H0"

Definition at line 67 of file xgraphic.c.

char* focus_axis_str[] = { "AX", "NS", "EW" }

Definition at line 82 of file xgraphic.c.

struct FOCUS_HISTORY_SEND focus_send

Definition at line 108 of file xgraphic.c.

char fsize[256]

Definition at line 75 of file xgraphic.c.

char* get_range_str = "print \"PLOT_RANGE: \", GPVAL_X_MIN, \" \", GPVAL_X_MAX, \" \", GPVAL_Y_MIN, \" \", GPVAL_Y_MAX"

Definition at line 78 of file xgraphic.c.

char* gnuplot_inits[]
Initial value:
= {
"bind m \"x = 1\"",
"bind a \"x = 1\"",
"bind g \"x = 1\"",
"bind h \"x = 1\"",
"bind l \"x = 1\"",
"bind L \"x = 1\"",
"bind 1 \"x = 1\"",
"bind 2 \"x = 1\"",
"bind 3 \"x = 1\"",
"bind 4 \"x = 1\"",
"bind 5 \"x = 1\"",
"bind 6 \"x = 1\"",
"bind 7 \"x = 1\"",
NULL
}

Definition at line 132 of file xgraphic.c.

int gnuplot_pid

Definition at line 85 of file xgraphic.c.

char gpfifo[256]

Definition at line 169 of file xgraphic.c.

FILE * gpin

Definition at line 118 of file xgraphic.c.

FILE* gpout

Definition at line 118 of file xgraphic.c.

char* kp_sideband[] = { "H-LSB", "H-USB", "V-LSB", "V-USB" }

Definition at line 69 of file xgraphic.c.

struct FFT_INFO last_fft

Definition at line 102 of file xgraphic.c.

struct FLUX_INFO last_flux

Definition at line 97 of file xgraphic.c.

struct HISTO_INFO last_histo

Definition at line 103 of file xgraphic.c.

struct LP_IMAGE_INFO last_image

Definition at line 95 of file xgraphic.c.

struct OBJECT last_obj

Definition at line 101 of file xgraphic.c.

struct CONTINUUM_PLAIN last_plain_send

Definition at line 99 of file xgraphic.c.

struct CONTINUUM_SPTIP last_sptip_send

Definition at line 100 of file xgraphic.c.

struct TSYS_SEND last_tsys

Definition at line 105 of file xgraphic.c.

int lastPlot = LAST_IMAGE_INFO

Definition at line 86 of file xgraphic.c.

int lp_logging

Definition at line 124 of file xgraphic.c.

char* map_ang_str = "print \"MAP_ANGLE: \", GPVAL_VIEW_ROT_X, \" \", GPVAL_VIEW_ROT_Z"

Definition at line 77 of file xgraphic.c.

struct SOCK* master

Definition at line 84 of file xgraphic.c.

char* mg_sideband[] = { "H-LSB", "H-USB", "V-LSB", "V-USB" }

Definition at line 70 of file xgraphic.c.

char* mouse_str = "print \"MOUSE: \", MOUSE_X, \" \", MOUSE_X2, \" \", MOUSE_Y, \" \", MOUSE_Y2"

Definition at line 76 of file xgraphic.c.

char osbStr[32]

Definition at line 128 of file xgraphic.c.

char* papersize = "10, 7.5"

Definition at line 74 of file xgraphic.c.

double plot_interval

Definition at line 91 of file xgraphic.c.

char* plotStyleStrs[]
Initial value:
= { "histeps",
"lines",
"points",
"linespoints"
}

Definition at line 112 of file xgraphic.c.

char* prompt = "Xgraphics >>"

Definition at line 73 of file xgraphic.c.

char psize[256]

Definition at line 75 of file xgraphic.c.

int recursiveLevel

Definition at line 122 of file xgraphic.c.

struct STRINGS_AND_THINGS sat

Definition at line 104 of file xgraphic.c.

char session[80]

Definition at line 80 of file xgraphic.c.

char* sideband[] = { "LSB", "USB", "LSB", "USB" }

Definition at line 71 of file xgraphic.c.

struct SCAN_SUM_SEND sss

Definition at line 106 of file xgraphic.c.

int startx = 1920-800

Definition at line 89 of file xgraphic.c.

int stquiet

Definition at line 121 of file xgraphic.c.

int verboseLevel

Definition at line 123 of file xgraphic.c.

struct XGRAPHIC_SEND xsend

Definition at line 107 of file xgraphic.c.