/* Balloon Laue-lens optimization. Niels Lund March 2006. */ /* Three-layer lens version December 2018 - March 2019 */ /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* */ /* Three layer Bragg telescope, Niels Lund, December 2018 */ /* */ /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* */ /* Overall description of program assumptions and logic */ /* 1) The lens consists of three layers of crystal facets, each layer arranged in a hexagonal pattern */ /* */ /* 2) The centers of the crystals in each layer are offset from the other two layers so as to obtain */ /* the uniform coverage of the three layers combined. */ /* */ /* 3) The lens may be divided into a number of radial zones. Within each zone the diffraction option in */ /* all three layers are kept constant. (The diffraction option specifies the crystal type (Z), the */ /* diffracton order and type (Miller index) and the mosaic width). However, the crystal thickness may */ /* vary smoothly across the zone to optimize the diffraction yield over the energy bands diffracted */ /* from this zone. */ /* The number of zones and their characteristics are defined in the parameter file ZONES.dat */ /* */ /* Program logic: (Program parts are separated by the string 'QQQQQ' */ /* */ /* A) Define the (X,Y) coordinates of all the facet positions in the three layers. Assign zones to facets */ /* Line QQQ01 (422) - QQQ02 (470). */ /* */ /* B) Establish neighbor relations between facets in layer 1 with 2, 2 with 3 and 3 with 1. */ /* Line QQQ03 (570) - QQQ04 (470). */ /* */ /* C) Assign diffraction options to facets according to the specifications in 'ZONES.dat'. */ /* Note that some facet positions may be left empty. */ /* Line QQQ05 (570) - QQQ06 (470). */ /* */ /* D) Choose the thickness of each facet according to its diffraction efficiency, absorption properties */ /* and the possible overlap with neighboring crystals in the other two layers. */ /* Line QQQ07 (422) - QQQ08 (470). */ /* */ /* E) Calculate the flux collection area as function of energy for the lens */ /* Line QQQ09 (422) - QQQ10 (470). */ /* */ /* F) Terminate by preparing various numerical and graphic output */ /* Line QQQ11 (422) - QQQ12 (470). */ /* */ /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ #include #include #include #include #include "mucal.h" #include "panel.h" #include int main(int argc, char* argv[]) { FILE *in, *out, *out2, *listfil, *preget, *gnufil, *pltfil, *chkfil, *gnufil2, *gnuFIL[2][20], *zone_file, *thkfil; static char Miller[6], iline[300], textlines[20][128], Titl[32], gnutitl[64], Lauetitl[64], Outtitl[64]; static char ELEMENT[20][4], IDtext[16], gnuFILname[32], gnutitl1[64], thktitl[64]; char Millerlist[20][5], Chktitl[64], zone_name[64], systemtxt[64], PStitl[64]; char outline2[64], outline3[64], outline4[64], triptxt[16]; static int L_order[numLayers][N_CryPos]; /* Sequence numbering of crystals in the three crystal layers [0/1/2] - ordered according to distance from the axis */ int i, ii, i_elem, j, k, m, n_order, tst, newcry, r_imax, idist, loi, E_indx0, nl; int FF=1, iR, n_z, num_zones=0, iE, iE_low, iE_high, nOpt, iOrder, mE, gnunum, RING_NUM=0; int Z, Cmiller, control, Len, r_index, E1k, E2k, E3k, E4k, E5k, Ek, d_index, EE_index; int status = 0, Au_111, Au_200, Cu_111, Cu_200, Ag_111, Ag_200, Ge111, Ge220, r_imin; int Cu220, Ag220, Au220, chan[100], L_start[600], gnufnum=0, new_gnufnum, dot_gnufnum; int iC, iiC, ring_i, elements, g_index, IE, elem_save, imax, IntE, Efound[20][100]; int basic_elem, basic_order, j_old, r_num[600], updated[20], update_gate, k_dist[8][20]; int elem, E_indx, E_imax, num_crys[20], cry_ptr_lo[20], cry_ptr_hi[20], selected[20]; int Nrand0=0, Nrand1=0, locnum[20], kk[20], listptr, rest_elem, combnum, n_layer=0; int DetArea, y2min, y2max, Cu111, Cu200, Ag111, Ag200, Au111, Au200, Zsave, opt2; int maxRing, i_radius, imin, preset_i[20][100], chan_max, chan_index, lim_chan1, lim_chan2;; int Lens_layers=2, Z2 = 6, Cmiller2 = 99, n_order2 = 1, nOpt0[2] = { 0, 1}; int IZ[6] = {0, 0, 0, 0, 0, 0}, znum, kmax, old_numOp, Ngnu[20], OptionZ[20]; int facet_no[3], facet_init[3], last_init[3], uselen[3], NNopt=0; int npr=0, layer_no, ring_no, good_facets, pr_ok=0; int last_ring, first_ring=0, last_good=0, allnabs; int azimnum=0, modulLim=0, modulLim0=0, Zside[2], CMside[2], numOptions=0, atoms_cell[5]; int azim_index, N_z, NN, prcnt=0, GG=0, GGOK=0; int iaz, ik, ik_min, mm, KK, ii_ref, iii, jjj, ring_num, Xrest[6], option2_num, z_ring; int tlnum, iseq, basic_Z=0, MAXcm=0, INITfacets=0, jold=0, N_sec[2][3]={0, 0, 0, 0, 0, 0}; unsigned LEN[4]; double E, E2, E3, fwhmt, T, tant2B, B_radius, radius_old, thetaB, lambda, dE; double gain, fwhm_cm[20], t_save; double ny_use, t_use, E0, minthick, mufact0; double x, y, alfa, fi_lo, fi_hi, fi, fwhmt2 = 1.0, T_FACTOR = 0.35; static int distr_layer[3][400]; static float r_area[600], nysum[N_CryPos*3], OAz[500]; static float EAALL[3+2][N_CryPos], AZIM_REF[6]={0.0, 180.0, 60.0, 240.0, 120.0, 300.0}; static float T_Area[500][5], Eval_pos[20][600]; static float EffArea[3*2][20][4][N_CryPos]; /* EffArea [Layer contribution] [nOption] [nOrder] [energy in 2 keV steps] */ static float EffAOpt[3*2][20][4][N_CryPos]; static float Agnu[20][3000]; static int Rgnu[3][20][100]; float RR, ms, sum0, sum1, sum2, sum3, sum4, sum5, sum6, disrad, val, valsum, fwhmth[20], t_Factor[20]; float m_tot[20], fwhm_fac, sigma_fac, sigma_cm, offpeak, arcmin2rad, Rf, facet_R, dmax; float ring_width, radius, panel3[25], LensTopRadius, lastR, thick, thickx; float x_focus0, y_focus0, facet_diam, lastBragg, MirrorWidth, MirrorDispl, az_min, az_dif, azim_ref; float x_focus2, y_focus2, T_fctop, T_fcbot, ModE; float x_focus1, y_focus1, facet_radius, facet_hole_radius, detector_diam, Rdf, dis, overlap_frac; float lens_diam, lens_hole_diam, cameraH, cameraD, det_area, EAall, EAall2, E_ref0=511.0, EAL = 1.0; float sum_area[600], sumarea_E[20], A_rstloc, E_ref[20], iElo[6]; float rhoval[20], A_chk[3][5], tri_wgt[100], xmean[100], ymean[100], xsum, ysum; float FRAC, Agnusum[20], A_wanted, separation, M_tot=0.0; float sigmarad, mu, R, nyuse, wght1, sqrt2pi, hexradius, dist, ov; float delta_r, old_radius, beta1, beta2, beta3, beta4, divisor; float gamma1, gamma2, gamma3, gamma4, gamma5, alfa1, wg, sumfi; float delta1, delta2, delta3, delta4, delta5, delta6; float Foc_len, H, H_focus, H_break1, H_break2, dH1, dH2, focus_sep, R_Tel; float gamuse1, gamuse2, gamuse3, x_focus, y_focus; float tB, tB0, Weight[20], Area[20][500], radius_lo, radius_hi; float radi[20], radi_lo[20], radi_hi[20], cry_frac[20][500], sum_Area, sumA; float distance, Brg_C, Brg_E, delta_Br, Brg_plus, Brg_minus; float E_C, refl_E, ref_plus, ref_minus, ref_C, cry_refl_E, WEIGHT=0.0, WEIGHT2=0.0; float Hsat, E_factor[20], radiusE0, accum_A, Evalmax; float unit_mass, weight[20], Rand_max, used_fi[20][600], fracfi[20][600]; float theta1, theta2, panel_width, dw, T_fclayer; float D_switch, sep_min, thetaref, A_factor, facet_sep; float deltachan, chanstep, chan_val1, chan_val2, preset[21][600]; float Cgeo[5][5], atoms_eff[5][5], A_basic, A_hole, crystal_mass[20]; float E_low, E_high, A_contr, B_contr, t_global=1.0, lens_inner_diam; float Bragg_min, Bragg_max, NABSTAT[3][30], rLim=500.0; float thkarray[2][numFACETS], thk_sum=0.0, use_frac, lo_azim_lim, hi_azim_lim; float PassBandLow=300.0, PassBandHigh= 800.0; /* Energy pass band for the lens */ int CameHere=0; /* The only legal actions on a structure are: * copying it * assigning to it as a unit * taking its address with & * accessing its members * (from Kernigan and Ritchey) */ reflect REFL[20], *PREFL; reflect REFL2[20], *PREFL2; zones ZONES[20], *PZONES; material MATER[100], *PMATER; static facet FACET[numFACETS]; /* numFACETS is defined in panel.h */ facet *PFACET; char navn[150], tmptxt[128], tmptxt2[150], dtext[130], dtext2[30]; char dtext3[70], dtext4[70], Xlabel[256], xlabel[64], date_txt[64]; time_t mytime; /* QQQQQ */ PREFL = &REFL[0]; PREFL2 = &REFL2[0]; PZONES = &ZONES[0]; PMATER = &MATER[0]; PFACET = &FACET[0]; PI = 3.14159; TWOPI = PI * 2.0; GTORAD = PI / 180.0; sqrt2pi = sqrt(TWOPI); arcmin2rad = GTORAD / 60.0; Rand_max = (float)(RAND_MAX); for (i=0; i 1) Foc_len = 100.0 * atof(argv[1]); */ /* convert to cm */ if (argc > 1) { Foc_len *= atof(argv[1]); /* scale Focal length */ PassBandLow *= atof(argv[1]); /* scale pass band */ PassBandHigh *= atof(argv[1]); if (atof(argv[1]) > 5.0) goto badargv; GG = (int)(atof(argv[1])); } if (argc > 2) fwhmt = atof(argv[2]); if (argc > 3) t_global = atof(argv[3]); if (argc > 4) detector_diam = atof(argv[4]); if (argc > 5) { if (argc > 6) Lens_layers = atoi(argv[6]); sprintf(IDtext, "_%s", argv[5]); sprintf(zone_name, "%s_ZONES%1d.dat", argv[5], Lens_layers); } else { sprintf(IDtext, ""); sprintf(zone_name, "ZONES.dat"); } if (Lens_layers > 2) Lens_layers = 2; if (detector_diam < facet_diam) { printf("The detector diameter is not allowed to be less than the facet diameter! (%3.1f cm)\n", facet_diam); exit(0); } if ((zone_file = fopen(zone_name, "rt")) == NULL) { printf("Could not open %s for reading!\n", zone_name); exit(0); } /* Initialize list of reflection options */ sprintf(Outtitl, "LaueW%03dT%03dR%02d%s_G%1d.out", (int)(fwhmt*100.0+0.5), (int)(100.0*t_global+0.5), (int)(detector_diam*10.0+0.5), IDtext, GG); if ((out = fopen(Outtitl, "wt")) == NULL) { printf("Could not open %s for writing!\n", Outtitl); exit(0); } else { printf("Opened %s for writing!\n", Outtitl); } fwhmt2 = fwhmt; T = 300.0; /* assumed crystal temperature (K) (for thermal factor calculation) */ num_zones = get_ZONES4(PZONES, zone_file); for (i=0; i 0) { for (j=0; j maxRings) { printf("The required maxRing-value, %3d, exceeds the allowed value: %3d. Increase maxRings in panel.h \n", maxRing, maxRings); exit(0); } else { /* printf("Required maxRing-value, %3d, Allowed value: %3d. INITfacets: %6d, N_CryPos: %6d, numLayers: %1d, facets: %6d\n", maxRing, maxRings, INITfacets, N_CryPos, numLayers, numFACETS); */ } jold = 0; for (i=1; i= 0) j++; /* printf("p2level: FACET: ring: %3d, INITfacets: %8d, index: %4d %4d, useful: %3d %3d\n", FACET[facet_no[layer_no]-1 + layer_no * N_CryPos].ring_num, INITfacets, facet_no[layer_no], facet_no[layer_no] - m, j, j-jold); */ jold = j; } for (j=0; j= 0) { good_facets++; lastBragg = FACET[j + layer_no * N_CryPos].thetaB; lastR = FACET[j + layer_no * N_CryPos].r; if (j >= facet_init[layer_no]) { last_ring = i; last_init[layer_no]=facet_init[layer_no]; } if (j < last_init[layer_no]) last_good = good_facets; } if (good_facets == 0) i = 5000; else first_ring = i; } jjj = 0; for (iii=0; iii= 0) {jjj++;} } printf("p2level: After hexring: layer %1d, Max ring %2d facets %5d %4d, valid facets (nOpt>=0): %4d, total good %6d\n", layer_no, maxRing, INITfacets, facet_no[layer_no], jjj, good_facets); pr_ok = 0; LEN[layer_no] = facet_no[layer_no]; } /* end of loop over 'layer_no' (start 452) */ /* QQQQQ2 */ LEN[numLayers] = 0; /* LEN[numLayers] is reserved for 'numOptions', to be used after facet initialization */ for (i=0; i= ZONES[n_z].R_inner) && (FACET[iseq].r < ZONES[n_z].R_outer)) { FACET[iseq].zone = n_z; FACET[iseq].fzone = (ZONES[n_z].R_outer - FACET[iseq].r) / (ZONES[n_z].R_outer - ZONES[n_z].R_inner); FACET[iseq].azim = atan2(FACET[iseq].y, FACET[iseq].x) / GTORAD; if (FACET[iseq].azim < 0.0) FACET[iseq].azim += 360.0; azim_index = (int)(FACET[iseq].azim / 120.0); if (ZONES[n_z].Z_lay[nl][azim_index] == -1) ZONES[n_z].Opt_lay[nl][azim_index] = -1; if (ZONES[n_z].secZ_lay[nl][azim_index] == -1) ZONES[n_z].secOpt_lay[nl][azim_index] = -1; FACET[iseq].nOption = ZONES[n_z].Opt_lay[nl][azim_index]; /* define nOption for this facet */ FACET[iseq].FTlay = ZONES[n_z].ftlay[nl][azim_index]; use_frac = ZONES[n_z].secfracB[nl][azim_index] * (1.0 - FACET[iseq].fzone) + ZONES[n_z].secfracA[nl][azim_index] * FACET[iseq].fzone; lo_azim_lim = azim_index * 120.0 - use_frac * 60.0 + 60.0; hi_azim_lim = azim_index * 120.0 + use_frac * 60.0 + 60.0; if (npr++ < 30) { printf( "%1d %3d FAC %6d Opt %2d scOpt %2d az %5.1f idx %1d r %5.1f fzone %5.3f FrA/B %4.2f %4.2f useF %5.3f lo/hilim %5.1f %5.1f fnOpt ", nl, ii, iseq, FACET[iseq].nOption, ZONES[n_z].secOpt_lay[nl][azim_index], FACET[iseq].azim, azim_index, FACET[iseq].r, FACET[iseq].fzone, ZONES[n_z].secfracA[nl][azim_index], ZONES[n_z].secfracB[nl][azim_index], use_frac, lo_azim_lim, hi_azim_lim); } if ((lo_azim_lim <= FACET[iseq].azim) && (FACET[iseq].azim < hi_azim_lim)) { FACET[iseq].nOption = ZONES[n_z].secOpt_lay[nl][azim_index]; /* redefine nOption for this facet */ FACET[iseq].FTlay = ZONES[n_z].secftlay[nl][azim_index]; N_sec[nl][azim_index]++; } if (npr < 31) printf("%2d %3d %3d %3d\n", FACET[iseq].nOption, N_sec[nl][0], N_sec[nl][1], N_sec[nl][2]); } } } } /* ***************************************************************** */ /* */ /* Establish neighbor connections between the crystal layers */ /* */ /* ***************************************************************** */ facet_R = facet_radius * 1.5; allnabs = facet_connect3(PFACET, uselen, L_order, facet_R, Lens_layers); printf("After neighbor check, allnabs: %5d\n", allnabs); for (i=0; i 1) goto newFF2; /* on subsequent calculations with modified Foc_len, skip all FACET modifications */ /* FACET[].thetaB is the only parameter which need to be modified */ /* specifically the facet thickness should be kept constant for all Foc_len-values */ T_fclayer = FACET[iseq].FTlay; FACET[iseq].Z = REFL2[nOpt].Z; /* POPULATE FACETS: Material */ Rgnu[nl][nOpt][(int)(FACET[iseq].r/facet_sep + 0.5)]++; /* fprintf(gnuFIL[0][nOpt], "%6.2f %6.2f\n", FACET[iseq].x, FACET[iseq].y); */ /* get crystal thickness as required by nOpt and thickness factor specific for this layer and option */ status = reflectT2(&(REFL2[nOpt]), &(MATER[FACET[iseq].Z]), &(FACET[iseq]), T_fclayer); if (status < 0.0) return(0.0); if (GGOK) { if (GG == 1) { thkarray[nl][iseq] = FACET[iseq].thick; /* save this thickness if we are analyzing primary Foc_len choice */ } else { FACET[iseq].thick = thkarray[nl][iseq]; /* use stored thickness values when analyzing subsequent Foc_len values */ } } E = FACET[iseq].E[nOpt]; /* nominal Bragg energy for this facet */ Efound[nOpt][0] = 1; IntE = (int)(E / 50.0); ModE = E - (float)(IntE * 50.0); if ((ModE < 5.0) && (Efound[nOpt][IntE] == 0)) { Efound[nOpt][IntE]++; status = reflect3A(IntE*50.0, &(REFL2[nOpt]), &(FACET[iseq]), &(MATER[REFL2[nOpt].Z]), 1, &refl_E); if (status < 0.0) {printf("Bad call to reflect3A from p2level\n"); exit(0);} printf("Peak reflectivity for %s %s at %5d keV is %5.1f (%%) at a crystal thickness of %5.1f (mm)\n", MATER[FACET[iseq].Z].ELEM_symb, REFL2[nOpt].Miller_txt, IntE*50, refl_E*100.0, FACET[iseq].thick*10.0); } if ((ModE > 45.0) && (Efound[nOpt][IntE+1] == 0)) { Efound[nOpt][IntE+1]++; status = reflect3A((IntE+1)*50.0, &(REFL2[nOpt]), &(FACET[iseq]), &(MATER[REFL2[nOpt].Z]), 1, &refl_E); if (status < 0.0) {printf("Bad call to reflect3A from p2level\n"); exit(0);} printf("Peak reflectivity for %s %s at %5d keV is %5.1f (%%) at a crystal thickness of %5.1f (mm)\n", MATER[FACET[iseq].Z].ELEM_symb, REFL2[nOpt].Miller_txt, (IntE+1)*50, refl_E*100.0, FACET[iseq].thick*10.0); } j++; newFF2: /* *************************************************************''''''''''''''''''''''''''''''''*** */ /* */ /* QQQQQ Begin integration of effective area of lens */ /* */ /* *******************************************************************''''''''''''''''''''''''''*** */ FACET[iseq].PEAKrefl = 0.0; FACET[iseq].PEAK_E = 0.0; /* *************************************************************''''''''''''''''''''''''''''''''*** */ /* */ /* QQQQQ Loop over reflection orders (1-4) and over the energy interval relevant for the */ /* current facet to integrate the effective area of the lens */ /* */ /* *******************************************************************''''''''''''''''''''''''''*** */ for (iOrder = 1; iOrder < 4; iOrder++) { /* loop over reflection orders, ends in 799 */ E_low = (FACET[iseq].E[nOpt] - FACET[iseq].dE[nOpt]) * (float)(iOrder); E_high = (FACET[iseq].E[nOpt] + FACET[iseq].dE[nOpt]) * (float)(iOrder); iE_low = (int)((E_low - 1.0) / 2.0); if (iE_low > 2999) iE_low = 2999; if (iE_low < 10 ) iE_low = 10 ; iE_high = (int)((E_high + 1.0) / 2.0); if (iE_high > 2999) iE_high = 2999; for (iE = iE_low; iE <= iE_high; iE++) { /* Loop over E in 2 keV steps (including higher order E-ranges) */ E = 2.0 * (float)(iE); B_contr = facet_Bcontrib(E, nOpt, iOrder, panel3, &(FACET[0]), &(MATER[REFL2[nOpt].Z]), &(REFL2[nOpt]), LEN, L_order, &refl_E, iseq, NABSTAT, gnufil2, Lens_layers); EffArea[nl][N_z][iOrder][iE] += B_contr; EffAOpt[nl][nOpt][iOrder][iE] += B_contr; Agnu[nOpt][iE] += B_contr; if ((iOrder == 0) && (fabs(FACET[iseq].E[0] - E) < 2.0)) FACET[iseq].PEAKrefl = refl_E; } if (FF > 1) continue; if ((iOrder == 1) && (B_contr > 0.20)) { mE = (int)(FACET[iseq].E[nOpt] / 2.0 + 0.5); EffArea[nl][N_z][0][mE] = FACET[iseq].thick; /* EffArea[iOrder 0] stores the facet thickness at this energy */ EffAOpt[nl][nOpt][0][mE] = FACET[iseq].thick; /* EffAOpt[iOrder 0] stores the facet thickness at this energy */ } } /* end of loop over reflection orders */ if (FF > 1) continue; crystal_mass[nOpt] += A_basic * MATER[FACET[iseq].Z].dens * FACET[iseq].thick * 0.001; Ngnu[nOpt]++; if ((nl == 0) && ((iseq%20000) == 0)) printf("nl: %1d, N_z: %1d, ii: %5d, iseq: %5d, nOpt: %2d, Z: %2d, thick: %5.3f, Mill: %s, mass: %5.1f, Ngnu: %4d %4d %4d %4d %4d %4d\n", nl, N_z, ii, iseq, FACET[iseq].nOption, FACET[iseq].Z, FACET[iseq].thick, REFL2[FACET[iseq].nOption].Miller_txt, A_basic * MATER[FACET[iseq].Z].dens * FACET[iseq].thick, Ngnu[0], Ngnu[1], Ngnu[2], Ngnu[3], Ngnu[4], Ngnu[5]); } /* End of loop over facets QQQQQ */ NNopt = 0; for (nOpt=0; nOpt<6; nOpt++) { if (FF == 1) { m_tot[nOpt] = crystal_mass[nOpt]; M_tot += crystal_mass[nOpt]; } if (Ngnu[nOpt] > 0) NNopt++; } for (n_z=0; n_z= 0) printf("%2d nOpt: %2d, iaz: %1d, Z: %2d Reference energy %5.1f keV, for %s(%s) t_fact: %4.2f, Mass: %5.1f %6.1f kg\n", n_z, nOpt, iaz, REFL2[nOpt].Z, E_ref[nOpt], MATER[REFL2[nOpt].Z].ELEM_symb, REFL2[nOpt].Miller_txt, ZONES[n_z].ftlay[nl][iaz], crystal_mass[nOpt], M_tot); } } if (GGOK) { if (GG == 1) { thk_sum = 0.0; for (ii=0; ii 0.0) printf("%s %6.1f kg\n", MATER[i].ELEM_symb, MATER[i].mass); printf("\n"); /* end4 */ printf( "\n %s Focal len: %3.0f m, Mos wdth: %3.0f arcs, Det. diam: %3.1f cm, T_glob: %4.2f, NZ: %2d\n", date_txt, Foc_len * 0.01, fwhmt * 60.0, detector_diam, t_global, num_zones); printf("Ngnu: %5d %5d %5d %5d %5d %5d\n", Ngnu[0], Ngnu[1], Ngnu[2], Ngnu[3], Ngnu[4], Ngnu[5]); out2 = fopen("Laue_summary.dat", "at"); fprintf(out2, "\n %s Focal length: %3.0f m, Mosaic width: %3.0f arcsec, Detector diameter: %3.1f cm, T_global: %4.2f\n", date_txt, Foc_len * 0.01, fwhmt * 60.0, detector_diam, t_global); fprintf(out2, "NABSTAT refl.sum area sum neighbor distribution \n"); for (i=0; i 0.0) fprintf(pltfil, "replot \"%s\" index %d axes x1y1 title \"%s \" with lines \n", Lauetitl, gnunum, textlines[gnunum]); fprintf(gnufil, "\n\n"); gnunum++; } */ /* gnunum 4 5 6 */ /* for (nl=0; nl 1) Foc_len = 100.0 * FF * atof(argv[1]); /* convert to cm */ panel3[0] = Foc_len; for (nl=0; nl