17 static const int IHI = 59;
18 static const int IWID = 121;
35 STATIC void pltr(
const double[],
const double[],
long,
double,
double,
double,
double,
36 char,
const char*,
long,
bool);
39 void plot(
const char *chCall)
58 for( np=0; np < plotCom.
nplot; np++ )
61 if( strcmp(plotCom.
chPType[np],
" MAP") == 0 )
66 else if( strcmp(plotCom.
chPType[np] ,
"CONT") == 0 ||
67 strcmp(plotCom.
chPType[np] ,
"CRAW") == 0 ||
68 strcmp(plotCom.
chPType[np] ,
"DIFF") == 0 ||
69 strcmp(plotCom.
chPType[np] ,
"REFL") == 0 ||
70 strcmp(plotCom.
chPType[np] ,
"EMIT") == 0 ||
71 strcmp(plotCom.
chPType[np] ,
"CPHT") == 0 ||
72 strcmp(plotCom.
chPType[np] ,
"OUTW") == 0 )
79 strcmp(plotCom.
chPType[np] ,
"OPAA") == 0 ||
80 strcmp(plotCom.
chPType[np] ,
"OPAS") == 0 ||
81 strcmp(plotCom.
chPType[np] ,
"OPAT") == 0 )
119 if( strcmp(chCall,
"FIRST") == 0 )
131 fprintf(
ioQQQ,
" XMIN, XMAX=%12.4e%12.4e NFLUX=%4ld\n",
137 fprintf(
ioQQQ,
" Reflected continuum not computed when SPHERE set.\n" );
146 strcpy( chSymPlt2,
"o " );
154 if( strcmp(plotCom.
chPType[np],
"CONT") == 0 )
163 y2[i] = log10(y2[i]);
165 else if( strcmp(plotCom.
chPType[np],
"CPHT") == 0 )
173 y2[i] = log10(y2[i]);
175 else if( strcmp(plotCom.
chPType[np],
"REFL") == 0 )
182 else if( strcmp(plotCom.
chPType[np],
"EMIT") == 0 )
192 else if( strcmp(plotCom.
chPType[np],
"OUTW") == 0 )
198 strcpy( chSymPlt2,
"o " );
202 else if( strcmp(plotCom.
chPType[np],
"DIFF") == 0 )
209 else if( strcmp(plotCom.
chPType[np],
"CRAW") == 0 )
215 y2[i] = log10(y2[i]);
220 ymin =
MIN2(ymin,(
double)y[i]);
225 ymin2 =
MIN2(ymin2,(
double)y2[i]);
228 ymax =
MAX2(ymax,(
double)y[i]);
229 ymax =
MAX2(ymax,(
double)y2[i]);
235 fprintf(
ioQQQ,
" PLOT called for the first time, YMAX, MIN=%10.2e%10.2e\n",
240 ymin2 =
MAX3(ymax-5.,-35.,ymin2);
243 ymin =
MIN3(ymin2,ymin,ymax-1.);
246 if( strcmp(plotCom.
chPType[np],
"EMIT") == 0 )
248 ymin =
MAX2(ymin,ymax-4.);
257 strcpy( chXtitle,
"Log(nu fnu) vs LOG(nu)" );
264 chSym = chSymPlt2[0];
281 static bool lgTlkSav;
293 if( strcmp(chCall,
"FIRST") == 0 )
345 fprintf(
ioQQQ,
" PLOT called for the first time, YMAX, MIN=%10.2e%10.2e\n",
356 strcpy( chXtitle,
"heating - cooling v te" );
388 if( strcmp(chCall,
"FIRST") == 0 )
403 fprintf(
ioQQQ,
" XMIN, XMAX=%12.4e%12.4e NFLUX=%4ld\n",
412 if( strcmp(plotCom.
chPType[np],
"OPAA") == 0 )
419 else if( strcmp(plotCom.
chPType[np],
"OPAS") == 0 )
426 else if( strcmp(plotCom.
chPType[np],
"OPAT") == 0 )
446 ymin =
MIN3(ymin,y[i],y2[i]);
447 ymax =
MAX3(ymax,y[i],y2[i]);
453 fprintf(
ioQQQ,
" PLOT called for the first time, YMAX, MIN=%10.2e%10.2e\n",
458 ymin =
MAX2(ymin-1.,-35.);
466 strcpy( chXtitle,
"Log(opacity) vs log(n)" );
497 const char *chXtitle,
501 static char chPage[59][122];
510 static const int NDECAD = 19;
512 static long int jpnt[NDECAD],
524 static char chLab[NDECAD][5]={
"1E-9",
"1E-8",
"1E-7",
"1E-6",
"1E-5",
525 "1E-4",
".001",
"0.01",
" 0.1",
" 1 ",
526 " 10 ",
" 100",
"1000",
"1E4 ",
"1E5 ",
"1E6 ",
"1E7 ",
"1E8 ",
"1E9 "};
534 for( i=1; i <
IHI; i++ )
537 for( j=1; j <
IWID; j++ )
544 strcpy( chPage[1],
" " );
545 strcat( chPage[1], chXtitle );
551 yinc = (
realnum)(IHI-2)/(ymax - ymin);
554 while( i <= IHI && nc < 200 )
556 chPage[i-1][1] =
'-';
558 i = (long)(ydown + 1);
563 for( i=0; i <
IWID; i++ )
565 chPage[IHI-1][i] =
'-';
568 if( xmin < xAxisMin )
570 fprintf(
ioQQQ,
" plts: xmin is less than min value in array\n");
576 lx = (long)(4.999-fabs(xmin));
579 lx = (long)(fabs(xAxisMin)-0.001-fabs(xmin));
582 xdec = -floor(fabs(xmin)+1e-5);
587 lx = (long)
MAX2(0.,4.+xmin);
589 lx = (long)
MAX2(0.,4.+xmin);
592 lx = (long)
MAX2(0., aa-1. + xmin );
593 xdec = floor(xmin+1e-5);
597 xinc = (
realnum)(IWID-1)/(xmax - xmin);
598 i = (long)
MAX2(1.,(xdec-xmin)*xinc+1.);
601 while( i < IWID && nc < 100 )
603 chPage[IHI-2][i - 1] =
'l';
606 lx =
MIN2(lx+1,NDECAD);
609 jpnt[lx-1] =
MAX2(0,i-3);
610 jpnt[lx-1] =
MIN2((
long)IWID-4,jpnt[lx-1]);
612 i = (long)
MAX2(1.,(xdec-xmin)*xinc+1.);
619 for( i=0; i < npnts; i++ )
621 if( (
double)x[i] > xmin && (double)x[i] < xmax )
623 iy = (long)(
IHI -
MAX2(y[i]-ymin,0.)*yinc);
625 ix = (long)((x[i] - xmin)*xinc + 1);
630 x[i], y[i], ix, iy );
632 chPage[iy-1][ix - 1] = chSym;
640 for( i=1; i <
IHI; i++ )
646 for( i=0; i <
IWID; i++ )
651 for( i=lowx-1; i < lx; i++ )
654 strncpy(chPage[0]+jpnt[i] , chLab[i+1] , 4);
double * opacity_abs_savzon1
void plot(const char *chCall)
STATIC void pltr(const double[], const double[], long, double, double, double, double, char, const char *, long, bool)
double widflx(size_t i) const
STATIC void pltcon(long int np, const char *chCall)
realnum ** flux_total_incident
double anu(size_t i) const
long int nflux_with_check
double anu2(size_t i) const
void map_do(FILE *io, const char *chType)
realnum gas_phase[LIMELM]
STATIC void pltmap(long int np, const char *chCall)
double * opacity_sct_savzon1
#define DEBUG_ENTRY(funcname)
int fprintf(const Output &stream, const char *format,...)
STATIC void pltopc(long int np, const char *chCall)
double anulog10(size_t i) const
const double * anulog10ptr() const