pax_global_header00006660000000000000000000000064127501224340014512gustar00rootroot0000000000000052 comment=7d44ccf49245d6b3a4ff19bffe8a72901ff1fd14 cassbeam-1.1/000077500000000000000000000000001275012243400131315ustar00rootroot00000000000000cassbeam-1.1/.gitignore000066400000000000000000000003611275012243400151210ustar00rootroot00000000000000# Object files *.o *.ko *.obj *.elf # Precompiled Headers *.gch *.pch # Libraries *.lib *.a *.la *.lo # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app *.i*86 *.x86_64 *.hex autom4te.cache/ cassbeam-1.1/CHANGES000066400000000000000000000002251275012243400141230ustar00rootroot000000000000001.1 === Changes since 1.0 * make compile on modern systems * don't generate doc by default * support for DESDIR in Makefile * Add manual page cassbeam-1.1/INSTALL000066400000000000000000000010201275012243400141530ustar00rootroot00000000000000To install cassbeam: 1. you must have glib version 1.2 or higher (but less than 2.0) This can be found at www.gtk.org 2. you must have fftw version 2.1 or higher (but less than 3.0) This can be found at www.fftw.org 3. Run ./configure To generate makefiles. To specify an installation destination specify --prefix=, where defaults to /usr/local/. 4. Run make 5. To install (optional) make install (You might need root permission depending on the permissions of . cassbeam-1.1/LICENSE000066400000000000000000000354331275012243400141460ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS cassbeam-1.1/Makefile.in000077500000000000000000000013511275012243400152010ustar00rootroot00000000000000CC = @CC@ CFLAGS = @CFLAGS@ -Wall LDFLAGS = @LDFLAGS@ OBJS = cassbeam.o illum.o antenna.o image.o vector.o image-vector.o \ keyvalue.o intvector.o vecarray.o polygon.o randdist.o mathfunc.o \ vector-fftw.o TARGETS = cassbeam all: $(TARGETS) clean: -rm -f *.o $(TARGETS) -rm -f core* cd doc;make clean distclean: -rm -f *.o $(TARGETS) -rm -f *~ doc/*~ -rm -f core* -rm -f config.cache config.log config.status cd doc;make clean -rm Makefile cassbeam: $(OBJS) $(CC) -o cassbeam $(OBJS) $(LDFLAGS) doc: doc/cassbeam.tex cd doc;make install: $(TARGETS) $(PYPROGS) -rm -f $(DESTDIR)@prefix@/bin/cassbeam install -D -m755 cassbeam $(DESTDIR)@prefix@/bin/cassbeam uninstall: -rm -f $(DESTDIR)@prefix@/bin/cassbeam cassbeam-1.1/README000066400000000000000000000002761275012243400140160ustar00rootroot00000000000000Please read the documentation: cd doc ; make ; then view cassbeam.ps. There is one example included here. Once compiled, the code can be tested: cd examples/vla cassbeam vla-1500MHz.in cassbeam-1.1/antenna.c000066400000000000000000001033471275012243400147310ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include #include "constants.h" #include "antenna.h" // #include "holog.h" // #include "vecsurface.h" // #include "vecdiffract.h" Antenna *newAntenna(double sub_h, double feed_x, double feed_y, double feed_z, double ftaper, double thmax, const char *geomfile) { Antenna *a; double z; VecArray arr; int n; double d; arr = VecArrayfromfile(geomfile, 3); if(!arr) { fprintf(stderr, "File %s not found\n", geomfile); return 0; } n = VecArrayVectorSize(arr); g_assert(n>2); z = sub_h-feed_z; a = g_new(Antenna, 1); a->sub_h = sub_h; a->feed[0] = feed_x; a->feed[1] = feed_y; a->feed[2] = feed_z; d = sqrt(feed_x*feed_x + feed_y*feed_y + z*z); if(z > 0.0) { a->K = sub_h + d; a->feeddir[0] = -feed_x/d; a->feeddir[1] = -feed_y/d; a->feeddir[2] = (sub_h-feed_z)/d; } else { a->K = sqrt(feed_x*feed_x + feed_y*feed_y + feed_z*feed_z); a->feeddir[0] = -feed_x/d; a->feeddir[1] = -feed_y/d; a->feeddir[2] = (sub_h-feed_z)/d; } a->radius = arr[0][n-1]; a->zedge = arr[1][n-1]; a->deltar = a->radius/(float)(n-1); a->bestparabola = a->zedge/(a->radius*a->radius); a->z = arr[1]; a->m = arr[2]; g_assert(a->m[0] == 0.0); if(a->ftaper < 0.0) fprintf(stderr, "Warning : changing sign of feedtaper\n"); a->ftaper = fabs(ftaper); a->thmax = thmax; a->fa2pi = 2.0*M_PI*sqrt(ftaper)*0.1874/sin(thmax*M_PI/180.0); a->legwidth = 0.0; a->legfoot = a->radius/2.0; a->legapex = sub_h*1.2; a->hole_radius = 0.0; a->roughness = 0.0; a->dir = newVector(3); a->dir[0] = a->dir[1] = 0.0; a->dir[2] = 1.0; a->hhat = newVector(3); a->vhat = newVector(3); a->k = newVector(3); a->name = g_strdup("unnamed"); zeroVector(a->k); /* default to no polarization state */ a->pol = newVector(4); zeroVector(a->pol); a->E = newVector(6); zeroVector(a->E); Antennasetfreq(a, 1.0); Antennasetdir(a, 0); /* compute hhat and vhat */ a->Trec = 50.0; a->Tground = 290.0; a->oversamp = 1.5; a->elev = M_PI/2.0; a->feedpattern = 0; a->feedpatterndelta = 0.0; a->gridsize = 0; a->leggroundscatter = 0.2; dishvalue(a, a->legfoot, &a->legfootz, 0); deleteVector(arr[0]); deleteVecArray(arr); return a; } void deleteAntenna(Antenna *a) { if(!a) return; if(a->z) deleteVector(a->z); if(a->m) deleteVector(a->m); if(a->k) deleteVector(a->k); if(a->dir) deleteVector(a->dir); if(a->hhat) deleteVector(a->hhat); if(a->vhat) deleteVector(a->vhat); if(a->pol) deleteVector(a->pol); if(a->E) deleteVector(a->E); g_free(a); } void Antennasetfreq(Antenna *a, double freq) { int i; g_assert(freq > 0.0); a->freq = freq; a->lambda = NS_METER/freq; if(freq < 1.0) a->Tsky = 3.0*pow(freq, -2.5); else a->Tsky = 3.0; for(i = 0; i < 3; i++) a->k[i] = -2.0*M_PI*a->dir[i]/a->lambda; } void Antennasetdir(Antenna *a, const Vector dir) { double hmag; int i, l; if(dir) { l = VectorSize(dir); g_assert(l == 1 || l == 3); if(l == 1) { a->dir[0] = -sin(dir[0]*M_PI/180.0); a->dir[1] = 0.0; a->dir[2] = cos(dir[0]*M_PI/180.0); } else { deleteVector(a->dir); a->dir = newunitVector(dir); } if(a->dir[0] == 0.0 && a->dir[1] == 0.0) { a->hhat[0] = 1.0; a->hhat[1] = a->hhat[2] = 0.0; a->vhat[1] = 1.0; a->vhat[0] = a->vhat[2] = 0.0; } else { a->hhat[0] = a->dir[1]; a->hhat[1] = -a->dir[0]; a->hhat[2] = 0.0; hmag = sqrt(a->hhat[0]*a->hhat[0] + a->hhat[1]*a->hhat[1]); a->hhat[0] /= hmag; a->hhat[1] /= hmag; a->vhat[0] = a->hhat[1]*a->dir[2] - a->hhat[2]*a->dir[1]; a->vhat[1] = a->hhat[2]*a->dir[0] - a->hhat[0]*a->dir[2]; a->vhat[2] = a->hhat[0]*a->dir[1] - a->hhat[1]*a->dir[0]; } } for(i = 0; i < 3; i++) a->k[i] = -2.0*M_PI*a->dir[i]/a->lambda; Antennasetpol(a, 0); /* recompute polarization */ } void Antennasetpol(Antenna *a, const Vector pol) { if(pol) { g_assert(VectorSize(pol) == 4); copytoVector(a->pol, pol); normalizeVector(a->pol); } a->E[0] = a->hhat[0]*a->pol[0] + a->vhat[0]*a->pol[2]; a->E[1] = a->hhat[0]*a->pol[1] + a->vhat[0]*a->pol[3]; a->E[2] = a->hhat[1]*a->pol[0] + a->vhat[1]*a->pol[2]; a->E[3] = a->hhat[1]*a->pol[1] + a->vhat[1]*a->pol[3]; a->E[4] = a->hhat[2]*a->pol[0] + a->vhat[2]*a->pol[2]; a->E[5] = a->hhat[2]*a->pol[1] + a->vhat[2]*a->pol[3]; } /* sets feeddir after pathology is considered */ void alignfeed(Antenna *a, const Pathology *p) { int i, j; double f[3], s0[3], s[3], d[3], m=0.0; for(i = 0; i < 3; i++) f[i] = a->feed[i] + p->feedshift[i]; for(i = 0; i < 3; i++) s0[i] = -p->subrotpoint[i]; s0[2] += a->sub_h; for(i = 0; i < 3; i++) { s[i] = 0.0; for(j = 0; j < 3; j++) s[i] += p->subrot[i][j]*s0[j]; s[i] += p->subrotpoint[i] + p->subshift[i]; d[i] = s[i]-f[i]; m += d[i]*d[i]; } m = sqrt(m); for(i = 0; i < 3; i++) a->feeddir[i] = d[i]/m; } VecArray getfeedbasis(const Antenna *a, const Pathology *p) { int i, j; VecArray B; Vector dir, vhat, hhat; B = newpopulatedVecArray(3, 3); hhat = B[0]; vhat = B[1]; dir = B[2]; if(p == 0) for(i = 0; i < 3; i++) dir[i] = a->feeddir[i]; else { zeroVector(dir); for(j = 0; j < 3; j++) for(i = 0; i < 3; i++) dir[j] += p->feedrot[j][i]*a->feeddir[i]; } if(dir[0] == 0.0 && dir[1] == 0.0) { vhat[0] = 1.0; vhat[1] = vhat[2] = 0.0; hhat[1] = 1.0; hhat[0] = hhat[2] = 0.0; } else { vhat[0] = dir[1]; vhat[1] = -dir[0]; vhat[2] = 0.0; normalizeVector(vhat); hhat[0] = vhat[1]*dir[2] - vhat[2]*dir[1]; hhat[1] = vhat[2]*dir[0] - vhat[0]*dir[2]; hhat[2] = vhat[0]*dir[1] - vhat[1]*dir[0]; } return B; } /* Returns vecarray. each vector is nrim long. The columns are: * * [0] x coordinate of rim * [1] y coordinate of rim * [2] z coordinate of rim * [3] theta (azimuth angle) of point as seen by the feed * [4] phi (boresight angle) of point as seen by the feed * [5] dtheta, useful for integrations. */ VecArray calcsubreflectorrim(const Antenna *a, const Pathology *p, int nrim) { VecArray subrim, feedbasis; Vector s1, subr, h, v, feedaxis; double Reff, theta; int i, j; feedbasis = getfeedbasis(a, p); h = feedbasis[0]; v = feedbasis[1]; feedaxis = feedbasis[2]; subrim = newpopulatedVecArray(6, nrim); s1 = newVector(6); subr = newVector(3); /* Reff is such that the polygon circumcsribes the primary */ Reff = a->radius/cos(M_PI/nrim); for(i = 0; i < nrim; i++) { theta = 2.0*M_PI*i/nrim; subfromdish(a, Reff*cos(theta), Reff*sin(theta), s1); Pathologize(s1, p); subrim[0][i] = s1[0]; subrim[1][i] = s1[1]; subrim[2][i] = s1[2]; for(j = 0; j < 3; j++) subr[j] = s1[j] - (a->feed[j]+p->feedshift[j]); normalizeVector(subr); subrim[3][i] = atan2(dotVectors(subr, v), dotVectors(subr, h)); subrim[4][i] = acos(dotVectors(subr, feedaxis)); } deleteVecArrayandVectors(feedbasis); deleteVector(subr); deleteVector(s1); /* compute dtheta */ subrim[5][0] = subrim[3][1]-subrim[3][nrim-1]; subrim[5][nrim-1] = subrim[3][0]-subrim[3][nrim-2]; for(i = 1; i < nrim-1; i++) subrim[5][i] = subrim[3][i+1]-subrim[3][i-1]; for(i = 0; i < nrim; i++) { if(subrim[5][i] < -M_PI) subrim[5][i] += 2.0*M_PI; if(subrim[5][i] > M_PI) subrim[5][i] -= 2.0*M_PI; subrim[5][i] = 0.5*fabs(subrim[5][i]); } return subrim; } /* rim is derived from calcsubreflectorrim */ double subpower(const VecArray rim, const Antenna *a) { const int ntheta = 2000; int i, t, N; double theta, dtheta, power=0.0; double domega; g_assert(rim); g_assert(VecArraySize(rim) == 6); N = VecArrayVectorSize(rim); g_assert(N > 2); dtheta = Vectormax(rim[4])/(ntheta-0.5); for(t = 0; t < ntheta; t++) { theta = (t+0.5)*dtheta; domega = 0.0; for(i = 0; i < N; i++) if(rim[4][i] > theta) domega += rim[5][i]; domega*=sin(theta)*dtheta; power += domega*feedfunc(a, theta); } return power; } Vector Efield(const Antenna *a, const Pathology *p, const Vector pol) { VecArray B; Vector hhat, vhat, E; B = getfeedbasis(a, p); hhat = B[0]; vhat = B[1]; E = newVector(6); E[0] = hhat[0]*pol[0] + vhat[0]*pol[2]; E[1] = hhat[0]*pol[1] + vhat[0]*pol[3]; E[2] = hhat[1]*pol[0] + vhat[1]*pol[2]; E[3] = hhat[1]*pol[1] + vhat[1]*pol[3]; E[4] = hhat[2]*pol[0] + vhat[2]*pol[2]; E[5] = hhat[2]*pol[1] + vhat[2]*pol[3]; deleteVecArrayandVectors(B); return E; } int Antennasetfeedpattern(Antenna *a, const char *filename, double scale) { int i, N, Nmax; double x, delta; VecArray pat; a->feedpatterndelta = 0.0; if(a->feedpattern) deleteVector(a->feedpattern); if(filename == 0) return 1; pat = VecArrayfromfile(filename, 2); if(!pat) return 0; N = VectorSize(pat[0]); g_assert(N > 2); g_assert(pat[0][0] == 0.0); delta = pat[0][1]; g_assert(delta > 0.0); for(i = 2; i < N; i++) { x = pat[0][i]-pat[0][i-1]-delta; g_assert(fabs(x) < delta/10000.0); } /* convert to radians */ delta *= M_PI/180.0; /* and scale it */ if(scale > 0.0) delta *= scale; /* Do we need to truncate the pattern? */ Nmax = M_PI/delta; if(N > Nmax) { a->feedpattern = newVector(Nmax); for(i = 0; i < Nmax; i++) a->feedpattern[i] = fabs(pat[1][i]); deleteVector(pat[1]); } else a->feedpattern = pat[1]; a->feedpatterndelta = delta; deleteVector(pat[0]); deleteVecArray(pat); return 1; } Antenna *newAntennafromKeyValue(struct KeyValue *kv, const char *paramfilename) { Antenna *a; Vector V; double v; char paramfile[100]; double sub_h, feed_x, feed_y, feed_z, thmax, ftaper; const char *geomfile, *feedfile; const char *name; int i; if(paramfilename) strncpy(paramfile, paramfilename, 99); else strncpy(paramfile, "(input file)", 99); paramfile[99] = 0; sub_h = getKeyValuedouble(kv, "sub_h"); if(sub_h == KV_FLOATERR) { fprintf(stderr, "sub_h not defined in %s\n", paramfile); return 0; } feed_x = getKeyValuedouble(kv, "feed_x"); if(feed_x == KV_FLOATERR) { fprintf(stderr, "feed_x not defined in %s\n", paramfile); return 0; } feed_y = getKeyValuedouble(kv, "feed_y"); if(feed_y == KV_FLOATERR) { fprintf(stderr, "feed_y not defined in %s\n", paramfile); return 0; } feed_z = getKeyValuedouble(kv, "feed_z"); if(feed_z == KV_FLOATERR) { fprintf(stderr, "feed_z not defined in %s\n", paramfile); return 0; } feedfile = getKeyValuestring(kv, "feedpattern"); thmax = getKeyValuedouble(kv, "feedthetamax"); if(thmax == KV_FLOATERR && !feedfile) { fprintf(stderr, "feedthetamax not defined in %s\n", paramfile); return 0; } ftaper = getKeyValuedouble(kv, "feedtaper"); if(ftaper == KV_FLOATERR && !feedfile) { fprintf(stderr, "feedthetamax not defined in %s\n", paramfile); return 0; } geomfile = getKeyValuestring(kv, "geom"); if(geomfile == 0) { fprintf(stderr, "geom not defined in %s\n", paramfile); return 0; } a = newAntenna(sub_h, feed_x, feed_y, feed_z, ftaper, thmax, geomfile); g_assert(a); name = getKeyValuestring(kv, "name"); if(name) { g_free(a->name); a->name = g_strdup(name); } /* feed pattern file is two column text file containing * angle (in degrees) and power (in dBi) */ if(feedfile != 0) { double scale; scale = getKeyValuedouble(kv, "feedpatternscale"); if(!Antennasetfeedpattern(a, feedfile, scale)) { deleteAntenna(a); fprintf(stderr, "Problem with feed file <%s>\n", feedfile); return 0; } } i = getKeyValueint(kv, "gridsize"); if(i > 0) { if(i < 32) a->gridsize = 32; else a->gridsize = i; } v = getKeyValuedouble(kv, "freq"); if(v > 0.0) Antennasetfreq(a, v); v = getKeyValuedouble(kv, "OS"); if(v > 0.0) a->oversamp = v; v = getKeyValuedouble(kv, "oversamp"); if(v > 0.0) a->oversamp = v; v = getKeyValuedouble(kv, "legwidth"); if(v != KV_FLOATERR) a->legwidth = v; v = getKeyValuedouble(kv, "legfoot"); if(v != KV_FLOATERR) { a->legfoot = v; dishvalue(a, a->legfoot, &a->legfootz, 0); } v = getKeyValuedouble(kv, "legapex"); if(v != KV_FLOATERR) a->legapex = v; v = getKeyValuedouble(kv, "hole_radius"); if(v != KV_FLOATERR) a->hole_radius = v; v = getKeyValuedouble(kv, "Tground"); if(v != KV_FLOATERR) a->Tground = v; v = getKeyValuedouble(kv, "Trec"); if(v != KV_FLOATERR) a->Trec = v; v = getKeyValuedouble(kv, "elev"); if(v != KV_FLOATERR) a->elev = v*M_PI/180.0; v = getKeyValuedouble(kv, "roughness"); if(v != KV_FLOATERR) a->roughness = v; v = getKeyValuedouble(kv, "leggroundscatter"); if(v != KV_FLOATERR) a->leggroundscatter = v; V = getKeyValueVector(kv, "point"); if(V) { Antennasetdir(a, V); deleteVector(V); } else { V = newVector(1); V[0] = 0.0; Antennasetdir(a, V); deleteVector(V); } V = getKeyValueVector(kv, "pol"); if(V) { Antennasetpol(a, V); deleteVector(V); } else { V = newVector(4); zeroVector(V); V[0] = 1.0; /* liner pol */ Antennasetpol(a, V); deleteVector(V); } return a; } int dishvalue(const Antenna *a, double r, double *z, double *m) { double ma, mb, mc, zav, A, B, C, D; double x, d, dd; double s = 1.0; int n; g_assert(a); if(r == 0) { *z = a->z[0]; *m = 0.0; return 1; } if(r < 0) { s = -1.0; r = -r; } d = a->deltar; dd = d*d; n = floor(r/d + 0.5); /* the middle point */ if(n > VectorSize(a->m)-2) n = VectorSize(a->m)-2; x = r - n*d; if(n == 0) { mc = a->m[1]; ma = -mc; mb = 0.0; zav = 2.0*a->z[1] + a->z[0]; } else { ma = a->m[n-1]; mb = a->m[n]; mc = a->m[n+1]; zav = a->z[n-1] + a->z[n] + a->z[n+1]; } A = mb; B = 0.5*(mc - ma)/d; C = 0.5*(mc - 2.0*mb + ma)/dd; D = (zav - B*dd)/3.0; if(m) *m = s*(A + B*x + C*x*x); if(z) *z = s*(D + A*x + B*x*x/2.0 + C*x*x*x/3.0); return 1; } /* normalizes a "vector" of 3 doubles in the vector sense */ static inline void norm3(double *v) { double s; s = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); v[0] /= s; v[1] /= s; v[2] /= s; } /* Returns position of subreflector piece (x, y, z) and * its normal (u, v, w) */ int subfromdish(const Antenna *a, double x, double y, Vector subpoint) { double r, z, m, u, v, w; double dx, dy, dz, dl, t; double n[3], sf[3], sd[3]; int i; r = sqrt(x*x + y*y); if(r == 0) { subpoint[0] = 0.0; subpoint[1] = 0.0; subpoint[2] = a->sub_h; } else { dishvalue(a, r, &z, &m); /* Compute reflected unit vector direction */ m = tan(2.0*atan(m)); w = 1.0/sqrt(1.0+m*m); u = -m*(x/r)*w; v = -m*(y/r)*w; dx = a->feed[0]-x; dy = a->feed[1]-y; dz = a->feed[2]-z; dl = a->K + z; t = 0.5*(dx*dx + dy*dy + dz*dz - dl*dl) / (-dl + u*dx + v*dy + w*dz); subpoint[0] = x + u*t; subpoint[1] = y + v*t; subpoint[2] = z + w*t; } for(i = 0; i < 3; i++) sf[i] = a->feed[i] - subpoint[i]; sd[0] = x - subpoint[0]; sd[1] = y - subpoint[1]; sd[2] = z - subpoint[2]; norm3(sf); norm3(sd); for(i = 0; i < 3; i++) n[i] = sd[i]+sf[i]; norm3(n); for(i = 0; i < 3; i++) subpoint[3+i] = n[i]; return 1; } int dishfromsub(const Antenna *a, double x, double y, Vector dishpoint) { VecArray sub; double x1, y1, dx, dy, mx, my, r, d; const double eps = 0.001; int iter, niter=500; sub = newpopulatedVecArray(5, 6); x1 = x; y1 = y; for(iter = 0; iter < niter; iter++) { subfromdish(a, x1, y1, sub[0]); subfromdish(a, x1-eps, y1, sub[1]); subfromdish(a, x1+eps, y1, sub[2]); subfromdish(a, x1, y1-eps, sub[3]); subfromdish(a, x1, y1+eps, sub[4]); mx = 0.5*(sub[2][0]-sub[1][0])/eps; my = 0.5*(sub[4][1]-sub[3][1])/eps; dx = (x-sub[0][0])/mx; dy = (y-sub[0][1])/my; if(fabs(dx) > a->radius/7.0) { if(dx < 0) dx = -a->radius/7.0; else dx = a->radius/7.0; } if(fabs(dy) > a->radius/7.0) { if(dy < 0) dy = -a->radius/7.0; else dy = a->radius/7.0; } r = sqrt(x1*x1 + y1*y1); if(r >= a->radius) if(x1*dx + y1*dy > 0.0) return 0; x1 += 0.5*dx; y1 += 0.5*dy; if(fabs(dx) < 0.005*eps && fabs(dy) < 0.005*eps) break; } if(iter == niter) return 0; r = sqrt(x1*x1 + y1*y1); dishpoint[0] = x1; dishpoint[1] = y1; // dishpoint[2] = polyvalue(a->shape, r); dishpoint[3] = sub[0][0]; dishpoint[4] = sub[0][1]; dishpoint[5] = sub[0][2]; d = sqrt(1.0+mx*mx+my*my); dishpoint[6] = mx/d; dishpoint[7] = my/d; dishpoint[8] = 1.0/d; dishpoint[9] = sub[0][3]; dishpoint[10] = sub[0][4]; dishpoint[11] = sub[0][5]; deleteVecArrayandVectors(sub); if(r > a->radius) return 0; else return 1; } void printAntenna(const Antenna *a) { printf("Antenna: %s %p\n", a->name, a); printf(" freq = %f GHz lambda = %f m\n", a->freq, a->lambda); printf(" Tsky = %f K Tground = %f K Trec = %f K\n", a->Tsky, a->Tground, a->Trec); printf(" dir = "); printVector(a->dir); printf(" feeddir = %f, %f, %f\n", a->feeddir[0], a->feeddir[1], a->feeddir[2]); if(!a->feedpattern) { printf(" ftaper = %f\n", a->ftaper); printf(" thmax = %f\n", a->thmax); } printf("\n"); } Ray *newRay(const Vector sub) { Ray *ray; ray = g_new(Ray, 1); ray->aper = newVector(6); ray->dish = newVector(6); ray->sub = dupVector(sub); ray->feed = newVector(3); return ray; } void printRay(const Ray *ray) { printf("Ray : "); printVector(ray->sub); printf(" "); printVector(ray->dish); printf(" "); printVector(ray->aper); } void deleteRay(Ray *ray) { g_assert(ray); if(ray->aper) deleteVector(ray->aper); if(ray->dish) deleteVector(ray->dish); if(ray->sub ) deleteVector(ray->sub); if(ray->feed) deleteVector(ray->feed); g_free(ray); } Pathology *newPathology() { Pathology *P; int i; P = g_new(Pathology, 1); P->subrot = newMatrix(3, 3); zeroMatrix(P->subrot); for(i = 0; i < 3; i++) P->subrot[i][i] = 1.0; P->subrotpoint = newVector(3); zeroVector(P->subrotpoint); P->feedrot = newMatrix(3, 3); zeroMatrix(P->feedrot); for(i = 0; i < 3; i++) P->feedrot[i][i] = 1.0; P->subshift = newVector(3); zeroVector(P->subshift); P->feedshift = newVector(3); zeroVector(P->feedshift); P->az_offset = 0.0; P->el_offset = 0.0; P->phase_offset = 0.0; P->focus = 0.0; return P; } Pathology *dupPathology(const Pathology *P) { Pathology *Q; Q = g_new(Pathology, 1); Q->subrot = dupMatrix(P->subrot); Q->subrotpoint = dupVector(P->subrotpoint); Q->feedrot = dupMatrix(P->feedrot); Q->subshift = dupVector(P->subshift); Q->feedshift = dupVector(P->feedshift); Q->az_offset = P->az_offset; Q->el_offset = P->el_offset; Q->phase_offset = P->phase_offset; Q->focus = P->focus; return Q; } Pathology *newPathologyfromKeyValue(struct KeyValue *kv) { Pathology *P; double v; double srx=0.0, sry=0.0, srz=0.0, frx=0.0, fry=0.0, frz=0.0; Vector V; P = newPathology(); v = getKeyValuedouble(kv, "dfeed_x"); if(v != KV_FLOATERR) P->feedshift[0] = v; v = getKeyValuedouble(kv, "dfeed_y"); if(v != KV_FLOATERR) P->feedshift[1] = v; v = getKeyValuedouble(kv, "dfeed_z"); if(v != KV_FLOATERR) P->feedshift[2] = v; v = getKeyValuedouble(kv, "dsub_x"); if(v != KV_FLOATERR) P->subshift[0] = v; v = getKeyValuedouble(kv, "dsub_y"); if(v != KV_FLOATERR) P->subshift[1] = v; v = getKeyValuedouble(kv, "dsub_z"); if(v != KV_FLOATERR) P->subshift[2] = v; v = getKeyValuedouble(kv, "rsub_x"); if(v != KV_FLOATERR) srx = v; v = getKeyValuedouble(kv, "rsub_y"); if(v != KV_FLOATERR) sry = v; v = getKeyValuedouble(kv, "rsub_z"); if(v != KV_FLOATERR) srz = v; v = getKeyValuedouble(kv, "rfeed_x"); if(v != KV_FLOATERR) frx = v; v = getKeyValuedouble(kv, "rfeed_y"); if(v != KV_FLOATERR) fry = v; v = getKeyValuedouble(kv, "rfeed_z"); if(v != KV_FLOATERR) frz = v; v = getKeyValuedouble(kv, "focus"); if(v != KV_FLOATERR) P->focus = v; v = getKeyValuedouble(kv, "az_offset"); if(v != KV_FLOATERR) P->az_offset = v*M_PI/180.0; v = getKeyValuedouble(kv, "el_offset"); if(v != KV_FLOATERR) P->el_offset = v*M_PI/180.0; v = getKeyValuedouble(kv, "phase_offset"); if(v != KV_FLOATERR) P->phase_offset = v*M_PI/180.0; v = getKeyValuedouble(kv, "sub_h"); if(v != KV_FLOATERR) { P->subrotpoint[0] = 0.0; P->subrotpoint[1] = 0.0; P->subrotpoint[2] = v; } V = getKeyValueVector(kv, "subrotpoint"); if(V) { switch(VectorSize(V)) { case 1: P->subrotpoint[0] = 0.0; P->subrotpoint[1] = 0.0; P->subrotpoint[2] = V[0]; break; case 2: fprintf(stderr, "Warning : assuming a height for sub rot\n"); P->subrotpoint[0] = V[0]; P->subrotpoint[1] = V[1]; break; case 3: P->subrotpoint[0] = V[0]; P->subrotpoint[1] = V[1]; P->subrotpoint[2] = V[2]; break; default: deletePathology(P); fprintf(stderr, "Pathology error : subrotpoint\n"); return 0; } } deleteMatrix(P->subrot); P->subrot = newrotationMatrix(srx, sry, srz); deleteMatrix(P->feedrot); P->feedrot = newrotationMatrix(frx, fry, frz); return P; } void printPathology(const Pathology *P) { printf("Pathology: %p\n", P); printf(" subrot = "); printMatrix(P->subrot); printf(" feedrot = "); printMatrix(P->feedrot); printf(" subshift = "); printVector(P->subshift); printf(" subrotpoint = "); printVector(P->subrotpoint); printf(" feedshift = "); printVector(P->feedshift); printf("\n"); } void deletePathology(Pathology *P) { g_assert(P); if(P->subrot) deleteMatrix(P->subrot); if(P->feedrot) deleteMatrix(P->feedrot); if(P->subshift) deleteVector(P->subshift); if(P->feedshift) deleteVector(P->feedshift); if(P->subrotpoint) deleteVector(P->subrotpoint); g_free(P); } static void normvec(const double *a, const double *b, double *c) { int i; double r; for(i = 0; i < 3; i++) c[i] = a[i] - b[i]; r = sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]); for(i = 0; i < 3; i++) c[i] /= r; } double dAdOmega(const Antenna *a, const Ray *ray1, const Ray *ray2, const Ray *ray3, const Pathology *p) { double A, Omega; double n1[3], n2[3], n3[3], f[3], ci, cj, ck; int i; /* Area in aperture is in a plane z = const */ A = 0.5*fabs( (ray1->aper[0]-ray2->aper[0])*(ray1->aper[1]-ray3->aper[1]) - (ray1->aper[0]-ray3->aper[0])*(ray1->aper[1]-ray2->aper[1]) ); for(i = 0; i < 3; i++) f[i] = a->feed[i] + p->feedshift[i]; normvec(ray1->sub, f, n1); normvec(ray2->sub, f, n2); normvec(ray3->sub, f, n3); for(i = 0; i < 3; i++) { n1[i] -= n3[i]; n2[i] -= n3[i]; } ci = n1[1]*n2[2] - n1[2]*n2[1]; cj = n1[2]*n2[0] - n1[0]*n2[2]; ck = n1[0]*n2[1] - n1[1]*n2[0]; Omega = 0.5*sqrt(ci*ci + cj*cj + ck*ck); return A/Omega; } double dOmega(const Antenna *a, const Ray *ray1, const Ray *ray2, const Ray *ray3, const Pathology *p) { double Omega; double n1[3], n2[3], n3[3], f[3], ci, cj, ck; int i; for(i = 0; i < 3; i++) f[i] = a->feed[i] + p->feedshift[i]; normvec(ray1->sub, f, n1); normvec(ray2->sub, f, n2); normvec(ray3->sub, f, n3); for(i = 0; i < 3; i++) { n1[i] -= n3[i]; n2[i] -= n3[i]; } ci = n1[1]*n2[2] - n1[2]*n2[1]; cj = n1[2]*n2[0] - n1[0]*n2[2]; ck = n1[0]*n2[1] - n1[1]*n2[0]; Omega = 0.5*sqrt(ci*ci + cj*cj + ck*ck); return Omega; } double Raylen(const Ray *ray) { double len = 0, d[3]; int i; /* feed to subreflector */ for(i = 0; i < 3; i++) d[i] = ray->feed[i] - ray->sub[i]; len += sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]); /* subreflector to dish */ for(i = 0; i < 3; i++) d[i] = ray->sub[i] - ray->dish[i]; len += sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]); /* dish to aperture */ for(i = 0; i < 3; i++) d[i] = ray->dish[i] - ray->aper[i]; len += sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]); return len; } void Pathologize(Vector sub, const Pathology *p) { int i; int j; double tmp[6]; for(i = 0; i < 3; i++) sub[i] -= p->subrotpoint[i]; for(i = 0; i < 3; i++) { tmp[i] = 0.0; tmp[i+3] = 0.0; for(j = 0; j < 3; j++) tmp[i] += p->subrot[i][j]*sub[j]; for(j = 0; j < 3; j++) tmp[i+3] += p->subrot[i][j]*sub[j+3]; } for(i = 0; i < 3; i++) sub[i] = tmp[i] + p->subrotpoint[i] + p->subshift[i]; for(i = 4; i < 6; i++) sub[i] = tmp[i]; } void defocusAntenna(Pathology *P, const Antenna *a) { double dx[3]; int i; dx[0] = -a->feed[0]; dx[1] = -a->feed[1]; dx[2] = a->sub_h-a->feed[2]; norm3(dx); for(i = 0; i < 3; i++) P->feedshift[i] += P->focus*dx[i]; P->focus = 0.0; } void intersectdish(const Antenna *a, const Vector sub, const Vector unitdir, Vector dish, int niter) { double A, B, C, t, m, r; double x[3], n[3]; int i, iter; /* First intersect with ideal paraboloid */ A = a->bestparabola*(unitdir[0]*unitdir[0] + unitdir[1]*unitdir[1]); B = 2.0*a->bestparabola*(unitdir[0]*sub[0] + unitdir[1]*sub[1]) -unitdir[2]; C = a->bestparabola*(sub[0]*sub[0] + sub[1]*sub[1]) - sub[2]; t = 0.5*(sqrt(B*B-4.0*A*C) - B)/A; /* take greater root */ for(iter = 0; ; iter++) { /* get position (x) and normal (n) on the real dish */ for(i = 0; i < 2; i++) x[i] = sub[i] + t*unitdir[i]; r = sqrt(x[0]*x[0] + x[1]*x[1]); dishvalue(a, r, &(x[2]), &m); n[2] = 1.0/sqrt(1.0+m*m); n[0] = -m*(x[0]/r)*n[2]; n[1] = -m*(x[1]/r)*n[2]; if(iter >= niter) break; A = B = 0; for(i = 0; i < 3; i++) { A += n[i]*(x[i]-sub[i]); /* n dot (x-sub) */ B += n[i]*unitdir[i]; /* n dot unitdir */ } t = A/B; } for(i = 0; i < 3; i++) { dish[i] = x[i]; dish[i+3] = n[i]; } } void intersectaperture(const Antenna *a, const Vector dish, const Vector unitdir, Vector aper) { double t; int i; t = (a->zedge-dish[2])/unitdir[2]; for(i = 0; i < 3; i++) aper[i] = dish[i] + t*unitdir[i]; aper[3] = aper[4] = 0.0; aper[5] = 1.0; } /* gain in power */ double feedfunc(const Antenna *a, double theta) { double stheta; if(a->feedpattern == 0) { stheta = sin(theta); return exp(2.0*(-0.083)*a->fa2pi*a->fa2pi*stheta*stheta); } else return pow(10.0, 0.1*interpolateVector(a->feedpattern, theta/a->feedpatterndelta)); } /* gain in power */ double feedgain(const Antenna *a, const Ray *ray, const Pathology *p) { double theta, costheta = 0.0; double v[3], f[3]; int i, j; for(i = 0; i < 3; i++) v[i] = ray->sub[i] - ray->feed[i]; norm3(v); for(i = 0; i < 3; i++) f[i] = 0.0; for(j = 0; j < 3; j++) for(i = 0; i < 3; i++) f[j] += p->feedrot[j][i]*a->feeddir[i]; for(i = 0; i < 3; i++) costheta += f[i]*v[i]; if(a->feedpattern == 0) return exp(2.0*(-0.083)*a->fa2pi*a->fa2pi*(1.0-costheta*costheta)); theta = acos(costheta); return pow(10.0, 0.1*interpolateVector(a->feedpattern, theta/a->feedpatterndelta)); } /* returns integral of feedgain(theta)*sin(theta) over theta = 0 to pi/2 * this is equivalent to the power over the forward hemisphere */ double feedpower(const Antenna *a) { const double dtheta = 0.00005; double theta, stheta, thetamax; double v, sum = 0.0; if(a->feedpattern == 0) { for(theta = 0.5*dtheta; theta < 0.5*M_PI; theta+=dtheta) { stheta = sin(theta); v = exp(2.0*(-0.083)*a->fa2pi*a->fa2pi*stheta*stheta); sum += v*stheta*dtheta; } } else { thetamax = a->feedpatterndelta*(VectorSize(a->feedpattern)-1.0); if(thetamax > M_PI/2.0) thetamax = M_PI/2.0; for(theta = 0.5*dtheta; theta < thetamax; theta+=dtheta) { stheta = sin(theta); v = pow(10.0, 0.1*interpolateVector(a->feedpattern, theta/a->feedpatterndelta)); sum += v*stheta*dtheta; } } return 2.0*M_PI*sum; } double feedbackpower(const Antenna *a) { const double dtheta = 0.00005; double theta, stheta, thetamax; double v, sum = 0.0; if(a->feedpattern == 0) return 0.0; else { thetamax = a->feedpatterndelta*(VectorSize(a->feedpattern)-1.0); if(thetamax < M_PI/2.0) return 0.0; if(thetamax > M_PI) thetamax = M_PI; for(theta = M_PI/2.0; theta < thetamax; theta+=dtheta) { stheta = sin(theta); v = pow(10.0, 0.1*interpolateVector(a->feedpattern, theta/a->feedpatterndelta)); sum += v*stheta*dtheta; } return 2.0*M_PI*sum; } } Ray *trace(const Antenna *a, double x, double y, const Pathology *p) { Ray *ray; Vector idealsub; double fu[3], du[3], au[3], ndotf=0.0, ndotd=0.0; int i; const int niter = 7; idealsub = newVector(6); subfromdish(a, x, y, idealsub); ray = newRay(idealsub); deleteVector(idealsub); Pathologize(ray->sub, p); if(ray->sub[5] < -1.0 || ray->sub[5] > -0.0) { deleteRay(ray); return 0; } for(i = 0; i < 3; i++) ray->feed[i] = a->feed[i] + p->feedshift[i]; /* now determine unit vector pointing to dish */ /* unit toward feed */ for(i = 0; i < 3; i++) fu[i] = ray->feed[i] - ray->sub[i]; norm3(fu); /* unit toward dish */ for(i = 0; i < 3; i++) ndotf += ray->sub[i+3]*fu[i]; for(i = 0; i < 3; i++) du[i] = 2.0*ray->sub[i+3]*ndotf - fu[i]; /* dish point */ intersectdish(a, ray->sub, du, ray->dish, niter); /* unit toward aperture */ for(i = 0; i < 3; i++) ndotd += ray->dish[i+3]*du[i]; for(i = 0; i < 3; i++) au[i] = du[i] - 2.0*ray->dish[i+3]*ndotd; intersectaperture(a, ray->dish, au, ray->aper); return ray; } #if 0 Ray *supertrace(const Antenna *a, const Pathology *p, int niter, double x, double y, double *x0, double *y0) { Ray *ray; int iter; double x1, y1, R2; R2 = a->radius*a->radius; x1 = x; y1 = y; for(iter = 0; iter < niter; iter++) { ray = trace(a, x1, y1, p); if(!ray) return 0; x1 += (x - ray->aper[0]); y1 += (y - ray->aper[1]); deleteRay(ray); if(x1*x1 + y1*y1 > R2) return 0; } if(x0) *x0 = x1; if(y0) *y0 = y1; return trace(a, x1, y1, p); } #endif Vector tracepol(const Vector E0, const Ray *ray) { Vector E; int i; double v1[3], v2[3], v3[3], r[3], C[2]; for(i = 0; i < 3; i++) { v1[i] = ray->sub[i] - ray->feed[i]; v2[i] = ray->dish[i] - ray->sub[i]; v3[i] = ray->aper[i] - ray->dish[i]; } norm3(v1); norm3(v2); norm3(v3); E = dupVector(E0); for(i = 0; i < 3; i++) r[i] = v1[i] - v2[i]; norm3(r); C[0] = r[0]*E[0] + r[1]*E[2] + r[2]*E[4]; C[1] = r[0]*E[1] + r[1]*E[3] + r[2]*E[5]; for(i = 0; i < 6; i++) E[i] -= 2.0*r[i/2]*C[i%2]; for(i = 0; i < 6; i++) E[i] = -E[i]; for(i = 0; i < 3; i++) r[i] = v2[i] - v3[i]; norm3(r); C[0] = r[0]*E[0] + r[1]*E[2] + r[2]*E[4]; C[1] = r[0]*E[1] + r[1]*E[3] + r[2]*E[5]; for(i = 0; i < 6; i++) E[i] -= 2.0*r[i/2]*C[i%2]; for(i = 0; i < 6; i++) E[i] = -E[i]; return E; } int legplanewaveblock(const Antenna *a, double x, double y) { /* outside the leg foot area, the blockage is spherical wave */ if(x*x + y*y > a->legfoot*a->legfoot) return 0; if(a->legwidth == 0.0) return 0; if(strcmp(a->name, "VLBA") == 0) { const double s=1.457937; const double c=1.369094; if(fabs(s*x+c*y) < -a->legwidth) return 1; if(fabs(s*x-c*y) < -a->legwidth) return 1; } else if(a->legwidth < 0.0) /* "x shaped" legs */ { if(fabs(x-y)*M_SQRT2 < -a->legwidth) return 1; if(fabs(x+y)*M_SQRT2 < -a->legwidth) return 1; } else if(a->legwidth > 0.0) /* "+ shaped" legs */ { if(fabs(x)*2.0 < a->legwidth) return 1; if(fabs(y)*2.0 < a->legwidth) return 1; } return 0; } int legplanewaveblock2(const Antenna *a, const Ray *ray) { int i, n; double dr2; double theta, phi; double r0[3], dr[3], l0[3], l1[3], dl[3], D[3]; double D2, N[3], ll, rr; const double thetaplus[4] = {0, M_PI/2.0, M_PI, 3.0*M_PI/2.0}; const double thetacross[4] = {0.25*M_PI, 0.75*M_PI, 1.25*M_PI, 1.75*M_PI}; const double thetavlba[4] = {0.816817, 2.3247756, 3.9584096, 5.466368}; const double *thetalut; if(a->legwidth == 0.0) return 0; if(strcmp(a->name, "VLBA") == 0) thetalut = thetavlba; else if(a->legwidth < 0.0) thetalut = thetacross; else thetalut = thetaplus; /* inside the leg feet is plane wave blockage */ dr2 = ray->dish[0]*ray->dish[0] + ray->dish[1]*ray->dish[1]; if(dr2 >= a->legfoot*a->legfoot) return 0; for(i = 0; i < 3; i++) { r0[i] = ray->dish[i]; dr[i] = ray->aper[i] - r0[i]; } rr = r0[0]*r0[0] + r0[1]*r0[1]; l0[2] = a->legfootz; l1[0] = l1[1] = 0.0; l1[2] = a->legapex; phi = atan2(r0[1], r0[0]); for(n = 0; n < 4; n++) { theta = thetalut[n]; l0[0] = a->legfoot*cos(theta); l0[1] = a->legfoot*sin(theta); ll = l0[0]*l0[0] + l0[1]*l0[1]; if((l0[0]*r0[0] + l0[1]*r0[1])/sqrt(ll*rr) < 0.7) continue; for(i = 0; i < 3; i++) dl[i] = l1[i] - l0[i]; for(i = 0; i < 3; i++) D[i] = r0[i] - l0[i]; N[0] = dr[1]*dl[2] - dr[2]*dl[1]; N[1] = dr[2]*dl[0] - dr[0]*dl[2]; N[2] = dr[0]*dl[1] - dr[1]*dl[0]; norm3(N); D2 = D[0]*N[0] + D[1]*N[1] + D[2]*N[2]; if(fabs(D2) <= 0.5*fabs(a->legwidth)) return 1; } return 0; } int legsphericalwaveblock(const Antenna *a, const Ray *ray) { int i, n; double dr2; double theta, phi; double r0[3], dr[3], l0[3], l1[3], dl[3], D[3]; double D2, N[3], ll, rr; const double thetaplus[4] = {0, M_PI/2.0, M_PI, 3.0*M_PI/2.0}; const double thetacross[4] = {0.25*M_PI, 0.75*M_PI, 1.25*M_PI, 1.75*M_PI}; const double thetavlba[4] = {0.816817, 2.3247756, 3.9584096, 5.466368}; const double *thetalut; if(a->legwidth == 0.0) return 0; if(strcmp(a->name, "VLBA") == 0) thetalut = thetavlba; else if(a->legwidth < 0.0) thetalut = thetacross; else thetalut = thetaplus; /* inside the leg feet is plane wave blockage */ dr2 = ray->dish[0]*ray->dish[0] + ray->dish[1]*ray->dish[1]; if(dr2 < a->legfoot*a->legfoot) return 0; for(i = 0; i < 3; i++) { r0[i] = ray->dish[i]; dr[i] = ray->sub[i] - r0[i]; } rr = r0[0]*r0[0] + r0[1]*r0[1]; l0[2] = a->legfootz; l1[0] = l1[1] = 0.0; l1[2] = a->legapex; phi = atan2(r0[1], r0[0]); for(n = 0; n < 4; n++) { theta = thetalut[n]; l0[0] = a->legfoot*cos(theta); l0[1] = a->legfoot*sin(theta); ll = l0[0]*l0[0] + l0[1]*l0[1]; if((l0[0]*r0[0] + l0[1]*r0[1])/sqrt(ll*rr) < 0.7) continue; for(i = 0; i < 3; i++) dl[i] = l1[i] - l0[i]; for(i = 0; i < 3; i++) D[i] = r0[i] - l0[i]; N[0] = dr[1]*dl[2] - dr[2]*dl[1]; N[1] = dr[2]*dl[0] - dr[0]*dl[2]; N[2] = dr[0]*dl[1] - dr[1]*dl[0]; norm3(N); D2 = D[0]*N[0] + D[1]*N[1] + D[2]*N[2]; if(fabs(D2) <= 0.5*fabs(a->legwidth)) return 1; } return 0; } cassbeam-1.1/antenna.h000066400000000000000000000120211275012243400147220ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __ANTENNA_H__ #define __ANTENNA_H__ #include "vector.h" #include "vecarray.h" #include "keyvalue.h" /* * Antenna parameters */ typedef struct { double sub_h; /* height of subreflector (on axis) */ double feed[3]; /* position of the feed */ double feeddir[3]; /* unit vector pointing along feed */ double radius; /* antenna radius (m) */ double K; double deltar; double zedge; /* height at the edge of the dish */ double bestparabola; /* best fit parabola quadratic coef */ double ftaper; /* taper of feed */ double thmax; /* maximum angle of feed */ double fa2pi; double legwidth; double legfoot, legfootz; double legapex; double leggroundscatter; double hole_radius; double freq, lambda; double oversamp; double roughness; /* RMS surface roughness in meters */ double Trec, Tsky, Tground; double elev; /* elevation in radians. 0 = point at horiz */ Vector dir; Vector hhat, vhat; /* unit vectors orthogonal to dir */ Vector z; Vector m; Vector k; Vector pol; /* 4 component electric field -- ReH, ImH, ReV, ImV */ Vector E; /* 6 component electric field -- ReX, ImX, ... */ Vector feedpattern; double feedpatterndelta; char *name; int gridsize; } Antenna; typedef struct { Matrix subrot; /* 3x3 matrix rotating x,y,z or nx,ny,nz */ Matrix feedrot; /* 3x3 matrix rotating x,y,z or nx,ny,nz */ Vector subshift; /* 3 length vector */ Vector feedshift; /* 3 length vector */ Vector subrotpoint; /* 3 vector describing point to rotate sub. */ double az_offset; /* azimuth pointing offset (radians) */ double el_offset; /* elevation pointing offset (radians) */ double phase_offset; /* DC offset in phase (radians) */ double focus; /* meters out of focus toward subreflector */ } Pathology; typedef struct { Vector aper; /* aperture x, y, z, nx, ny, nz */ Vector dish; /* dish x, y, z, nx, ny, nz */ Vector sub; /* subreflector x, y, z, nx, ny, nz */ Vector feed; /* feed x, y, z */ } Ray; Antenna *newAntenna(double sub_h, double feed_x, double feed_y, double feed_z, double ftaper, double thmax, const char *geomfile); void deleteAntenna(Antenna *a); void Antennasetfreq(Antenna *a, double freq); void Antennasetdir(Antenna *a, const Vector dir); void alignfeed(Antenna *a, const Pathology *p); VecArray getfeedbasis(const Antenna *a, const Pathology *p); VecArray calcsubreflectorrim(const Antenna *a, const Pathology *p, int nrim); double subpower(const VecArray rim, const Antenna *a); Vector Efield(const Antenna *a, const Pathology *p, const Vector pol); void Antennasetpol(Antenna *a, const Vector pol); int Antennasetfeedpattern(Antenna *a, const char *filename, double scale); Antenna *newAntennafromKeyValue(struct KeyValue *kv, const char *paramfilename); void printAntenna(const Antenna *a); void defocusAntenna(Pathology *P, const Antenna *a); int dishvalue(const Antenna *a, double r, double *z, double *m); int subfromdish(const Antenna *a, double x, double y, Vector subpoint); int dishfromsub(const Antenna *a, double x, double y, Vector dishpoint); /* void antennaR(const Antenna *a, double r, double *x, double *z); */ Ray *newRay(const Vector sub); void deleteRay(Ray *ray); Pathology *newPathology(); Pathology *dupPathology(const Pathology *P); Pathology *newPathologyfromKeyValue(struct KeyValue *kv); void printPathology(const Pathology *P); void deletePathology(Pathology *P); double dAdOmega(const Antenna *a, const Ray *ray1, const Ray *ray2, const Ray *ray3, const Pathology *p); double dOmega(const Antenna *a, const Ray *ray1, const Ray *ray2, const Ray *ray3, const Pathology *p); double Raylen(const Ray *ray); double feedfunc(const Antenna *a, double theta); double feedgain(const Antenna *a, const Ray *ray, const Pathology *p); double feedpower(const Antenna *a); double feedbackpower(const Antenna *a); void Pathologize(Vector sub, const Pathology *p); void intersectdish(const Antenna *a, const Vector sub, const Vector unitdir, Vector dish, int niter); void intersectaperture(const Antenna *a, const Vector dish, const Vector unitdir, Vector aper); Ray *trace(const Antenna *a, double x, double y, const Pathology *p); Vector tracepol(const Vector E0, const Ray *ray); int legplanewaveblock(const Antenna *a, double x, double y); int legplanewaveblock2(const Antenna *a, const Ray *ray); int legsphericalwaveblock(const Antenna *a, const Ray *ray); #endif cassbeam-1.1/cassbeam.c000066400000000000000000000222561275012243400150620ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include #include "vector.h" #include "image.h" #include "image-vector.h" #include "vector-fftw.h" #include "vecarray.h" #include "polygon.h" #include "randdist.h" #include "antenna.h" #include "illum.h" const char program[] = "cassbeam"; const char version[] = "1.0"; const char versiondate[] = "08/18/2003"; /* TODO * * * POST 1.0 * Add opacity for gain and Tsys calculations * Compute phase gradient in primary beam (DFT beam cuts) * Oversample blockage calculations? * More accurate diffraction loss? * Feed radius/azimuth instead of x,y */ /* given an array of alternating re and im components, mult by exp(i phase) */ void phaseshift(Vector e, double phase) { double c, s; Vector E; int i, N; N = VectorSize(e); g_assert(N % 2 == 0); c = cos(phase); s = sin(phase); E = dupVector(e); for(i = 0; i < N; i+=2) { e[i ] = c*E[i] - s*E[i+1]; e[i+1] = s*E[i] + c*E[i+1]; } deleteVector(E); } /* Returns 4 matrices : Re[Ex], Im[Ex], Re[Ey], Im[Ey] */ Illum *cassillum(const Antenna *a, const Pathology *p, const struct KeyValue *kv) { int i, j, ii, jj, N, n, iter, niter=7; double dx, dA, R2, H2, eps; Ray *ray, *rayx, *rayy, *bray; double x, y, r2, x1, y1, bx, by; double dx1, dy1, dx2, dy2; double dO, dP; double amp, L, L0; Vector E, Er, El, Pr, Pl; Illum *I; double Pforward, Pbackward, Pspill, Pground, Pleg=0.0, Phole=0.0; double Psub=0.0, Ppri=0.0, Ptot; double phase, cp, sp; double subperimeter; const int nrim=120; VecArray subrim; /* columns are : X, Y, Z, theta, rho, dtheta */ VecArray B; /* compute total power coming out of the feed */ Pforward = feedpower(a); Pbackward = feedbackpower(a); Ptot = Pforward + Pbackward; /* compute rim of subreflector and the total power hitting it */ subrim = calcsubreflectorrim(a, p, nrim); Psub = subpower(subrim, a); subperimeter = polygonperimeter(subrim[0], subrim[1]); /* compute image size */ if(a->gridsize > 0) n = a->gridsize/2; else n = 2.0*a->oversamp*a->radius/a->lambda + 0.999; if(n%2 == 1) n++; N = 2*n; dx = a->radius/n; dA = dx*dx; eps = dx/9.237; R2 = a->radius*a->radius; H2 = a->hole_radius*a->hole_radius; /* compute central ray pathlength */ ray = trace(a, 0.0, 0.00001, p); L0 = Raylen(ray); deleteRay(ray); /* compute polarization vectors */ Pr = newVector(4); Pl = newVector(4); Pr[0] = 1.0/M_SQRT2; Pr[1] = 0.0; Pr[2] = 0.0; Pr[3] = 1.0/M_SQRT2; Pl[0] = 1.0/M_SQRT2; Pl[1] = 0.0; Pl[2] = 0.0; Pl[3] = -1.0/M_SQRT2; Er = Efield(a, p, Pr); El = Efield(a, p, Pl); deleteVector(Pr); deleteVector(Pl); B = getfeedbasis(a, p); /* Initialize the illumination structure */ I = newIllum(N); setIllumfromKeyValue(I, kv); I->dA = dA; I->a0 = a->radius*a->radius*M_PI; I->lambda = a->lambda; I->Tsky = a->Tsky; I->Tground = a->Tground; I->Trec = a->Trec; I->Xangle = atan2(B[0][1], B[0][0]); I->gridsize = a->gridsize; phaseshift(Er, -I->Xangle); phaseshift(El, I->Xangle); I->Xangle = 0.0; /* compute field on primary */ for(j = -n; j < n; j++) { y = (j + 0.5)*dx; jj = j + n; for(i = -n; i < n; i++) { x = (i + 0.5)*dx; ii = i + n; ray = rayx = rayy = bray = 0; r2 = x*x + y*y; if(r2 > R2) continue; x1 = x; y1 = y; /* Iterate to find starting point */ for(iter = 0; iter < niter; iter++) { ray = trace(a, x1, y1, p); if(!ray) goto nextpoint; x1 += (x - ray->aper[0]); y1 += (y - ray->aper[1]); deleteRay(ray); ray = 0; if(x1*x1 + y1*y1 > R2) goto nextpoint; } if(y < 0) rayy = trace(a, x1, y1+eps, p); else rayy = trace(a, x1, y1-eps, p); if(x < 0) rayx = trace(a, x1+eps, y1, p); else rayx = trace(a, x1-eps, y1, p); ray = trace(a, x1, y1, p); if(ray == 0 || rayx == 0 || rayy == 0) goto nextpoint; dx1 = rayx->aper[0]-ray->aper[0]; dy1 = rayx->aper[1]-ray->aper[1]; dx2 = rayy->aper[0]-ray->aper[0]; dy2 = rayy->aper[1]-ray->aper[1]; /* To make blockage statistically correct... */ bx = x + 0.5*rand_pm_one()*(dx1/eps)*dx; by = y + 0.5*rand_pm_one()*(dy2/eps)*dx; bray = trace(a, bx, by, p); dA = 0.5*fabs(dx1*dy2 - dx2*dy1); dO = (dOmega(a, rayx, rayy, ray, p)/dA)*dx*dx; dP = dO*feedgain(a, ray, p); /* Check for blockage */ if(bx*bx+by*by < H2) /* hole in the middle */ { I->B[jj][ii] = 1.0; Phole += dP; } else if(legplanewaveblock2(a, bray) || /* legs */ legsphericalwaveblock(a, bray)) { I->B[jj][ii] = 1.0; Pleg += dP; } #if 0 if(polygonside(subrim[0], subrim[1], ray->sub[0], ray->sub[1]) < 0) { Po += dP; printf("."); goto nextpoint; } #endif Ppri += dP; /* Fill in Scalar field matrices */ amp = sqrt(dP); L = Raylen(ray); phase = 2.0*M_PI*(L-L0)/a->lambda; sp = sin(phase); cp = cos(phase); I->A[jj][ii] = amp; I->P[jj][ii] = phase; /* Fill in Vector field matrices */ E = tracepol(Er, ray); I->E[RXR][jj][ii] = amp*(E[0]*cp - E[1]*sp); I->E[IXR][jj][ii] = amp*(E[0]*sp + E[1]*cp); I->E[RYR][jj][ii] = amp*(E[2]*cp - E[3]*sp); I->E[IYR][jj][ii] = amp*(E[2]*sp + E[3]*cp); I->E[RZR][jj][ii] = amp*(E[4]*cp - E[5]*sp); I->E[IZR][jj][ii] = amp*(E[4]*sp + E[5]*cp); deleteVector(E); E = tracepol(El, ray); I->E[RXL][jj][ii] = amp*(E[0]*cp - E[1]*sp); I->E[IXL][jj][ii] = amp*(E[0]*sp + E[1]*cp); I->E[RYL][jj][ii] = amp*(E[2]*cp - E[3]*sp); I->E[IYL][jj][ii] = amp*(E[2]*sp + E[3]*cp); I->E[RZL][jj][ii] = amp*(E[4]*cp - E[5]*sp); I->E[IZL][jj][ii] = amp*(E[4]*sp + E[5]*cp); deleteVector(E); nextpoint: if(ray) deleteRay(ray); if(rayx) deleteRay(rayx); if(rayy) deleteRay(rayy); if(bray) deleteRay(bray); } } deleteVecArrayandVectors(B); deleteVecArrayandVectors(subrim); deleteVector(Er); deleteVector(El); /* remove phase gradient, populate pointing fields */ dephaseIllum(I); /* again, with incremental inprovements */ dephaseIllum(I); Pspill = Ptot - Ppri; Pground = Pspill - (Ptot-Psub) + a->leggroundscatter*Pleg; I->groundfrac = Pground/Ptot; I->spilleff = 1.0-Pspill/Ptot; I->subspilleff = Psub/Ptot; I->prispilleff = I->spilleff/I->subspilleff; x = 4.0*M_PI*a->roughness/a->lambda; I->surfeff = exp(-x*x); /* Emperical -- FIXME */ if(I->diffeff == 0.0) I->diffeff = 1.0-5.5*a->lambda/subperimeter; calcIllumparams(I); return I; } void savecassdata(const Antenna *a, const Illum *I) { char filename[1000]; if(I->saveapertureimages) { sprintf(filename, "%s.illumamp.pgm", I->prefix); saveMatrixaspgm(I->A, filename); sprintf(filename, "%s.illumphase.pgm", I->prefix); saveMatrixaspgm(I->P, filename); sprintf(filename, "%s.illumblock.pgm", I->prefix); saveMatrixaspgm(I->B, filename); } } int makecassbeam(struct KeyValue *kv, const char *paramfile) { Pathology *p; Antenna *a; Illum *I; char filename[1000]; a = newAntennafromKeyValue(kv, paramfile); g_assert(a); p = newPathologyfromKeyValue(kv); g_assert(p); alignfeed(a, p); printAntenna(a); printPathology(p); if(p->focus != 0.0) defocusAntenna(p, a); I = cassillum(a, p, kv); printIllum(I); calcIllumpolparams(I); savecassdata(a, I); KeyValueupdateIllum(kv, I); if(I->saveparams) { sprintf(filename, "%s.params", I->prefix); saveKeyValue(kv, filename); } deleteIllum(I); deletePathology(p); deleteAntenna(a); return 1; } int main(int argc, char **argv) { struct KeyValue *kv; int i, j; char k[100], v[100]; if(argc < 2) { fprintf(stderr, "%s version %s\n\n", program, version); fprintf(stderr, "Walter Brisken, NRAO, %s\n\n", versiondate); fprintf(stderr, "usage : %s [options]\n", argv[0]); return 0; } kv = loadKeyValue(argv[1]); if(!kv) return 0; if(argc > 2) for(i = 2; i < argc; i++) { if(argv[i][0] == '=') fprintf(stderr, "Warning -- option begins with =\n"); for(j = 0; argv[i][j] != 0; j++) if(argv[i][j] == '=') argv[i][j] = ' '; if(sscanf(argv[i], "%s %s", k, v) != 2) continue; j = KeyValuekeyindex(kv, k); if(j < 0) KeyValueaddparm(kv, k, v); else { g_free(kv->value[j]); kv->value[j] = g_strdup(v); } } /* force some default values */ if(KeyValuekeyindex(kv, "out") < 0) KeyValueupdateparm(kv, "out", program); if(KeyValuekeyindex(kv, "compute") < 0) KeyValueupdateparm(kv, "compute", "all"); KeyValueupdateparm(kv, "program", program); KeyValueupdateparm(kv, "version", version); makecassbeam(kv, argv[1]); deleteKeyValue(kv); printf("\n%s has finished\n", program); return 0; } cassbeam-1.1/configure000077500000000000000000004234431275012243400150520ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="antenna.c" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS CASSBEAM_VERSION CASSBEAM_MINOR CASSBEAM_MAJOR EGREP GREP CPP GLIB_CONFIG INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CASSBEAM_MAJOR=1 CASSBEAM_MINOR=1 CASSBEAM_VERSION="${CASSBEAM_MAJOR}.${CASSBEAM_MINOR}" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GLIB_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GLIB_CONFIG"; then ac_cv_prog_GLIB_CONFIG="$GLIB_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GLIB_CONFIG="ok" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GLIB_CONFIG" && ac_cv_prog_GLIB_CONFIG="NONE" fi fi GLIB_CONFIG=$ac_cv_prog_GLIB_CONFIG if test -n "$GLIB_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_CONFIG" >&5 $as_echo "$GLIB_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$GLIB_CONFIG" != xNONE then { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"for GLIB version\"" >&5 $as_echo_n "checking \"for GLIB version\"... " >&6; } glib_version=`pkg-config --version glib-2.0` glib_flags=`pkg-config --cflags glib-2.0` glib_libs=`pkg-config --libs glib-2.0` else as_fn_error $? "\"Could not find glib-config in PATH\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$glib_version\"" >&5 $as_echo "\"$glib_version\"" >&6; } for flag in ${glib_flags} do if echo "${CFLAGS}" | grep -v -- "$flag" > /dev/null then CFLAGS="${CFLAGS} $flag" fi done for lib in ${glib_libs} do if echo "${LIBS}" | grep -v -- "$lib" > /dev/null then LIBS="${LIBS} $lib" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for erf in -lm" >&5 $as_echo_n "checking for erf in -lm... " >&6; } if ${ac_cv_lib_m_erf+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char erf (); int main () { return erf (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_erf=yes else ac_cv_lib_m_erf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_erf" >&5 $as_echo "$ac_cv_lib_m_erf" >&6; } if test "x$ac_cv_lib_m_erf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi XLIBS=${LIBS} LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_create_plan in -lfftw" >&5 $as_echo_n "checking for fftw_create_plan in -lfftw... " >&6; } if ${ac_cv_lib_fftw_fftw_create_plan+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_create_plan (); int main () { return fftw_create_plan (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fftw_fftw_create_plan=yes else ac_cv_lib_fftw_fftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw_fftw_create_plan" >&5 $as_echo "$ac_cv_lib_fftw_fftw_create_plan" >&6; } if test "x$ac_cv_lib_fftw_fftw_create_plan" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFFTW 1 _ACEOF LIBS="-lfftw $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rfftw_create_plan in -lrfftw" >&5 $as_echo_n "checking for rfftw_create_plan in -lrfftw... " >&6; } if ${ac_cv_lib_rfftw_rfftw_create_plan+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rfftw_create_plan (); int main () { return rfftw_create_plan (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rfftw_rfftw_create_plan=yes else ac_cv_lib_rfftw_rfftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rfftw_rfftw_create_plan" >&5 $as_echo "$ac_cv_lib_rfftw_rfftw_create_plan" >&6; } if test "x$ac_cv_lib_rfftw_rfftw_create_plan" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRFFTW 1 _ACEOF LIBS="-lrfftw $LIBS" fi fftw_libs=${LIBS} LIBS="${XLIBS} ${fftw_libs}" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fftw.h do : ac_fn_c_check_header_mongrel "$LINENO" "fftw.h" "ac_cv_header_fftw_h" "$ac_includes_default" if test "x$ac_cv_header_fftw_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FFTW_H 1 _ACEOF fi done for ac_header in rfftw.h do : ac_fn_c_check_header_mongrel "$LINENO" "rfftw.h" "ac_cv_header_rfftw_h" "$ac_includes_default" if test "x$ac_cv_header_rfftw_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RFFTW_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi if test x${prefix} = "xNONE" then prefix="/usr/local" fi echo "LIBS = ${LIBS}" echo "CFLAGS = ${CFLAGS}" LDFLAGS="${LDFLAGS} ${LIBS}" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo echo "Type make to build cassbeam" echo cassbeam-1.1/configure.in000066400000000000000000000033361275012243400154470ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(antenna.c) dnl AC_CONFIG_HEADER(config.h) AC_PREFIX_DEFAULT(/usr/local) CASSBEAM_MAJOR=1 CASSBEAM_MINOR=1 CASSBEAM_VERSION="${CASSBEAM_MAJOR}.${CASSBEAM_MINOR}" dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_CHECK_PROG(GLIB_CONFIG, pkg-config, ok, NONE) if test "x$GLIB_CONFIG" != xNONE then AC_MSG_CHECKING("for GLIB version") glib_version=`pkg-config --version glib-2.0` glib_flags=`pkg-config --cflags glib-2.0` glib_libs=`pkg-config --libs glib-2.0` else AC_MSG_ERROR("Could not find glib-config in PATH") fi AC_MSG_RESULT("$glib_version") dnl ADD CODE to check for version number dnl get rid of any duplicates in CFLAGS or LIBS for flag in ${glib_flags} do if echo "${CFLAGS}" | grep -v -- "$flag" > /dev/null then CFLAGS="${CFLAGS} $flag" fi done for lib in ${glib_libs} do if echo "${LIBS}" | grep -v -- "$lib" > /dev/null then LIBS="${LIBS} $lib" fi done dnl Checks for libraries. AC_CHECK_LIB(m, erf) XLIBS=${LIBS} LIBS="" AC_CHECK_LIB(fftw, fftw_create_plan) AC_CHECK_LIB(rfftw, rfftw_create_plan) fftw_libs=${LIBS} dnl if test "x$LIBS" = x dnl then dnl AC_MSG_ERROR("Couldn't find fftw") dnl fi LIBS="${XLIBS} ${fftw_libs}" dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fftw.h) AC_CHECK_HEADERS(rfftw.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. if test x${prefix} = "xNONE" then prefix="/usr/local" fi echo "LIBS = ${LIBS}" echo "CFLAGS = ${CFLAGS}" LDFLAGS="${LDFLAGS} ${LIBS}" AC_SUBST(CASSBEAM_MAJOR) AC_SUBST(CASSBEAM_MINOR) AC_SUBST(CASSBEAM_VERSION) AC_SUBST(LDFLAGS) AC_OUTPUT(Makefile) echo echo "Type make to build cassbeam" echo cassbeam-1.1/constants.h000066400000000000000000000022131275012243400153140ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __CONSTANTS_H__ #define __CONSTANTS_H__ #include /* X_Y = multiplicitive constant required to convert a number in X units to * a number in Y units. * * 39.37 * INCH_METER = 1.0 */ #define METER_INCH 39.37008 #define INCH_METER (1.0/METER_INCH) #define NS_METER 0.299792458 /* Exact */ #define METER_NS (1.0/NS_METER) #define DEG_RAD M_PI/180.0 #define RAD_DEG 180.0/M_PI #endif cassbeam-1.1/doc/000077500000000000000000000000001275012243400136765ustar00rootroot00000000000000cassbeam-1.1/doc/Makefile000066400000000000000000000003261275012243400153370ustar00rootroot00000000000000TARGETS = cassbeam.ps all: $(TARGETS) cassbeam.dvi: cassbeam.tex latex cassbeam.tex latex cassbeam.tex cassbeam.ps: cassbeam.dvi dvips cassbeam.dvi -o cassbeam.ps clean: -rm -f *.aux *.dvi *.log $(TARGETS) cassbeam-1.1/doc/cassbeam.1000066400000000000000000000417211275012243400155430ustar00rootroot00000000000000.\" Copyright (C) August 18, 2003 Walter Brisken .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .TH "CASSBEAM" "1" "18 Aug 2003" "1.0" "User Commands" .SH "NAME" cassbeam \- Cassbeam is a Cassegrain antenna ray tracer .SH "SYNOPSIS" .PP \fBcassbeam\fR \fIinput_file\fR [\fIkey\fR=\fIvalue\fR ...] .SH "DESCRIPTION" .PP \fBcassbeam\fR is a program for Cassegrain antenna modelling. It computes several properties of the antenna including gain, zenith system temperature, and the beam, in full polarization. All calculations are done in the transmit sense and use reciprocity to relate to the equivalent receiving system. .PP Cassbeam is a non-interactive command line program that takes all of its input from the command line. Note that this does not preclude someone at a later date from making a graphical or web front end. There is one required argument when running cassbeam - the input filename. Additional arguments can supplement the parameters of the input file. These arguments are passed in the same \fBkey=value\fR as required in the input file except whitespace is not allowed around the equal sign. If a parameter appears both in the input file and the command line, then the value on the command line supercedes the value on the input file. .SH "INPUT FILE" .PP The main input file consists of a series of lines of the form \fIkey\fR=\fIvalue\fR. Only one such entry is allowed per line. The equal sign is optional. The input files allow comments to be placed within the file. All comments begin with \fI%\fR. This character and any that follow it on a given line are ignored by cassbeam. Depending on \fIkey\fR, the \fIvalue\fR may be one of five types: string, integer, double, vector, none. A string is a sequence of non-whitespace characters \fInot\fR surrounded by quotes of any kind. A double value is a number that can have a fractional part. A vector is a comma-separated list of doubles. The `none' type expects no \fIvalue\fR. Below is a list of the allowed \fIkeys\fR and the type of \fIvalue\fR expected. If the range of legal values is restricted, the legal range will be contained within brackets. Note that legal values do not imply a physical system that will generate meaningful results! For the vector type, if a certain number of values are needed, they will be indicated in parentheses. A required parameter will be indicated with a `*'. It is important to realize that the secondary optical surface (i.e., the subreflector) is defined based on the input geometry. Thus changing the feed placement will change the geometry of the subreflector! To change parameters of the telescope without affecting the shape of the subreflector, set the pathology parameters. Note that the order of the parameters does not matter. .SS "Antenna geometry parameters" .TP \fBfeed\_x\fR The x value of the phase center of the feed. If no value is provided, 0 is assumed. [double] .TP \fBfeed\_y\fR The y value of the phase center of the feed. If no value is provided, 0 is assumed. [double] .TP \fBfeed\_z\fR The z value of the phase center of the feed. If no value is provided, 0 is assumed. [double] .TP \fBgeom\fR This string points to a disk file containing the primary optical surface geometry. This file is a three column ascii text file, each containing space separated values for r, z, and dz/dr for the antenna. There is no limit (other than your computer's memory) to the number of lines in this file. It is assumed (but not checked!) that the values of r start at 0 and are equally spaced. The radius, R, of the primary is given by the value of r in the last row. Columns 1 and 2 are in meters, and column 3 is dimensionless. [string] .TP \fBhole\_radius\fR The radius (in meters) of an unpanelled area at the center of the primary. If omitted, no hole will be made. [double, > 0] .TP \fBlegapex\fR The z value where the legs (struts) intersect each other. Note that the legs might terminate before reaching this point. The default value is 1.2*\fBsub_h\fR. [double, > 0] .TP \fBlegfoot\fR The r value where the legs (struts) intersect the primary surface. The default value is half the antenna radius. [double, > 0] .TP \fBlegwidth\fR The effective width of the legs, used to compute blockage. Note that currently a positive value indicates four equally spaced legs with one leg along the x axis. If the value is negative, its absolute value is used in the blockage calculations, but the legs are rotated 45°. If this parameter is not set, or if it is set to 0, then no legs will be generated. [double] .TP \fBname\fR An optional name given to the antenna. If the name is ``VLBA'', then the true strut geometry for the VLBA antennas is used rather than equispaced struts. [string] .TP \fBroughness\fR The RSS surface roughness in meters. This number represents the combined surface error for the primary and secondary. If no roughness is provided, the default value of 0 is used. [double, >= 0] .TP \fBsub_h\fR This value is the z value of the intersection of the subreflector with the z axis. [double, > 0] .PP .SS "Feed pattern parameters" .PP Note that either both \fBfeedtaper\fR and \fBfeedangle\fR or \fBfeedpattern\fR must be provided. .TP \fBfeedangle\fR Sets the reference angle for the feed taper. [double, > 0] .TP \fBfeedpattern\fR The name of the file containing the pattern of the feed. This file contains two space-separated columns of numbers: the angle in degrees and the taper in dB. The first angle must equal 0, and the angles must be uniformly spaced. [string] .TP \fBfeedpatternscale\fR The factor by which to scale the pattern defined in \fBfeedpattern\fR. [double, > 0] .TP \fBfeedtaper\fR This parameter sets the taper (in dB) of the feed at an angle \fBfeedangle\fR from the feed axis to 10^-\fBfeedtaper\fR/10. [double, > 0] .PP .SS "Pathology parameters" .PP None of the following operations change the shape of the subreflector - its geometry is calculated before their application. Note that displacements of either the feed or the subreflector result in a rotation of the feed that corrects for the mispointing caused by the translations. Rotations of the feed act in addition to this correction. Composited rotations (i.e., setting \fBrsub_x\fR and \fBrsub_y\fR are both provided), the operations on the object being rotated proceed in reverse alphabetical order (z rotation before y rotation; y rotation before x rotation) regardless of the order that the parameters are received. .TP \fBdfeed\_x\fR Displacement of the feed along the x axis. [double] .TP \fBdfeed\_y\fR Displacement of the feed along the y axis. [double] .TP \fBdfeed\_z\fR Displacement of the feed along the z axis. [double] .TP \fBdsub\_x\fR Displacement of the subreflector along the x axis. [double] .TP \fBdsub\_y\fR Displacement of the subreflector along the y axis. [double] .TP \fBdsub\_z\fR Displacement of the subreflector along the z axis. [double] .TP \fBfocus\fR Displacement of the feed along the feed axis. A positive value moves the feed closer to the subreflector. [double] .TP \fBrfeed_x\fR Rotation of the feed in degrees about the x axis. A positive value will rotate from the z axis through the y axis. [double] .TP \fBrfeed_y\fR Rotation of the feed in degrees about the y axis. A positive value will rotate from the x axis through the z axis. [double] .TP \fBrfeed_z\fR Rotation of the feed in degrees about the z axis. A positive value will rotate from the y axis through the x axis. [double] .TP \fBrsub_x\fR Rotation of the subreflector in degrees about the x axis. A positive value will rotate from the z axis through the y axis. [double] .TP \fBrsub_y\fR Rotation of the subreflector in degrees about the y axis. A positive value will rotate from the x axis through the z axis. [double] .TP \fBrsub_z\fR Rotation of the subreflector in degrees about the z axis. A positive value will rotate from the y axis through the x axis. [double] .TP \fBsubrotpoint\fR Defines the point about which the rotation of the subreflector is performed. The contents of the vector depend on the number of elements are provided: either only the z value, or the x and y values, or the x, y, and z values. [vector (1 or 2 or 3)] .PP .SS "Operating condition parameters" .TP \fBcompute\fR A string to tell what output to produce. The string can be `all', `none', or a string containing flag characters. The default value is `all', meaning produce all possible output. `none' will produce only messages on the screen and no output files. The characters of the general string mean the following: .IP \fBa\fR Save the aperture images; .IP \fBj\fR Save the Jones matrices in a table; .IP \fBp\fR Save the parameters; .IP \fBs\fR Save the polarized beams. .IP Note that the string is case insensitive. [string] .TP \fBdiffeff\fR A user supplied diffraction efficiency. If none is provided, an internal algorithm that is not very good is used. This needs to be upgraded! [double] .TP \fBfreq\fR The frequency in GHz at which the calculation will be run. [double, > 0] .TP \fBgridsize\fR Specifies a fixed grid size. If odd, the next even number will be used. This option overrides any setting of \fBoversamp\fR and is the preferred method of setting the grid size. Setting it to a value less than 32 will result in a grid size of 32. [integer, >= 32] .TP \fBleggroundscatter\fR The fraction of power that scatters off the struts toward the ground. The default value is 0.2. [double, >= 0, <= 1] .TP \fBmisceff\fR A factor of the efficiency calculation that contains ``everything else''. The user is responsible for choosing a realistic value for this. A default of 1 (i.e., 100%) is assumed if this parameter is not provided. [double, >= 0, <= 1] .TP \fBout\fR The prefix for all output files. The default is \fIcassbeam\fR. A dot will always separate the prefix from any trailing characters. [string] .TP \fBoversamp\fR One way of specifying the grid size. This option will make the grid on the primary fine enough to accommodate 4*\fBoversamp\fR*R/lambda points. The default is 1. Note that vastly ``undersampling'' is fine as the field is never calculated anywhere between the feed and the aperture plane. Normally blockage calculations and constancy of the illumination will dictate the required sampling. See \fBgridsize\fR for an alternate way of specifying the grid. This parameter is ignored if \fBgridsize\fR is set. [double, > 0] .TP \fBpixelsperbeam\fR This is the approximate number of pixels that the core of the beam will occupy in the output images. [int, > 0] .TP \fBTground\fR The temperature in Kelvin of the ground. The default value is 290. [double, > 0] .TP \fBTrec\fR The equivalent temperature of the receiver. This adds into the system temperature. The default value is 50. [double, > 0] .TP \fBTsky\fR The temperature in Kelvin of the sky. The default value is 3 for frequencies over 1 GHz, and 3 * 10^-2.5 nu for frequencies below 1 GHz. [double, > 0] .PP .SH "OUTPUT FILES" .PP Up to 12 output files are generated depending on which \fBcompute\fR options were selected at run time. These files are listed below. The letter in brackets in the section headings indicate which option is used to enable this file to be written. All output files begin with the value of the input parameter \fBout\fR. Currently all output images are in PGM format, which is a very simple greyscale image format supported by most unix-based image viewers. .SS "Aperture images [a]" .PP Three images are generated that allow the aperture field to be examined qualitatively. If quantitative numbers are needed, the source code should be modified to export the illumination parameters. .TP \fIout\fB.illumamp.pgm\fR Raster image showing the amplitude of the illumination pattern of the primary. No blockage is done at this point. The scale is linear in flux. .TP \fIout\fB.illumphase.pgm\fR Raster image showing the net phase (pathlength multiplied by wave vector) at each point on the primary. A phase gradient is removed. Portions of the image that correspond to zero flux have an arbitrary phase. .TP \fIout\fB.illumblock.pgm\fR Raster image showing the blocked portion of the aperture. White means that this part of the dish is experiences either plane wave blockage from the sky or spherical wave blockage from the feed, and thus does not contribute to the gain of the antenna. .PP .SS "Jones matrix file [j]" .PP The Jones matrix file, \fIout\fB.jones.dat\fR contains the Jones matrix (see Hamaker et al. 1996 for details) corresponding to the effect of the antenna on the incoming radiation as a function of position on the sky. The file is organized as an eight column ascii. The first row corresponds to the point on the image with smallest l and m. The rastering then proceeds first with increasing l, and then with increasing m. There are a total of n^2 rows, where n is the smallest odd number greater than or equal to the \fBgridsize\fR used. The matrices are rastered on a sine-projected coordinate system tangent to the sky at the beam center, which corresponds to row number (n^2+1)/2. At the beam center the pixel scale is given by the output parameter \fBbeampixelscale\fR, which is stored in the output file \fIout\fB.params\fR described below. .PP .SS "Parameter file [p]" .PP The parameter file, \fIout\fB.params\fR is an output file in the same format as the input file, containing all of the input parameters that were specified (even if on the command line) as well as many output values. They are: .TP \fBAeff\fR The effective area of the antenna [m^2]. [double] .TP \fBAeff\_Tsys\fR The effective area of the antenna divided by the system temperature [m^2/K]. [double] .TP \fBampeff\fR The amplitude efficiency. [double] .TP \fBbeampixelscale\fR The scale of the generated beam images [deg/pixel]. [double] .TP \fBblockeff\fR The blockage efficiency. [double] .TP \fBdiffeff\fR The diffraction efficiency. [double] .TP \fBfwhm\_l\fR The full width at half max of the beam in the l direction. [double] .TP \fBfwhm\_m\fR The full width at half max of the beam in the m direction. [double] .TP \fBgain\fR The gain G of the antenna. [double] .TP \fBillumeff\fR The illumination efficiency. [double] .TP \fBpeaksidelobe\fR The directivity of the greatest sidelobe relative to the peak directivity of the beam. [double] .TP \fBphaseeff\fR The phase efficiency. [double] .TP \fBpoint\_l\fR The l component of the pointing offset from the z axis measured in the image plane. [double] .TP \fBpoint\_m\fR The m component of the pointing offset from the z axis measured in the image plane. [double] .TP \fBprispilleff\fR The primary spillover efficiency. [double] .TP \fBprogram\fR The name of the program run, which is \fIcassbeam\fR. [string] .TP \fBmisceff\fR The miscellaneous efficiency. [double] .TP \fBspilleff\fR The spillover efficiency. [double] .TP \fBsubspilleff\fR The subreflector spillover efficiency. [double] .TP \fBsurfeff\fR The surface efficiency. [double] .TP \fBtotaleff\fR The total efficiency calculated for the antenna. [double] .TP \fBTsys\fR The system temperature. [double] .TP \fBversion\fR The software version number. [string] .PP .SS "Polarized beam images [s]" .PP With the \fBs\fR option, cassbeam will produce 7 images of the beam showing in the four Stokes parameters the response to an unpolarized source as a function of the position of the source on the sky. This information is derived from the Jones matrices which are saved in \fIout\fB.jones.dat\fR. These images are meant for qualitative inspection. The Jones matrices contain the formal output. .TP \fIout\fB.I.pgm\fR Stokes I - total intensity; .TP \fIout\fB.Q.pgm\fR Stokes Q - excess linear polarization e_1 over e_2; .TP \fIout\fB.U.pgm\fR Stokes U - excess linear polarization in e'_1 over e'_2 .TP \fIout\fB.V.pgm\fR Stokes V - excess right circular polarzation over left circular polarization; .TP \fIout\fB.QI.pgm\fR The ratio of the Stokes Q image to the Stokes I image; .TP \fIout\fB.UI.pgm\fR The ratio of the Sytokes U image to the Stokes I image; .TP \fIout\fB.VI.pgm\fR The ratio of the Stokes V image to the Stokes I image; .PP .SH "AUTHOR" .PP \fBCassbeam\fR is written by Walter Brisken, National Radio Astronomy Observatory. This manpage is extracted from his cassbeam manual. .SH "SEE ALSO" .PP See the complete manual in /usr/share/doc/cassbeam/ for more information. cassbeam-1.1/doc/cassbeam.tex000066400000000000000000001353321275012243400162050ustar00rootroot00000000000000\documentclass{article} \usepackage{fullpage} \usepackage{graphics} \begin{document} \begin{center} {\Large \it CASSBEAM} \vspace{5pt} Software for Cassegrain antenna modelling \vspace{10pt} {\it Walter Brisken} \vspace{5pt} National Radio Astronomy Observatory \vspace{5 pt} Version {\bf 1.0} \hspace{0.5in} August 18, 2003 \end{center} \section{Introduction} Cassbeam is a Cassegrain antenna ray tracer. Based on an input text file, it computes several properties of the antenna including gain, zenith system temperature, and the beam, in full polarization. All calculations are done in the {\it transmit sense} and use reciprocity to relate to the equivalent receiving system. A classical Cassegrain antenna consists of a paraboloidal primary optical surface and a hyperboloidal secondary. This allows a large effective focal length to be shortened considerably. This means that more directive feeds can be used. Since wideband feeds tend to have narrower radiation patterns, the Cassegrain is often a better choice for wide band systems. A second advantage of Cassegrain systems is that the radiation that spills over the secondary reaches the cold sky rather than the 290K ground. Shaped Cassegrain systems have primary surfaces that are rotationally symmetric but no longer paraboloidal. The secondary is then shaped as well in order to well define a secondary focus. Shaping is used to adjust the amplitude of the illumination across the primary, allowing for higher aperture efficiency. An additional deviation from the classical Cassigrain is placing the feed off axis and compensating with an asymmetric secondary. This is used at the VLA. It allows a rotation of the subreflector about the primary's symmetry axis to point the beam toward one of six feeds. Both of these deviations from a classical Cassegrain are supported. An example of a offset, shaped Cassegrain antenna is shown in Fig.~\ref{fig:vlaant}. Additionally, cassbeam allows deformations, or ``pathologies'' of the optics to be modelled. Currently this is limited to rotations and translations of the feed and secondary. In the future, large scale deviations in the primary (such as a misplaced panel) will likely be supported. \begin{figure}[h!] \begin{center} \resizebox{5in}{!}{\includegraphics{vlaslice2.eps}} \begin{tabular}{|l|l|} \hline \footnotesize Point & Coordinates (meters) \\ \hline \hline A. Feed & 0.975, 1.676 \\ \hline B. Intersection of subreflector and primary axis& 0.0, 8.479 \\ \hline C. Edge of primary & 12.5, 4.325 \\ \hline D. Inner edge of paneled primary & 2.0, 0.112 \\ \hline E. Base of strut & 7.550, 1.594 \\ \hline F. Top of strut & 1.391, 9.217 \\ \hline G. Prime focus & 0.0, 9.0 \\ \hline H. Vertex of primary & 0.0, 0.0 \\ \hline \end{tabular} \end{center} \caption{\label{fig:vlaant} The VLA antenna optics. This is an example of a shaped, offset Cassegrain. Coordinates are $x$, $z$.} \end{figure} This software is presented to the world under the Gnu General Public License (GPL) version 2.0\footnote{See {\tt http://www.gnu.org/copyleft/gpl.html} or the LICENSE file included with the software for more information.}. The use of this software is at your risk! Although this software is thought to produce correct output, your mileage may vary. \subsection{Sample use case} \label{sec:use} Here is a very terse description on how to use cassbeam. Read this entire document to understand what is actually happening. First an input file must be created. A sample input file called {\tt X-mid.in} is shown in Appendix~\ref{apx:sample}. This file specifies the geometry of the EVLA antenna and has some parameters tuned for X-band in particular. A second file must also be created called {\tt vla\_geom} to supply the shape of the primary. A portion of this file is shown in Appendix~\ref{apx:vlageom}. Cassbeam is run simply by supplying the input filename. A sample session is shown in Appendix~\ref{apx:sampout}. Running this file produces 12 output files that will be explained in detail in Sec.~\ref{sec:output}. \subsection{Limitations} In its current form, cassbeam only computes the properties of Cassegrain antennas that have a rotationally symmetric primary surface. The figure of this primary may be specified as a function of radius. While all $z(r)$ curves are legal input, pathological surfaces (such as those with negative $z^\prime(r)$) will either produce non-physical results or will cause abnormal program termination. Gregorian geometries, those where the secondary surface is concave and above the prime focus, will probably produce correct answers but this geometry is not formally supported. The number of struts (secondary supports) is currently fixed to be four. This will likely change with future versions of this software. Cassbeam works in the optical regime, meaning that the wavelength is assumed to be infinitesimal. This allows the use of ray tracing rather than physical optics, which is much faster and much simpler to implement. Antenna geometries with structures with dimensions smaller than about 2 wavelengths will produce results that deviate from reality, although tests with $1\,\lambda$ struts show results that are consistent with a similar simulation using physical optics in Grasp8. Also optical surfaces with sharp edges will likely be treated incorrectly. \section{Conventions} In the optics world there are several examples of contradictory conventions that potentially lead to confusion. The conventions chosen here aim to be those most commonly encountered in the radio astronomy community. In most cases, these are the same as those used within antenna engineering. \subsection{Units} The metric system is used exclusively over emperial units. Specifically, the meter is used as the unit of length, the nanosecond is used as the unit of time, and all frequencies are measured in GHz. The user specifies angles in degrees, although within the software radians are used in all angular calculations. All temperatures are in Kelvin. \subsection{Coordinate systems} The user must define the coordinates of various antenna components in {\it antenna coordinates}. In this right-handed Cartesian coordinate system, $\hat{z}$ points along the symmetry axis of the antenna, toward the pointing direction. Above is always taken to mean ``with greater $z$ value.'' The $\hat{x}$ direction is taken to be parallel to the ground and $\hat{y}$ is thus determined by orthogonality. $\hat{y}$ points away from the ground. The radial coordinate used to define the shape of the primary is $r \equiv \sqrt{x^2 + y^2}$. The origin of the coordinate system is the vertex of the primary -- the point on the vertex that intersects the $z$ axis. \begin{figure}[hb] \begin{center} \resizebox{2.5in}{!}{\includegraphics{coords.eps}} \end{center} \caption{\label{fig:coords}The antenna and sky coordinate systems. This view is from behind the primary surface looking at the sky.} \end{figure} The sky coordinate system is a two-dimensional sine-projected angular coordinate system used to define the the beam axes. The sine-projection comes naturally out of the Fourier transform that relates the aperture field to the radiation pattern on the sky. The origin of this coordinate system is the pointing direction, $\hat{z}$. At this point, $\hat{l}$ points parallel to $-\hat{x}$ and $\hat{m}$ is parallel to $\hat{y}$. In other words, $\hat{l}$ points west and $\hat{m}$ points north when the antenna is pointed at the meridian. \subsection{Fields} The vacuum plane wave solutions to Maxwell's equations are harmonic in time. Internally, complex notation is used in field calculations, which simplifies notation and allows temporal and spatial evolution of the plane wave fields to be expressed with complex exponentials. The physical field is the real component of its complex value. Both sign conventions are used for the phase factor. The convention used by both Jackson and Thompson, Moran, and Swenson is used; the evolution of plane wave fields is governed by \begin{equation} \label{eqn:phase} \vec{E}(\vec{x}, t) = \vec{E}_0 e^{i (\vec{k} \cdot \vec{x} - 2 \pi \nu t)}. \end{equation} Note that Born and Wolf use the opposite convention for the phase (and thus also for circular polarization). Here $\vec{k}$ is the wave vector (with magnitude $2 \pi / \lambda$) and $\nu$ is the frequency (cycle rate). $\vec{E}_0$ is a vector quantity with magnitude equal to the electric field strength. The direction of the vector describes its polarization state. The electric field is transverse: \begin{equation} \vec{k} \cdot \vec{E}_0 = 0. \end{equation} For completeness, it is noted that the magnetic induction is given by \begin{equation} \vec{B} = \frac{c}{|k|} \, \vec{k} \times \vec{E}. \end{equation} \subsection{Polarization} A right handed linear polarization coordinate system is used. The linear polarization basis unit vectors used, $\mathbf{e}_1$ and $\mathbf{e}_2$, depend on the direction of propagation, $\mathbf{e}_3$, but always have the following orthogonality properties: \begin{eqnarray} \mathbf{e}_i^* \cdot \mathbf{e}_j & = & \delta_{ij} \label{eqn:ortho} \\ \mathbf{e}_1 \times \mathbf{e}_2 & = & \mathbf{e}_3 \end{eqnarray} The IEEE definition of circular polarization is used. With the above phase convention (Eqn.~\ref{eqn:phase}), the right and left circular polarization basis vectors are respectively \begin{eqnarray} \mathbf{e}_\mathrm{R} & = & \frac{1}{\sqrt{2}}(\mathbf{e}_1 + i \mathbf{e}_2) \\ \mathbf{e}_\mathrm{L} & = & \frac{1}{\sqrt{2}}(\mathbf{e}_1 - i \mathbf{e}_2) . \end{eqnarray} Note that these two unit vectors and $\mathbf{e}_3$ satisfy the orthogonality condition of Eqn.~\ref{eqn:ortho}. A useful property of the circular polarization basis vectors is that they are eigenvectors of $\mathbf{e}_3 \times$ with eigenvalues $-i$ and $i$ for $\mathbf{e}_\mathrm{R}$ and $\mathbf{e}_\mathrm{L}$ respectively. Thus since $\vec{k} = k\, \mathbf{e}_3$, \begin{eqnarray} \vec{k} \times \mathbf{e}_\mathrm{R} & = & -ik\, \mathbf{e}_\mathrm{R} \label{eqn:ker} \\ \vec{k} \times \mathbf{e}_\mathrm{L} & = & ik\, \mathbf{e}_\mathrm{L} \label{eqn:kel} \end{eqnarray} The `1' polarization vector in radio astronomy is often taken to be that which points toward the meridian (see Fig.~\ref{fig:polcoords}). Thus for a receiving system, $\mathbf{e}_1 \propto \hat{m}$, $\mathbf{e}_2 \propto -\hat{l}$, and $\mathbf{e}_3 \propto -\hat{z}$. To avoid confusion $\mathbf{e}_1$ and $\mathbf{e}_2$ are used in lieu of the explicit Cartesian axes, $\mathbf{e}_x$ and $\mathbf{e}_y$. \begin{figure}[hb] \begin{center} \resizebox{1in}{!}{\includegraphics{polcoords.eps}} \end{center} \caption{\label{fig:polcoords}The polarization basis vectors. Note that $\mathbf{e}_3$ points out of the page, toward the antenna.} \end{figure} \subsection{The Stokes parameters} The Stokes parameters provide a compact representation of the statistical properties of the polarization of quasi-monochromatic or broad-band radiation. The 4 parameters are most often labeled $I$, $Q$, $U$, and $V$, although other conventions, such as $\{s_0, s_1, s_2, s_3\}$ and $\{A, B, C, D\}$ also exist. The Stokes parameters are defined by the following linear polarization products: \begin{eqnarray} I & = & \left + \left \\ Q & = & \left - \left \\ U & = & 2 \, \Re \left \\ V & = & 2 \, \Im \left \end{eqnarray} They are equally well defined by circular polarization products: \begin{eqnarray} I & = & \left + \left \\ Q & = & \left - \left \\ U & = & 2 \, \Re \left \\ V & = & 2 \, \Im \left \end{eqnarray} In these equations, $E_i \equiv \mathbf{e}_i^* \cdot \vec{E}$ for any polarization component $i$ in $\{1, 2, \mathrm{R}, \mathrm{L}\}$. The symbols $\Re$ and $\Im$ extract the real and imaginary part of a complex number, respectively. \subsection{Additional terminology} Here we list some other terminology that will be useful in the following sections. \begin{description} \item[aperture plane] The surface in the $x$ -- $y$ plane containing the rim of the primary. \item[struts] The secondary supports, or legs. \end{description} \section{User reference} The user provides inputs to cassbeam through an input file. Additional options can be passed to cassbeam on the command line. Based on the arguments to the {\bf command} parameter, various output files are generated in addition to the text dumped to the screen. \subsection{Input files} \label{sec:input} The main input file consists of a series of lines of the form {\it key = value}. Only one such entry is allowed per line. The equal sign is optional. The input files allow comments to be placed within the file. All comments begin with {\tt \%}. This character and any that follow it on a given line are ignored by cassbeam. Depending on {\it key}, the {\it value} may be one of five types: string, integer, double, vector, none. A string is a sequence of non-whitespace characters {\it not} surrounded by quotes of any kind. A double value is a number that can have a fractional part. A vector is a comma-separated list of doubles. The `none' type expects no {\it value}. Below is a list of the allowed {\it keys} and the type of {\it value} expected. If the range of legal values is restricted, the legal range will be contained within brackets. Note that legal values do not imply a physical system that will generate meaningful results! For the vector type, if a certain number of values are needed, they will be indicated in parentheses. A required parameter will be indicated with a `*'. It is important to realize that the secondary optical surface (i.e., the subreflector) is defined based on the input geometry. Thus changing the feed placement will change the geometry of the subreflector! To change parameters of the telescope without affecting the shape of the subreflector, set the pathology parameters. Note that the order of the parameters does not matter. \subsubsection{Antenna geometry parameters} \begin{description} \item[feed\_x] \ {\it double} \\ The $x$ value of the phase center of the feed. If no value is provided, 0 is assumed. \item[feed\_y] \ {\it double} \\ The $y$ value of the phase center of the feed. If no value is provided, 0 is assumed. \item[feed\_z] \ {\it double} \\ The $z$ value of the phase center of the feed. If no value is provided, 0 is assumed. \item[geom$^*$] \ {\it string} \\ This string points to a disk file containing the primary optical surface geometry. This file is a three column ascii text file, each containing space separated values for $r$, $z$, and $dz/dr$ for the antenna. There is no limit (other than your computer's memory) to the number of lines in this file. It is assumed (but not checked!) that the values of $r$ start at 0 and are equally spaced. The radius, $R$, of the primary is given by the value of $r$ in the last row. Columns 1 and 2 are in meters, and column 3 is dimensionless. \item[hole\_radius] \ {\it double} \ [$>$ 0] \\ The radius (in meters) of an unpanelled area at the center of the primary. If omitted, no hole will be made. \item[legapex] \ {\it double} \ [$>$ 0] \\ The $z$ value where the legs (struts) intersect each other. Note that the legs might terminate before reaching this point. The default value is $1.2*${\bf sub\_h}. \item[legfoot] \ {\it double} \ [$>$ 0] \\ The $r$ value where the legs (struts) intersect the primary surface. The default value is half the antenna radius. \item[legwidth] \ {\it double} \\ The effective width of the legs, used to compute blockage. Note that currently a positive value indicates four equally spaced legs with one leg along the $x$ axis. If the value is negative, its absolute value is used in the blockage calculations, but the legs are rotated 45$^{\circ}$. If this parameter is not set, or if it is set to 0, then no legs will be generated. \item[name] \ {\it string} \\ An optional name given to the antenna. If the name is ``VLBA'', then the true strut geometry for the VLBA antennas is used rather than equispaced struts. \item[roughness] \ {\it double} \ [$/ge$ 0] \\ The RSS surface roughness in meters. This number represents the combined surface error for the primary and secondary. If no roughness is provided, the default value of 0 is used. \item[sub\_h$^*$] \ {\it double} \ [$>$ 0] \\ This value is the $z$ value of the intersection of the subreflector with the $z$ axis. \end{description} \subsubsection{Feed pattern parameters} Note that either both {\bf feedtaper} and {\bf feedangle} or {\bf feedpattern} must be provided. \begin{description} \item[feedangle] \ {\it double} \ [$>$ 0] \\ Sets the reference angle for the feed taper. \item[feedpattern] {\it string} \\ The name of the file containing the pattern of the feed. This file contains two space-separated columns of numbers: the angle in degrees and the taper in dB. The first angle must equal 0, and the angles must be uniformly spaced. \item[feedpatternscale] {\it double} \ [$>$ 0] \\ The factor by which to scale the pattern defined in {\bf feedpattern}. \item[feedtaper] \ {\it double} \ [$>$ 0] \\ This parameter sets the taper (in dB) of the feed at an angle {\bf feedangle} from the feed axis to $10^{-\mathbf{feedtaper}/10}$. \end{description} \subsubsection{Pathology parameters} None of the following operations change the shape of the subreflector -- its geometry is calculated before their application. Note that displacements of either the feed or the subreflector result in a rotation of the feed that corrects for the mispointing caused by the translations. Rotations of the feed act in addition to this correction. Composited rotations (i.e., setting {\bf rsub\_x} and {\bf rsub\_y} are both provided), the operations on the object being rotated proceed in reverse alphabetical order ($z$ rotation before $y$ rotation; $y$ rotation before $x$ rotation) regardless of the order that the parameters are received. \begin{description} \item[dfeed\_x] \ {\it double} \\ Displacement of the feed along the $x$ axis. \item[dfeed\_y] \ {\it double} \\ Displacement of the feed along the $y$ axis. \item[dfeed\_z] \ {\it double} \\ Displacement of the feed along the $z$ axis. \item[dsub\_x] \ {\it double} \\ Displacement of the subreflector along the $x$ axis. \item[dsub\_y] \ {\it double} \\ Displacement of the subreflector along the $y$ axis. \item[dsub\_z] \ {\it double} \\ Displacement of the subreflector along the $z$ axis. \item[focus] \ {\it double} \\ Displacement of the feed along the feed axis. A positive value moves the feed closer to the subreflector. \item[rfeed\_x] \ {\it double} \\ Rotation of the feed in degrees about the $x$ axis. A positive value will rotate from the $z$ axis through the $y$ axis. \item[rfeed\_y] \ {\it double} \\ Rotation of the feed in degrees about the $y$ axis. A positive value will rotate from the $x$ axis through the $z$ axis. \item[rfeed\_z] \ {\it double} \\ Rotation of the feed in degrees about the $z$ axis. A positive value will rotate from the $y$ axis through the $x$ axis. \item[rsub\_x] \ {\it double} \\ Rotation of the subreflector in degrees about the $x$ axis. A positive value will rotate from the $z$ axis through the $y$ axis. \item[rsub\_y] \ {\it double} \\ Rotation of the subreflector in degrees about the $y$ axis. A positive value will rotate from the $x$ axis through the $z$ axis. \item[rsub\_z] \ {\it double} \\ Rotation of the subreflector in degrees about the $z$ axis. A positive value will rotate from the $y$ axis through the $x$ axis. \item[subrotpoint] \ {\it vector (1 or 2 or 3)} \\ Defines the point about which the rotation of the subreflector is performed. The contents of the vector depend on the number of elements are provided: \begin{enumerate} \item The $z$ value; \item The $x$ and $y$ values; \item The $x$, $y$, and $z$ values. \end{enumerate} \end{description} \subsubsection{Operating condition parameters} \begin{description} \item[compute] \ {\it string} [`all' or `none' or combination of `a', `j', `p', \& `s'] \\ A string to tell what output to produce. The string can be `all', `none', or a string containing flag characters. The default value is `all', meaning produce all possible output. `none' will produce only messages on the screen and no output files. The characters of the general string mean the following: \begin{description} \item[a] Save the aperture images; \item[j] Save the Jones matrices in a table; \item[p] Save the parameters; \item[s] Save the polarized beams. \end{description} Note that the string is case insensitive. See Sec.~\ref{sec:output} for an explanation of the output files. \item[diffeff] \ {\it double} \\ A user supplied diffraction efficiency. If none is provided, an internal algorithm that is not very good is used. This needs to be upgraded! \item[freq$^*$] \ {\it double} \ [$>$ 0] \\ The frequency in GHz at which the calculation will be run. \item[gridsize] \ {\it integer} \ [$\ge$ 32] \\ Specifies a fixed grid size. If odd, the next even number will be used. This option overrides any setting of {\bf oversamp} and is the preferred method of setting the grid size. Setting it to a value less than 32 will result in a grid size of 32. \item[leggroundscatter] \ {\it double} [$\ge$ 0, $\le$ 1]\\ The fraction of power that scatters off the struts toward the ground. The default value is 0.2. \item[misceff] \ {it double} [$\ge$ 0, $\le$ 1]\\ A factor of the efficiency calculation that contains ``everything else''. The user is responsible for choosing a realistic value for this. A default of 1 (i.e., 100\%) is assumed if this parameter is not provided. \item[out] \ {\it string} \\ The prefix for all output files. The default is {\it cassbeam}. A dot will always separate the prefix from any trailing characters. \item[oversamp] \ {\it double} \ [$>$ 0] \\ One way of specifying the grid size. This option will make the grid on the primary fine enough to accommodate 4*{\bf oversamp}*$R/\lambda$ points. The default is 1. Note that vastly ``undersampling'' is fine as the field is never calculated anywhere between the feed and the aperture plane. Normally blockage calculations and constancy of the illumination will dictate the required sampling. See {\bf gridsize} for an alternate way of specifying the grid. This parameter is ignored if {\bf gridsize} is set. \item[pixelsperbeam] \ {\it int} [$>$ 0] \\ This is the approximate number of pixels that the core of the beam will occupy in the output images. \item[Tground] \ {\it double} \ [$>$ 0] \\ The temperature in Kelvin of the ground. The default value is 290. \item[Trec] \ {\it double} \ [$>$ 0] \\ The equivalent temperature of the receiver. This adds into the system temperature. The default value is 50. \item[Tsky] \ {\it double} \ [$>$ 0] \\ The temperature in Kelvin of the sky. The default value is 3 for frequencies over 1~GHz, and $3 \times 10^{-2.5 \nu}$ for frequencies below 1~GHz. \end{description} \subsection{Running cassbeam} Cassbeam is a non-interactive command line program that takes all of its input from the command line. Note that this does not preclude someone at a later date from making a graphical or web front end. There is one required argument when running cassbeam -- the input filename that is described above in Sec/~\ref{sec:input}. Additional arguments can supplement the parameters of the input file. These arguments are passed in the same {\it key=value} as required in the input file {\it except} whitespace is not allowed around the equal sign. If a parameter appears both in the input file and the command line, then the value on the command line supercedes the value on the input file. \subsection{Output files} \label{sec:output} Up to 12 output files are generated with version 1.0 of cassbeam depending on which {\bf compute} options were selected at run time. These files are listed below. The letter in brackets in the section headings indicate which option is used to enable this file to be written. All output files begin with the value of the input parameter{\bf out}. Currently all output images are in {\tt .pgm}\footnote{See {\tt http://www.die/net/doc/linux/man/man5/pgm.5.html} for details on this format.} format, which is a very simple greyscale image format supported by most unix-based image viewers. \subsubsection{Aperture images [{\bf a}]} Three images are generated that allow the aperture field to be examined qualitatively. If quantitative numbers are needed, the source code should be modified to export the illumination parameters. \begin{itemize} \item {\bf out}{\tt .illumamp.pgm} is a raster image showing the amplitude of the illumination pattern of the primary. No blockage is done at this point. The scale is linear in flux. \item {\bf out}{\tt .illumphase.pgm} is a raster image showing the net phase (pathlength multiplied by wave vector) at each point on the primary. A phase gradient is removed. Portions of the image that correspond to zero flux have an arbitrary phase. \item {\bf out}{\tt .illumblock.pgm} is a raster image showing the blocked portion of the aperture. White means that this part of the dish is experiences either plane wave blockage from the sky or spherical wave blockage from the feed, and thus does not contribute to the gain of the antenna. \end{itemize} \subsubsection{Jones matrix file [{\bf j}]} The Jones matrix file, {\bf out}{\tt .jones.dat} contains the Jones matrix (see Hamaker et al. 1996 for details) corresponding to the effect of the antenna on the incoming radiation as a function of position on the sky. The file is organized as an eight column ascii with columns \{$ \Re \, g_\mathrm{RR}, \Im \, g_\mathrm{RR}, \Re \, g_\mathrm{LR}, \Im \, g_\mathrm{LR}, \Re \, g_\mathrm{RL}, \Im \, g_\mathrm{RL}, \Re \, g_\mathrm{LL}, \Im \, g_\mathrm{LL}$\}. The first row corresponds to the point on the image with smallese $l$ and $m$. The rastering then proceeds first with increasing $l$, and then with increasing $m$. There are a total of $n^2$ rows, where $n$ is the smallest odd number greater than or equal to the {\bf gridsize} used. The matrices are rastered on a sine-projected coordinate system tangent to the sky at the beam center, which corresponds to row number $(n^2+1)/2$. At the beam center the pixel scale is given by the output parameter {\bf beampixelscale}, which is stored in the output file {\bf out}{.params} described below. \subsubsection{Parameter file [{\bf p}]} The parameter file, {\bf out}{.params} is an output file in the same format as the input file, containing all of the input parameters that were specified (even if on the command line) as well as many output values. They are: \begin{description} \item[Aeff] \ {\it double} \\ The effective area of the antenna [m$^2$]. \item[Aeff\_Tsys] \ {\it double} \\ The effective area of the antenna divided by the system temperature [m$^2$/K]. \item[ampeff] \ {\it double} \\ The amplitude efficiency, $\eta_\mathrm{I,amp}$. \item[beampixelscale] \ {\it double} \\ The scale of the generated beam images [deg/pixel]. \item[blockeff] \ {\it double} \\ The blockage efficiency, $\eta_\mathrm{B}$. \item[diffeff] \ {\it double} \\ The diffraction efficiency, $\eta_\mathrm{D}$. \item[fwhm\_l] \ {\it double} \\ The full width at half max of the beam in the $l$ direction. \item[fwhm\_m] \ {\it double} \\ The full width at half max of the beam in the $m$ direction. \item[gain] \ {\it double} \\ The gain $G$ of the antenna, as defined by Eqn.~\ref{eqn:gain}. \item[illumeff] \ {\it double} \\ The illumination efficiency, $\eta_\mathrm{I}$. \item[peaksidelobe] \ {\it double} \\ The directivity of the greatest sidelobe relative to the peak directivity of the beam. \item[phaseeff] \ {\it double} \\ The phase efficiency, $\eta_\mathrm{I,phase}$. \item[point\_l] \ {\it double} \\ The $l$ component of the pointing offset from the $z$ axis measured in the image plane. \item[point\_m] \ {\it double} \\ The $m$ component of the pointing offset from the $z$ axis measured in the image plane. \item[prispilleff] \ {\it double} \\ The primary spillover efficiency, $\eta_\mathrm{S,pri}$. \item[program] \ {\it string} \\ The name of the program run, which is {\tt cassbeam}. \item[misceff] \ {\it double} \\ The miscellaneous efficiency, $\eta_\mathrm{M}$. \item[spilleff] \ {\it double} \\ The spillover efficiency, $\eta_\mathrm{S}$. \item[subspilleff] \ {\it double} \\ The subreflector spillover efficiency, $\eta_\mathrm{S,sub}$. \item[surfeff] \ {\it double} \\ The surface efficiency, given by Eqn.~\ref{eqn:surf}. \item[totaleff] \ {\it double} \\ The total efficiency calculated for the antenna, given by Eqn.~\ref{eqn:eff}. \item[Tsys] \ {\it double} \\ The system temperature calculated with Eqn.~\ref{eqn:tsys}. \item[version] \ {\it string} \\ The software version number. \end{description} \subsubsection{Polarized beam images [{\bf s}]} With the {\bf s} option, cassbeam will produce 7 images of the beam showing in the four Stokes parameters the response to an unpolarized source as a function of the position of the source on the sky. This information is derived from the Jones matrices which are saved in {\bf out}{.jones.dat}. These images are meant for qualitative inspection. The Jones matrices contain the formal output. \begin{itemize} \item {\bf out}{\tt .I.pgm} Stokes $I$ -- total intensity; \item {\bf out}{\tt .Q.pgm} Stokes $Q$ -- excess linear polarization in $\mathbf{e}_1$ over $\mathbf{e}_2$; \item {\bf out}{\tt .U.pgm} Stokes $U$ -- excess linear polarization in $\mathbf{e}_1^\prime$ over $\mathbf{e}_2^\prime$\footnote{ $\mathbf{e}_1^\prime = 1/\sqrt{2}(\mathbf{e}_1 + \mathbf{e}_2)$, $\mathbf{e}_2^\prime = 1/\sqrt{2}(\mathbf{e}_2 - \mathbf{e}_2)$}; \item {\bf out}{\tt .V.pgm} Stokes $V$ -- excess right circular polarzation over left circular polarization; \item {\bf out}{\tt .QI.pgm} The ratio of the Stokes $Q$ image to the Stokes $I$ image; \item {\bf out}{\tt .UI.pgm} The ratio of the Stokes $U$ image to the Stokes $I$ image; \item {\bf out}{\tt .VI.pgm} The ratio of the Stokes $V$ image to the Stokes $I$ image; \end{itemize} \section{Theory of operation} This section briefly describes how the code works. Many details are left out. See the source code if further understanding is needed. \subsection{Ray tracing} \label{sec:trace} Ray tracing is used to determine the electric field at each grid point on the aperture plane. This is done through a complicated process that will be discussed briefly here. For each grid cell on the primary, the following process is followed. We are interested in calculating the electric field on a uniformly spaced grid on the aperture plane. Since the ray may not travel along $\hat{z}$ from the primary to the aperture plane, some iteration is required. First the ($x, y$) position of the grid point to be calculated is taken as the starting point on the primary. The corresponding $z$ value and the surface normal are then calculated for that point on the primary. The virtual ray is then reflected off the subreflector. It should be noted here that nowhere is the subreflector ever stored as a rastered surface -- it is recomputed each time it is needed, and this is likely far more efficient than searching a tabulated surface for an intersection point. The subreflector displacement and rotation are then considered. A ray is then projected from the feed to this point on the subreflector. The process is reversed now that a guess for the appropriate subreflector point is made. A ray is traced from the feed to this point on the subreflector, reflected toward the primary, and finally reflected to the aperture plane. The ($x, y$) value of the intersection of the ray with the aperture plane is compared with the initial ($x, y$). An offset is applied to the original value and the iteration continues. About 3 iterations are sufficient for convergenence, although about 7 are done in practice. Once points on both the aperture plane and the primary are known, the final ray is defined. Three rays are shot out from a small triangular region of the aperture plane and are used to calculate $dP/dA$, the flux through the point of interest on the aperture plane. This value includes the taper of the feed, the dilution of the beam due to expansion, and the effects of all the surface shapings. The length of the ray is then used to derive the phase of the field on the aperture. Finally, the two circular polarization vectors are propagated from the feed. Reflections obey the proper boundary conditions for a conducting surface: \begin{eqnarray} E_{\parallel} & = & 0 \\ B_{\perp} & = & 0 \end{eqnarray} The electric field, decomposed into a linear polarization basis for each outgoing circular polarization, is computed on the aperture plane grid. \subsection{Antenna performance} \label{sec:perf} The gain, $G$, is calculated by first computing the efficiency, $\eta$, and then using \begin{equation} \label{eqn:gain} G = 4 \pi \eta \frac{A}{\lambda^2}. \end{equation} Here $\lambda$ is the observing wavelength, and $A$ is the geometric area of the primary, including any unused portion. For a circular aperture, $A = \pi R^2$. The efficiency is computed by multiplying many factors, each with its own physical cause: \begin{equation} \label{eqn:eff} \eta = \eta_S \, \eta_B \, \eta_{\sigma} \, \eta_I \, \eta_D \, \eta_M \end{equation} The meanings and definitions of these factors will be discussed below. A useful quantity is the total power radiated by the feed, given by \begin{equation} P_\mathrm{total} = \int_{4 \pi} \left|E^2(\theta, \phi)\right| \, d \Omega. \end{equation} The integral is performed over all $4 \pi$ steradians and $\vec{E}(\theta, \phi)$ is the electric field radiated by the feed. Note that an overall constant factor of $(4 \pi)^{-1}$ is removed from this equation to simplify notation. Of particular importance to radio astronomy is the ratio of gain to system temperature. This is directly related to the on-axis sensitivity of the antenna. \subsubsection{Spillover efficiency, $\eta_\mathrm{S}$} The spillover efficiency is the fraction of power radiated that ends up illuminating the primary surface. For a two reflector system, spillover can occur at two places: around the subreflector and around the primary. In the GO limit, a perfectly aligned Cassegrain antenna will only spill around the secondary, as any ray hitting the secondary will hit the primary. For a misaligned system this is no longer strictly true. The total spillover efficiency is then a product of the subreflector spillover efficiency, $\eta_\mathrm{S,sub}$ and that of the primary, $\eta_\mathrm{S,pri}$. The secondary spillover efficiency is calculated as: \begin{equation} \eta_\mathrm{S,sub} = \frac{\int_\mathrm{sub} \left|E^2(\theta, \phi)\right| \, d \Omega}{P_\mathrm{total}}. \end{equation} The numerator is the integrated power over the solid angle subtended by the subreflector. The total spillover is the fraction of power hitting the primary, \begin{equation} \eta_\mathrm{S} = \frac{\int_\mathrm{aper} \left|E^2(x, y)\right| \, dA} {P_\mathrm{total}}. \end{equation} Here $\vec{E}(x, y)$ is the electric field on the aperture plane and the integral is performed over the aperture plane. The contribution to spillover due solely to the primary is then determined by \begin{equation} \eta_\mathrm{S,pri} = \frac{\eta_\mathrm{S}}{\eta_\mathrm{S,sub}}. \end{equation} \subsubsection{Blockage efficiency, $\eta_\mathrm{B}$} The blockage efficiency can be approximated by examining the projected blocked area on the aperture plane. The ray tracing procedure produces a mask specifies if any portion of a given ray is blocked by a strut, or intersects the hole in the primary. Small objects, such as struts, in practice have a different electrical cross section than geometric cross section, and this cross section is polarization dependent. Here we make the ray trace approximation, which produces reasonably accurate results, except for wavelengths that are larger than, or similar in size to, the smallest significant blocking structures. The standard expression for blockage efficiency is used: \begin{equation} \eta_\mathrm{B} = \frac{\left|\int_\mathrm{aper} \vec{E}(x, y) M(x, y)\, dA\right|^2} {\left|\int_\mathrm{aper} \vec{E}(x, y) \, dA\right|^2}. \end{equation} Here $M(x, y)$ is the mask expression that has a value of 1 for an unblocked location on the aperture, and 0 for a blocked region. This formulation allows for partially blocked cells to be numerically integrated. \subsubsection{Surface roughness efficiency, $\eta_\sigma$} A surface that has roughness will contribute to random scattering and hence loss of efficiency. Without derivation we state the surface roughness efficiency as derived by Ruze (1966): \begin{equation} \label{eqn:surf} \eta_\sigma = e^{-\left(\frac{4 \pi \epsilon}{\lambda}\right)^2}. \end{equation} The RMS surface error, $\epsilon$, represents contributions from both the primary and secondary surface; the individual surface errors add in quadrature. It should be noted that this equation is strictly true only for normal incedence. Deep dishes (i.e., $f/D < 1$) may see deviations from this estimate since the normal incedence approximation breaks down. \subsubsection{Illumination efficiency, $\eta_\mathrm{I}$} An aperture that has uniform amplitude and phase illumination will produce a beam with the greatest directivity. The illumination, or aperture, efficiency is a measure of the efficiency of a radiating aperture relative to the uniformly illuminated aperture. Again without derivation, the expression used to compute the illumination efficiency is \begin{equation} \eta_\mathrm{I} = \frac{\left|\int_\mathrm{aper} \vec{E}(x, y) M(x, y) \, dA \right|^2}{A_\mathrm{m} \, \int_\mathrm{aper} \left|E^2(x, y)\right| M^2(x, y) \, dA}, \end{equation} where $A_\mathrm{m}$ is the {\it masked area}, \begin{equation} A_\mathrm{m} = \int_\mathrm{aper} M(x, y) \, dA. \end{equation} Often the this illumination efficiency is decomposed into factors that are due to amplitude $\eta_\mathrm{I,amp}$ and phase $\eta_\mathrm{I,phase}$ with the corresponding values: \begin{eqnarray} \eta_\mathrm{I,amp} & = & \frac{\left[\int_\mathrm{aper} \left|E(x, y)\right| M(x, y) \, dA \right]^2} {A_\mathrm{m} \, \int_\mathrm{aper} \left|E^2(x, y)\right| M^2(x, y) \, dA} \\ \eta_\mathrm{I,phase} & = & \frac{\left|\int_\mathrm{aper} \vec{E}(x, y) M(x, y) \, dA \right|^2}{\left[\int_\mathrm{aper} \left|E(x, y)\right| M(x, y) \, dA\right]^2}. \end{eqnarray} \subsubsection{Diffraction efficiency, $\eta_\mathrm{D}$} It should be mentioned immediately that the diffraction efficiency calculation is likely wrong. An equation was emperically derived that is probably approximately correct for the VLA. A scale factor has been applied that allows antennas with different subreflector sizes to be used. This assumes that all diffraction loss is due to the subreflector, which is likely a good guess. Note that this efficiency does not currently depend on taper -- another indication of its inadequacy. \subsubsection{Miscellaneaous efficiency, $\eta_\mathrm{M}$} This final efficiency catagory contains everything else. The user must supply a value in the input file, otherwise 100\% is assumed. \subsubsection{System Temperature} The zenith system temperature is computed by determining the fraction of transmitted power that would hit the ground, $f_\mathrm{g}$, and sky, $f_\mathrm{s} \equiv 1-f_\mathrm{g}$, and multiplying each by their respective temperatures. The receiver temperature is then added: \begin{equation} \label{eqn:tsys} T_\mathrm{sys} = T_\mathrm{rec} + f_\mathrm{g}\,T_\mathrm{g} + f_\mathrm{s}\,T_\mathrm{s}. \end{equation} For a Cassegrain antenna, the fractional power hitting the ground is computed as \begin{equation} f_\mathrm{g} = (1 - \eta_\mathrm{S,sub}) + f (1 - \eta_\mathrm{B,leg}), \end{equation} where $\eta_\mathrm{B,leg}$ is the leg blockage efficiency and $f$ is a fudge factor. The first term represents the power that spills over the primary, and thus hits the ground. The second term represents the power that scatters off the struts to the ground. The fraction of scattered power that hits the ground is controlled by $f$. The input parameter to set $f$ is called {\bf leggroundscatter}. \subsection{Beam calculation} \label{sec:beam} Once the aperture plane electric field is known, the far field radiation pattern can be determined. For each hand of circular polarization, the following operations are performed. Fraunhofer diffraction applies as we are interested in the far field radiation pattern and the electric field is known over an entire surface (it is zero outside the aperture and computed on the aperture). The radiation at a location $\vec{x}$ is given by \begin{equation} \label{eqn:fraun} \vec{E}(\vec{x}) = \frac{i e^{ikr}}{2 \pi r} \, \vec{k} \times \int_\mathrm{aper} \hat{z} \times \vec{E}(x^\prime, y^\prime) \, e^{-i(k_x x^\prime + k_y y^\prime)} \, dA^\prime, \end{equation} which is adapted to our application from Eqn.~9.156 of Jackson. In this expression, $r = |x|$ and $\vec{k}$ is the wave vector of the transmitted radiation. The primed coordinates refer to the coordinates on the aperture plane; the unprimed coordnates refer to the field test points. Since the integral in this case is over a uniformly gridded plane, the integral, $\vec{I}(l, m)$, becomes a two-dimensional component-by-component forward\footnote{A forward transform as defined in the FFT package called FFTW.} FFT of $\hat{z} \times \vec{E}$. Here ($l, m$) are the sine-projected angular sky coordinates equal to ($x/z, y/z$). This is taken in the limit that $z$ is very large. In order to reexpress Eqn.~\ref{eqn:fraun} in a circularly polarized basis, the radiated electric field is projected on the circular polarization basis. Thus, modulo the complex constant, the quantities of interest are: \begin{eqnarray} E_\mathrm{R}(l, m) & = & \mathbf{e}_\mathrm{R}^* \cdot \vec{k} \times \vec{I} \\ E_\mathrm{L}(l, m) & = & \mathbf{e}_\mathrm{L}^* \cdot \vec{k} \times \vec{I} . \end{eqnarray} The vector triple product can be rearranged, and Eqns.~\ref{eqn:ker} and \ref{eqn:kel} can be used simplfiy these to \begin{eqnarray} E_\mathrm{R}(l, m) & = & ik\,\mathbf{e}_\mathrm{R}^* \cdot \vec{I} \\ E_\mathrm{L}(l, m) & = & -ik\,\mathbf{e}_\mathrm{L}^* \cdot \vec{I}. \end{eqnarray} \appendix \section{Input file} \label{apx:sample} This appendix contains a sample input file for cassbeam. This file describes in detail the geometry for an EVLA antenna at 10.0~GHz. Note that this may not in fact truly represent the geometry of the EVLA -- it is meant as an example only. \begin{verbatim} # X-mid.in -- an input file for simulating mid X-band with EVLA name = EVLA # EVLA geometry sub_h = 8.47852 # meters from vertex to subreflector feed_x = 0.97536 # meters from optic axis to feed ring feed_y = 0.0 # Note that the position on the feed ring is not right feed_z = 1.67640 # height of feed ring from vertex geom = vla_geom # file containing the primary surface profile feedtaper = 13.0 # dB below peak feedthetamax = 9.26 # degrees legwidth = 0.27 # meters wide legfoot = 7.55 # meters from optic axis at dish legapex = 10.93876 # meters above vertex hole_radius = 2.0 # meters -- radius of unpanelled area roughness=0.00035 # meters RMS error of combined surfaces # Abnormalities specific to mid-X band focus=-0.289 # the phase center is below the feed circle dsub_z=-0.005 # the subreflector is moved to compensate for this # Running parameters freq = 10.0 # GHz gridsize = 100 # pixels on a side Trec=18 out = X-mid \end{verbatim} \section{Primary profile input file} \label{apx:vlageom} This appendix contains a sample file containing the profile of the primary surface. Note that only a portion of the file is shown. 1240 lines have been omitted and replaced with elipses. The first column is the radial coordinate $r$ in meters. The second column is the axial coordinate $z$, also in meters. The third column is the local derivative $dz/dr$. \begin{verbatim} 0.000000 0.000000 0.000000 0.010000 0.000003 0.000561 0.020000 0.000011 0.001122 0.030000 0.000025 0.001683 0.040000 0.000045 0.002244 0.050000 0.000070 0.002805 0.060000 0.000101 0.003366 0.070000 0.000137 0.003927 . . . 12.480000 4.311402 0.671823 12.490000 4.318122 0.672216 12.500000 4.324847 0.672607 \end{verbatim} \section{Sample session} \label{apx:sampout} This appendix contains an example of the text output when running cassbeam. \begin{verbatim} parallax<365>% cassbeam X-mid.in Antenna: VLA 0x80aba60 freq = 10.000000 GHz lambda = 0.029979 m Tsky = 3.000000 K Tground = 290.000000 K Trec = 18.000000 K dir = -0.000000e+00 0.000000e+00 1.000000e+00 feeddir = -0.142041, 0.000000, 0.989861 ftaper = 13.000000 thmax = 9.260000 Pathology: 0x80ac608 subrot = Matrix (3 by 3) 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 feedrot = Matrix (3 by 3) 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 subshift = 0.000000e+00 0.000000e+00 -5.000000e-03 subrotpoint = 0.000000e+00 0.000000e+00 8.478520e+00 feedshift = 0.000000e+00 0.000000e+00 0.000000e+00 Output: 0x80ae2f8 Spillover eff = 0.922563 primary = 0.997158 subreflector= 0.925193 Blockage eff = 0.857039 Surface eff = 0.978706 Illum eff = 0.993388 phase eff = 0.994786 amp eff = 0.998595 Diffract eff = 0.977420 Misc eff = 1.000000 Total eff = 0.751363 Gain = 5156891.55 = 67.12 dBi Tsys = 24.419 K ground = 3.454 K sky = 2.964 K rec = 18.000 K Aeff = 368.824311 m^2 Aeff/Tsys = 15.104166 m^2/K l beamshift = -0.000115 deg m beamshift = -0.000000 deg l beam FWHM = 0.070499 deg m beam FWHM = 0.070676 deg Peak sidelobe = 0.039489 = -14.035194 dB Output image scale is 0.002147 deg/pixel \end{verbatim} \section{References} \noindent Born, M. \& Wolf, E., ``Principles of Optics: Electromagnetic Theory of Propagation, Interference and Diffraction of Light,'' 6th edition, FIXME... \vspace{10pt} \noindent Frigo, M., \& Johnson, S. G., ``The Fastest Fourier Transform in the West,'' {\tt http://www.fftw.org/}. \vspace{10pt} \noindent Hamaker, J. P., Bregman, J. D., \& Sault, R. J., ``Understanding Radio Polarimetry, I. Mathematical Foundations,'' 1996, Astronomy \& Astrophysics Supplemental Series, 117, pp. 137-147. \vspace{10pt} \noindent Jackson, J. D., ``Classical Electrodynamics,'' 2nd edition, 1975, Wiley. \vspace{10pt} \noindent Ruze, J., ``Antenna Tolerance Theory -- A Review,'' 1966, Proceedings of IEEE, vol. 54, no. 4. \vspace{10pt} \noindent Thompson, A. R., Moran, J. M., \& Swenson, G. W. Jr., ``Interferometry and Synthesis in Radio Astronomy,'' 2nd edition, 2001, Wiley Interscience. \end{document} cassbeam-1.1/doc/coords.eps000066400000000000000000000303731275012243400157060ustar00rootroot00000000000000%!PS-Adobe-2.0 EPSF-2.0 %%Title: /home/wbrisken/cassbeam/coords.dia %%Creator: Dia v0.91 %%CreationDate: Tue Aug 5 20:16:40 2003 %%For: wbrisken %%Orientation: Portrait %%Magnification: 1.0000 %%BoundingBox: 0 0 203 171 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def /cp {closepath} bind def /c {curveto} bind def /f {fill} bind def /a {arc} bind def /ef {eofill} bind def /ex {exch} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth pop} bind def /tr {translate} bind def /ellipsedict 8 dict def ellipsedict /mtrx matrix put /ellipse { ellipsedict begin /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc savematrix setmatrix end } def /mergeprocs { dup length 3 -1 roll dup length dup 5 1 roll 3 -1 roll add array cvx dup 3 -1 roll 0 exch putinterval dup 4 2 roll putinterval } bind def /dpi_x 300 def /dpi_y 300 def /conicto { /to_y exch def /to_x exch def /conic_cntrl_y exch def /conic_cntrl_x exch def currentpoint /p0_y exch def /p0_x exch def /p1_x p0_x conic_cntrl_x p0_x sub 2 3 div mul add def /p1_y p0_y conic_cntrl_y p0_y sub 2 3 div mul add def /p2_x p1_x to_x p0_x sub 1 3 div mul add def /p2_y p1_y to_y p0_y sub 1 3 div mul add def p1_x p1_y p2_x p2_y to_x to_y curveto } bind def /start_ol { gsave 1.1 dpi_x div dup scale} bind def /end_ol { closepath fill grestore } bind def 28.346000 -28.346000 scale -6.970000 -17.030000 translate %%EndProlog 1.000000 1.000000 1.000000 srgb n 11.500000 11.100000 m 11.500000 13.700000 l 14.100000 13.700000 l 14.100000 11.100000 l f 0.060000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 11.500000 11.100000 m 11.500000 13.700000 l 14.100000 13.700000 l 14.100000 11.100000 l cp s 0.080000 slw [] 0 sd [] 0 sd 0 slc n 8.700000 15.300000 m 12.555075 12.573239 l s 0 slj n 12.641695 12.695702 m 12.800000 12.400000 l 12.468456 12.450777 l f 1.000000 1.000000 1.000000 srgb n 9.000000 15.000000 2.000000 2.000000 0 360 ellipse f 0.060000 slw [] 0 sd [] 0 sd 0.000000 0.000000 0.000000 srgb n 9.000000 15.000000 2.000000 2.000000 0 360 ellipse cp s 0.040000 slw [] 0 sd [] 0 sd 0 slc n 15.516667 15.000000 6.816667 6.816667 162.938469 197.061531 ellipse s 0.040000 slw [] 0 sd [] 0 sd 0 slc n 9.000000 8.483333 6.816667 6.816667 72.938469 107.061531 ellipse s 0.080000 slw [] 0 sd [] 0 sd 0 slc n 8.700000 15.300000 m 8.700000 14.000000 l s 0 slj n 8.850000 14.000000 m 8.700000 13.700000 l 8.550000 14.000000 l f 0.080000 slw [] 0 sd [] 0 sd 0 slc n 8.700000 15.300000 m 7.400000 15.300000 l s 0 slj n 7.400000 15.150000 m 7.100000 15.300000 l 7.400000 15.450000 l f 0.080000 slw [1.000000] 0 sd [0.200000] 0 sd 0 slc n 8.700000 15.300000 m 10.800000 13.800000 l s 0.080000 slw [] 0 sd [] 0 sd 0 slc n 12.800000 12.400000 m 13.600000 12.400000 l s 0 slj n 13.600000 12.550000 m 13.900000 12.400000 l 13.600000 12.250000 l f 0.080000 slw [] 0 sd [] 0 sd 0 slc n 12.800000 12.400000 m 12.800000 11.600000 l s 0 slj n 12.950000 11.600000 m 12.800000 11.300000 l 12.650000 11.600000 l f gsave 7.400000 15.800000 translate 0.035278 -0.035278 scale start_ol 2710 2496 moveto 1577 1273 lineto 2271 0 lineto 1806 0 lineto 1283 989 lineto 375 0 lineto -117 0 lineto 1098 1315 lineto 452 2496 lineto 917 2496 lineto 1391 1593 lineto 2218 2496 lineto 2710 2496 lineto end_ol grestore gsave 8.400000 13.700000 translate 0.035278 -0.035278 scale start_ol 1120 -240 moveto 838 -721 660 -840 conicto 483 -960 207 -960 conicto -112 -960 lineto -44 -612 lineto 190 -612 lineto 359 -612 478 -518 conicto 598 -425 745 -152 conicto 871 86 lineto 324 2494 lineto 754 2494 lineto 1164 580 lineto 2298 2494 lineto 2723 2494 lineto 1120 -240 lineto end_ol grestore gsave 12.400000 13.100000 translate 0.035278 -0.035278 scale start_ol 525 2496 moveto 2452 2496 lineto 2379 2102 lineto 520 348 lineto 2055 348 lineto 1991 0 lineto -13 0 lineto 60 394 lineto 1918 2148 lineto 461 2148 lineto 525 2496 lineto end_ol grestore gsave 13.800000 13.100000 translate 0.035278 -0.035278 scale start_ol 827 3456 moveto 1233 3456 lineto 564 0 lineto 159 0 lineto 827 3456 lineto end_ol grestore gsave 13.000000 11.700000 translate 0.035278 -0.035278 scale start_ol 4031 1477 moveto 3736 -27 lineto 3328 -27 lineto 3613 1468 lineto 3630 1564 3639 1633 conicto 3648 1703 3648 1752 conicto 3648 1953 3538 2064 conicto 3428 2176 3229 2176 conicto 2934 2176 2702 1951 conicto 2471 1727 2403 1368 conicto 2132 -27 lineto 1725 -27 lineto 2014 1468 lineto 2032 1551 2041 1621 conicto 2050 1691 2050 1747 conicto 2050 1950 1939 2063 conicto 1829 2176 1635 2176 conicto 1335 2176 1103 1951 conicto 872 1727 804 1368 conicto 532 -27 lineto 127 -27 lineto 610 2496 lineto 1015 2496 lineto 938 2084 lineto 1104 2313 1325 2418 conicto 1547 2524 1800 2524 conicto 2069 2524 2242 2388 conicto 2416 2253 2451 1993 conicto 2636 2263 2881 2393 conicto 3126 2524 3400 2524 conicto 3719 2524 3893 2339 conicto 4067 2154 4067 1816 conicto 4067 1743 4058 1655 conicto 4050 1567 4031 1477 conicto end_ol grestore gsave 12.275067 14.400000 translate 0.035278 -0.035278 scale start_ol 2420 3231 moveto 2420 2798 lineto 2188 2922 1959 2983 conicto 1731 3044 1519 3044 conicto 1149 3044 948 2899 conicto 748 2755 748 2488 conicto 748 2264 881 2150 conicto 1015 2036 1387 1966 conicto 1660 1909 lineto 2167 1812 2385 1570 conicto 2604 1328 2604 921 conicto 2604 436 2286 186 conicto 1968 -64 1354 -64 conicto 1122 -64 861 -13 conicto 600 38 320 138 conicto 320 598 lineto 587 442 851 363 conicto 1115 284 1369 284 conicto 1755 284 1965 438 conicto 2176 592 2176 876 conicto 2176 1125 2024 1265 conicto 1873 1405 1528 1475 conicto 1252 1530 lineto 760 1630 540 1844 conicto 320 2059 320 2440 conicto 320 2883 624 3137 conicto 929 3392 1465 3392 conicto 1695 3392 1932 3351 conicto 2170 3311 2420 3231 conicto end_ol grestore gsave 12.656067 14.400000 translate 0.035278 -0.035278 scale start_ol 384 3456 moveto 812 3456 lineto 812 1420 lineto 2023 2496 lineto 2541 2496 lineto 1231 1328 lineto 2596 0 lineto 2067 0 lineto 812 1219 lineto 812 0 lineto 384 0 lineto 384 3456 lineto end_ol grestore gsave 12.977800 14.400000 translate 0.035278 -0.035278 scale start_ol 1480 -237 moveto 1308 -684 1145 -822 conicto 982 -960 708 -960 conicto 384 -960 lineto 384 -612 lineto 622 -612 lineto 790 -612 882 -531 conicto 975 -451 1088 -152 conicto 1160 35 lineto 162 2494 lineto 591 2494 lineto 1363 539 lineto 2135 2494 lineto 2565 2494 lineto 1480 -237 lineto end_ol grestore gsave 7.363867 12.800000 translate 0.035278 -0.035278 scale start_ol 1544 2838 moveto 939 1180 lineto 2150 1180 lineto 1544 2838 lineto 1292 3282 moveto 1797 3282 lineto 3052 0 lineto 2589 0 lineto 2289 832 lineto 805 832 lineto 505 0 lineto 35 0 lineto 1292 3282 lineto end_ol grestore gsave 7.770267 12.800000 translate 0.035278 -0.035278 scale start_ol 2476 1509 moveto 2476 0 lineto 2048 0 lineto 2048 1502 lineto 2048 1858 1913 2035 conicto 1778 2212 1509 2212 conicto 1185 2212 998 1999 conicto 812 1786 812 1419 conicto 812 0 lineto 384 0 lineto 384 2496 lineto 812 2496 lineto 812 2120 lineto 955 2340 1153 2450 conicto 1351 2560 1610 2560 conicto 2038 2560 2257 2293 conicto 2476 2026 2476 1509 conicto end_ol grestore gsave 8.151267 12.800000 translate 0.035278 -0.035278 scale start_ol 832 3213 moveto 832 2524 lineto 1664 2524 lineto 1664 2176 lineto 832 2176 lineto 832 825 lineto 832 521 914 434 conicto 997 348 1249 348 conicto 1664 348 lineto 1664 0 lineto 1242 0 lineto 766 0 585 179 conicto 404 359 404 826 conicto 404 2176 lineto 128 2176 lineto 128 2524 lineto 404 2524 lineto 404 3213 lineto 832 3213 lineto end_ol grestore gsave 8.388333 12.800000 translate 0.035278 -0.035278 scale start_ol 2560 1328 moveto 2560 1124 lineto 684 1124 lineto 684 714 912 499 conicto 1140 284 1547 284 conicto 1782 284 2003 340 conicto 2225 396 2432 509 conicto 2432 128 lineto 2216 34 1988 -15 conicto 1761 -64 1526 -64 conicto 940 -64 598 284 conicto 256 633 256 1226 conicto 256 1839 585 2199 conicto 915 2560 1475 2560 conicto 1976 2560 2268 2228 conicto 2560 1897 2560 1328 conicto 2132 1472 moveto 2132 1809 1949 2010 conicto 1766 2212 1465 2212 conicto 1125 2212 920 2018 conicto 715 1824 684 1472 conicto 2132 1472 lineto end_ol grestore gsave 8.760867 12.800000 translate 0.035278 -0.035278 scale start_ol 2476 1509 moveto 2476 0 lineto 2048 0 lineto 2048 1502 lineto 2048 1858 1913 2035 conicto 1778 2212 1509 2212 conicto 1185 2212 998 1999 conicto 812 1786 812 1419 conicto 812 0 lineto 384 0 lineto 384 2496 lineto 812 2496 lineto 812 2120 lineto 955 2340 1153 2450 conicto 1351 2560 1610 2560 conicto 2038 2560 2257 2293 conicto 2476 2026 2476 1509 conicto end_ol grestore gsave 9.141867 12.800000 translate 0.035278 -0.035278 scale start_ol 2476 1509 moveto 2476 0 lineto 2048 0 lineto 2048 1502 lineto 2048 1858 1913 2035 conicto 1778 2212 1509 2212 conicto 1185 2212 998 1999 conicto 812 1786 812 1419 conicto 812 0 lineto 384 0 lineto 384 2496 lineto 812 2496 lineto 812 2120 lineto 955 2340 1153 2450 conicto 1351 2560 1610 2560 conicto 2038 2560 2257 2293 conicto 2476 2026 2476 1509 conicto end_ol grestore gsave 9.522867 12.800000 translate 0.035278 -0.035278 scale start_ol 1529 1252 moveto 1052 1252 868 1139 conicto 684 1027 684 755 conicto 684 539 822 411 conicto 960 284 1197 284 conicto 1525 284 1722 524 conicto 1920 764 1920 1162 conicto 1920 1252 lineto 1529 1252 lineto 2348 1426 moveto 2348 0 lineto 1920 0 lineto 1920 383 lineto 1785 154 1579 45 conicto 1373 -64 1076 -64 conicto 700 -64 478 154 conicto 256 373 256 739 conicto 256 1166 544 1383 conicto 832 1600 1368 1600 conicto 1920 1600 lineto 1920 1639 lineto 1920 1912 1741 2062 conicto 1562 2212 1238 2212 conicto 1033 2212 837 2162 conicto 642 2113 448 2014 conicto 448 2386 lineto 670 2473 879 2516 conicto 1088 2560 1286 2560 conicto 1820 2560 2084 2278 conicto 2348 1997 2348 1426 conicto end_ol grestore showpage cassbeam-1.1/doc/polcoords.eps000066400000000000000000000231011275012243400164100ustar00rootroot00000000000000%!PS-Adobe-2.0 EPSF-2.0 %%Title: /home/wbrisken/cassbeam/polcoords.dia %%Creator: Dia v0.91 %%CreationDate: Tue Aug 5 20:26:15 2003 %%For: wbrisken %%Orientation: Portrait %%Magnification: 1.0000 %%BoundingBox: 0 0 87 117 %%BeginSetup %%EndSetup %%EndComments %%BeginProlog [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def /cp {closepath} bind def /c {curveto} bind def /f {fill} bind def /a {arc} bind def /ef {eofill} bind def /ex {exch} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth pop} bind def /tr {translate} bind def /ellipsedict 8 dict def ellipsedict /mtrx matrix put /ellipse { ellipsedict begin /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix mtrx currentmatrix def x y tr xrad yrad sc 0 0 1 startangle endangle arc savematrix setmatrix end } def /mergeprocs { dup length 3 -1 roll dup length dup 5 1 roll 3 -1 roll add array cvx dup 3 -1 roll 0 exch putinterval dup 4 2 roll putinterval } bind def /dpi_x 300 def /dpi_y 300 def /conicto { /to_y exch def /to_x exch def /conic_cntrl_y exch def /conic_cntrl_x exch def currentpoint /p0_y exch def /p0_x exch def /p1_x p0_x conic_cntrl_x p0_x sub 2 3 div mul add def /p1_y p0_y conic_cntrl_y p0_y sub 2 3 div mul add def /p2_x p1_x to_x p0_x sub 1 3 div mul add def /p2_y p1_y to_y p0_y sub 1 3 div mul add def p1_x p1_y p2_x p2_y to_x to_y curveto } bind def /start_ol { gsave 1.1 dpi_x div dup scale} bind def /end_ol { closepath fill grestore } bind def 28.346000 -28.346000 scale -5.970000 -11.950000 translate %%EndProlog 1.000000 1.000000 1.000000 srgb n 6.000000 8.000000 m 6.000000 11.000000 l 9.000000 11.000000 l 9.000000 8.000000 l f 0.060000 slw [] 0 sd [] 0 sd 0 slj 0.000000 0.000000 0.000000 srgb n 6.000000 8.000000 m 6.000000 11.000000 l 9.000000 11.000000 l 9.000000 8.000000 l cp s 0.080000 slw [] 0 sd [] 0 sd 0 slc n 7.500000 9.500000 m 7.500000 8.500000 l s 0 slj n 7.650000 8.500000 m 7.500000 8.200000 l 7.350000 8.500000 l f 0.080000 slw [] 0 sd [] 0 sd 0 slc n 7.500000 9.500000 m 6.600000 9.500000 l s 0 slj n 6.600000 9.350000 m 6.300000 9.500000 l 6.600000 9.650000 l f 0.080000 slw [] 0 sd [] 0 sd 0 slc n 7.500000 9.500000 m 6.836806 10.015818 l s 0 slj n 6.744715 9.897415 m 6.600000 10.200000 l 6.928897 10.134221 l f gsave 7.700000 8.500000 translate 0.035278 -0.035278 scale start_ol 2560 1328 moveto 2560 1124 lineto 684 1124 lineto 684 714 912 499 conicto 1140 284 1547 284 conicto 1782 284 2003 340 conicto 2225 396 2432 509 conicto 2432 128 lineto 2216 34 1988 -15 conicto 1761 -64 1526 -64 conicto 940 -64 598 284 conicto 256 633 256 1226 conicto 256 1839 585 2199 conicto 915 2560 1475 2560 conicto 1976 2560 2268 2228 conicto 2560 1897 2560 1328 conicto 2132 1472 moveto 2132 1809 1949 2010 conicto 1766 2212 1465 2212 conicto 1125 2212 920 2018 conicto 715 1824 684 1472 conicto 2132 1472 lineto end_ol grestore gsave 8.100000 8.600000 translate 0.035278 -0.035278 scale start_ol 384 261 moveto 959 261 lineto 959 2185 lineto 365 2064 lineto 365 2374 lineto 956 2496 lineto 1280 2496 lineto 1280 261 lineto 1792 261 lineto 1792 0 lineto 384 0 lineto 384 261 lineto end_ol grestore gsave 6.100000 9.200000 translate 0.035278 -0.035278 scale start_ol 2560 1328 moveto 2560 1124 lineto 684 1124 lineto 684 714 912 499 conicto 1140 284 1547 284 conicto 1782 284 2003 340 conicto 2225 396 2432 509 conicto 2432 128 lineto 2216 34 1988 -15 conicto 1761 -64 1526 -64 conicto 940 -64 598 284 conicto 256 633 256 1226 conicto 256 1839 585 2199 conicto 915 2560 1475 2560 conicto 1976 2560 2268 2228 conicto 2560 1897 2560 1328 conicto 2132 1472 moveto 2132 1809 1949 2010 conicto 1766 2212 1465 2212 conicto 1125 2212 920 2018 conicto 715 1824 684 1472 conicto 2132 1472 lineto end_ol grestore gsave 6.500000 9.300000 translate 0.035278 -0.035278 scale start_ol 655 261 moveto 1793 261 lineto 1793 0 lineto 256 0 lineto 256 261 lineto 444 463 772 804 conicto 1100 1145 1184 1244 conicto 1345 1429 1408 1557 conicto 1472 1686 1472 1810 conicto 1472 2012 1334 2139 conicto 1196 2267 974 2267 conicto 817 2267 642 2211 conicto 468 2155 270 2041 conicto 270 2376 lineto 469 2451 643 2489 conicto 817 2528 960 2528 conicto 1340 2528 1566 2335 conicto 1793 2142 1793 1819 conicto 1793 1666 1737 1529 conicto 1682 1392 1537 1205 conicto 1499 1155 1279 919 conicto 1059 684 655 261 conicto end_ol grestore gsave 6.700000 10.600000 translate 0.035278 -0.035278 scale start_ol 2560 1328 moveto 2560 1124 lineto 684 1124 lineto 684 714 912 499 conicto 1140 284 1547 284 conicto 1782 284 2003 340 conicto 2225 396 2432 509 conicto 2432 128 lineto 2216 34 1988 -15 conicto 1761 -64 1526 -64 conicto 940 -64 598 284 conicto 256 633 256 1226 conicto 256 1839 585 2199 conicto 915 2560 1475 2560 conicto 1976 2560 2268 2228 conicto 2560 1897 2560 1328 conicto 2132 1472 moveto 2132 1809 1949 2010 conicto 1766 2212 1465 2212 conicto 1125 2212 920 2018 conicto 715 1824 684 1472 conicto 2132 1472 lineto end_ol grestore gsave 7.100000 10.700000 translate 0.035278 -0.035278 scale start_ol 1349 1353 moveto 1595 1304 1726 1144 conicto 1857 985 1857 750 conicto 1857 389 1607 192 conicto 1358 -5 898 -5 conicto 743 -5 580 23 conicto 417 52 243 109 conicto 243 421 lineto 371 339 538 297 conicto 705 256 887 256 conicto 1204 256 1370 380 conicto 1536 505 1536 743 conicto 1536 963 1376 1087 conicto 1217 1211 936 1211 conicto 640 1211 lineto 640 1472 lineto 950 1472 lineto 1203 1472 1337 1573 conicto 1472 1675 1472 1864 conicto 1472 2058 1335 2162 conicto 1199 2267 944 2267 conicto 805 2267 646 2236 conicto 487 2206 311 2142 conicto 311 2430 lineto 500 2479 665 2503 conicto 830 2528 976 2528 conicto 1354 2528 1573 2356 conicto 1793 2184 1793 1892 conicto 1793 1689 1677 1548 conicto 1562 1407 1349 1353 conicto end_ol grestore gsave 6.975067 11.600000 translate 0.035278 -0.035278 scale start_ol 2420 3231 moveto 2420 2798 lineto 2188 2922 1959 2983 conicto 1731 3044 1519 3044 conicto 1149 3044 948 2899 conicto 748 2755 748 2488 conicto 748 2264 881 2150 conicto 1015 2036 1387 1966 conicto 1660 1909 lineto 2167 1812 2385 1570 conicto 2604 1328 2604 921 conicto 2604 436 2286 186 conicto 1968 -64 1354 -64 conicto 1122 -64 861 -13 conicto 600 38 320 138 conicto 320 598 lineto 587 442 851 363 conicto 1115 284 1369 284 conicto 1755 284 1965 438 conicto 2176 592 2176 876 conicto 2176 1125 2024 1265 conicto 1873 1405 1528 1475 conicto 1252 1530 lineto 760 1630 540 1844 conicto 320 2059 320 2440 conicto 320 2883 624 3137 conicto 929 3392 1465 3392 conicto 1695 3392 1932 3351 conicto 2170 3311 2420 3231 conicto end_ol grestore gsave 7.356067 11.600000 translate 0.035278 -0.035278 scale start_ol 384 3456 moveto 812 3456 lineto 812 1420 lineto 2023 2496 lineto 2541 2496 lineto 1231 1328 lineto 2596 0 lineto 2067 0 lineto 812 1219 lineto 812 0 lineto 384 0 lineto 384 3456 lineto end_ol grestore gsave 7.677800 11.600000 translate 0.035278 -0.035278 scale start_ol 1480 -237 moveto 1308 -684 1145 -822 conicto 982 -960 708 -960 conicto 384 -960 lineto 384 -612 lineto 622 -612 lineto 790 -612 882 -531 conicto 975 -451 1088 -152 conicto 1160 35 lineto 162 2494 lineto 591 2494 lineto 1363 539 lineto 2135 2494 lineto 2565 2494 lineto 1480 -237 lineto end_ol grestore showpage cassbeam-1.1/doc/vlaslice2.eps000066400000000000000000003024441275012243400163020ustar00rootroot00000000000000%!PS-Adobe-3.0 EPSF-3.0 %%Creator: GNU libplot drawing library 4.1 %%Title: PostScript plot %%CreationDate: Fri Apr 11 17:39:59 2003 %%DocumentData: Clean7Bit %%LanguageLevel: 1 %%Pages: 1 %%PageOrder: Ascend %%Orientation: Portrait %%BoundingBox: 63 284 566 514 %%DocumentNeededResources: %%DocumentSuppliedResources: procset GNU_libplot 1.0 0 %%EndComments %%BeginDefaults %%PageResources: %%EndDefaults %%BeginProlog %%EndProlog %%BeginSetup /DrawDict 50 dict def DrawDict begin %%BeginResource procset GNU_libplot 1.0 0 /none null def /numGraphicParameters 17 def /stringLimit 65535 def /arrowHeight 8 def /eoFillRule true def /Begin { save numGraphicParameters dict begin } def /End { end restore } def /SetB { dup type /nulltype eq { pop false /brushRightArrow idef false /brushLeftArrow idef true /brushNone idef } { /brushDashOffset idef /brushDashArray idef 0 ne /brushRightArrow idef 0 ne /brushLeftArrow idef /brushWidth idef false /brushNone idef } ifelse } def /SetCFg { /fgblue idef /fggreen idef /fgred idef } def /SetCBg { /bgblue idef /bggreen idef /bgred idef } def /SetF { /printSize idef /printFont idef } def /SetP { dup type /nulltype eq { pop true /patternNone idef } { /patternGrayLevel idef patternGrayLevel -1 eq { /patternString idef } if false /patternNone idef } ifelse } def /BSpl { 0 begin storexyn newpath n 1 gt { 0 0 0 0 0 0 1 1 true subspline n 2 gt { 0 0 0 0 1 1 2 2 false subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline } if n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup 1 sub dup rightarrow } if end } dup 0 4 dict put def /Circ { newpath 0 360 arc closepath patternNone not { ifill } if brushNone not { istroke } if } def /CBSpl { 0 begin dup 2 gt { storexyn newpath n 1 sub dup 0 0 1 1 2 2 true subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline n 2 sub dup n 1 sub dup 0 0 1 1 false subspline patternNone not { ifill } if brushNone not { istroke } if } { Poly } ifelse end } dup 0 4 dict put def /Elli { 0 begin newpath 4 2 roll translate scale 0 0 1 0 360 arc closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 1 dict put def /Line { 0 begin 2 storexyn newpath x 0 get y 0 get moveto x 1 get y 1 get lineto brushNone not { istroke } if 0 0 1 1 leftarrow 0 0 1 1 rightarrow end } dup 0 4 dict put def /MLine { 0 begin storexyn newpath n 1 gt { x 0 get y 0 get moveto 1 1 n 1 sub { /i exch def x i get y i get lineto } for patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Poly { 3 1 roll newpath moveto -1 add { lineto } repeat closepath patternNone not { ifill } if brushNone not { istroke } if } def /Rect { 0 begin /t exch def /r exch def /b exch def /l exch def newpath l b moveto l t lineto r t lineto r b lineto closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 4 dict put def /Text { ishow } def /idef { dup where { pop pop pop } { exch def } ifelse } def /ifill { 0 begin gsave patternGrayLevel -1 ne { fgred bgred fgred sub patternGrayLevel mul add fggreen bggreen fggreen sub patternGrayLevel mul add fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor eoFillRule { eofill } { fill } ifelse } { eoFillRule { eoclip } { clip } ifelse originalCTM setmatrix pathbbox /t exch def /r exch def /b exch def /l exch def /w r l sub ceiling cvi def /h t b sub ceiling cvi def /imageByteWidth w 8 div ceiling cvi def /imageHeight h def bgred bggreen bgblue setrgbcolor eoFillRule { eofill } { fill } ifelse fgred fggreen fgblue setrgbcolor w 0 gt h 0 gt and { l b translate w h scale w h true [w 0 0 h neg 0 h] { patternproc } imagemask } if } ifelse grestore end } dup 0 8 dict put def /istroke { gsave brushDashOffset -1 eq { [] 0 setdash 1 setgray } { brushDashArray brushDashOffset setdash fgred fggreen fgblue setrgbcolor } ifelse brushWidth setlinewidth originalCTM setmatrix stroke grestore } def /ishow { 0 begin gsave fgred fggreen fgblue setrgbcolor /fontDict printFont findfont printSize scalefont dup setfont def /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end transform exch pop def /vertoffset 1 printSize sub descender sub def { 0 vertoffset moveto show /vertoffset vertoffset printSize sub def } forall grestore end } dup 0 3 dict put def /patternproc { 0 begin /patternByteLength patternString length def /patternHeight patternByteLength 8 mul sqrt cvi def /patternWidth patternHeight def /patternByteWidth patternWidth 8 idiv def /imageByteMaxLength imageByteWidth imageHeight mul stringLimit patternByteWidth sub min def /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv patternHeight mul patternHeight max def /imageHeight imageHeight imageMaxHeight sub store /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def 0 1 imageMaxHeight 1 sub { /y exch def /patternRow y patternByteWidth mul patternByteLength mod def /patternRowString patternString patternRow patternByteWidth getinterval def /imageRow y imageByteWidth mul def 0 patternByteWidth imageByteWidth 1 sub { /x exch def imageString imageRow x add patternRowString putinterval } for } for imageString end } dup 0 12 dict put def /min { dup 3 2 roll dup 4 3 roll lt { exch } if pop } def /max { dup 3 2 roll dup 4 3 roll gt { exch } if pop } def /midpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 x1 add 2 div y0 y1 add 2 div end } dup 0 4 dict put def /thirdpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 2 mul x1 add 3 div y0 2 mul y1 add 3 div end } dup 0 4 dict put def /subspline { 0 begin /movetoNeeded exch def y exch get /y3 exch def x exch get /x3 exch def y exch get /y2 exch def x exch get /x2 exch def y exch get /y1 exch def x exch get /x1 exch def y exch get /y0 exch def x exch get /x0 exch def x1 y1 x2 y2 thirdpoint /p1y exch def /p1x exch def x2 y2 x1 y1 thirdpoint /p2y exch def /p2x exch def x1 y1 x0 y0 thirdpoint p1x p1y midpoint /p0y exch def /p0x exch def x2 y2 x3 y3 thirdpoint p2x p2y midpoint /p3y exch def /p3x exch def movetoNeeded { p0x p0y moveto } if p1x p1y p2x p2y p3x p3y curveto end } dup 0 17 dict put def /storexyn { /n exch def /y n array def /x n array def n 1 sub -1 0 { /i exch def y i 3 2 roll put x i 3 2 roll put } for } def /arrowhead { 0 begin transform originalCTM itransform /taily exch def /tailx exch def transform originalCTM itransform /tipy exch def /tipx exch def /dy tipy taily sub def /dx tipx tailx sub def /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def gsave originalCTM setmatrix tipx tipy translate angle rotate newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto patternNone not { originalCTM setmatrix /padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul arrowWidth div def /padtail brushWidth 2 div def tipx tipy translate angle rotate padtip 0 translate arrowHeight padtip add padtail add arrowHeight div dup scale arrowheadpath ifill } if brushNone not { originalCTM setmatrix tipx tipy translate angle rotate arrowheadpath istroke } if grestore end } dup 0 9 dict put def /arrowheadpath { newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto } def /leftarrow { 0 begin y exch get /taily exch def x exch get /tailx exch def y exch get /tipy exch def x exch get /tipx exch def brushLeftArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def /rightarrow { 0 begin y exch get /tipy exch def x exch get /tipx exch def y exch get /taily exch def x exch get /tailx exch def brushRightArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def %%EndResource %%EndSetup %%Page: 1 1 %%PageResources: %%PageBoundingBox: 63 294 566 514 %%BeginPageSetup %I Idraw 8 Begin %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 1 0 0 1 0 0 ] concat /originalCTM matrix currentmatrix def /trueoriginalCTM matrix currentmatrix def %%EndPageSetup Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4048 10883 4048 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4224 10883 4224 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4400 10883 4400 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4575 10883 4575 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4751 10883 4751 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4927 10883 4927 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5103 10883 5103 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5278 10883 5278 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5454 10883 5454 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5630 10883 5630 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5805 10883 5805 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5981 10883 5981 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6157 10883 6157 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6332 10883 6332 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6508 10883 6508 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6684 10883 6684 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6859 10883 6859 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7035 10883 7035 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7211 10883 7211 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7387 10883 7387 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7562 10883 7562 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7738 10883 7738 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7914 10883 7914 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 8089 10883 8089 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4400 10823 4400 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5103 10823 5103 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 5805 10823 5805 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 6508 10823 6508 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7211 10823 7211 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 7914 10823 7914 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10944 4040 10944 8098 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1545 8098 1545 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1896 8098 1896 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2247 8098 2247 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2599 8098 2599 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2950 8098 2950 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 3302 8098 3302 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 3653 8098 3653 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4004 8098 4004 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4356 8098 4356 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4707 8098 4707 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5058 8098 5058 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5410 8098 5410 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5761 8098 5761 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 8098 6113 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6464 8098 6464 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6815 8098 6815 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7167 8098 7167 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7518 8098 7518 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7869 8098 7869 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8221 8098 8221 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8572 8098 8572 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8924 8098 8924 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9275 8098 9275 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9626 8098 9626 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9978 8098 9978 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10329 8098 10329 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10680 8098 10680 8037 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2599 8098 2599 7977 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4356 8098 4356 7977 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 8098 6113 7977 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7869 8098 7869 7977 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9626 8098 9626 7977 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 8098 10944 8098 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4048 1342 4048 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4224 1342 4224 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4400 1342 4400 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4575 1342 4575 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4751 1342 4751 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4927 1342 4927 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5103 1342 5103 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5278 1342 5278 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5454 1342 5454 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5630 1342 5630 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5805 1342 5805 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5981 1342 5981 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6157 1342 6157 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6332 1342 6332 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6508 1342 6508 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6684 1342 6684 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6859 1342 6859 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7035 1342 7035 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7211 1342 7211 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7387 1342 7387 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7562 1342 7562 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7738 1342 7738 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7914 1342 7914 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 8089 1342 8089 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4400 1402 4400 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5103 1402 5103 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 5805 1402 5805 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 6508 1402 6508 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7211 1402 7211 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 7914 1402 7914 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4040 1281 8098 2 MLine End Begin %I Poly [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 16 1094 4488 1116 4481 1130 4459 1138 4422 1138 4400 1130 4363 1116 4341 1094 4334 1079 4334 1057 4341 1042 4363 1035 4400 1035 4422 1042 4459 1057 4481 1079 4488 16 Poly End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 14 1042 5154 1042 5161 1050 5176 1057 5183 1072 5191 1101 5191 1116 5183 1123 5176 1130 5161 1130 5147 1123 5132 1108 5110 1035 5036 1138 5036 14 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 3 1108 5894 1035 5791 1145 5791 3 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1108 5894 1108 5739 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 23 1130 6574 1123 6589 1101 6596 1086 6596 1064 6589 1050 6567 1042 6530 1042 6493 1050 6464 1064 6449 1086 6442 1094 6442 1116 6449 1130 6464 1138 6486 1138 6493 1130 6515 1116 6530 1094 6537 1086 6537 1064 6530 1050 6515 1042 6493 23 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 29 1072 7299 1050 7292 1042 7277 1042 7262 1050 7248 1064 7240 1094 7233 1116 7226 1130 7211 1138 7196 1138 7174 1130 7159 1123 7152 1101 7145 1072 7145 1050 7152 1042 7159 1035 7174 1035 7196 1042 7211 1057 7226 1079 7233 1108 7240 1123 7248 1130 7262 1130 7277 1123 7292 1101 7299 1072 7299 29 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 4 910 7972 925 7980 947 8002 947 7847 4 MLine End Begin %I Poly [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 16 1094 8002 1116 7994 1130 7972 1138 7936 1138 7914 1130 7877 1116 7855 1094 7847 1079 7847 1057 7855 1042 7877 1035 7914 1035 7936 1042 7972 1057 7994 1079 8002 16 Poly End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1545 4040 1545 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1896 4040 1896 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2247 4040 2247 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2599 4040 2599 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2950 4040 2950 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 3302 4040 3302 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 3653 4040 3653 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4004 4040 4004 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4356 4040 4356 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4707 4040 4707 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5058 4040 5058 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5410 4040 5410 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5761 4040 5761 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 4040 6113 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6464 4040 6464 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6815 4040 6815 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7167 4040 7167 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7518 4040 7518 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7869 4040 7869 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8221 4040 8221 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8572 4040 8572 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8924 4040 8924 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9275 4040 9275 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9626 4040 9626 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9978 4040 9978 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10329 4040 10329 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 10680 4040 10680 4100 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2599 4040 2599 4161 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4356 4040 4356 4161 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 4040 6113 4161 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 7869 4040 7869 4161 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 9626 4040 9626 4161 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 1281 4040 10944 4040 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 2386 3797 2518 3797 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 4 2591 3856 2606 3863 2628 3885 2628 3731 4 MLine End Begin %I Poly [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 16 2775 3885 2797 3878 2812 3856 2819 3819 2819 3797 2812 3760 2797 3738 2775 3731 2760 3731 2738 3738 2724 3760 2716 3797 2716 3819 2724 3856 2738 3878 2760 3885 16 Poly End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 4216 3797 4348 3797 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 17 4488 3885 4414 3885 4407 3819 4414 3827 4436 3834 4459 3834 4481 3827 4495 3812 4503 3790 4503 3775 4495 3753 4481 3738 4459 3731 4436 3731 4414 3738 4407 3746 4400 3760 17 MLine End Begin %I Poly [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 16 6120 3885 6142 3878 6157 3856 6164 3819 6164 3797 6157 3760 6142 3738 6120 3731 6105 3731 6083 3738 6068 3760 6061 3797 6061 3819 6068 3856 6083 3878 6105 3885 16 Poly End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 17 7906 3885 7833 3885 7825 3819 7833 3827 7855 3834 7877 3834 7899 3827 7914 3812 7921 3790 7921 3775 7914 3753 7899 3738 7877 3731 7855 3731 7833 3738 7825 3746 7818 3760 17 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 4 9523 3856 9538 3863 9560 3885 9560 3731 4 MLine End Begin %I Poly [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 16 9707 3885 9729 3878 9744 3856 9751 3819 9751 3797 9744 3760 9729 3738 9707 3731 9692 3731 9670 3738 9656 3760 9648 3797 9648 3819 9656 3856 9670 3878 9692 3885 16 Poly End Begin %I Rect [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg White 1 1 1 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 1720 4224 10505 7914 Rect End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 500 1720 5919 1725 5917 1729 5914 1733 5911 1738 5908 1742 5905 1747 5902 1751 5899 1755 5896 1760 5893 1764 5890 1769 5887 1773 5884 1777 5881 1782 5878 1786 5875 1791 5872 1795 5870 1799 5867 1804 5864 1808 5861 1813 5858 1817 5855 1821 5852 1826 5849 1830 5846 1834 5843 1839 5841 1843 5838 1848 5835 1852 5832 1856 5829 1861 5826 1865 5823 1870 5820 1874 5817 1878 5815 1883 5812 1887 5809 1892 5806 1896 5803 1900 5800 1905 5797 1909 5795 1914 5792 1918 5789 1922 5786 1927 5783 1931 5780 1936 5777 1940 5775 1944 5772 1949 5769 1953 5766 1957 5763 1962 5760 1966 5758 1971 5755 1975 5752 1979 5749 1984 5746 1988 5744 1993 5741 1997 5738 2001 5735 2006 5732 2010 5730 2015 5727 2019 5724 2023 5721 2028 5718 2032 5716 2037 5713 2041 5710 2045 5707 2050 5704 2054 5702 2058 5699 2063 5696 2067 5693 2072 5691 2076 5688 2080 5685 2085 5682 2089 5680 2094 5677 2098 5674 2102 5671 2107 5669 2111 5666 2116 5663 2120 5660 2124 5658 2129 5655 2133 5652 2138 5650 2142 5647 2146 5644 2151 5641 2155 5639 2160 5636 2164 5633 2168 5631 2173 5628 2177 5625 2181 5622 2186 5620 2190 5617 2195 5614 2199 5612 2203 5609 2208 5606 2212 5604 2217 5601 2221 5598 2225 5596 2230 5593 2234 5590 2239 5588 2243 5585 2247 5582 2252 5580 2256 5577 2261 5574 2265 5572 2269 5569 2274 5566 2278 5564 2283 5561 2287 5559 2291 5556 2296 5553 2300 5551 2304 5548 2309 5546 2313 5543 2318 5540 2322 5538 2326 5535 2331 5532 2335 5530 2340 5527 2344 5525 2348 5522 2353 5520 2357 5517 2362 5514 2366 5512 2370 5509 2375 5507 2379 5504 2384 5501 2388 5499 2392 5496 2397 5494 2401 5491 2405 5489 2410 5486 2414 5484 2419 5481 2423 5478 2427 5476 2432 5473 2436 5471 2441 5468 2445 5466 2449 5463 2454 5461 2458 5458 2463 5456 2467 5453 2471 5451 2476 5448 2480 5446 2485 5443 2489 5441 2493 5438 2498 5436 2502 5433 2507 5431 2511 5428 2515 5426 2520 5423 2524 5421 2528 5418 2533 5416 2537 5413 2542 5411 2546 5408 2550 5406 2555 5404 2559 5401 2564 5399 2568 5396 2572 5394 2577 5391 2581 5389 2586 5386 2590 5384 2594 5382 2599 5379 2603 5377 2608 5374 2612 5372 2616 5369 2621 5367 2625 5365 2629 5362 2634 5360 2638 5357 2643 5355 2647 5353 2651 5350 2656 5348 2660 5345 2665 5343 2669 5341 2673 5338 2678 5336 2682 5334 2687 5331 2691 5329 2695 5326 2700 5324 2704 5322 2709 5319 2713 5317 2717 5315 2722 5312 2726 5310 2731 5308 2735 5305 2739 5303 2744 5301 2748 5298 2752 5296 2757 5294 2761 5291 2766 5289 2770 5287 2774 5284 2779 5282 2783 5280 2788 5277 2792 5275 2796 5273 2801 5271 2805 5268 2810 5266 2814 5264 2818 5261 2823 5259 2827 5257 2832 5255 2836 5252 2840 5250 2845 5248 2849 5246 2853 5243 2858 5241 2862 5239 2867 5237 2871 5234 2875 5232 2880 5230 2884 5228 2889 5225 2893 5223 2897 5221 2902 5219 2906 5216 2911 5214 2915 5212 2919 5210 2924 5208 2928 5205 2933 5203 2937 5201 2941 5199 2946 5197 2950 5194 2955 5192 2959 5190 2963 5188 2968 5186 2972 5183 2976 5181 2981 5179 2985 5177 2990 5175 2994 5173 2998 5170 3003 5168 3007 5166 3012 5164 3016 5162 3020 5160 3025 5157 3029 5155 3034 5153 3038 5151 3042 5149 3047 5147 3051 5145 3056 5143 3060 5140 3064 5138 3069 5136 3073 5134 3077 5132 3082 5130 3086 5128 3091 5126 3095 5124 3099 5121 3104 5119 3108 5117 3113 5115 3117 5113 3121 5111 3126 5109 3130 5107 3135 5105 3139 5103 3143 5101 3148 5099 3152 5097 3157 5095 3161 5092 3165 5090 3170 5088 3174 5086 3179 5084 3183 5082 3187 5080 3192 5078 3196 5076 3200 5074 3205 5072 3209 5070 3214 5068 3218 5066 3222 5064 3227 5062 3231 5060 3236 5058 3240 5056 3244 5054 3249 5052 3253 5050 3258 5048 3262 5046 3266 5044 3271 5042 3275 5040 3280 5038 3284 5036 3288 5034 3293 5032 3297 5030 3302 5028 3306 5026 3310 5024 3315 5023 3319 5021 3323 5019 3328 5017 3332 5015 3337 5013 3341 5011 3345 5009 3350 5007 3354 5005 3359 5003 3363 5001 3367 4999 3372 4997 3376 4996 3381 4994 3385 4992 3389 4990 3394 4988 3398 4986 3403 4984 3407 4982 3411 4980 3416 4979 3420 4977 3424 4975 3429 4973 3433 4971 3438 4969 3442 4967 3446 4965 3451 4964 3455 4962 3460 4960 3464 4958 3468 4956 3473 4954 3477 4953 3482 4951 3486 4949 3490 4947 3495 4945 3499 4943 3504 4942 3508 4940 3512 4938 3517 4936 3521 4934 3526 4933 3530 4931 3534 4929 3539 4927 3543 4925 3547 4924 3552 4922 3556 4920 3561 4918 3565 4916 3569 4915 3574 4913 3578 4911 3583 4909 3587 4908 3591 4906 3596 4904 3600 4902 3605 4901 3609 4899 3613 4897 3618 4895 3622 4894 3627 4892 3631 4890 3635 4888 3640 4887 3644 4885 3648 4883 3653 4882 3657 4880 3662 4878 3666 4876 3670 4875 3675 4873 3679 4871 3684 4870 3688 4868 3692 4866 3697 4865 3701 4863 3706 4861 3710 4859 3714 4858 3719 4856 3723 4854 3728 4853 3732 4851 3736 4849 3741 4848 3745 4846 3750 4845 3754 4843 3758 4841 3763 4840 3767 4838 3771 4836 3776 4835 3780 4833 3785 4831 3789 4830 3793 4828 3798 4827 3802 4825 3807 4823 3811 4822 3815 4820 3820 4819 3824 4817 3829 4815 3833 4814 3837 4812 3842 4811 3846 4809 3851 4807 3855 4806 3859 4804 3864 4803 3868 4801 3872 4800 3877 4798 3881 4796 3886 4795 3890 4793 3894 4792 3899 4790 3903 4789 3908 4787 3912 4786 500 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 500 3912 4786 3916 4784 3921 4783 3925 4781 3930 4779 3934 4778 3938 4776 3943 4775 3947 4773 3952 4772 3956 4770 3960 4769 3965 4767 3969 4766 3974 4764 3978 4763 3982 4761 3987 4760 3991 4758 3995 4757 4000 4755 4004 4754 4009 4753 4013 4751 4017 4750 4022 4748 4026 4747 4031 4745 4035 4744 4039 4742 4044 4741 4048 4739 4053 4738 4057 4737 4061 4735 4066 4734 4070 4732 4075 4731 4079 4729 4083 4728 4088 4727 4092 4725 4096 4724 4101 4722 4105 4721 4110 4720 4114 4718 4118 4717 4123 4715 4127 4714 4132 4713 4136 4711 4140 4710 4145 4708 4149 4707 4154 4706 4158 4704 4162 4703 4167 4702 4171 4700 4176 4699 4180 4698 4184 4696 4189 4695 4193 4693 4198 4692 4202 4691 4206 4689 4211 4688 4215 4687 4219 4685 4224 4684 4228 4683 4233 4682 4237 4680 4241 4679 4246 4678 4250 4676 4255 4675 4259 4674 4263 4672 4268 4671 4272 4670 4277 4669 4281 4667 4285 4666 4290 4665 4294 4663 4299 4662 4303 4661 4307 4660 4312 4658 4316 4657 4321 4656 4325 4655 4329 4653 4334 4652 4338 4651 4342 4650 4347 4648 4351 4647 4356 4646 4360 4645 4364 4643 4369 4642 4373 4641 4378 4640 4382 4639 4386 4637 4391 4636 4395 4635 4400 4634 4404 4633 4408 4631 4413 4630 4417 4629 4422 4628 4426 4627 4430 4625 4435 4624 4439 4623 4443 4622 4448 4621 4452 4620 4457 4618 4461 4617 4465 4616 4470 4615 4474 4614 4479 4613 4483 4612 4487 4610 4492 4609 4496 4608 4501 4607 4505 4606 4509 4605 4514 4604 4518 4603 4523 4601 4527 4600 4531 4599 4536 4598 4540 4597 4545 4596 4549 4595 4553 4594 4558 4593 4562 4592 4566 4590 4571 4589 4575 4588 4580 4587 4584 4586 4588 4585 4593 4584 4597 4583 4602 4582 4606 4581 4610 4580 4615 4579 4619 4578 4624 4577 4628 4576 4632 4575 4637 4574 4641 4573 4646 4571 4650 4570 4654 4569 4659 4568 4663 4567 4667 4566 4672 4565 4676 4564 4681 4563 4685 4562 4689 4561 4694 4560 4698 4559 4703 4558 4707 4557 4711 4556 4716 4555 4720 4554 4725 4553 4729 4553 4733 4552 4738 4551 4742 4550 4747 4549 4751 4548 4755 4547 4760 4546 4764 4545 4769 4544 4773 4543 4777 4542 4782 4541 4786 4540 4790 4539 4795 4538 4799 4537 4804 4536 4808 4536 4812 4535 4817 4534 4821 4533 4826 4532 4830 4531 4834 4530 4839 4529 4843 4528 4848 4527 4852 4527 4856 4526 4861 4525 4865 4524 4870 4523 4874 4522 4878 4521 4883 4520 4887 4520 4891 4519 4896 4518 4900 4517 4905 4516 4909 4515 4913 4515 4918 4514 4922 4513 4927 4512 4931 4511 4935 4510 4940 4510 4944 4509 4949 4508 4953 4507 4957 4506 4962 4505 4966 4505 4971 4504 4975 4503 4979 4502 4984 4501 4988 4501 4993 4500 4997 4499 5001 4498 5006 4498 5010 4497 5014 4496 5019 4495 5023 4494 5028 4494 5032 4493 5036 4492 5041 4491 5045 4491 5050 4490 5054 4489 5058 4488 5063 4488 5067 4487 5072 4486 5076 4486 5080 4485 5085 4484 5089 4483 5094 4483 5098 4482 5102 4481 5107 4481 5111 4480 5115 4479 5120 4478 5124 4478 5129 4477 5133 4476 5137 4476 5142 4475 5146 4474 5151 4474 5155 4473 5159 4472 5164 4472 5168 4471 5173 4470 5177 4470 5181 4469 5186 4468 5190 4468 5195 4467 5199 4466 5203 4466 5208 4465 5212 4465 5217 4464 5221 4463 5225 4463 5230 4462 5234 4461 5238 4461 5243 4460 5247 4460 5252 4459 5256 4458 5260 4458 5265 4457 5269 4457 5274 4456 5278 4455 5282 4455 5287 4454 5291 4454 5296 4453 5300 4453 5304 4452 5309 4451 5313 4451 5318 4450 5322 4450 5326 4449 5331 4449 5335 4448 5340 4448 5344 4447 5348 4446 5353 4446 5357 4445 5361 4445 5366 4444 5370 4444 5375 4443 5379 4443 5383 4442 5388 4442 5392 4441 5397 4441 5401 4440 5405 4440 5410 4439 5414 4439 5419 4438 5423 4438 5427 4437 5432 4437 5436 4436 5441 4436 5445 4435 5449 4435 5454 4434 5458 4434 5462 4434 5467 4433 5471 4433 5476 4432 5480 4432 5484 4431 5489 4431 5493 4430 5498 4430 5502 4430 5506 4429 5511 4429 5515 4428 5520 4428 5524 4427 5528 4427 5533 4427 5537 4426 5542 4426 5546 4425 5550 4425 5555 4425 5559 4424 5564 4424 5568 4423 5572 4423 5577 4423 5581 4422 5585 4422 5590 4422 5594 4421 5599 4421 5603 4421 5607 4420 5612 4420 5616 4419 5621 4419 5625 4419 5629 4418 5634 4418 5638 4418 5643 4417 5647 4417 5651 4417 5656 4416 5660 4416 5665 4416 5669 4416 5673 4415 5678 4415 5682 4415 5686 4414 5691 4414 5695 4414 5700 4413 5704 4413 5708 4413 5713 4413 5717 4412 5722 4412 5726 4412 5730 4411 5735 4411 5739 4411 5744 4411 5748 4410 5752 4410 5757 4410 5761 4410 5766 4409 5770 4409 5774 4409 5779 4409 5783 4408 5788 4408 5792 4408 5796 4408 5801 4408 5805 4407 5809 4407 5814 4407 5818 4407 5823 4407 5827 4406 5831 4406 5836 4406 5840 4406 5845 4406 5849 4405 5853 4405 5858 4405 5862 4405 5867 4405 5871 4404 5875 4404 5880 4404 5884 4404 5889 4404 5893 4404 5897 4404 5902 4403 5906 4403 5910 4403 5915 4403 5919 4403 5924 4403 5928 4403 5932 4402 5937 4402 5941 4402 5946 4402 5950 4402 5954 4402 5959 4402 5963 4402 5968 4401 5972 4401 5976 4401 5981 4401 5985 4401 5990 4401 5994 4401 5998 4401 6003 4401 6007 4401 6012 4401 6016 4401 6020 4400 6025 4400 6029 4400 6033 4400 6038 4400 6042 4400 6047 4400 6051 4400 6055 4400 6060 4400 6064 4400 6069 4400 6073 4400 6077 4400 6082 4400 6086 4400 6091 4400 6095 4400 6099 4400 6104 4400 500 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 500 6104 4400 6108 4400 6113 4400 6117 4400 6121 4400 6126 4400 6130 4400 6134 4400 6139 4400 6143 4400 6148 4400 6152 4400 6156 4400 6161 4400 6165 4400 6170 4400 6174 4400 6178 4400 6183 4400 6187 4400 6192 4400 6196 4400 6200 4400 6205 4400 6209 4401 6214 4401 6218 4401 6222 4401 6227 4401 6231 4401 6236 4401 6240 4401 6244 4401 6249 4401 6253 4401 6257 4401 6262 4402 6266 4402 6271 4402 6275 4402 6279 4402 6284 4402 6288 4402 6293 4402 6297 4403 6301 4403 6306 4403 6310 4403 6315 4403 6319 4403 6323 4403 6328 4404 6332 4404 6337 4404 6341 4404 6345 4404 6350 4404 6354 4404 6359 4405 6363 4405 6367 4405 6372 4405 6376 4405 6380 4406 6385 4406 6389 4406 6394 4406 6398 4406 6402 4407 6407 4407 6411 4407 6416 4407 6420 4407 6424 4408 6429 4408 6433 4408 6438 4408 6442 4408 6446 4409 6451 4409 6455 4409 6460 4409 6464 4410 6468 4410 6473 4410 6477 4410 6481 4411 6486 4411 6490 4411 6495 4411 6499 4412 6503 4412 6508 4412 6512 4413 6517 4413 6521 4413 6525 4413 6530 4414 6534 4414 6539 4414 6543 4415 6547 4415 6552 4415 6556 4416 6561 4416 6565 4416 6569 4416 6574 4417 6578 4417 6583 4417 6587 4418 6591 4418 6596 4418 6600 4419 6604 4419 6609 4419 6613 4420 6618 4420 6622 4421 6626 4421 6631 4421 6635 4422 6640 4422 6644 4422 6648 4423 6653 4423 6657 4423 6662 4424 6666 4424 6670 4425 6675 4425 6679 4425 6684 4426 6688 4426 6692 4427 6697 4427 6701 4427 6705 4428 6710 4428 6714 4429 6719 4429 6723 4430 6727 4430 6732 4430 6736 4431 6741 4431 6745 4432 6749 4432 6754 4433 6758 4433 6763 4434 6767 4434 6771 4434 6776 4435 6780 4435 6785 4436 6789 4436 6793 4437 6798 4437 6802 4438 6807 4438 6811 4439 6815 4439 6820 4440 6824 4440 6828 4441 6833 4441 6837 4442 6842 4442 6846 4443 6850 4443 6855 4444 6859 4444 6864 4445 6868 4445 6872 4446 6877 4446 6881 4447 6886 4448 6890 4448 6894 4449 6899 4449 6903 4450 6908 4450 6912 4451 6916 4451 6921 4452 6925 4453 6929 4453 6934 4454 6938 4454 6943 4455 6947 4455 6951 4456 6956 4457 6960 4457 6965 4458 6969 4458 6973 4459 6978 4460 6982 4460 6987 4461 6991 4461 6995 4462 7000 4463 7004 4463 7009 4464 7013 4465 7017 4465 7022 4466 7026 4466 7031 4467 7035 4468 7039 4468 7044 4469 7048 4470 7052 4470 7057 4471 7061 4472 7066 4472 7070 4473 7074 4474 7079 4474 7083 4475 7088 4476 7092 4476 7096 4477 7101 4478 7105 4478 7110 4479 7114 4480 7118 4481 7123 4481 7127 4482 7132 4483 7136 4483 7140 4484 7145 4485 7149 4486 7153 4486 7158 4487 7162 4488 7167 4488 7171 4489 7175 4490 7180 4491 7184 4491 7189 4492 7193 4493 7197 4494 7202 4494 7206 4495 7211 4496 7215 4497 7219 4498 7224 4498 7228 4499 7233 4500 7237 4501 7241 4501 7246 4502 7250 4503 7255 4504 7259 4505 7263 4505 7268 4506 7272 4507 7276 4508 7281 4509 7285 4510 7290 4510 7294 4511 7298 4512 7303 4513 7307 4514 7312 4515 7316 4515 7320 4516 7325 4517 7329 4518 7334 4519 7338 4520 7342 4520 7347 4521 7351 4522 7356 4523 7360 4524 7364 4525 7369 4526 7373 4527 7378 4527 7382 4528 7386 4529 7391 4530 7395 4531 7399 4532 7404 4533 7408 4534 7413 4535 7417 4536 7421 4536 7426 4537 7430 4538 7435 4539 7439 4540 7443 4541 7448 4542 7452 4543 7457 4544 7461 4545 7465 4546 7470 4547 7474 4548 7479 4549 7483 4550 7487 4551 7492 4552 7496 4553 7500 4553 7505 4554 7509 4555 7514 4556 7518 4557 7522 4558 7527 4559 7531 4560 7536 4561 7540 4562 7544 4563 7549 4564 7553 4565 7558 4566 7562 4567 7566 4568 7571 4569 7575 4570 7580 4571 7584 4573 7588 4574 7593 4575 7597 4576 7602 4577 7606 4578 7610 4579 7615 4580 7619 4581 7623 4582 7628 4583 7632 4584 7637 4585 7641 4586 7645 4587 7650 4588 7654 4589 7659 4590 7663 4592 7667 4593 7672 4594 7676 4595 7681 4596 7685 4597 7689 4598 7694 4599 7698 4600 7703 4601 7707 4603 7711 4604 7716 4605 7720 4606 7724 4607 7729 4608 7733 4609 7738 4610 7742 4612 7746 4613 7751 4614 7755 4615 7760 4616 7764 4617 7768 4618 7773 4620 7777 4621 7782 4622 7786 4623 7790 4624 7795 4625 7799 4627 7804 4628 7808 4629 7812 4630 7817 4631 7821 4633 7826 4634 7830 4635 7834 4636 7839 4637 7843 4639 7847 4640 7852 4641 7856 4642 7861 4643 7865 4645 7869 4646 7874 4647 7878 4648 7883 4650 7887 4651 7891 4652 7896 4653 7900 4655 7905 4656 7909 4657 7913 4658 7918 4660 7922 4661 7927 4662 7931 4663 7935 4665 7940 4666 7944 4667 7948 4669 7953 4670 7957 4671 7962 4672 7966 4674 7970 4675 7975 4676 7979 4678 7984 4679 7988 4680 7992 4682 7997 4683 8001 4684 8006 4685 8010 4687 8014 4688 8019 4689 8023 4691 8028 4692 8032 4693 8036 4695 8041 4696 8045 4698 8050 4699 8054 4700 8058 4702 8063 4703 8067 4704 8071 4706 8076 4707 8080 4708 8085 4710 8089 4711 8093 4713 8098 4714 8102 4715 8107 4717 8111 4718 8115 4720 8120 4721 8124 4722 8129 4724 8133 4725 8137 4727 8142 4728 8146 4729 8151 4731 8155 4732 8159 4734 8164 4735 8168 4737 8172 4738 8177 4739 8181 4741 8186 4742 8190 4744 8194 4745 8199 4747 8203 4748 8208 4750 8212 4751 8216 4753 8221 4754 8225 4755 8230 4757 8234 4758 8238 4760 8243 4761 8247 4763 8252 4764 8256 4766 8260 4767 8265 4769 8269 4770 8274 4772 8278 4773 8282 4775 8287 4776 8291 4778 8295 4779 500 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 500 8295 4779 8300 4781 8304 4783 8309 4784 8313 4786 8317 4787 8322 4789 8326 4790 8331 4792 8335 4793 8339 4795 8344 4796 8348 4798 8353 4800 8357 4801 8361 4803 8366 4804 8370 4806 8375 4807 8379 4809 8383 4811 8388 4812 8392 4814 8397 4815 8401 4817 8405 4819 8410 4820 8414 4822 8418 4823 8423 4825 8427 4827 8432 4828 8436 4830 8440 4831 8445 4833 8449 4835 8454 4836 8458 4838 8462 4840 8467 4841 8471 4843 8476 4845 8480 4846 8484 4848 8489 4849 8493 4851 8498 4853 8502 4854 8506 4856 8511 4858 8515 4859 8519 4861 8524 4863 8528 4865 8533 4866 8537 4868 8541 4870 8546 4871 8550 4873 8555 4875 8559 4876 8563 4878 8568 4880 8572 4882 8577 4883 8581 4885 8585 4887 8590 4888 8594 4890 8599 4892 8603 4894 8607 4895 8612 4897 8616 4899 8621 4901 8625 4902 8629 4904 8634 4906 8638 4908 8642 4909 8647 4911 8651 4913 8656 4915 8660 4916 8664 4918 8669 4920 8673 4922 8678 4924 8682 4925 8686 4927 8691 4929 8695 4931 8700 4933 8704 4934 8708 4936 8713 4938 8717 4940 8722 4942 8726 4943 8730 4945 8735 4947 8739 4949 8743 4951 8748 4953 8752 4954 8757 4956 8761 4958 8765 4960 8770 4962 8774 4964 8779 4965 8783 4967 8787 4969 8792 4971 8796 4973 8801 4975 8805 4977 8809 4979 8814 4980 8818 4982 8823 4984 8827 4986 8831 4988 8836 4990 8840 4992 8845 4994 8849 4996 8853 4997 8858 4999 8862 5001 8866 5003 8871 5005 8875 5007 8880 5009 8884 5011 8888 5013 8893 5015 8897 5017 8902 5019 8906 5021 8910 5023 8915 5024 8919 5026 8924 5028 8928 5030 8932 5032 8937 5034 8941 5036 8946 5038 8950 5040 8954 5042 8959 5044 8963 5046 8967 5048 8972 5050 8976 5052 8981 5054 8985 5056 8989 5058 8994 5060 8998 5062 9003 5064 9007 5066 9011 5068 9016 5070 9020 5072 9025 5074 9029 5076 9033 5078 9038 5080 9042 5082 9047 5084 9051 5086 9055 5088 9060 5090 9064 5092 9069 5095 9073 5097 9077 5099 9082 5101 9086 5103 9090 5105 9095 5107 9099 5109 9104 5111 9108 5113 9112 5115 9117 5117 9121 5119 9126 5121 9130 5124 9134 5126 9139 5128 9143 5130 9148 5132 9152 5134 9156 5136 9161 5138 9165 5140 9170 5143 9174 5145 9178 5147 9183 5149 9187 5151 9191 5153 9196 5155 9200 5157 9205 5160 9209 5162 9213 5164 9218 5166 9222 5168 9227 5170 9231 5173 9235 5175 9240 5177 9244 5179 9249 5181 9253 5183 9257 5186 9262 5188 9266 5190 9271 5192 9275 5194 9279 5197 9284 5199 9288 5201 9293 5203 9297 5205 9301 5208 9306 5210 9310 5212 9314 5214 9319 5216 9323 5219 9328 5221 9332 5223 9336 5225 9341 5228 9345 5230 9350 5232 9354 5234 9358 5237 9363 5239 9367 5241 9372 5243 9376 5246 9380 5248 9385 5250 9389 5252 9394 5255 9398 5257 9402 5259 9407 5261 9411 5264 9416 5266 9420 5268 9424 5271 9429 5273 9433 5275 9437 5277 9442 5280 9446 5282 9451 5284 9455 5287 9459 5289 9464 5291 9468 5294 9473 5296 9477 5298 9481 5301 9486 5303 9490 5305 9495 5308 9499 5310 9503 5312 9508 5315 9512 5317 9517 5319 9521 5322 9525 5324 9530 5326 9534 5329 9538 5331 9543 5334 9547 5336 9552 5338 9556 5341 9560 5343 9565 5345 9569 5348 9574 5350 9578 5353 9582 5355 9587 5357 9591 5360 9596 5362 9600 5365 9604 5367 9609 5369 9613 5372 9618 5374 9622 5377 9626 5379 9631 5382 9635 5384 9640 5386 9644 5389 9648 5391 9653 5394 9657 5396 9661 5399 9666 5401 9670 5404 9675 5406 9679 5408 9683 5411 9688 5413 9692 5416 9697 5418 9701 5421 9705 5423 9710 5426 9714 5428 9719 5431 9723 5433 9727 5436 9732 5438 9736 5441 9741 5443 9745 5446 9749 5448 9754 5451 9758 5453 9762 5456 9767 5458 9771 5461 9776 5463 9780 5466 9784 5468 9789 5471 9793 5473 9798 5476 9802 5478 9806 5481 9811 5484 9815 5486 9820 5489 9824 5491 9828 5494 9833 5496 9837 5499 9842 5501 9846 5504 9850 5507 9855 5509 9859 5512 9864 5514 9868 5517 9872 5520 9877 5522 9881 5525 9885 5527 9890 5530 9894 5532 9899 5535 9903 5538 9907 5540 9912 5543 9916 5546 9921 5548 9925 5551 9929 5553 9934 5556 9938 5559 9943 5561 9947 5564 9951 5566 9956 5569 9960 5572 9965 5574 9969 5577 9973 5580 9978 5582 9982 5585 9986 5588 9991 5590 9995 5593 10000 5596 10004 5598 10008 5601 10013 5604 10017 5606 10022 5609 10026 5612 10030 5614 10035 5617 10039 5620 10044 5622 10048 5625 10052 5628 10057 5631 10061 5633 10066 5636 10070 5639 10074 5641 10079 5644 10083 5647 10088 5650 10092 5652 10096 5655 10101 5658 10105 5660 10109 5663 10114 5666 10118 5669 10123 5671 10127 5674 10131 5677 10136 5680 10140 5682 10145 5685 10149 5688 10153 5691 10158 5693 10162 5696 10167 5699 10171 5702 10175 5704 10180 5707 10184 5710 10189 5713 10193 5716 10197 5718 10202 5721 10206 5724 10210 5727 10215 5730 10219 5732 10224 5735 10228 5738 10232 5741 10237 5744 10241 5746 10246 5749 10250 5752 10254 5755 10259 5758 10263 5760 10268 5763 10272 5766 10276 5769 10281 5772 10285 5775 10290 5777 10294 5780 10298 5783 10303 5786 10307 5789 10312 5792 10316 5795 10320 5797 10325 5800 10329 5803 10333 5806 10338 5809 10342 5812 10347 5815 10351 5817 10355 5820 10360 5823 10364 5826 10369 5829 10373 5832 10377 5835 10382 5838 10386 5841 10391 5843 10395 5846 10399 5849 10404 5852 10408 5855 10413 5858 10417 5861 10421 5864 10426 5867 10430 5870 10435 5872 10439 5875 10443 5878 10448 5881 10452 5884 10456 5887 10461 5890 10465 5893 10470 5896 10474 5899 10478 5902 10483 5905 10487 5908 500 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 5 10487 5908 10492 5911 10496 5914 10500 5917 10505 5919 5 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 330 5663 7524 5665 7524 5667 7523 5669 7522 5670 7521 5672 7520 5674 7519 5676 7518 5678 7518 5679 7517 5681 7516 5683 7515 5684 7514 5686 7514 5688 7513 5689 7512 5691 7511 5693 7510 5694 7510 5696 7509 5698 7508 5699 7507 5701 7507 5702 7506 5704 7505 5705 7505 5707 7504 5708 7503 5710 7502 5711 7502 5713 7501 5714 7500 5716 7500 5717 7499 5719 7498 5720 7498 5721 7497 5723 7496 5724 7496 5725 7495 5727 7495 5728 7494 5730 7493 5731 7493 5732 7492 5733 7491 5735 7491 5736 7490 5737 7490 5739 7489 5740 7488 5741 7488 5742 7487 5744 7487 5745 7486 5746 7486 5747 7485 5748 7485 5750 7484 5751 7483 5752 7483 5753 7482 5754 7482 5755 7481 5757 7481 5758 7480 5759 7480 5760 7479 5761 7479 5762 7478 5763 7478 5764 7477 5765 7477 5767 7476 5768 7476 5769 7475 5770 7475 5771 7474 5772 7474 5773 7473 5774 7473 5775 7472 5776 7472 5777 7471 5778 7471 5779 7471 5780 7470 5781 7470 5782 7469 5783 7469 5784 7468 5785 7468 5786 7467 5787 7467 5788 7467 5788 7466 5789 7466 5790 7465 5791 7465 5792 7465 5793 7464 5794 7464 5795 7463 5796 7463 5797 7463 5798 7462 5799 7461 5800 7461 5801 7461 5802 7460 5803 7460 5804 7459 5805 7459 5806 7458 5807 7458 5808 7458 5809 7457 5810 7457 5811 7456 5812 7456 5813 7455 5814 7455 5815 7454 5816 7454 5817 7454 5817 7453 5818 7453 5819 7453 5820 7452 5821 7452 5822 7451 5823 7451 5824 7450 5825 7450 5826 7450 5826 7449 5827 7449 5828 7449 5829 7448 5830 7448 5831 7448 5831 7447 5832 7447 5833 7447 5834 7446 5835 7446 5836 7445 5837 7445 5838 7445 5838 7444 5839 7444 5840 7444 5841 7443 5842 7443 5843 7443 5843 7442 5844 7442 5845 7441 5846 7441 5847 7441 5848 7440 5849 7440 5850 7440 5850 7439 5851 7439 5852 7439 5852 7438 5853 7438 5854 7438 5855 7437 5856 7437 5857 7437 5857 7436 5858 7436 5859 7436 5860 7435 5861 7435 5862 7434 5863 7434 5864 7434 5864 7433 5865 7433 5866 7433 5867 7433 5867 7432 5868 7432 5869 7432 5870 7431 5871 7431 5872 7430 5873 7430 5874 7430 5875 7429 5876 7429 5877 7428 5878 7428 5879 7428 5880 7427 5881 7427 5882 7427 5882 7426 5883 7426 5884 7426 5885 7425 5886 7425 5887 7425 5887 7424 5888 7424 5889 7424 5890 7424 5890 7423 5891 7423 5892 7423 5893 7422 5894 7422 5895 7422 5895 7421 5896 7421 5897 7421 5898 7420 5899 7420 5900 7420 5900 7419 5901 7419 5902 7419 5903 7418 5904 7418 5905 7418 5906 7417 5907 7417 5908 7417 5909 7416 5910 7416 5911 7416 5911 7415 5912 7415 5913 7415 5914 7415 5914 7414 5915 7414 5916 7414 5917 7413 5918 7413 5919 7413 5919 7412 5920 7412 5921 7412 5922 7412 5922 7411 5923 7411 5924 7411 5925 7411 5925 7410 5926 7410 5927 7410 5928 7410 5928 7409 5929 7409 5930 7409 5931 7409 5931 7408 5932 7408 5933 7408 5934 7408 5934 7407 5935 7407 5936 7407 5937 7407 5937 7406 5938 7406 5939 7406 5940 7406 5940 7405 5941 7405 5942 7405 5943 7405 5943 7404 5944 7404 5945 7404 5946 7404 5946 7403 5947 7403 5948 7403 5949 7403 5950 7402 5951 7402 5952 7402 5953 7402 5953 7401 5954 7401 5955 7401 5956 7400 5957 7400 5958 7400 5959 7400 5959 7399 5960 7399 5961 7399 5962 7399 5963 7398 5964 7398 5965 7398 5966 7398 5966 7397 5967 7397 5968 7397 5969 7397 5970 7396 5971 7396 5972 7396 5973 7396 5973 7395 5974 7395 5975 7395 5976 7395 5977 7395 5977 7394 5978 7394 5979 7394 5980 7394 5981 7393 5982 7393 5983 7393 5984 7393 5985 7392 5986 7392 5987 7392 5988 7392 5988 7391 5989 7391 330 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 133 5989 7391 5990 7391 5991 7391 5992 7391 5993 7390 5994 7390 5995 7390 5996 7390 5997 7390 5997 7389 5998 7389 5999 7389 6000 7389 6001 7389 6001 7388 6002 7388 6003 7388 6004 7388 6005 7388 6006 7387 6007 7387 6008 7387 6009 7387 6010 7387 6011 7386 6012 7386 6013 7386 6014 7386 6015 7386 6016 7386 6016 7385 6017 7385 6018 7385 6019 7385 6020 7385 6021 7385 6021 7384 6022 7384 6023 7384 6024 7384 6025 7384 6026 7384 6027 7384 6027 7383 6028 7383 6029 7383 6030 7383 6031 7383 6032 7383 6033 7383 6033 7382 6034 7382 6035 7382 6036 7382 6037 7382 6038 7382 6039 7382 6040 7382 6040 7381 6041 7381 6042 7381 6043 7381 6044 7381 6045 7381 6046 7381 6047 7381 6048 7381 6048 7380 6049 7380 6050 7380 6051 7380 6052 7380 6053 7380 6054 7380 6055 7380 6056 7380 6057 7380 6058 7380 6059 7379 6060 7379 6061 7379 6062 7379 6063 7379 6064 7379 6065 7379 6066 7379 6067 7379 6068 7379 6069 7379 6070 7379 6071 7379 6072 7379 6073 7379 6074 7378 6075 7378 6076 7378 6077 7378 6078 7378 6079 7378 6080 7378 6081 7378 6082 7378 6083 7378 6084 7378 6085 7378 6086 7378 6087 7378 6088 7378 6089 7378 6090 7378 6091 7378 6092 7378 6093 7378 6094 7378 6095 7378 6096 7378 6097 7378 6098 7378 6099 7378 6100 7378 6101 7378 6102 7378 6103 7378 6104 7378 6104 7379 6105 7379 6106 7379 6107 7379 6108 7379 6109 7379 6110 7379 6111 7379 6112 7379 133 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 134 6112 7379 6113 7379 6114 7379 6115 7379 6116 7379 6117 7379 6118 7379 6119 7379 6119 7380 6120 7380 6121 7380 6122 7380 6123 7380 6124 7380 6125 7380 6126 7380 6127 7380 6128 7380 6128 7381 6129 7381 6130 7381 6131 7381 6132 7381 6133 7381 6134 7381 6135 7381 6136 7381 6136 7382 6137 7382 6138 7382 6139 7382 6140 7382 6141 7382 6142 7382 6142 7383 6143 7383 6144 7383 6145 7383 6146 7383 6147 7383 6148 7383 6148 7384 6149 7384 6150 7384 6151 7384 6152 7384 6153 7384 6153 7385 6154 7385 6155 7385 6156 7385 6157 7385 6158 7385 6158 7386 6159 7386 6160 7386 6161 7386 6162 7386 6163 7386 6163 7387 6164 7387 6165 7387 6166 7387 6167 7387 6167 7388 6168 7388 6169 7388 6170 7388 6171 7388 6171 7389 6172 7389 6173 7389 6174 7389 6175 7389 6175 7390 6176 7390 6177 7390 6178 7390 6179 7391 6180 7391 6181 7391 6182 7391 6182 7392 6183 7392 6184 7392 6185 7392 6186 7393 6187 7393 6188 7393 6189 7393 6189 7394 6190 7394 6191 7394 6192 7394 6192 7395 6193 7395 6194 7395 6195 7395 6195 7396 6196 7396 6197 7396 6198 7396 6198 7397 6199 7397 6200 7397 6201 7397 6201 7398 6202 7398 6203 7398 6204 7398 6204 7399 6205 7399 6206 7399 6207 7399 6207 7400 6208 7400 6209 7400 6210 7401 6211 7401 6212 7401 6212 7402 6213 7402 6214 7402 6215 7402 6215 7403 6216 7403 6217 7403 6218 7404 6219 7404 6220 7404 6220 7405 6221 7405 6222 7405 6223 7406 134 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 291 6223 7406 6224 7406 6225 7406 6225 7407 6226 7407 6227 7407 6228 7408 6229 7408 6230 7408 6230 7409 6231 7409 6232 7409 6232 7410 6233 7410 6234 7410 6235 7411 6236 7411 6237 7411 6237 7412 6238 7412 6239 7412 6239 7413 6240 7413 6241 7413 6242 7414 6243 7414 6244 7414 6244 7415 6245 7415 6246 7415 6246 7416 6247 7416 6248 7416 6248 7417 6249 7417 6250 7417 6250 7418 6251 7418 6252 7418 6253 7419 6254 7419 6255 7420 6256 7420 6257 7421 6258 7421 6259 7422 6260 7422 6261 7423 6262 7423 6263 7423 6263 7424 6264 7424 6265 7424 6265 7425 6266 7425 6267 7425 6267 7426 6268 7426 6269 7427 6270 7427 6271 7428 6272 7428 6273 7429 6274 7429 6275 7430 6276 7430 6277 7431 6278 7431 6278 7432 6279 7432 6280 7432 6281 7433 6282 7433 6282 7434 6283 7434 6284 7434 6284 7435 6285 7435 6286 7435 6286 7436 6287 7436 6288 7436 6288 7437 6289 7437 6290 7438 6291 7438 6292 7439 6293 7439 6294 7440 6295 7440 6295 7441 6296 7441 6297 7441 6297 7442 6298 7442 6299 7442 6299 7443 6300 7443 6301 7444 6302 7444 6303 7445 6304 7445 6304 7446 6305 7446 6306 7446 6306 7447 6307 7447 6308 7447 6308 7448 6309 7448 6310 7449 6311 7449 6311 7450 6312 7450 6313 7450 6313 7451 6314 7451 6315 7452 6316 7452 6317 7453 6318 7453 6318 7454 6319 7454 6320 7454 6320 7455 6321 7455 6322 7456 6323 7456 6324 7457 6325 7457 6325 7458 6326 7458 6327 7459 6328 7459 6329 7460 6330 7460 6330 7461 6331 7461 6332 7461 6332 7462 6333 7462 6334 7463 6335 7463 6336 7464 6337 7464 6337 7465 6338 7465 6339 7466 6340 7466 6340 7467 6341 7467 6342 7467 6342 7468 6343 7468 6344 7469 6345 7469 6345 7470 6346 7470 6347 7470 6347 7471 6348 7471 6349 7472 6350 7472 6350 7473 6351 7473 6352 7474 6353 7474 6353 7475 6354 7475 6355 7476 6356 7476 6357 7477 6358 7477 6358 7478 6359 7478 6360 7479 6361 7479 6361 7480 6362 7480 6363 7480 6363 7481 6364 7481 6364 7482 6365 7482 6366 7482 6366 7483 6367 7483 6368 7484 6369 7484 6370 7485 6371 7486 6372 7486 6373 7487 6374 7487 6374 7488 6375 7488 6376 7489 6377 7489 6378 7490 6379 7491 6380 7491 6380 7492 6381 7492 6382 7493 6383 7493 6383 7494 6384 7494 6385 7494 6386 7495 6387 7496 6388 7496 6389 7497 6390 7498 6391 7498 6392 7499 6393 7500 6394 7500 6395 7501 6396 7501 6396 7502 6397 7502 6398 7503 6399 7504 6400 7504 6401 7505 6402 7506 6403 7506 6404 7507 6405 7507 6406 7508 6407 7509 6408 7510 6409 7510 6410 7511 6411 7511 6412 7512 6413 7513 6414 7513 6415 7514 6416 7514 6417 7515 6418 7516 6419 7516 6420 7517 6421 7518 6422 7518 6423 7519 6424 7520 6425 7520 6426 7521 6427 7522 6428 7522 6429 7523 6430 7524 6431 7524 6432 7525 6433 7526 6434 7526 6435 7527 6436 7528 6437 7529 6438 7529 6439 7530 6441 7531 6442 7532 6443 7532 6444 7533 6445 7534 6446 7535 6448 7535 6449 7536 6450 7537 6451 7538 6452 7539 6454 7540 6455 7540 6456 7541 6457 7542 6459 7543 6460 7544 6461 7545 6463 7545 6464 7546 6465 7547 6467 7548 6468 7549 6469 7550 6471 7551 6472 7552 6474 7553 6475 7554 291 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 5 6475 7554 6476 7555 6478 7556 6479 7557 6481 7558 5 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5410 4387 5410 4492 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6815 4387 6815 4492 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 4347 6113 4453 2 MLine End Begin %I MLine [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6113 7326 6113 7432 2 MLine End Begin %I MLine [0.8083783 0 0 0.8083783 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8765 4960 6601 7638 2 MLine End Begin %I MLine [0.8083783 0 0 0.8083783 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 3460 4960 5624 7638 2 MLine End Begin %I Elli [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 6455 4989 35 35 Elli End Begin %I Elli [0.6776471 0 0 0.6776471 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 0 setlinecap 0 setlinejoin 10.43 setmiterlimit /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 6113 7562 35 35 Elli End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6592 5077 6533 4923 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6592 5077 6650 4923 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6555 4974 6628 4974 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6065 7276 6065 7121 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 9 6065 7276 6131 7276 6153 7268 6160 7261 6168 7246 6168 7232 6160 7217 6153 7209 6131 7202 9 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 10 6065 7202 6131 7202 6153 7195 6160 7187 6168 7173 6168 7151 6160 7136 6153 7129 6131 7121 6065 7121 10 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 18 10434 6141 10426 6156 10411 6171 10397 6178 10367 6178 10353 6171 10338 6156 10331 6141 10323 6119 10323 6083 10331 6061 10338 6046 10353 6031 10367 6024 10397 6024 10411 6031 10426 6046 10434 6061 18 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6768 4719 6768 4565 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 12 6768 4719 6819 4719 6841 4712 6856 4697 6863 4682 6870 4660 6870 4623 6863 4601 6856 4587 6841 4572 6819 4565 6768 4565 12 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8830 4867 8830 4713 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8830 4867 8926 4867 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8830 4794 8889 4794 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 8830 4713 8926 4713 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6463 7883 6463 7729 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6463 7883 6559 7883 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6463 7810 6522 7810 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 19 6020 7663 6013 7678 5998 7692 5983 7700 5954 7700 5939 7692 5925 7678 5917 7663 5910 7641 5910 7604 5917 7582 5925 7567 5939 7553 5954 7545 5983 7545 5998 7553 6013 7567 6020 7582 6020 7604 19 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 5983 7604 6020 7604 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6061 4680 6061 4525 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6164 4680 6164 4525 2 MLine End Begin %I MLine [0.5217714 0 0 0.5217714 0 0 ] trueoriginalCTM originalCTM concatmatrix pop 1 setlinecap 1 setlinejoin /eoFillRule true def %I b 65535 1 0 0 [ ] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p none SetP %I t [0.05 0 0 0.05 18 108 ] concat %I 2 6061 4606 6164 4606 2 MLine End %%PageTrailer End %I eop showpage %%Trailer end %%EOF cassbeam-1.1/examples/000077500000000000000000000000001275012243400147475ustar00rootroot00000000000000cassbeam-1.1/examples/vla/000077500000000000000000000000001275012243400155315ustar00rootroot00000000000000cassbeam-1.1/examples/vla/vla-1500MHz.in000066400000000000000000000011701275012243400176440ustar00rootroot00000000000000name=VLA # VLA definitions sub_h = 8.47852 # meters from vertex to subreflector feed_x = -0.6896837 # meters from optic axis to feed ring feed_y = -0.6896837 feed_z = 1.67640 # height of feed ring from vertex geom = vla_geom feedtaper = 10.0 feedthetamax = 9.26 # degrees legwidth = 0.27 # meters -- - for X shaped, + for + shaped legfoot = 7.55 # meters from optic axis at dish legapex = 10.93876 # meters from vertex hole_radius = 2.0 roughness=0.00035 # Running parameters freq = 1.5 # GHz gridsize = 120 out = vla-1500MHz Trec=10 pixelsperbeam=16 # abnormalities dfeed_x=0.051 focus=-1.413 dsub_z=-0.022 cassbeam-1.1/examples/vla/vla_geom000066400000000000000000001023541275012243400172520ustar00rootroot000000000000000.000000 0.000000 0.000000 0.010000 0.000003 0.000561 0.020000 0.000011 0.001122 0.030000 0.000025 0.001683 0.040000 0.000045 0.002244 0.050000 0.000070 0.002805 0.060000 0.000101 0.003366 0.070000 0.000137 0.003927 0.080000 0.000180 0.004489 0.090000 0.000227 0.005050 0.100000 0.000281 0.005611 0.110000 0.000339 0.006172 0.120000 0.000404 0.006733 0.130000 0.000474 0.007294 0.140000 0.000550 0.007855 0.150000 0.000631 0.008416 0.160000 0.000718 0.008977 0.170000 0.000811 0.009538 0.180000 0.000909 0.010099 0.190000 0.001013 0.010660 0.200000 0.001122 0.011221 0.210000 0.001237 0.011782 0.220000 0.001358 0.012343 0.230000 0.001484 0.012904 0.240000 0.001616 0.013466 0.250000 0.001753 0.014027 0.260000 0.001896 0.014588 0.270000 0.002045 0.015149 0.280000 0.002199 0.015710 0.290000 0.002359 0.016271 0.300000 0.002525 0.016832 0.310000 0.002696 0.017393 0.320000 0.002873 0.017954 0.330000 0.003055 0.018515 0.340000 0.003243 0.019076 0.350000 0.003437 0.019637 0.360000 0.003636 0.020198 0.370000 0.003840 0.020759 0.380000 0.004051 0.021320 0.390000 0.004267 0.021881 0.400000 0.004488 0.022442 0.410000 0.004716 0.023003 0.420000 0.004949 0.023564 0.430000 0.005187 0.024125 0.440000 0.005431 0.024686 0.450000 0.005681 0.025247 0.460000 0.005936 0.025808 0.470000 0.006197 0.026370 0.480000 0.006463 0.026931 0.490000 0.006736 0.027492 0.500000 0.007013 0.028053 0.510000 0.007297 0.028614 0.520000 0.007586 0.029175 0.530000 0.007880 0.029736 0.540000 0.008180 0.030297 0.550000 0.008486 0.030858 0.560000 0.008797 0.031419 0.570000 0.009114 0.031980 0.580000 0.009437 0.032541 0.590000 0.009765 0.033102 0.600000 0.010099 0.033663 0.610000 0.010438 0.034224 0.620000 0.010783 0.034785 0.630000 0.011134 0.035346 0.640000 0.011490 0.035907 0.650000 0.011852 0.036468 0.660000 0.012220 0.037029 0.670000 0.012593 0.037590 0.680000 0.012972 0.038151 0.690000 0.013356 0.038712 0.700000 0.013746 0.039273 0.710000 0.014141 0.039834 0.720000 0.014542 0.040395 0.730000 0.014949 0.040956 0.740000 0.015362 0.041517 0.750000 0.015780 0.042077 0.760000 0.016203 0.042638 0.770000 0.016632 0.043199 0.780000 0.017067 0.043760 0.790000 0.017508 0.044321 0.800000 0.017954 0.044882 0.810000 0.018405 0.045443 0.820000 0.018862 0.046004 0.830000 0.019325 0.046565 0.840000 0.019794 0.047126 0.850000 0.020268 0.047687 0.860000 0.020747 0.048248 0.870000 0.021233 0.048809 0.880000 0.021724 0.049370 0.890000 0.022220 0.049931 0.900000 0.022722 0.050492 0.910000 0.023230 0.051053 0.920000 0.023743 0.051614 0.930000 0.024262 0.052174 0.940000 0.024787 0.052735 0.950000 0.025317 0.053296 0.960000 0.025853 0.053857 0.970000 0.026394 0.054418 0.980000 0.026941 0.054979 0.990000 0.027494 0.055540 1.000000 0.028052 0.056101 1.010000 0.028616 0.056662 1.020000 0.029185 0.057223 1.030000 0.029760 0.057783 1.040000 0.030341 0.058344 1.050000 0.030927 0.058905 1.060000 0.031519 0.059466 1.070000 0.032116 0.060027 1.080000 0.032719 0.060588 1.090000 0.033328 0.061149 1.100000 0.033942 0.061709 1.110000 0.034562 0.062270 1.120000 0.035188 0.062831 1.130000 0.035819 0.063392 1.140000 0.036456 0.063953 1.150000 0.037098 0.064514 1.160000 0.037746 0.065075 1.170000 0.038399 0.065635 1.180000 0.039059 0.066196 1.190000 0.039723 0.066757 1.200000 0.040394 0.067318 1.210000 0.041070 0.067879 1.220000 0.041751 0.068439 1.230000 0.042439 0.069000 1.240000 0.043131 0.069561 1.250000 0.043830 0.070122 1.260000 0.044534 0.070683 1.270000 0.045243 0.071243 1.280000 0.045959 0.071804 1.290000 0.046679 0.072365 1.300000 0.047406 0.072926 1.310000 0.048138 0.073487 1.320000 0.048876 0.074047 1.330000 0.049619 0.074608 1.340000 0.050368 0.075169 1.350000 0.051122 0.075730 1.360000 0.051882 0.076290 1.370000 0.052648 0.076851 1.380000 0.053419 0.077412 1.390000 0.054196 0.077972 1.400000 0.054979 0.078533 1.410000 0.055767 0.079094 1.420000 0.056561 0.079655 1.430000 0.057360 0.080215 1.440000 0.058165 0.080776 1.450000 0.058976 0.081337 1.460000 0.059792 0.081897 1.470000 0.060614 0.082458 1.480000 0.061441 0.083019 1.490000 0.062274 0.083580 1.500000 0.063113 0.084140 1.510000 0.063957 0.084701 1.520000 0.064807 0.085262 1.530000 0.065662 0.085822 1.540000 0.066523 0.086383 1.550000 0.067390 0.086944 1.560000 0.068262 0.087504 1.570000 0.069140 0.088065 1.580000 0.070023 0.088625 1.590000 0.070912 0.089186 1.600000 0.071807 0.089747 1.610000 0.072707 0.090307 1.620000 0.073613 0.090868 1.630000 0.074525 0.091429 1.640000 0.075442 0.091989 1.650000 0.076364 0.092550 1.660000 0.077293 0.093110 1.670000 0.078227 0.093671 1.680000 0.079166 0.094231 1.690000 0.080111 0.094792 1.700000 0.081062 0.095353 1.710000 0.082018 0.095913 1.720000 0.082980 0.096474 1.730000 0.083948 0.097034 1.740000 0.084921 0.097595 1.750000 0.085900 0.098155 1.760000 0.086884 0.098716 1.770000 0.087874 0.099276 1.780000 0.088869 0.099837 1.790000 0.089871 0.100397 1.800000 0.090877 0.100958 1.810000 0.091890 0.101518 1.820000 0.092908 0.102079 1.830000 0.093931 0.102639 1.840000 0.094961 0.103200 1.850000 0.095995 0.103760 1.860000 0.097036 0.104321 1.870000 0.098082 0.104881 1.880000 0.099133 0.105442 1.890000 0.100191 0.106002 1.900000 0.101253 0.106563 1.910000 0.102322 0.107123 1.920000 0.103396 0.107684 1.930000 0.104476 0.108244 1.940000 0.105561 0.108804 1.950000 0.106652 0.109365 1.960000 0.107748 0.109925 1.970000 0.108850 0.110486 1.980000 0.109958 0.111046 1.990000 0.111071 0.111606 2.000000 0.112190 0.112167 2.010000 0.113314 0.112727 2.020000 0.114444 0.113288 2.030000 0.115580 0.113848 2.040000 0.116721 0.114408 2.050000 0.117868 0.114969 2.060000 0.119021 0.115529 2.070000 0.120179 0.116089 2.080000 0.121343 0.116650 2.090000 0.122512 0.117210 2.100000 0.123687 0.117770 2.110000 0.124867 0.118331 2.120000 0.126053 0.118891 2.130000 0.127245 0.119451 2.140000 0.128442 0.120011 2.150000 0.129645 0.120572 2.160000 0.130854 0.121132 2.170000 0.132068 0.121692 2.180000 0.133288 0.122252 2.190000 0.134513 0.122813 2.200000 0.135744 0.123373 2.210000 0.136980 0.123933 2.220000 0.138223 0.124493 2.230000 0.139470 0.125054 2.240000 0.140724 0.125614 2.250000 0.141983 0.126174 2.260000 0.143247 0.126734 2.270000 0.144517 0.127294 2.280000 0.145793 0.127855 2.290000 0.147074 0.128415 2.300000 0.148361 0.128975 2.310000 0.149654 0.129535 2.320000 0.150952 0.130095 2.330000 0.152256 0.130655 2.340000 0.153565 0.131215 2.350000 0.154880 0.131776 2.360000 0.156201 0.132336 2.370000 0.157527 0.132896 2.380000 0.158859 0.133456 2.390000 0.160196 0.134016 2.400000 0.161539 0.134576 2.410000 0.162887 0.135136 2.420000 0.164242 0.135696 2.430000 0.165601 0.136256 2.440000 0.166967 0.136816 2.450000 0.168338 0.137376 2.460000 0.169714 0.137936 2.470000 0.171096 0.138496 2.480000 0.172484 0.139056 2.490000 0.173878 0.139616 2.500000 0.175277 0.140176 2.510000 0.176681 0.140736 2.520000 0.178091 0.141296 2.530000 0.179507 0.141856 2.540000 0.180928 0.142416 2.550000 0.182355 0.142976 2.560000 0.183788 0.143536 2.570000 0.185226 0.144096 2.580000 0.186670 0.144656 2.590000 0.188119 0.145216 2.600000 0.189574 0.145776 2.610000 0.191035 0.146336 2.620000 0.192501 0.146896 2.630000 0.193973 0.147456 2.640000 0.195450 0.148016 2.650000 0.196933 0.148575 2.660000 0.198421 0.149135 2.670000 0.199916 0.149695 2.680000 0.201415 0.150255 2.690000 0.202921 0.150815 2.700000 0.204432 0.151375 2.710000 0.205948 0.151934 2.720000 0.207470 0.152494 2.730000 0.208998 0.153054 2.740000 0.210531 0.153614 2.750000 0.212070 0.154174 2.760000 0.213615 0.154733 2.770000 0.215165 0.155293 2.780000 0.216721 0.155853 2.790000 0.218282 0.156413 2.800000 0.219849 0.156972 2.810000 0.221422 0.157532 2.820000 0.223000 0.158092 2.830000 0.224583 0.158652 2.840000 0.226173 0.159211 2.850000 0.227768 0.159771 2.860000 0.229368 0.160331 2.870000 0.230974 0.160890 2.880000 0.232586 0.161450 2.890000 0.234203 0.162010 2.900000 0.235826 0.162569 2.910000 0.237455 0.163129 2.920000 0.239089 0.163688 2.930000 0.240728 0.164248 2.940000 0.242374 0.164808 2.950000 0.244025 0.165367 2.960000 0.245681 0.165927 2.970000 0.247343 0.166486 2.980000 0.249011 0.167046 2.990000 0.250684 0.167605 3.000000 0.252363 0.168165 3.010000 0.254047 0.168724 3.020000 0.255737 0.169284 3.030000 0.257433 0.169844 3.040000 0.259134 0.170403 3.050000 0.260841 0.170962 3.060000 0.262553 0.171522 3.070000 0.264271 0.172081 3.080000 0.265995 0.172641 3.090000 0.267724 0.173200 3.100000 0.269459 0.173760 3.110000 0.271199 0.174319 3.120000 0.272945 0.174879 3.130000 0.274697 0.175438 3.140000 0.276454 0.175997 3.150000 0.278217 0.176557 3.160000 0.279985 0.177116 3.170000 0.281759 0.177675 3.180000 0.283539 0.178235 3.190000 0.285324 0.178794 3.200000 0.287115 0.179353 3.210000 0.288911 0.179913 3.220000 0.290713 0.180472 3.230000 0.292521 0.181031 3.240000 0.294334 0.181591 3.250000 0.296152 0.182150 3.260000 0.297977 0.182709 3.270000 0.299807 0.183268 3.280000 0.301642 0.183828 3.290000 0.303483 0.184387 3.300000 0.305330 0.184946 3.310000 0.307182 0.185505 3.320000 0.309040 0.186065 3.330000 0.310903 0.186624 3.340000 0.312772 0.187183 3.350000 0.314647 0.187742 3.360000 0.316527 0.188301 3.370000 0.318413 0.188860 3.380000 0.320304 0.189419 3.390000 0.322201 0.189979 3.400000 0.324104 0.190538 3.410000 0.326012 0.191097 3.420000 0.327926 0.191656 3.430000 0.329845 0.192215 3.440000 0.331770 0.192774 3.450000 0.333701 0.193333 3.460000 0.335637 0.193892 3.470000 0.337579 0.194451 3.480000 0.339526 0.195010 3.490000 0.341479 0.195569 3.500000 0.343437 0.196128 3.510000 0.345401 0.196687 3.520000 0.347371 0.197246 3.530000 0.349346 0.197805 3.540000 0.351327 0.198364 3.550000 0.353313 0.198923 3.560000 0.355305 0.199481 3.570000 0.357303 0.200040 3.580000 0.359306 0.200599 3.590000 0.361315 0.201158 3.600000 0.363329 0.201717 3.610000 0.365349 0.202276 3.620000 0.367375 0.202835 3.630000 0.369406 0.203393 3.640000 0.371443 0.203952 3.650000 0.373485 0.204511 3.660000 0.375533 0.205070 3.670000 0.377587 0.205629 3.680000 0.379646 0.206187 3.690000 0.381710 0.206746 3.700000 0.383781 0.207305 3.710000 0.385856 0.207863 3.720000 0.387938 0.208422 3.730000 0.390025 0.208981 3.740000 0.392117 0.209539 3.750000 0.394216 0.210098 3.760000 0.396319 0.210657 3.770000 0.398429 0.211215 3.780000 0.400544 0.211774 3.790000 0.402664 0.212333 3.800000 0.404790 0.212891 3.810000 0.406922 0.213450 3.820000 0.409059 0.214008 3.830000 0.411202 0.214567 3.840000 0.413351 0.215125 3.850000 0.415505 0.215684 3.860000 0.417664 0.216242 3.870000 0.419830 0.216801 3.880000 0.422000 0.217359 3.890000 0.424177 0.217918 3.900000 0.426359 0.218476 3.910000 0.428546 0.219035 3.920000 0.430739 0.219593 3.930000 0.432938 0.220151 3.940000 0.435142 0.220710 3.950000 0.437352 0.221268 3.960000 0.439568 0.221827 3.970000 0.441789 0.222385 3.980000 0.444016 0.222943 3.990000 0.446248 0.223502 4.000000 0.448486 0.224060 4.010000 0.450729 0.224618 4.020000 0.452978 0.225176 4.030000 0.455232 0.225735 4.040000 0.457493 0.226293 4.050000 0.459758 0.226851 4.060000 0.462030 0.227409 4.070000 0.464307 0.227967 4.080000 0.466589 0.228526 4.090000 0.468877 0.229084 4.100000 0.471171 0.229642 4.110000 0.473470 0.230200 4.120000 0.475775 0.230758 4.130000 0.478085 0.231316 4.140000 0.480401 0.231874 4.150000 0.482723 0.232432 4.160000 0.485050 0.232990 4.170000 0.487382 0.233549 4.180000 0.489721 0.234107 4.190000 0.492064 0.234665 4.200000 0.494414 0.235223 4.210000 0.496769 0.235780 4.220000 0.499130 0.236338 4.230000 0.501496 0.236896 4.240000 0.503867 0.237454 4.250000 0.506245 0.238012 4.260000 0.508628 0.238570 4.270000 0.511016 0.239128 4.280000 0.513410 0.239686 4.290000 0.515810 0.240244 4.300000 0.518215 0.240801 4.310000 0.520626 0.241359 4.320000 0.523042 0.241917 4.330000 0.525464 0.242475 4.340000 0.527892 0.243033 4.350000 0.530325 0.243590 4.360000 0.532764 0.244148 4.370000 0.535208 0.244706 4.380000 0.537658 0.245263 4.390000 0.540113 0.245821 4.400000 0.542574 0.246379 4.410000 0.545041 0.246936 4.420000 0.547513 0.247494 4.430000 0.549991 0.248052 4.440000 0.552474 0.248609 4.450000 0.554963 0.249167 4.460000 0.557457 0.249724 4.470000 0.559957 0.250282 4.480000 0.562463 0.250839 4.490000 0.564974 0.251397 4.500000 0.567491 0.251954 4.510000 0.570013 0.252512 4.520000 0.572541 0.253069 4.530000 0.575075 0.253627 4.540000 0.577614 0.254184 4.550000 0.580158 0.254741 4.560000 0.582708 0.255299 4.570000 0.585264 0.255856 4.580000 0.587826 0.256413 4.590000 0.590392 0.256971 4.600000 0.592965 0.257528 4.610000 0.595543 0.258085 4.620000 0.598127 0.258642 4.630000 0.600716 0.259200 4.640000 0.603311 0.259757 4.650000 0.605911 0.260314 4.660000 0.608517 0.260871 4.670000 0.611128 0.261428 4.680000 0.613745 0.261985 4.690000 0.616368 0.262543 4.700000 0.618996 0.263100 4.710000 0.621630 0.263657 4.720000 0.624269 0.264214 4.730000 0.626914 0.264771 4.740000 0.629565 0.265328 4.750000 0.632221 0.265885 4.760000 0.634883 0.266442 4.770000 0.637550 0.266999 4.780000 0.640223 0.267556 4.790000 0.642901 0.268113 4.800000 0.645585 0.268669 4.810000 0.648274 0.269226 4.820000 0.650969 0.269783 4.830000 0.653670 0.270340 4.840000 0.656376 0.270897 4.850000 0.659088 0.271454 4.860000 0.661805 0.272010 4.870000 0.664528 0.272567 4.880000 0.667257 0.273124 4.890000 0.669991 0.273681 4.900000 0.672730 0.274237 4.910000 0.675475 0.274794 4.920000 0.678226 0.275350 4.930000 0.680982 0.275907 4.940000 0.683744 0.276464 4.950000 0.686512 0.277020 4.960000 0.689285 0.277577 4.970000 0.692063 0.278133 4.980000 0.694847 0.278690 4.990000 0.697637 0.279246 5.000000 0.700432 0.279803 5.010000 0.703233 0.280359 5.020000 0.706039 0.280916 5.030000 0.708851 0.281472 5.040000 0.711669 0.282028 5.050000 0.714492 0.282585 5.060000 0.717320 0.283141 5.070000 0.720155 0.283697 5.080000 0.722994 0.284254 5.090000 0.725840 0.284810 5.100000 0.728691 0.285366 5.110000 0.731547 0.285922 5.120000 0.734409 0.286478 5.130000 0.737277 0.287035 5.140000 0.740150 0.287591 5.150000 0.743028 0.288147 5.160000 0.745913 0.288703 5.170000 0.748803 0.289259 5.180000 0.751698 0.289815 5.190000 0.754599 0.290371 5.200000 0.757505 0.290927 5.210000 0.760417 0.291483 5.220000 0.763335 0.292039 5.230000 0.766258 0.292595 5.240000 0.769187 0.293151 5.250000 0.772121 0.293707 5.260000 0.775061 0.294263 5.270000 0.778006 0.294818 5.280000 0.780957 0.295374 5.290000 0.783914 0.295930 5.300000 0.786876 0.296486 5.310000 0.789844 0.297041 5.320000 0.792817 0.297597 5.330000 0.795796 0.298153 5.340000 0.798780 0.298708 5.350000 0.801770 0.299264 5.360000 0.804765 0.299820 5.370000 0.807766 0.300375 5.380000 0.810773 0.300931 5.390000 0.813785 0.301486 5.400000 0.816802 0.302042 5.410000 0.819826 0.302597 5.420000 0.822854 0.303153 5.430000 0.825889 0.303708 5.440000 0.828928 0.304263 5.450000 0.831974 0.304819 5.460000 0.835025 0.305374 5.470000 0.838081 0.305929 5.480000 0.841143 0.306485 5.490000 0.844211 0.307040 5.500000 0.847284 0.307595 5.510000 0.850363 0.308150 5.520000 0.853447 0.308706 5.530000 0.856537 0.309261 5.540000 0.859632 0.309816 5.550000 0.862733 0.310371 5.560000 0.865840 0.310926 5.570000 0.868952 0.311481 5.580000 0.872069 0.312036 5.590000 0.875193 0.312591 5.600000 0.878321 0.313146 5.610000 0.881456 0.313701 5.620000 0.884595 0.314256 5.630000 0.887741 0.314811 5.640000 0.890892 0.315365 5.650000 0.894048 0.315920 5.660000 0.897210 0.316475 5.670000 0.900377 0.317030 5.680000 0.903551 0.317584 5.690000 0.906729 0.318139 5.700000 0.909913 0.318694 5.710000 0.913103 0.319248 5.720000 0.916298 0.319803 5.730000 0.919499 0.320357 5.740000 0.922705 0.320912 5.750000 0.925917 0.321467 5.760000 0.929135 0.322021 5.770000 0.932358 0.322575 5.780000 0.935586 0.323130 5.790000 0.938820 0.323684 5.800000 0.942060 0.324239 5.810000 0.945305 0.324793 5.820000 0.948556 0.325347 5.830000 0.951812 0.325901 5.840000 0.955074 0.326456 5.850000 0.958341 0.327010 5.860000 0.961614 0.327564 5.870000 0.964892 0.328118 5.880000 0.968176 0.328672 5.890000 0.971466 0.329226 5.900000 0.974761 0.329780 5.910000 0.978061 0.330334 5.920000 0.981368 0.330888 5.930000 0.984679 0.331442 5.940000 0.987996 0.331996 5.950000 0.991319 0.332550 5.960000 0.994647 0.333104 5.970000 0.997981 0.333658 5.980000 1.001321 0.334212 5.990000 1.004665 0.334765 6.000000 1.008016 0.335319 6.010000 1.011372 0.335873 6.020000 1.014733 0.336426 6.030000 1.018100 0.336980 6.040000 1.021473 0.337534 6.050000 1.024851 0.338087 6.060000 1.028235 0.338641 6.070000 1.031624 0.339194 6.080000 1.035019 0.339748 6.090000 1.038419 0.340301 6.100000 1.041825 0.340854 6.110000 1.045236 0.341408 6.120000 1.048653 0.341961 6.130000 1.052075 0.342514 6.140000 1.055503 0.343067 6.150000 1.058936 0.343621 6.160000 1.062375 0.344174 6.170000 1.065820 0.344727 6.180000 1.069270 0.345280 6.190000 1.072726 0.345833 6.200000 1.076187 0.346386 6.210000 1.079653 0.346939 6.220000 1.083125 0.347492 6.230000 1.086603 0.348045 6.240000 1.090086 0.348598 6.250000 1.093575 0.349151 6.260000 1.097069 0.349704 6.270000 1.100569 0.350256 6.280000 1.104074 0.350809 6.290000 1.107585 0.351362 6.300000 1.111102 0.351914 6.310000 1.114624 0.352467 6.320000 1.118151 0.353020 6.330000 1.121684 0.353572 6.340000 1.125223 0.354125 6.350000 1.128767 0.354677 6.360000 1.132316 0.355230 6.370000 1.135871 0.355782 6.380000 1.139432 0.356334 6.390000 1.142998 0.356887 6.400000 1.146569 0.357439 6.410000 1.150147 0.357991 6.420000 1.153729 0.358543 6.430000 1.157317 0.359096 6.440000 1.160911 0.359648 6.450000 1.164510 0.360200 6.460000 1.168115 0.360752 6.470000 1.171725 0.361304 6.480000 1.175341 0.361856 6.490000 1.178963 0.362408 6.500000 1.182589 0.362960 6.510000 1.186222 0.363512 6.520000 1.189860 0.364063 6.530000 1.193503 0.364615 6.540000 1.197152 0.365167 6.550000 1.200806 0.365719 6.560000 1.204466 0.366270 6.570000 1.208132 0.366822 6.580000 1.211803 0.367374 6.590000 1.215479 0.367925 6.600000 1.219161 0.368477 6.610000 1.222849 0.369028 6.620000 1.226542 0.369579 6.630000 1.230240 0.370131 6.640000 1.233944 0.370682 6.650000 1.237654 0.371233 6.660000 1.241369 0.371785 6.670000 1.245090 0.372336 6.680000 1.248816 0.372887 6.690000 1.252547 0.373438 6.700000 1.256285 0.373989 6.710000 1.260027 0.374540 6.720000 1.263775 0.375091 6.730000 1.267529 0.375642 6.740000 1.271288 0.376193 6.750000 1.275053 0.376744 6.760000 1.278823 0.377295 6.770000 1.282599 0.377846 6.780000 1.286380 0.378396 6.790000 1.290167 0.378947 6.800000 1.293959 0.379498 6.810000 1.297757 0.380048 6.820000 1.301560 0.380599 6.830000 1.305369 0.381149 6.840000 1.309183 0.381700 6.850000 1.313003 0.382250 6.860000 1.316828 0.382801 6.870000 1.320659 0.383351 6.880000 1.324495 0.383901 6.890000 1.328337 0.384452 6.900000 1.332184 0.385002 6.910000 1.336037 0.385552 6.920000 1.339895 0.386102 6.930000 1.343759 0.386652 6.940000 1.347628 0.387202 6.950000 1.351503 0.387752 6.960000 1.355383 0.388302 6.970000 1.359269 0.388852 6.980000 1.363160 0.389402 6.990000 1.367057 0.389951 7.000000 1.370959 0.390501 7.010000 1.374867 0.391051 7.020000 1.378780 0.391601 7.030000 1.382699 0.392150 7.040000 1.386623 0.392700 7.050000 1.390553 0.393249 7.060000 1.394488 0.393799 7.070000 1.398429 0.394348 7.080000 1.402375 0.394897 7.090000 1.406327 0.395447 7.100000 1.410284 0.395996 7.110000 1.414247 0.396545 7.120000 1.418215 0.397094 7.130000 1.422189 0.397644 7.140000 1.426168 0.398193 7.150000 1.430153 0.398742 7.160000 1.434143 0.399291 7.170000 1.438138 0.399840 7.180000 1.442139 0.400388 7.190000 1.446146 0.400937 7.200000 1.450158 0.401486 7.210000 1.454176 0.402035 7.220000 1.458199 0.402583 7.230000 1.462227 0.403132 7.240000 1.466262 0.403681 7.250000 1.470301 0.404229 7.260000 1.474346 0.404778 7.270000 1.478397 0.405326 7.280000 1.482453 0.405874 7.290000 1.486514 0.406423 7.300000 1.490581 0.406971 7.310000 1.494654 0.407519 7.320000 1.498731 0.408067 7.330000 1.502815 0.408616 7.340000 1.506904 0.409164 7.350000 1.510998 0.409712 7.360000 1.515098 0.410260 7.370000 1.519203 0.410807 7.380000 1.523314 0.411355 7.390000 1.527430 0.411903 7.400000 1.531552 0.412451 7.410000 1.535679 0.412999 7.420000 1.539812 0.413546 7.430000 1.543950 0.414094 7.440000 1.548094 0.414641 7.450000 1.552243 0.415189 7.460000 1.556398 0.415736 7.470000 1.560558 0.416284 7.480000 1.564724 0.416831 7.490000 1.568895 0.417378 7.500000 1.573071 0.417925 7.510000 1.577253 0.418473 7.520000 1.581441 0.419020 7.530000 1.585633 0.419567 7.540000 1.589832 0.420114 7.550000 1.594036 0.420661 7.560000 1.598245 0.421208 7.570000 1.602460 0.421754 7.580000 1.606680 0.422301 7.590000 1.610906 0.422848 7.600000 1.615137 0.423395 7.610000 1.619374 0.423941 7.620000 1.623616 0.424488 7.630000 1.627864 0.425034 7.640000 1.632117 0.425581 7.650000 1.636375 0.426127 7.660000 1.640639 0.426673 7.670000 1.644909 0.427220 7.680000 1.649184 0.427766 7.690000 1.653464 0.428312 7.700000 1.657750 0.428858 7.710000 1.662041 0.429404 7.720000 1.666338 0.429950 7.730000 1.670640 0.430496 7.740000 1.674948 0.431042 7.750000 1.679261 0.431588 7.760000 1.683580 0.432133 7.770000 1.687904 0.432679 7.780000 1.692233 0.433225 7.790000 1.696568 0.433770 7.800000 1.700909 0.434316 7.810000 1.705254 0.434861 7.820000 1.709606 0.435407 7.830000 1.713963 0.435952 7.840000 1.718325 0.436497 7.850000 1.722693 0.437042 7.860000 1.727066 0.437587 7.870000 1.731444 0.438133 7.880000 1.735828 0.438678 7.890000 1.740218 0.439223 7.900000 1.744613 0.439767 7.910000 1.749013 0.440312 7.920000 1.753419 0.440857 7.930000 1.757830 0.441402 7.940000 1.762247 0.441946 7.950000 1.766669 0.442491 7.960000 1.771097 0.443036 7.970000 1.775530 0.443580 7.980000 1.779968 0.444124 7.990000 1.784412 0.444669 8.000000 1.788862 0.445213 8.010000 1.793317 0.445757 8.020000 1.797777 0.446301 8.030000 1.802243 0.446845 8.040000 1.806714 0.447389 8.050000 1.811191 0.447933 8.060000 1.815673 0.448477 8.070000 1.820160 0.449021 8.080000 1.824653 0.449565 8.090000 1.829151 0.450109 8.100000 1.833655 0.450652 8.110000 1.838164 0.451196 8.120000 1.842679 0.451739 8.130000 1.847199 0.452283 8.140000 1.851725 0.452826 8.150000 1.856256 0.453369 8.160000 1.860792 0.453913 8.170000 1.865334 0.454456 8.180000 1.869881 0.454999 8.190000 1.874434 0.455542 8.200000 1.878992 0.456085 8.210000 1.883556 0.456628 8.220000 1.888125 0.457171 8.230000 1.892699 0.457713 8.240000 1.897279 0.458256 8.250000 1.901864 0.458799 8.260000 1.906455 0.459341 8.270000 1.911051 0.459884 8.280000 1.915653 0.460426 8.290000 1.920260 0.460969 8.300000 1.924872 0.461511 8.310000 1.929490 0.462053 8.320000 1.934113 0.462595 8.330000 1.938742 0.463137 8.340000 1.943376 0.463679 8.350000 1.948015 0.464221 8.360000 1.952660 0.464763 8.370000 1.957310 0.465305 8.380000 1.961966 0.465847 8.390000 1.966627 0.466388 8.400000 1.971294 0.466930 8.410000 1.975966 0.467471 8.420000 1.980643 0.468013 8.430000 1.985326 0.468554 8.440000 1.990015 0.469095 8.450000 1.994708 0.469637 8.460000 1.999407 0.470178 8.470000 2.004112 0.470719 8.480000 2.008822 0.471260 8.490000 2.013537 0.471801 8.500000 2.018258 0.472342 8.510000 2.022984 0.472882 8.520000 2.027715 0.473423 8.530000 2.032452 0.473964 8.540000 2.037195 0.474504 8.550000 2.041942 0.475045 8.560000 2.046695 0.475585 8.570000 2.051454 0.476125 8.580000 2.056218 0.476666 8.590000 2.060987 0.477206 8.600000 2.065762 0.477746 8.610000 2.070542 0.478286 8.620000 2.075328 0.478826 8.630000 2.080119 0.479366 8.640000 2.084915 0.479906 8.650000 2.089717 0.480445 8.660000 2.094524 0.480985 8.670000 2.099337 0.481524 8.680000 2.104155 0.482064 8.690000 2.108978 0.482603 8.700000 2.113807 0.483143 8.710000 2.118641 0.483682 8.720000 2.123480 0.484221 8.730000 2.128325 0.484760 8.740000 2.133175 0.485299 8.750000 2.138031 0.485838 8.760000 2.142892 0.486377 8.770000 2.147759 0.486915 8.780000 2.152630 0.487454 8.790000 2.157508 0.487993 8.800000 2.162390 0.488531 8.810000 2.167278 0.489070 8.820000 2.172172 0.489608 8.830000 2.177070 0.490146 8.840000 2.181975 0.490684 8.850000 2.186884 0.491222 8.860000 2.191799 0.491760 8.870000 2.196719 0.492298 8.880000 2.201645 0.492836 8.890000 2.206576 0.493374 8.900000 2.211513 0.493911 8.910000 2.216454 0.494449 8.920000 2.221402 0.494987 8.930000 2.226354 0.495524 8.940000 2.231312 0.496061 8.950000 2.236275 0.496598 8.960000 2.241244 0.497136 8.970000 2.246218 0.497673 8.980000 2.251197 0.498210 8.990000 2.256182 0.498746 9.000000 2.261172 0.499283 9.010000 2.266168 0.499820 9.020000 2.271169 0.500356 9.030000 2.276175 0.500893 9.040000 2.281187 0.501429 9.050000 2.286204 0.501966 9.060000 2.291226 0.502502 9.070000 2.296254 0.503038 9.080000 2.301287 0.503574 9.090000 2.306325 0.504110 9.100000 2.311369 0.504646 9.110000 2.316418 0.505182 9.120000 2.321472 0.505717 9.130000 2.326532 0.506253 9.140000 2.331598 0.506788 9.150000 2.336668 0.507324 9.160000 2.341744 0.507859 9.170000 2.346825 0.508394 9.180000 2.351912 0.508929 9.190000 2.357004 0.509464 9.200000 2.362101 0.509999 9.210000 2.367204 0.510534 9.220000 2.372312 0.511069 9.230000 2.377425 0.511603 9.240000 2.382544 0.512138 9.250000 2.387668 0.512672 9.260000 2.392797 0.513206 9.270000 2.397932 0.513740 9.280000 2.403072 0.514275 9.290000 2.408218 0.514809 9.300000 2.413368 0.515342 9.310000 2.418524 0.515876 9.320000 2.423686 0.516410 9.330000 2.428853 0.516943 9.340000 2.434025 0.517477 9.350000 2.439202 0.518010 9.360000 2.444385 0.518543 9.370000 2.449573 0.519077 9.380000 2.454766 0.519610 9.390000 2.459965 0.520143 9.400000 2.465169 0.520675 9.410000 2.470379 0.521208 9.420000 2.475593 0.521741 9.430000 2.480814 0.522273 9.440000 2.486039 0.522806 9.450000 2.491270 0.523338 9.460000 2.496506 0.523870 9.470000 2.501747 0.524402 9.480000 2.506994 0.524934 9.490000 2.512246 0.525466 9.500000 2.517503 0.525998 9.510000 2.522766 0.526529 9.520000 2.528034 0.527061 9.530000 2.533307 0.527592 9.540000 2.538585 0.528123 9.550000 2.543869 0.528654 9.560000 2.549159 0.529185 9.570000 2.554453 0.529716 9.580000 2.559753 0.530247 9.590000 2.565058 0.530778 9.600000 2.570368 0.531308 9.610000 2.575684 0.531838 9.620000 2.581005 0.532369 9.630000 2.586332 0.532899 9.640000 2.591663 0.533429 9.650000 2.597000 0.533959 9.660000 2.602342 0.534489 9.670000 2.607690 0.535018 9.680000 2.613043 0.535548 9.690000 2.618401 0.536077 9.700000 2.623764 0.536606 9.710000 2.629133 0.537136 9.720000 2.634507 0.537665 9.730000 2.639886 0.538193 9.740000 2.645271 0.538722 9.750000 2.650661 0.539251 9.760000 2.656056 0.539779 9.770000 2.661456 0.540308 9.780000 2.666862 0.540836 9.790000 2.672273 0.541364 9.800000 2.677689 0.541892 9.810000 2.683111 0.542420 9.820000 2.688538 0.542947 9.830000 2.693970 0.543475 9.840000 2.699407 0.544002 9.850000 2.704850 0.544529 9.860000 2.710298 0.545057 9.870000 2.715751 0.545584 9.880000 2.721209 0.546110 9.890000 2.726673 0.546637 9.900000 2.732142 0.547164 9.910000 2.737616 0.547690 9.920000 2.743096 0.548216 9.930000 2.748581 0.548742 9.940000 2.754071 0.549268 9.950000 2.759566 0.549794 9.960000 2.765067 0.550320 9.970000 2.770573 0.550845 9.980000 2.776084 0.551370 9.990000 2.781600 0.551895 10.000000 2.787122 0.552420 10.010000 2.792648 0.552945 10.020000 2.798180 0.553470 10.030000 2.803718 0.553995 10.040000 2.809260 0.554519 10.050000 2.814808 0.555043 10.060000 2.820361 0.555567 10.070000 2.825919 0.556091 10.080000 2.831483 0.556615 10.090000 2.837052 0.557138 10.100000 2.842626 0.557662 10.110000 2.848205 0.558185 10.120000 2.853789 0.558708 10.130000 2.859379 0.559231 10.140000 2.864974 0.559754 10.150000 2.870574 0.560276 10.160000 2.876180 0.560798 10.170000 2.881790 0.561321 10.180000 2.887406 0.561843 10.190000 2.893027 0.562364 10.200000 2.898653 0.562886 10.210000 2.904285 0.563407 10.220000 2.909921 0.563929 10.230000 2.915563 0.564450 10.240000 2.921210 0.564971 10.250000 2.926863 0.565491 10.260000 2.932520 0.566012 10.270000 2.938183 0.566532 10.280000 2.943851 0.567052 10.290000 2.949524 0.567572 10.300000 2.955202 0.568092 10.310000 2.960886 0.568612 10.320000 2.966575 0.569131 10.330000 2.972269 0.569650 10.340000 2.977968 0.570169 10.350000 2.983672 0.570688 10.360000 2.989381 0.571207 10.370000 2.995096 0.571725 10.380000 3.000816 0.572243 10.390000 3.006541 0.572761 10.400000 3.012271 0.573279 10.410000 3.018006 0.573796 10.420000 3.023747 0.574314 10.430000 3.029493 0.574831 10.440000 3.035244 0.575348 10.450000 3.041000 0.575864 10.460000 3.046761 0.576381 10.470000 3.052527 0.576897 10.480000 3.058299 0.577413 10.490000 3.064076 0.577929 10.500000 3.069857 0.578444 10.510000 3.075644 0.578960 10.520000 3.081437 0.579475 10.530000 3.087234 0.579989 10.540000 3.093036 0.580504 10.550000 3.098844 0.581018 10.560000 3.104657 0.581533 10.570000 3.110475 0.582047 10.580000 3.116298 0.582560 10.590000 3.122126 0.583074 10.600000 3.127959 0.583587 10.610000 3.133798 0.584100 10.620000 3.139641 0.584612 10.630000 3.145490 0.585125 10.640000 3.151344 0.585637 10.650000 3.157203 0.586149 10.660000 3.163067 0.586661 10.670000 3.168936 0.587172 10.680000 3.174810 0.587683 10.690000 3.180689 0.588194 10.700000 3.186574 0.588704 10.710000 3.192464 0.589215 10.720000 3.198358 0.589725 10.730000 3.204258 0.590235 10.740000 3.210163 0.590744 10.750000 3.216073 0.591253 10.760000 3.221988 0.591762 10.770000 3.227908 0.592271 10.780000 3.233833 0.592779 10.790000 3.239764 0.593287 10.800000 3.245699 0.593795 10.810000 3.251640 0.594303 10.820000 3.257585 0.594810 10.830000 3.263536 0.595317 10.840000 3.269492 0.595823 10.850000 3.275452 0.596330 10.860000 3.281418 0.596836 10.870000 3.287389 0.597341 10.880000 3.293365 0.597847 10.890000 3.299346 0.598352 10.900000 3.305332 0.598857 10.910000 3.311323 0.599361 10.920000 3.317319 0.599865 10.930000 3.323320 0.600369 10.940000 3.329327 0.600872 10.950000 3.335338 0.601375 10.960000 3.341354 0.601878 10.970000 3.347375 0.602381 10.980000 3.353402 0.602883 10.990000 3.359433 0.603385 11.000000 3.365469 0.603886 11.010000 3.371511 0.604387 11.020000 3.377557 0.604888 11.030000 3.383609 0.605388 11.040000 3.389665 0.605888 11.050000 3.395726 0.606388 11.060000 3.401793 0.606887 11.070000 3.407864 0.607386 11.080000 3.413940 0.607884 11.090000 3.420022 0.608383 11.100000 3.426108 0.608880 11.110000 3.432199 0.609378 11.120000 3.438296 0.609875 11.130000 3.444397 0.610371 11.140000 3.450503 0.610868 11.150000 3.456614 0.611364 11.160000 3.462730 0.611859 11.170000 3.468851 0.612354 11.180000 3.474977 0.612849 11.190000 3.481108 0.613343 11.200000 3.487244 0.613837 11.210000 3.493385 0.614330 11.220000 3.499531 0.614823 11.230000 3.505682 0.615316 11.240000 3.511837 0.615808 11.250000 3.517998 0.616300 11.260000 3.524163 0.616791 11.270000 3.530333 0.617282 11.280000 3.536509 0.617772 11.290000 3.542689 0.618262 11.300000 3.548874 0.618752 11.310000 3.555064 0.619241 11.320000 3.561259 0.619729 11.330000 3.567459 0.620217 11.340000 3.573663 0.620705 11.350000 3.579873 0.621192 11.360000 3.586087 0.621679 11.370000 3.592306 0.622165 11.380000 3.598530 0.622651 11.390000 3.604759 0.623136 11.400000 3.610993 0.623621 11.410000 3.617232 0.624105 11.420000 3.623475 0.624589 11.430000 3.629723 0.625072 11.440000 3.635977 0.625555 11.450000 3.642235 0.626037 11.460000 3.648497 0.626519 11.470000 3.654765 0.627000 11.480000 3.661037 0.627481 11.490000 3.667314 0.627961 11.500000 3.673596 0.628440 11.510000 3.679883 0.628919 11.520000 3.686175 0.629398 11.530000 3.692471 0.629876 11.540000 3.698772 0.630353 11.550000 3.705078 0.630830 11.560000 3.711389 0.631306 11.570000 3.717704 0.631782 11.580000 3.724025 0.632257 11.590000 3.730350 0.632731 11.600000 3.736679 0.633205 11.610000 3.743014 0.633678 11.620000 3.749353 0.634151 11.630000 3.755697 0.634623 11.640000 3.762045 0.635095 11.650000 3.768399 0.635566 11.660000 3.774757 0.636036 11.670000 3.781119 0.636506 11.680000 3.787487 0.636974 11.690000 3.793859 0.637443 11.700000 3.800236 0.637911 11.710000 3.806617 0.638378 11.720000 3.813003 0.638844 11.730000 3.819394 0.639310 11.740000 3.825789 0.639775 11.750000 3.832189 0.640239 11.760000 3.838594 0.640703 11.770000 3.845003 0.641166 11.780000 3.851417 0.641628 11.790000 3.857836 0.642090 11.800000 3.864259 0.642551 11.810000 3.870687 0.643011 11.820000 3.877119 0.643470 11.830000 3.883556 0.643929 11.840000 3.889998 0.644387 11.850000 3.896444 0.644844 11.860000 3.902895 0.645301 11.870000 3.909350 0.645757 11.880000 3.915810 0.646212 11.890000 3.922274 0.646666 11.900000 3.928743 0.647119 11.910000 3.935217 0.647572 11.920000 3.941695 0.648024 11.930000 3.948177 0.648475 11.940000 3.954664 0.648925 11.950000 3.961156 0.649375 11.960000 3.967652 0.649823 11.970000 3.974152 0.650271 11.980000 3.980657 0.650718 11.990000 3.987167 0.651164 12.000000 3.993680 0.651610 12.010000 4.000199 0.652054 12.020000 4.006721 0.652498 12.030000 4.013249 0.652941 12.040000 4.019780 0.653382 12.050000 4.026316 0.653823 12.060000 4.032857 0.654264 12.070000 4.039402 0.654703 12.080000 4.045951 0.655141 12.090000 4.052504 0.655578 12.100000 4.059062 0.656015 12.110000 4.065625 0.656450 12.120000 4.072191 0.656885 12.130000 4.078762 0.657318 12.140000 4.085338 0.657751 12.150000 4.091917 0.658183 12.160000 4.098501 0.658613 12.170000 4.105090 0.659043 12.180000 4.111682 0.659472 12.190000 4.118279 0.659899 12.200000 4.124880 0.660326 12.210000 4.131486 0.660752 12.220000 4.138095 0.661176 12.230000 4.144709 0.661600 12.240000 4.151327 0.662023 12.250000 4.157950 0.662444 12.260000 4.164576 0.662864 12.270000 4.171207 0.663284 12.280000 4.177842 0.663702 12.290000 4.184481 0.664119 12.300000 4.191124 0.664535 12.310000 4.197772 0.664950 12.320000 4.204423 0.665364 12.330000 4.211079 0.665777 12.340000 4.217739 0.666188 12.350000 4.224403 0.666598 12.360000 4.231071 0.667008 12.370000 4.237743 0.667416 12.380000 4.244419 0.667822 12.390000 4.251099 0.668228 12.400000 4.257784 0.668632 12.410000 4.264472 0.669035 12.420000 4.271164 0.669437 12.430000 4.277861 0.669838 12.440000 4.284561 0.670238 12.450000 4.291265 0.670636 12.460000 4.297974 0.671033 12.470000 4.304686 0.671428 12.480000 4.311402 0.671823 12.490000 4.318122 0.672216 12.500000 4.324847 0.672607 cassbeam-1.1/illum.c000066400000000000000000000461021275012243400144220ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include "vector.h" #include "image-vector.h" #include "vector-fftw.h" #include "keyvalue.h" #include "illum.h" Illum *newIllum(int N) { Illum *I; int i; I = g_new(Illum, 1); I->A = newMatrix(N, N); I->P = newMatrix(N, N); I->B = newMatrix(N, N); zeroMatrix(I->A); zeroMatrix(I->P); zeroMatrix(I->B); I->E = g_new(Matrix, 12); for(i = 0; i < 12; i++) { I->E[i] = newMatrix(N, N); zeroMatrix(I->E[i]); } I->groundfrac = 0.0; /* Fill in reasonable temperatures. should be updated */ I->Tsky = 3.0; I->Tground = 290.0; I->Trec = 20.0; I->pointx = I->pointy = 0.0; I->spilleff = 0.0; I->prispilleff = 0.0; I->subspilleff = 0.0; I->blockeff = 0.0; I->surfeff = 0.0; I->illumeff = 0.0; I->ampeff = 0.0; I->phaseeff = 0.0; I->efficiency = 0.0; I->diffeff = 0.0; I->misceff = 1.0; I->aeff = 0.0; I->fwhm_x = I->fwhm_y = 0.0; I->peaksidelobe = 0.0; I->lambda = 0.0; I->Xangle = 0.0; I->prefix = g_strdup("illum"); I->pixelsperbeam = 32; I->beampixelscale = 0.0; I->savejonesmatrices = 1; I->savestokesimages = 1; I->saveapertureimages = 1; I->saveparams = 1; return I; } void setIllumfromKeyValue(Illum *I, const struct KeyValue *kv) { int i; double v; const char *str; v = getKeyValuedouble(kv, "misceff"); if(v != KV_FLOATERR) I->misceff = v; v = getKeyValuedouble(kv, "diffeff"); if(v != KV_FLOATERR) I->diffeff = v; str = getKeyValuestring(kv, "out"); if(str) { if(I->prefix) g_free(I->prefix); I->prefix = g_strdup(str); } else if(!I->prefix) I->prefix = g_strdup("illum"); v = getKeyValuedouble(kv, "pixelsperbeam"); if(v != KV_FLOATERR) I->pixelsperbeam = v; str = getKeyValuestring(kv, "compute"); if(str) { if(strcmp(str, "all") == 0 || strcmp(str, "ALL") == 0) { I->savejonesmatrices = 1; I->savestokesimages = 1; I->saveapertureimages = 1; I->saveparams = 1; } else if(strcmp(str, "none") == 0 || strcmp(str, "NONE") == 0) { I->savejonesmatrices = 0; I->savestokesimages = 0; I->saveapertureimages = 0; I->saveparams = 0; } else { I->savejonesmatrices = 0; I->savestokesimages = 0; I->saveapertureimages = 0; I->saveparams = 0; for(i = 0; str[i]; i++) { if(str[i] == 'j' || str[i] == 'J') I->savejonesmatrices = 1; if(str[i] == 's' || str[i] == 'S') I->savestokesimages = 1; if(str[i] == 'a' || str[i] == 'A') I->saveapertureimages = 1; if(str[i] == 'p' || str[i] == 'P') I->saveparams = 1; } } } } void deleteIllum(Illum *I) { int i; if(!I) return; if(I->A) deleteMatrix(I->A); if(I->P) deleteMatrix(I->P); if(I->B) deleteMatrix(I->B); if(I->E) { for(i = 0; i < 12; i++) if(I->E[i]) deleteMatrix(I->E[i]); g_free(I->E); } } void calcIllumparams(Illum *I) { double er, ei, e, e2; /* sums over unblocked portion of aperture */ double aEr=0.0, aEi=0.0, aE=0.0, aE2=0.0, aA=0.0; /* sums over blocked portion of aperture */ double bEr=0.0, bEi=0.0; double a, b, abEr, abEi; int i, j, m, n; g_assert(MatrixSizeSame(I->A, I->P)); n = MatrixSize1(I->A); m = MatrixSize2(I->A); for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(I->A[j][i] > 0.0) { b = I->B[j][i]; a = 1.0-b; er = I->A[j][i]*cos(I->P[j][i]); ei = I->A[j][i]*sin(I->P[j][i]); e = I->A[j][i]; e2 = I->A[j][i]*I->A[j][i]; aEr += a*er; aEi += a*ei; aE += a*e; aE2 += a*e2; aA += a; bEr += b*er; bEi += b*ei; } aEr *= I->dA; aEi *= I->dA; aE *= I->dA; aE2 *= I->dA; aA *= I->dA; bEr *= I->dA; bEi *= I->dA; abEr = aEr + bEr; abEi = aEi + bEi; I->ampeff = (aE*aE)/(aA*aE2); I->phaseeff = (aEr*aEr + aEi*aEi)/(aE*aE); I->blockeff = (aEr*aEr + aEi*aEi)/(abEr*abEr + abEi*abEi); I->illumeff = I->ampeff*I->phaseeff; I->efficiency = I->spilleff * I->blockeff * I->surfeff * I->illumeff * I->diffeff * I->misceff; I->gain = I->efficiency*4.0*M_PI*I->a0/(I->lambda*I->lambda); I->aeff = I->lambda*I->lambda*I->gain/(4.0*M_PI); I->pTground = I->Tground*I->groundfrac; I->pTsky = I->Tsky*(1.0-I->groundfrac); I->pTrec = I->Trec; I->Tsys = I->pTground + I->pTsky + I->pTrec; } /* returns the matrix that rotates the XY Efield into RL. Element order is: * Input : ReX, ImX, ReY, ImY * Output : ReR, ImR, ReL, ImL */ static Matrix calcSmatrix(const Illum *I) { Matrix S; double c, s; S = newMatrix(4, 4); c = cos(I->Xangle); s = sin(I->Xangle); S[0][0] = c; S[0][1] = -s; S[0][2] = s; S[0][3] = c; S[1][0] = s; S[1][1] = c; S[1][2] = -c; S[1][3] = s; S[2][0] = c; S[2][1] = s; S[2][2] = s; S[2][3] = -c; S[3][0] = -s; S[3][1] = c; S[3][2] = c; S[3][3] = s; // printf("S = "); printMatrix(S); return S; } /* This function takes the electric fields on the aperture and computes the * far field pattern via Fraunhofer diffraction. See Jackson equation * 9.156 */ void calcIllumpolparams(Illum *I) { Matrix XRbeam, XLbeam, YRbeam, YLbeam; Matrix RRbeam, RLbeam, LRbeam, LLbeam; Matrix *beam, *stokes; Matrix T; const char stokename[][3] = {"I","Q","U","V","QI","UI","VI"}; char filename[1000]; int i, j, ii, jj, N; double kx, ky, kz, Rx, Ix, Ry, Iy; Matrix S; FILE *out; int start, stop; double f, factor, a, b, c; int F; if(I->savejonesmatrices == 0 && I->savestokesimages == 0) return; F = I->pixelsperbeam; S = calcSmatrix(I); N = MatrixSize1(I->A); beam = g_new(Matrix, 4); stokes = g_new(Matrix, 7); for(i = 0; i < 4; i++) { beam[i] = newMatrix(N, 2*N); zeroMatrix(beam[i]); } for(i = 0; i < 7; i++) stokes[i] = newMatrix(N, N); RRbeam = XRbeam = beam[0]; RLbeam = XLbeam = beam[1]; LRbeam = YRbeam = beam[2]; LLbeam = YLbeam = beam[3]; /* compute \hat{n} \cross \vec{E} on aperture surface * * \hat{n} = \hat{z} = (0, 0, 1), so cross product does: * x -> y y -> -x */ for(j = 0; j < N; j++) { if(j >= N/2) jj = (j-N/2)/F + N/2; else jj = N/2 - 1 - (N/2-j)/F; for(i = 0; i < N; i++) { if(i >= N/2) ii = (i-N/2)/F + N/2; else ii = N/2 - 1 - (N/2-i)/F; b = 1.0-I->B[j][i]; if(b <= 0.0) continue; /* components of beam excited with R pol */ XRbeam[jj][2*ii] += -b*I->E[RYR][j][i]; XRbeam[jj][2*ii+1] += -b*I->E[IYR][j][i]; YRbeam[jj][2*ii] += b*I->E[RXR][j][i]; YRbeam[jj][2*ii+1] += b*I->E[IXR][j][i]; /* components of beam excited with L pol */ XLbeam[jj][2*ii] += -b*I->E[RYL][j][i]; XLbeam[jj][2*ii+1] += -b*I->E[IYL][j][i]; YLbeam[jj][2*ii] += b*I->E[RXL][j][i]; YLbeam[jj][2*ii+1] += b*I->E[IXL][j][i]; } } for(i = 0; i < 4; i++) { rollMatrixinplace(beam[i], -N/2, -N); MatrixFFT(beam[i], FFTW_FORWARD); rollMatrixinplace(beam[i], N/2, N); /* convert from x, y to l, m by reflecting about y=m axis */ reflectMatrix2inplace(beam[i]); } /* compute k cross the above FFT. * * To recover stokes R and L, dot this vector with the conjugate of * the circular polarization vectors. p_r and p_l. * These vectors need to be rotated * at each point to be orthogonal to k. The final product is then * p_r^* . (k x I), where I is the Integral performed above in the * FFT. This is rearranged as -(k x p_r) . I. In the circular basis * k x p_r = -i p_r, and k x p_l = i p_l. */ factor = I->lambda/(F*N*sqrt(I->dA)); for(j = 0; j < N; j++) for(i = 0; i < 2*N; i+=2) { kx = (i/2-N/2)*(factor)-I->pointx; ky = (j-N/2)*(factor)-I->pointy; kz = sqrt(1.0-kx*kx-ky*ky); /* rotated p_r and p_l have the following components: * [note that the z component is not used] * (a + b i) X + (b + c i) Y and (a - b i) X + (b - c i) Y * k cross these are: * (b - a i) X + (c - b i) Y and (b + a i) X + (c + b i) Y * thus the conjugates used in the dotting are: * (b + a i) X + (c + b i) Y and (b - a i) X + (c - b i) Y */ f = 1.0/(M_SQRT2*(kx*kx + ky*ky)); a = f*(kx*kx*kz + ky*ky); b = f*(kx*ky - kx*ky*kz); c = f*(kx*kx + ky*ky*kz); /* compute RRbeam and LRbeam. note that the beam matrices * are being recycled * * The x <--> y here is done to reflect that radio astronomers * have e_1 along the y = m axis and e_2 along the x=-l axis. */ Ry = XRbeam[j][i]; Iy = XRbeam[j][i+1]; Rx = YRbeam[j][i]; Ix = YRbeam[j][i+1]; RRbeam[j][i] = b*Rx - a*Ix + c*Ry - b*Iy; RRbeam[j][i+1] = a*Rx + b*Ix + b*Ry + c*Iy; LRbeam[j][i] = b*Rx + a*Ix + c*Ry + b*Iy; LRbeam[j][i+1] = -a*Rx + b*Ix - b*Ry + c*Iy; /* compute RLbeam and LLbeam. note that the beam matrices * are being recycled * * The x <--> y here is done to reflect that radio astronomers * have e_1 along the y = m axis and e_2 along the x=-l axis. */ Ry = XLbeam[j][i]; Iy = XLbeam[j][i+1]; Rx = YLbeam[j][i]; Ix = YLbeam[j][i+1]; RLbeam[j][i] = b*Rx - a*Ix + c*Ry - b*Iy; RLbeam[j][i+1] = a*Rx + b*Ix + b*Ry + c*Iy; LLbeam[j][i] = b*Rx + a*Ix + c*Ry + b*Iy; LLbeam[j][i+1] = -a*Rx + b*Ix - b*Ry + c*Iy; } start = N/4 ; stop = N - start + 1; if(I->savejonesmatrices) { sprintf(filename, "%s.jones.dat", I->prefix); out = fopen(filename, "w"); for(jj = start; jj < stop; jj++) for(ii = start; ii < stop; ii++) { fprintf(out, "%f %f %f %f %f %f %f %f\n", RRbeam[jj][2*ii], RRbeam[jj][2*ii+1], LRbeam[jj][2*ii], LRbeam[jj][2*ii+1], RLbeam[jj][2*ii], RLbeam[jj][2*ii+1], LLbeam[jj][2*ii], LLbeam[jj][2*ii+1]); } fclose(out); } for(j = 0; j < N; j++) for(i = 0; i < N; i++) { double RR, LL, RL; RR = RRbeam[j][2*i] * RRbeam[j][2*i] + RRbeam[j][2*i+1] * RRbeam[j][2*i+1] + RLbeam[j][2*i] * RLbeam[j][2*i] + RLbeam[j][2*i+1] * RLbeam[j][2*i+1] ; LL = LRbeam[j][2*i] * LRbeam[j][2*i] + LRbeam[j][2*i+1] * LRbeam[j][2*i+1] + LLbeam[j][2*i] * LLbeam[j][2*i] + LLbeam[j][2*i+1] * LLbeam[j][2*i+1] ; stokes[0][j][i] = 0.5*(RR + LL); stokes[3][j][i] = 0.5*(RR - LL); RL = RLbeam[j][2*i] * LLbeam[j][2*i] + RLbeam[j][2*i+1] * LLbeam[j][2*i+1] + RRbeam[j][2*i] * LRbeam[j][2*i] + RRbeam[j][2*i+1] * LRbeam[j][2*i+1] ; stokes[1][j][i] = RL; RL = RLbeam[j][2*i+1] * LLbeam[j][2*i] - RLbeam[j][2*i] * LLbeam[j][2*i+1] + RRbeam[j][2*i+1] * LRbeam[j][2*i] - RRbeam[j][2*i] * LRbeam[j][2*i+1]; stokes[2][j][i] = RL; stokes[4][j][i] = stokes[1][j][i]/stokes[0][j][i]; stokes[5][j][i] = stokes[2][j][i]/stokes[0][j][i]; stokes[6][j][i] = stokes[3][j][i]/stokes[0][j][i]; } if(I->savestokesimages) { printf("\n"); printf("Output image scale is %f deg/pixel\n", 180.0*factor/M_PI); I->beampixelscale = factor; for(i = 0; i < 7; i++) { sprintf(filename, "%s.%s.pgm", I->prefix, stokename[i]); /* flip again, because pgm stores the image upside down */ reflectMatrix1inplace(stokes[i]); T = refsubMatrix(stokes[i], start, start, stop-1, stop-1); saveMatrixaspgm(T, filename); deleteMatrix(T); } } /* cleanup */ for(i = 0; i < 7; i++) deleteMatrix(stokes[i]); g_free(stokes); for(i = 0; i < 4; i++) deleteMatrix(beam[i]); g_free(beam); deleteMatrix(S); } static double peaksidelobe(const Matrix M, int j0, int i0) { Matrix A; int i, j, imax, n, o; int rx=0, ry=0, rx1=0, rx2=0, ry1=0, ry2=0; double peak, side; /* 0. build centered amplitude image */ A = Matrixcomplexamplitudes(M); n = MatrixSize1(A); o = n/2; if(j0 > o) j0 -= n; if(i0 > o) i0 -= n; rollMatrixinplace(A, o-j0, o-i0); peak = A[o][o]; /* 1. find first null in x direction */ for(i = 2; i < o-2; i++) { if(rx1 == 0 && A[o][o+i] < A[o][o+i-1] && A[o][o+i] < A[o][o+i+1]) rx1 = i; if(rx2 == 0 && A[o][o-i] < A[o][o-i-1] && A[o][o-i] < A[o][o-i+1]) rx2 = i; if(rx1 != 0 && rx2 != 0) break; } if(rx1 > rx2) rx = rx1; else rx = rx2; /* 2. find first null in y direction */ for(j = 2; j < o-2; j++) { if(ry1 == 0 && A[o+j][o] < A[o+j-1][o] && A[o+j][o] < A[o+j+1][o]) ry1 = j; if(ry2 == 0 && A[o-j][o] < A[o-j-1][o] && A[o-j][o] < A[o-j+1][o]) ry2 = j; if(ry1 != 0 && ry2 != 0) break; } if(ry1 > ry2) ry = ry1; else ry = ry2; /* 3. blank ellipse in middle */ for(j = -ry; j <= ry; j++) { imax = sqrt(ry*ry - j*j)*(double)rx/(double)ry; for(i = -imax; i <= imax; i++) A[o+j][o+i] = 0.0; } side = Matrixmax(A)/peak; deleteMatrix(A); return side*side; } /* Todo : take F as a parameter, automatically peak up on area that scales * with F. */ void dephaseIllum(Illum *I) { Matrix M, A; int F=6; double max=0.0, mag=0.0; int maxi=0, maxj=0, i, j, k, n, ii, jj; double dx, xfac, yfac; double di, dj; double pointx, pointy; double c, s, re, im; double Axx, Axy, Ayy; double sidelobe; /* Make an F times oversampled beam... */ n = MatrixSize1(I->A); M = newMatrix(n*F, 2*n*F); zeroMatrix(M); for(j = 0; j < n; j++) for(i = 0; i < n; i++) { M[j][2*i] = (1.0-I->B[j][i])*I->A[j][i]*cos(I->P[j][i]); M[j][2*i+1] = (1.0-I->B[j][i])*I->A[j][i]*sin(I->P[j][i]); } rollMatrixinplace(M, -n/2, -n); MatrixFFT(M, FFTW_FORWARD); for(j = 0; j < n*F; j++) for(i = 0; i < n*F; i++) { mag = M[j][2*i]*M[j][2*i]+M[j][2*i+1]*M[j][2*i+1]; if(mag > max) { max = mag; maxi = i; maxj = j; } } dx = sqrt(I->dA); if(maxi > F*n/2) maxi = maxi-F*n; if(maxj > F*n/2) maxj = maxj-F*n; /* Peak up the maximum */ A = newMatrix(5, 5); for(j = 0; j < 5; j++) for(i = 0; i < 5; i++) { ii = maxi-2+i; if(ii < 0) ii += n*F; jj = maxj-2+j; if(jj < 0) jj += n*F; A[j][i] = M[jj][2*ii]*M[jj][2*ii]+M[jj][2*ii+1]*M[jj][2*ii+1]; } scaleMatrix(A, 1.0/A[2][2]); applyfunctoMatrix(A, log); Matrixpeakup(A, 2, 2, 2, 2, &dj, &di, &Ayy, &Axy, &Axx); I->fwhm_x = 2.0*sqrt(-log(2.0)/Axx)*I->lambda/(F*n*dx); I->fwhm_y = 2.0*sqrt(-log(2.0)/Ayy)*I->lambda/(F*n*dx); di -= 2.0; dj -= 2.0; if(fabs(di) > 0.8 || fabs(dj) > 0.8) { fprintf(stderr, "Warning -- peak up interpolation fails\n"); di = dj = 0.0; } /* incremental pointing offsets in radians */ pointx = (maxi+di)*I->lambda/(F*n*dx); pointy = (maxj+dj)*I->lambda/(F*n*dx); if(fabs(pointx) < 0.000001 && fabs(pointy) < 0.000001) { pointx = 0.000001; } /* should there be a sin() below around point? */ xfac = 2.0*M_PI*pointx*dx/I->lambda; yfac = 2.0*M_PI*pointy*dx/I->lambda; /* subtract phase wedge from scalar phase */ for(j = 0; j < n; j++) for(i = 0; i < n; i++) I->P[j][i] -= (xfac*i + yfac*j); /* subtract phase wedge from vector data */ for(j = 0; j < n; j++) for(i = 0; i < n; i++) { c = cos(xfac*i + yfac*j); s = -sin(xfac*i + yfac*j); for(k = 0; k < 12; k+=2) { re = I->E[k ][j][i]; im = I->E[k+1][j][i]; I->E[k ][j][i] = re*c - im*s; I->E[k+1][j][i] = re*s + im*c; } } /* accumulated pointing offsets in radians */ I->pointx += pointx; I->pointy += pointy; sidelobe = peaksidelobe(M, maxj, maxi); if(sidelobe > I->peaksidelobe) I->peaksidelobe = sidelobe; deleteMatrix(M); } void printIllum(const Illum *I) { printf("Output: %p\n", I); if(I->spilleff > 0.0) { printf(" Spillover eff = %f\n", I->spilleff); if(I->subspilleff != 0.0 > I->prispilleff > 0.0) { printf(" primary = %f\n", I->prispilleff); printf(" subreflector= %f\n", I->subspilleff); } } if(I->blockeff > 0.0) printf(" Blockage eff = %f\n", I->blockeff); if(I->surfeff > 0.0) printf(" Surface eff = %f\n", I->surfeff); if(I->illumeff > 0.0) { printf(" Illum eff = %f\n", I->illumeff); if(I->phaseeff > 0.0) printf(" phase eff = %f\n", I->phaseeff); if(I->ampeff > 0.0) printf(" amp eff = %f\n", I->ampeff); } if(I->diffeff > 0.0) printf(" Diffract eff = %f\n", I->diffeff); if(I->misceff > 0.0) printf(" Misc eff = %f\n", I->misceff); if(I->efficiency > 0.0) printf(" Total eff = %f\n", I->efficiency); if(I->gain > 0.0) printf(" Gain = %6.2f = %5.2f dBi\n", I->gain, 10.0*log10(I->gain)); if(I->Tsys > 0.0) { printf(" Tsys = %6.3f K\n", I->Tsys); if(I->pTground > 0.0) printf(" ground = %6.3f K\n", I->pTground); if(I->pTsky > 0.0) printf(" sky = %6.3f K\n", I->pTsky); if(I->pTrec > 0.0) printf(" rec = %6.3f K\n", I->pTrec); } if(I->aeff > 0.0) { printf(" Aeff = %f m^2\n", I->aeff); if(I->Tsys > 0.0) printf(" Aeff/Tsys = %f m^2/K\n", I->aeff/I->Tsys); } if(I->pointx != 0.0 || I->pointy != 0.0) { printf(" l beamshift = %f deg\n", -I->pointx*180.0/M_PI); printf(" m beamshift = %f deg\n", I->pointy*180.0/M_PI); } if(I->fwhm_x != 0.0 || I->fwhm_y != 0.0) { printf(" l beam FWHM = %f deg\n", I->fwhm_x*180.0/M_PI); printf(" m beam FWHM = %f deg\n", I->fwhm_y*180.0/M_PI); } if(I->peaksidelobe > 0.0) printf(" Peak sidelobe = %f = %f dB\n", I->peaksidelobe, 10.0*log10(I->peaksidelobe)); } void KeyValueupdateIllum(struct KeyValue *kv, const Illum *I) { if(I->spilleff > 0.0) { KeyValueupdateparmdouble(kv, "spilleff", I->spilleff); if(I->subspilleff != 0.0 > I->prispilleff > 0.0) { KeyValueupdateparmdouble(kv, "prispilleff", I->prispilleff); KeyValueupdateparmdouble(kv, "subspilleff", I->subspilleff); } } if(I->blockeff > 0.0) KeyValueupdateparmdouble(kv, "blockeff", I->blockeff); if(I->surfeff > 0.0) KeyValueupdateparmdouble(kv, "surfeff", I->surfeff); if(I->illumeff > 0.0) { KeyValueupdateparmdouble(kv, "illumeff", I->illumeff); if(I->phaseeff > 0.0) KeyValueupdateparmdouble(kv, "phaseeff", I->phaseeff); if(I->ampeff > 0.0) KeyValueupdateparmdouble(kv, "ampeff", I->ampeff); } if(I->diffeff > 0.0) KeyValueupdateparmdouble(kv, "diffeff", I->diffeff); if(I->misceff > 0.0) KeyValueupdateparmdouble(kv, "misceff", I->misceff); if(I->efficiency > 0.0) KeyValueupdateparmdouble(kv, "totaleff", I->efficiency); if(I->gain > 0.0) KeyValueupdateparmdouble(kv, "gain", I->gain); if(I->Tsys > 0.0) KeyValueupdateparmdouble(kv, "Tsys", I->Tsys); if(I->aeff > 0.0) { KeyValueupdateparmdouble(kv, "Aeff", I->aeff); if(I->Tsys > 0.0) KeyValueupdateparmdouble(kv, "Aeff_Tsys", I->aeff/I->Tsys); } if(I->pointx != 0.0 || I->pointy != 0.0) { KeyValueupdateparmdouble(kv, "point_l", -I->pointx*180.0/M_PI); KeyValueupdateparmdouble(kv, "point_m", I->pointy*180.0/M_PI); } if(I->fwhm_x != 0.0 || I->fwhm_y != 0.0) { KeyValueupdateparmdouble(kv, "fwhm_l", I->fwhm_x*180.0/M_PI); KeyValueupdateparmdouble(kv, "fwhm_m", I->fwhm_y*180.0/M_PI); } if(I->peaksidelobe > 0.0) KeyValueupdateparmdouble(kv, "peaksidelobe", I->peaksidelobe); if(I->beampixelscale > 0.0) KeyValueupdateparmdouble(kv, "beampixelscale", 180.0*I->beampixelscale/M_PI); } cassbeam-1.1/illum.h000066400000000000000000000047051275012243400144320ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __ILLUM_H__ #define __ILLUM_H__ #include "vector.h" #include "keyvalue.h" #define RXR 0 #define IXR 1 #define RYR 2 #define IYR 3 #define RZR 4 #define IZR 5 #define RXL 6 #define IXL 7 #define RYL 8 #define IYL 9 #define RZL 10 #define IZL 11 typedef struct { /* This first set of parameters is generated by telescope * specific code */ Matrix *E; Matrix A, P; /* amp / phase */ Matrix B; /* blockage matrix */ double dA; /* area of each pixel (m^2) */ double prispilleff, subspilleff; double spilleff, surfeff, diffeff, misceff; double a0; /* area of primary (m^2) */ double lambda; /* wavelength (m) */ double groundfrac; /* fraction of power hitting ground */ double Tsky, Tground, Trec; double Xangle; int gridsize; int pixelsperbeam; char *prefix; /* This second set of parameters are derived by calcIllumparams() * based on the above values */ double pTground, pTsky, pTrec; /* partial temperatures */ double Tsys; double gain; double blockeff, illumeff, ampeff, phaseeff; double efficiency; double aeff; double pointx, pointy; /* pointing offsets in radians */ double fwhm_x, fwhm_y; double peaksidelobe; /* A third set of parameters could be added that are derived from * calcIllumpolparams() */ double beampixelscale; /* these are control parameters */ int savejonesmatrices; int savestokesimages; int saveapertureimages; int saveparams; } Illum; Illum *newIllum(int N); void setIllumfromKeyValue(Illum *I, const struct KeyValue *kv); void deleteIllum(Illum *I); void printIllum(const Illum *I); void dephaseIllum(Illum *I); void calcIllumparams(Illum *I); void calcIllumpolparams(Illum *I); void KeyValueupdateIllum(struct KeyValue *kv, const Illum *I); #endif cassbeam-1.1/image-vector.c000066400000000000000000000033751275012243400156670ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include "image-vector.h" Image newImagefromMatrix(const Matrix M) { Image im; int m, n, i, j; MatrixType min, max; n = MatrixSize1(M); m = MatrixSize2(M); im = newImage(m, n); Matrixminmax(M, &min, &max); for(i = 0; i < m; i++) for(j = 0; j < n; j++) im->data[j][i] = 255.0*(M[j][i]-min)/(max-min); return im; } Matrix newMatrixfromImage(const Image im) { Matrix M; int m, n, i, j; m = im->xres; n = im->yres; M = newMatrix(n, m); for(i = 0; i < m; i++) for(j = 0; j < n ; j++) M[j][i] = im->data[j][i]/255.0; return M; } void saveMatrixaspgm(const Matrix M, const char *filename) { Image I; g_assert(M); I = newImagefromMatrix(M); saveImageaspgm(I, filename); deleteImage(I); } /* Note -- this doesn't blank the pad */ Matrix newpaddedMatrixfromImage(const Image im, int rowpad) { Matrix M; int m, n, i, j; m = im->xres; n = im->yres; M = newpaddedMatrix(n, m, rowpad); for(i = 0; i < m; i++) for(j = 0; j < n ; j++) M[j][i] = im->data[j][i]/255.0; return M; } cassbeam-1.1/image-vector.h000066400000000000000000000020441275012243400156640ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __IMAGE_VECTOR__ #define __IMAGE_VECTOR__ #include "image.h" #include "vector.h" Image newImagefromMatrix(const Matrix M); void saveMatrixaspgm(const Matrix M, const char *filename); Matrix newMatrixfromImage(const Image im); Matrix newpaddedMatrixfromImage(const Image im, int rowpad); #endif cassbeam-1.1/image.c000066400000000000000000000143721275012243400143660ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include "image.h" /* Warning! Does not blank Image */ Image newImage(int xres, int yres) { int i; Image img; unsigned char *raw; img = g_new(struct _Image, 1); img->xres = xres; img->yres = yres; img->data = g_new(unsigned char *, yres); raw = g_new(unsigned char, xres*yres); for(i = 0; i < yres; i++) img->data[i] = raw+(i*xres); return img; } void deleteImage(Image p) { if(!p) { fprintf(stderr, "Warning: Deleteing nullImage\n"); return; } if(p->data[0]) g_free(p->data[0]); if(p->data) g_free(p->data); g_free(p); } /* 0 on success */ int readpgmline(FILE *in, char line[100], const char *filename) { for(;;) { fgets(line, 99, in); if(feof(in)) { fprintf(stderr, "Short file: %s\n", filename); fclose(in); return -1; } if(strlen(line) > 98) { fprintf(stderr, "loadImageaspgm: Bad file: %s\n", filename); fclose(in); return -1; } if(line[0] != '#') return 0; } } Image loadImageaspgm(const char *filename) { Image img; FILE *in; int i, j, k, xres, yres, maxgrey; char line[100]; int mode, c; guchar *row; in = fopen(filename, "r"); if(!in) { fprintf(stderr, "loadImageaspgm: File not found: %s\n", filename); return 0; } if(readpgmline(in, line, filename)) return 0; if(line[0] != 'P' || (line[1] != '5' && line[1] != '6')) { fprintf(stderr, "Unsupported file: %s\n", filename); fclose(in); return 0; } if(line[1] == '5') mode = 0; else mode = 1; if(readpgmline(in, line, filename)) return 0; sscanf(line, "%d%d", &xres, &yres); if(xres <= 0 || yres <= 0) { fprintf(stderr, "loadImageaspgm: Bad file: %s\n", filename); fclose(in); return 0; } if(readpgmline(in, line, filename)) return 0; sscanf(line, "%d", &maxgrey); img = newImage(xres, yres); if(mode == 0) { for(j = 0; j < yres; j++) { if(fread(img->data[j], sizeof(unsigned char), xres, in) != xres) { fprintf(stderr, "Warning: loadImageaspgm: " "File Short: %s\n", filename); break; } } } else { row = g_new(guchar, 3*xres); for(j = 0; j < yres; j++) { if(fread(row, sizeof(unsigned char), 3*xres,in) != 3*xres) { fprintf(stderr, "Warning: loadImageaspgm:" " File Short: %s\n", filename); break; } k = 0; for(i = 0; i < xres; i++) { c = 71*row[k++]; c += 150*row[k++]; c += 28*row[k++]; img->data[j][i] = c>>8; } } g_free(row); } fclose(in); return img; } Image loadImageasweightedpgm(const char *filename, float rw, float gw, float bw) { Image img; FILE *in; int i, j, k, xres, yres, maxgrey; char line[100]; int mode; float wc; guchar *row; in = fopen(filename, "r"); if(!in) { fprintf(stderr, "loadImageaspgm: File not found: %s\n", filename); return 0; } if(readpgmline(in, line, filename)) return 0; if(line[0] != 'P' || (line[1] != '5' && line[1] != '6')) { fprintf(stderr, "Unsupported file: %s\n", filename); fclose(in); return 0; } if(line[1] == '5') mode = 0; else mode = 1; if(readpgmline(in, line, filename)) return 0; sscanf(line, "%d%d", &xres, &yres); if(xres <= 0 || yres <= 0) { fprintf(stderr, "loadImageaspgm: Bad file: %s\n", filename); fclose(in); return 0; } if(readpgmline(in, line, filename)) return 0; sscanf(line, "%d", &maxgrey); img = newImage(xres, yres); if(mode == 0) { for(j = 0; j < yres; j++) { if(fread(img->data[j], sizeof(unsigned char), xres, in) != xres) { fprintf(stderr, "Warning: loadImageaspgm: " "File Short: %s\n", filename); break; } } } else { row = g_new(guchar, 3*xres); for(j = 0; j < yres; j++) { if(fread(row, sizeof(unsigned char), 3*xres,in) != 3*xres) { fprintf(stderr, "Warning: loadImageaspgm:" " File Short: %s\n", filename); break; } k = 0; for(i = 0; i < xres; i++) { wc = rw*row[k++]; wc += gw*row[k++]; wc += bw*row[k++]; img->data[j][i] = wc/(rw+gw+bw); } } g_free(row); } fclose(in); return img; } /* 0 on success, non-0 otherwise */ int saveImageaspgm(const Image p, const char *filename) { int i; FILE *out; if(!p) { fprintf(stderr, "saveImageaspgm: Null Image. Dest: %s\n", filename); return -1; } out = fopen(filename, "w"); if(!out) { fprintf(stderr, "saveImageaspgm: Cannot open %s for write\n", filename); return -1; } fprintf(out, "P5\n%d %d\n255\n", p->xres, p->yres); for(i = 0; i < p->yres; i++) fwrite(p->data[i], sizeof(unsigned char), p->xres, out); fclose(out); return 0; } Image dupImage(const Image p) { Image img; int i; if(!p) return 0; img = newImage(p->xres, p->yres); for(i = 0; i < p->yres; i++) img->data[i] = g_memdup(p->data[i], p->xres); return img; } void blankImage(Image p, unsigned char value) { int i; if(!p) return; for(i = 0; i < p->yres; i++) memset(p->data[i], value, p->xres); } void Imagedrawhline(Image p, int x0, int x1, int y, unsigned char value) { if(!p) return; memset(p->data[y]+x0, value, x1-x0+1); } void stretchImage(Image p) { } Image scaleImage(const Image p, int newxres, int newyres) { return 0; } void applyfunctoImage(Image p, unsigned char (* func)(unsigned char v)) { int i, j; for(j = 0; j < p->yres; j++) for(i = 0; i < p->xres; i++) p->data[j][i] = func(p->data[j][i]); } Image halveImage(Image p) { Image q; int i, j; q = newImage(p->xres/2, p->yres/2); for(j = 0; j < q->yres; j++) for(i = 0; i < q->xres; i++) q->data[j][i] = (p->data[2*j][2*i] + p->data[2*j][2*i+1] + p->data[2*j+1][2*i] + p->data[2*j+1][2*i+1]) >> 2; return q; } cassbeam-1.1/image.h000066400000000000000000000030061275012243400143630ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __IMAGE_H__ #define __IMAGE_H__ /* data[Y][X] */ struct _Image { unsigned char **data; int xres, yres; }; typedef struct _Image* Image; #define zeroImage(p) blankImage(p, 0) Image newImage(int xres, int yres); void deleteImage(Image p); Image loadImageaspgm(const char *filename); Image loadImageasweightedpgm(const char *filename, float rw, float gw, float bw); int saveImageaspgm(const Image p, const char *filename); Image dupImage(const Image p); void blankImage(Image p, unsigned char value); void Imagedrawhline(Image p, int x0, int x1, int y, unsigned char value); void stretchImage(Image p); Image scaleImage(const Image p, int newxres, int newyres); void applyfunctoImage(Image p, unsigned char (* func)(unsigned char v)); Image halveImage(Image p); #endif cassbeam-1.1/install-sh000077500000000000000000000127201275012243400151370ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 cassbeam-1.1/intvector.c000066400000000000000000000201071275012243400153120ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include "intvector.h" #include "randdist.h" /* intVector routines */ intVector newintVector(int n) { intVector v; v = g_new(intVectorType, n+1); v++; intVectorSize(v) = n; return v; } void zerointVector(intVector v) { int i, m; m = intVectorSize(v); for(i = 0; i < m; i++) v[i] = 0; } void fillintVector(intVector v, int r) { int i, m; m = intVectorSize(v); for(i = 0; i < m; i++) v[i] = r; } void deleteintVector(intVector v) { g_free(v-1); } intVector dupintVector(const intVector v) { int i, m; intVector v2; m = intVectorSize(v); v2 = newintVector(m); for(i = 0; i < m; i++) v2[i] = v[i]; return v2; } void printintVector(const intVector v) { int i, m; m = intVectorSize(v); for(i = 0; i < m; i++) { if(i != 0) printf(" "); printf("%d", v[i]); } printf("\n"); } void saveintVectorasascii(const intVector v, const char *filename) { FILE *out; int i, m; g_assert(v); out = fopen(filename, "w"); g_assert(out); m = intVectorSize(v); for(i = 0; i < m; i++) fprintf(out, "%d %d\n", i, v[i]); fclose(out); } int intVectorrandomelement(const intVector v) { return v[rand_int(intVectorSize(v))]; } int intVectormax(const intVector v) { int i, n, m; g_assert(v); n = intVectorSize(v); m = v[0]; for(i = 1; i < n; i++) if(v[i] > m) m = v[i]; return m; } int intVectormin(const intVector v) { int i, n, m; g_assert(v); n = intVectorSize(v); m = v[0]; for(i = 1; i < n; i++) if(v[i] < m) m = v[i]; return m; } intMatrix newpaddedintMatrix(int n, int m, int rowpad) { intMatrix M; intMatrixTypePointer D; int j, w; w = m+rowpad; D = g_new(intMatrixType, w*n+INTMATRIXVALUESPERBLOCK) + INTMATRIXVALUESPERBLOCK; M = g_new(intMatrixTypePointer, ((n>1) ? (n+INTMATRIXSTUBINDICES) : (2+INTMATRIXSTUBINDICES))); M += INTMATRIXSTUBINDICES; intMatrixStub(M)->datastart = D; intMatrixStub(M)->n = n; intMatrixStub(M)->m = m; intMatrixStub(M)->rowpad = rowpad; intMatrixrefcount(M) = 1; for(j = 0; j < n; j++) M[j] = D + (j*w); /* Index array for [][] */ if(n == 1) M[1] = D + w; return M; } void deleteintMatrix(intMatrix M) { intMatrixStubType *ms; g_assert(M); ms = intMatrixStub(M); intMatrixrefcount(M)--; if(intMatrixrefcount(M) <= 0) g_free(ms->datastart-INTMATRIXVALUESPERBLOCK); g_free(ms); } intMatrix refsubintMatrix(const intMatrix M, int n1, int m1, int n2, int m2) { intMatrix N; intMatrixTypePointer D; int j, m, n, w; g_assert(M); n = intMatrixSize1(M); m = intMatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n) { fprintf(stderr, "subintMatrix: limit error\n"); return 0; } w = intMatrixstride(M); N = g_new(intMatrixTypePointer, ((n>1) ? (n+INTMATRIXSTUBINDICES) : (2+INTMATRIXSTUBINDICES))); N += INTMATRIXSTUBINDICES; intMatrixStub(N)->datastart = D = intMatrixStub(M)->datastart; intMatrixStub(N)->n = n2-n1+1; intMatrixStub(N)->m = m2-m1+1; intMatrixStub(N)->rowpad = w-(m2-m1+1); intMatrixrefcount(M)++; for(j = 0; j <= n2-n1; j++) N[j] = M[n1] + m1 + (j*w); if(n2 == n1) N[1] = N[0]+w; return N; } void zerointMatrix(intMatrix M) { int i, j, m, n; intMatrixTypePointer Mrow; n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) { Mrow = M[j]; for(i = 0; i < m; i++) Mrow[i] = 0; } } intMatrix dupintMatrix(const intMatrix M) { int i, j, m, n; intMatrix M2; n = intMatrixSize1(M); m = intMatrixSize2(M); M2 = newpaddedintMatrix(n, m, intMatrixrowpad(M)); for(i = 0; i < m; i++) for(j = 0; j < n; j++) M2[j][i] = M[j][i]; return M2; } intMatrixType intMatrixmax(const intMatrix M) { intMatrixType max; int i, j, m, n; n = intMatrixSize1(M); m = intMatrixSize2(M); max = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] > max) max = M[j][i]; return max; } intMatrixType intMatrixmin(const intMatrix M) { intMatrixType min; int i, j, m, n; n = intMatrixSize1(M); m = intMatrixSize2(M); min = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] < min) min = M[j][i]; return min; } void intMatrixminmax(const intMatrix M, intMatrixType *min, intMatrixType *max) { int i, j, m, n; n = intMatrixSize1(M); m = intMatrixSize2(M); *min = *max = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) { if(M[j][i] < *min) *min = M[j][i]; if(M[j][i] > *max) *max = M[j][i]; } } void scaleintMatrix(intMatrix M, double f) { int i, j, m, n; n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] *= f; } void biasintMatrix(intMatrix M, int b) { int i, j, m, n; n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] += b; } void addtointMatrix(intMatrix M, const intMatrix N) { int i, j, m, n; g_assert(intMatrixSizeSame(M, N)); n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] += N[j][i]; } intMatrix addintMatrices(const intMatrix M, const intMatrix N) { int i, j, m, n; intMatrix Sum; g_assert(intMatrixSizeSame(M, N)); n = intMatrixSize1(M); m = intMatrixSize2(M); Sum = newintMatrix(n, m); for(j = 0; j < n; j++) for(i = 0; i < m; i++) Sum[j][i] = M[j][i] + N[j][i]; return Sum; } void copytointMatrix(intMatrix M, const intMatrix N) { int i, j, m, n; g_assert(intMatrixSizeSame(M, N)); n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = N[j][i]; } void applyfunctointMatrix(intMatrix M, int (*func)(int x)) { int i, j, m, n; g_assert(M); n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = func(M[j][i]); } intMatrix intMatrixproduct(intVector v2, intVector v1) { intMatrix M; int i, j, m, n; g_assert(v2); g_assert(v1); M = newintMatrix(intVectorSize(v2), intVectorSize(v1)); n = intMatrixSize1(M); m = intMatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = v2[j]*v1[i]; return M; } intMatrix dupsubintMatrix(const intMatrix M, int n1, int m1, int n2, int m2) { intMatrix N; int i, j, m, n; g_assert(M); n = intMatrixSize1(M); m = intMatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n) { fprintf(stderr, "dupsubintMatrix: limit error\n"); return 0; } N = newintMatrix(n2-n1+1, m2-m1+1); for(j = n1; j <= n2; j++) for(i = m1; i <= m2; i++) N[j-n1][i-m1] = M[j][i]; return N; } void copysubintMatrix(intMatrix N, const intMatrix M, int n1, int m1, int n2, int m2, int n3, int m3) { int i, j, m, n; g_assert(M); g_assert(N); n = intMatrixSize1(M); m = intMatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n || n3 >= intMatrixSize1(N) || m3 >= intMatrixSize2(N)) { fprintf(stderr, "copysubMatrix: limit error\n"); return; } if(n3 < 0) n3 = intMatrixSize1(N)-(n2-n1); if(m3 < 0) m3 = intMatrixSize2(N)-(m2-m1); if(n3 < 0) { n1 -= n3; n3 = 0; } if(m3 < 0) { m1 -= m3; m3 = 0; } if(n3+n2-n1 >= intMatrixSize1(N)) n2 = n1-n3+intMatrixSize1(N)-1; if(m3+m2-m1 >= intMatrixSize2(N)) m2 = m1-m3+intMatrixSize2(N)-1; for(j = n1; j <= n2; j++) for(i = m1; i <= m2; i++) N[j+n1-n3][i+m1-m3] = M[j][i]; } cassbeam-1.1/intvector.h000066400000000000000000000103621275012243400153210ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __INT_VECTOR__ #define __INT_VECTOR__ typedef int* intVector; typedef int intVectorType; typedef int* intVectorTypePointer; typedef int** intMatrix; typedef int intMatrixType; typedef int* intMatrixTypePointer; typedef struct { intMatrixTypePointer datastart; int n, m, rowpad; } intMatrixStubType; #define INTMATRIXALIGN 32 #define INTMATRIXSTUBBLOCKS (((sizeof(intMatrixStubType)-1)/INTMATRIXALIGN)+1) #define INTMATRIXSTUBINDICES (((INTMATRIXALIGN*INTMATRIXSTUBBLOCKS-1)/ \ sizeof(intMatrixTypePointer))+1) #define INTMATRIXVALUESPERBLOCK (((INTMATRIXALIGN-1)/sizeof(intMatrixType))+1) #define intMatrixStub(M) ((intMatrixStubType *)(M-INTMATRIXSTUBINDICES)) #define constintMatrixStub(M) ((const intMatrixStubType *)(M-INTMATRIXSTUBINDICES)) #define intVectorSize(v) ((v)[-1]) #define intVectorSizeSame(U, V) (intVectorSize((U)) == intVectorSize((V))) #define intMatrixSize1(M) (constintMatrixStub((M))->n) #define intMatrixSize2(M) (constintMatrixStub((M))->m) #define intMatrixrowpad(M) (constintMatrixStub((M))->rowpad) #define intMatrixstride(M) (((M)[1]-(M)[0])) #define intMatrixrefcount(M) (*((int *)((intMatrixStub((M))->datastart)- \ INTMATRIXVALUESPERBLOCK))) #define newintMatrix(n, m) newpaddedintMatrix((n), (m), 0) #define refintMatrix(M) refsubintMatrix((M), 0, 0, -1, -1) #define intMatrixSizeSame(M, N) ((intMatrixSize1((M)) == intMatrixSize1((N))) && \ (intMatrixSize2((M)) == intMatrixSize2((N)))) intVector newintVector(int n); void zerointVector(intVector v); void fillintVector(intVector v, int r); void deleteintVector(intVector v); intVector dupintVector(const intVector v); void printintVector(const intVector v); void saveintVectorasascii(const intVector v, const char *filename); int intVectorrandomelement(const intVector v); int intVectormax(const intVector v); int intVectormin(const intVector v); intMatrix newpaddedintMatrix(int n, int m, int rowpad); void deleteintMatrix(intMatrix M); intMatrix refsubintMatrix(const intMatrix M, int n1, int m1, int n2, int m2); void zerointMatrix(intMatrix M); intMatrix dupintMatrix(const intMatrix M); intMatrixType intMatrixmax(const intMatrix M); intMatrixType intMatrixmin(const intMatrix M); void intMatrixminmax(const intMatrix M, intMatrixType *min, intMatrixType *max); void scaleintMatrix(intMatrix M, double f); void biasintMatrix(intMatrix M, int b); void addtointMatrix(intMatrix M, const intMatrix N); intMatrix addintMatrices(const intMatrix M, const intMatrix N); void copytointMatrix(intMatrix M, const intMatrix N); void applyfunctointMatrix(intMatrix M, int (*func)(int x)); intMatrix intMatrixproduct(intVector v2, intVector v1); intMatrix dupsubintMatrix(const intMatrix M, int n1, int m1, int n2, int m2); void copysubintMatrix(intMatrix N, const intMatrix M, int n1, int m1, int n2, int m2, int n3, int m3); intVector intMatrixrow(const intMatrix M, int row); intVector intMatrixcolumn(const intMatrix M, int column); intVector sumintMatrixrows(const intMatrix M); intVector sumintMatrixcolumns(const intMatrix M); void intMatrixmeanRMS(const intMatrix M, double *rms, double *mean); double intMatrixmean(const intMatrix M); double intMatrixRMS(const intMatrix M); intMatrix intMatrixcomplexamplitudes(const intMatrix M); intMatrix intMatrixcomplexphases(const intMatrix M); intVector intMatrixhistogram(const intMatrix M, int bin0, int bin1); #endif /* __INT_VECTOR__ */ cassbeam-1.1/keyvalue.c000066400000000000000000000074511275012243400151310ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include #include "keyvalue.h" struct KeyValue *newKeyValue() { struct KeyValue *p; p = g_new(struct KeyValue, 1); p->nparms = 0; return p; } void deleteKeyValue(struct KeyValue *p) { int i; if(!p) return; for(i = 0; i < p->nparms; i++) { g_free(p->key[i]); g_free(p->value[i]); } g_free(p); } void KeyValueaddparm(struct KeyValue *p, const char *key, const char *value) { p->key[p->nparms] = g_strdup(key); p->value[p->nparms] = g_strdup(value); p->nparms++; } void KeyValueupdateparm(struct KeyValue *p, const char *key, const char *value) { int i; i = KeyValuekeyindex(p, key); if(i >= 0) { g_free(p->value[i]); p->value[i] = g_strdup(value); } else { p->key[p->nparms] = g_strdup(key); p->value[p->nparms] = g_strdup(value); p->nparms++; } } void KeyValueupdateparmdouble(struct KeyValue *p, const char *key, double value) { int i; char v[100]; sprintf(v, "%f", value); i = KeyValuekeyindex(p, key); if(i >= 0) { g_free(p->value[i]); p->value[i] = g_strdup(v); } else { p->key[p->nparms] = g_strdup(key); p->value[p->nparms] = g_strdup(v); p->nparms++; } } struct KeyValue *loadKeyValue(const char *filename) { struct KeyValue *p; FILE *in; int i; char str[1000], K[200], V[200]; if(strcmp(filename, "-") == 0) in = stdin; else in = fopen(filename, "r"); if(!in) { fprintf(stderr, "loadKeyValue: no file: %s\n", filename); return 0; } p = newKeyValue(); while(1) { fgets(str, 999, in); if(feof(in)) break; for(i = 0; str[i] != 0; i++) { if(str[i] == '#') str[i] = 0; else if(str[i] == '=') str[i] = ' '; } if(str[0] == 0) continue; if(sscanf(str, "%s %s\n", K, V) != 2) continue; KeyValueaddparm(p, K, V); } if(strcmp(filename, "-") != 0) fclose(in); return p; } int saveKeyValue(const struct KeyValue *kv, const char *filename) { int i; FILE *out; out = fopen(filename, "w"); if(!out) return 0; for(i = 0; i < kv->nparms; i++) fprintf(out, "%s = %s\n", kv->key[i], kv->value[i]); fclose(out); return 1; } /* return -1 if not in the list of keys */ int KeyValuekeyindex(const struct KeyValue *p, const char *key) { int i; for(i = 0; i < p->nparms; i++) if(strcmp(p->key[i], key) == 0) return i; return -1; } int getKeyValueint(const struct KeyValue *p, const char *key) { int i = KeyValuekeyindex(p, key); if(i < 0) return KV_INTERR; return atoi(p->value[i]); } double getKeyValuedouble(const struct KeyValue *p, const char *key) { int i = KeyValuekeyindex(p, key); if(i < 0) return KV_FLOATERR; return atof(p->value[i]); } Vector getKeyValueVector(const struct KeyValue *p, const char *key) { int i = KeyValuekeyindex(p, key); if(i < 0) return 0; return newVectorfromstring(p->value[i]); } const char *getKeyValuestring(const struct KeyValue *p, const char *key) { int i = KeyValuekeyindex(p, key); if(i < 0) return 0; return p->value[i]; } void printKeyValue(const struct KeyValue *p) { int i; for(i = 0; i < p->nparms; i++) printf("KV: %s = %s\n", p->key[i], p->value[i]); } cassbeam-1.1/keyvalue.h000066400000000000000000000035051275012243400151320ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __KEYVALUE__ #define __KEYVALUE__ #define KV_MAXPARMS 256 /* Max number of parameters for a KeyValue */ #define KV_INTERR -999999 #define KV_FLOATERR -999999.0 #include "vector.h" struct KeyValue { char *key[KV_MAXPARMS]; char *value[KV_MAXPARMS]; int nparms; }; struct KeyValue *newKeyValue(); void deleteKeyValue(struct KeyValue *p); void KeyValueaddparm(struct KeyValue *p, const char *key, const char *value); void KeyValueupdateparm(struct KeyValue *p, const char *key, const char *value); void KeyValueupdateparmdouble(struct KeyValue *p, const char *key, double value); struct KeyValue *loadKeyValue(const char *filename); int saveKeyValue(const struct KeyValue *kv, const char *filename); int KeyValuekeyindex(const struct KeyValue *p, const char *key); int getKeyValueint(const struct KeyValue *p, const char *key); double getKeyValuedouble(const struct KeyValue *p, const char *key); Vector getKeyValueVector(const struct KeyValue *p, const char *key); const char *getKeyValuestring(const struct KeyValue *p, const char *key); void printKeyValue(const struct KeyValue *p); #endif cassbeam-1.1/mathfunc.c000066400000000000000000002277411275012243400151170ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include "mathfunc.h" double pythag(double a, double b) { double absa, absb; absa=fabs(a); absb=fabs(b); if(absa > absb) return absa*sqrt(1.0+(absb/absa)*(absb/absa)); if(absb > absa) return absb*sqrt(1.0+(absa/absb)*(absa/absb)); return 0; } /* The following code has been adapted from a different author: Copyright(C) 1996 Takuya OOURA (email: ooura@mmm.t.u-tokyo.ac.jp). You may use, copy, modify this code for any purpose and without fee. You may distribute this ORIGINAL package. */ /* BESSEL FUNCTIONS and MODIFIED BESSEL FUNCTIONS of 0 and 1 order */ double bessel_J0(double x) { int k; double w, t, y, v, theta; const static double a[8] = { -2.3655394e-12, 4.70889868e-10, -6.78167892231e-8, 6.7816840038636e-6, -4.340277777716935e-4, 0.0156249999999992397, -0.2499999999999999638, 0.9999999999999999997 }; const static double b[65] = { 6.26681117e-11, -2.2270614428e-9, 6.62981656302e-8, -1.6268486502196e-6, 3.21978384111685e-5, -5.00523773331583e-4, 0.0059060313537449816, -0.0505265323740109701, 0.2936432097610503985, -1.0482565081091638637, 1.9181123286040428113, -1.13191994752217001, -0.1965480952704682, 4.57457332e-11, -1.5814772025e-9, 4.55487446311e-8, -1.0735201286233e-6, 2.02015179970014e-5, -2.942392368203808e-4, 0.0031801987726150648, -0.0239875209742846362, 0.1141447698973777641, -0.2766726722823530233, 0.1088620480970941648, 0.5136514645381999197, -0.2100594022073706033, 3.31366618e-11, -1.1119090229e-9, 3.08823040363e-8, -6.956602653104e-7, 1.23499947481762e-5, -1.66295194539618e-4, 0.0016048663165678412, -0.0100785479932760966, 0.0328996815223415274, -0.0056168761733860688, -0.2341096400274429386, 0.2551729256776404262, 0.2288438186148935667, 2.38007203e-11, -7.731046439e-10, 2.06237001152e-8, -4.412291442285e-7, 7.3107766249655e-6, -8.91749801028666e-5, 7.34165451384135e-4, -0.0033303085445352071, 0.0015425853045205717, 0.0521100583113136379, -0.1334447768979217815, -0.1401330292364750968, 0.2685616168804818919, 1.6935595e-11, -5.308092192e-10, 1.35323005576e-8, -2.726650587978e-7, 4.151324014176e-6, -4.43353052220157e-5, 2.815740758993879e-4, -4.393235121629007e-4, -0.0067573531105799347, 0.0369141914660130814, 0.0081673361942996237, -0.257338128589888186, 0.0459580257102978932 }; const static double c[70] = { -3.009451757e-11, -1.4958003844e-10, 5.06854544776e-9, 1.863564222012e-8, -6.0304249068078e-7, -1.47686259937403e-6, 4.714331342682714e-5, 6.286305481740818e-5, -0.00214137170594124344, -8.9157336676889788e-4, 0.04508258728666024989, -0.00490362805828762224, -0.27312196367405374426, 0.04193925184293450356, -7.1245356e-12, -4.1170814825e-10, 1.38012624364e-9, 5.704447670683e-8, -1.9026363528842e-7, -5.33925032409729e-6, 1.736064885538091e-5, 3.0692619152608375e-4, -9.2598938200644367e-4, -0.00917934265960017663, 0.02287952522866389076, 0.10545197546252853195, -0.16126443075752985095, -0.19392874768742235538, 2.128344556e-11, -3.1053910272e-10, -3.34979293158e-9, 4.50723289505e-8, 3.6437959146427e-7, -4.46421436266678e-6, -2.523429344576552e-5, 2.7519882931758163e-4, 9.7185076358599358e-4, -0.00898326746345390692, -0.01665959196063987584, 0.11456933464891967814, 0.07885001422733148815, -0.23664819446234712621, 3.035295055e-11, 5.486066835e-11, -5.01026824811e-9, -5.0124684786e-9, 5.8012340163034e-7, 1.6788922416169e-7, -4.373270270147275e-5, 1.183898532719802e-5, 0.00189863342862291449, -0.0011375924956163613, -0.03846797195329871681, 0.02389746880951420335, 0.22837862066532347461, -0.06765394811166522844, 1.279875977e-11, 3.5925958103e-10, -2.28037105967e-9, -4.852770517176e-8, 2.8696428000189e-7, 4.40131125178642e-6, -2.366617753349105e-5, -2.4412456252884129e-4, 0.00113028178539430542, 0.0070847051391978908, -0.02526914792327618386, -0.08006137953480093426, 0.16548380461475971846, 0.14688405470042110229 }; const static double d[52] = { 1.059601355592185731e-14, -2.71150591218550377e-13, 8.6514809056201638e-12, -4.6264028554286627e-10, 5.0815403835647104e-8, -1.76722552048141208e-5, 0.16286750396763997378, 2.949651820598278873e-13, -8.818215611676125741e-12, 3.571119876162253451e-10, -2.63192412099371706e-8, 4.709502795656698909e-6, -0.005208333333333283282, 7.18344107717531977e-15, -2.51623725588410308e-13, 8.6017784918920604e-12, -4.6256876614290359e-10, 5.0815343220437937e-8, -1.7672255176494197e-5, 0.16286750396763433767, 2.2327570859680094777e-13, -8.464594853517051292e-12, 3.563766464349055183e-10, -2.631843986737892965e-8, 4.70950234228865941e-6, -0.0052083333332278466225, 5.15413392842889366e-15, -2.27740238380640162e-13, 8.4827767197609014e-12, -4.6224753682737618e-10, 5.0814848128929134e-8, -1.7672254763876748e-5, 0.16286750396748926663, 1.7316195320192170887e-13, -7.971122772293919646e-12, 3.544039469911895749e-10, -2.631443902081701081e-8, 4.709498228695400603e-6, -0.005208333331514365361, 3.84653681453798517e-15, -2.04464520778789011e-13, 8.3089298605177838e-12, -4.6155016158412096e-10, 5.081326369646665e-8, -1.76722528311426167e-5, 0.1628675039665006593, 1.3797879972460878797e-13, -7.448089381011684812e-12, 3.51273379710695978e-10, -2.630500895563592722e-8, 4.709483934775839193e-6, -0.0052083333227940760113 }; w = fabs(x); if (w < 1) { t = w * w; y = ((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]; } else if (w < 8.5) { t = w * w * 0.0625; k = (int) t; t -= k + 0.5; k *= 13; y = (((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]; } else if (w < 12.5) { k = (int) w; t = w - (k + 0.5); k = 14 * (k - 8); y = ((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]; } else { v = 24 / w; t = v * v; k = 13 * ((int) t); y = ((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * sqrt(v); theta = (((((d[k + 7] * t + d[k + 8]) * t + d[k + 9]) * t + d[k + 10]) * t + d[k + 11]) * t + d[k + 12]) * v - 0.78539816339744830962; y *= cos(w + theta); } return y; } double bessel_J1(double x) { int k; double w, t, y, v, theta; const static double a[8] = { -1.4810349e-13, 3.363594618e-11, -5.65140051697e-9, 6.7816840144764e-7, -5.425347222188379e-5, 0.00260416666666662438, -0.06249999999999999799, 0.49999999999999999998 }; const static double b[65] = { 2.43721316e-12, -9.400554763e-11, 3.0605338998e-9, -8.287270492518e-8, 1.83020515991344e-6, -3.219783841164382e-5, 4.3795830161515318e-4, -0.00442952351530868999, 0.03157908273375945955, -0.14682160488052520107, 0.39309619054093640008, -0.4795280821510107028, 0.1414899934402712514, 1.82119257e-12, -6.862117678e-11, 2.1732790836e-9, -5.69359291782e-8, 1.20771046483277e-6, -2.020151799736374e-5, 2.5745933218048448e-4, -0.00238514907946126334, 0.01499220060892984289, -0.05707238494868888345, 0.10375225210588234727, -0.02721551202427354117, -0.06420643306727498985, 1.352611196e-12, -4.9706947875e-11, 1.527944986332e-9, -3.8602878823401e-8, 7.82618036237845e-7, -1.23499947484511e-5, 1.45508295194426686e-4, -0.001203649737425854162, 0.006299092495799005109, -0.016449840761170764763, 0.002106328565019748701, 0.05852741000686073465, -0.031896615709705053191, 9.97982124e-13, -3.5702556073e-11, 1.062332772617e-9, -2.5779624221725e-8, 4.96382962683556e-7, -7.310776625173004e-6, 7.8028107569541842e-5, -5.50624088538081113e-4, 0.002081442840335570371, -7.71292652260286633e-4, -0.019541271866742634199, 0.033361194224480445382, 0.017516628654559387164, 7.31050661e-13, -2.5404499912e-11, 7.29360079088e-10, -1.6915375004937e-8, 3.06748319652546e-7, -4.151324014331739e-6, 3.8793392054271497e-5, -2.11180556924525773e-4, 2.74577195102593786e-4, 0.003378676555289966782, -0.013842821799754920148, -0.002041834048574905921, 0.032167266073736023299 }; const static double c[70] = { -1.185964494e-11, 3.9110295657e-10, 1.80385519493e-9, -5.575391345723e-8, -1.8635897017174e-7, 5.42738239401869e-6, 1.181490114244279e-5, -3.300031939852107e-4, -3.7717832892725053e-4, 0.01070685852970608288, 0.00356629346707622489, -0.13524776185998074716, 0.00980725611657523952, 0.27312196367405374425, -3.029591097e-11, 9.259293559e-11, 4.96321971223e-9, -1.518137078639e-8, -5.7045127595547e-7, 1.71237271302072e-6, 4.271400348035384e-5, -1.2152454198713258e-4, -0.00184155714921474963, 0.00462994691003219055, 0.03671737063840232452, -0.06863857568599167175, -0.21090395092505707655, 0.16126443075752985095, -2.19760208e-11, -2.7659100729e-10, 3.74295124827e-9, 3.684765777023e-8, -4.5072801091574e-7, -3.27941630669276e-6, 3.5713715545163e-5, 1.7664005411843533e-4, -0.00165119297594774104, -0.00485925381792986774, 0.03593306985381680131, 0.04997877588191962563, -0.22913866929783936544, -0.07885001422733148814, 5.16292316e-12, -3.9445956763e-10, -6.6220021263e-10, 5.511286218639e-8, 5.01257940078e-8, -5.22111059203425e-6, -1.34311394455105e-6, 3.0612891890766805e-4, -7.103391195326182e-5, -0.00949316714311443491, 0.00455036998246516948, 0.11540391585989614784, -0.04779493761902840455, -0.2283786206653234746, 2.697817493e-11, -1.6633326949e-10, -4.3313486035e-9, 2.508404686362e-8, 4.8528284780984e-7, -2.58267851112118e-6, -3.521049080466759e-5, 1.6566324273339952e-4, 0.00146474737522491617, -0.00565140892697147306, -0.028338820556793004, 0.07580744376982855057, 0.16012275906960187978, -0.16548380461475971845 }; const static double d[52] = { -1.272346002224188092e-14, 3.370464692346669075e-13, -1.144940314335484869e-11, 6.863141561083429745e-10, -9.491933932960924159e-8, 5.301676561445687562e-5, 0.162867503967639974, -3.652982212914147794e-13, 1.151126750560028914e-11, -5.165585095674343486e-10, 4.657991250060549892e-8, -1.186794704692706504e-5, 0.01562499999999994026, -8.713069680903981555e-15, 3.140780373478474935e-13, -1.139089186076256597e-11, 6.862299023338785566e-10, -9.491926788274594674e-8, 5.301676558106268323e-5, 0.162867503967646622, -2.792555727162752006e-13, 1.108650207651756807e-11, -5.156745588549830981e-10, 4.657894859077370979e-8, -1.186794650130550256e-5, 0.01562499999987299901, -6.304859171204770696e-15, 2.857249044208791652e-13, -1.124956921556753188e-11, 6.858482894906716661e-10, -9.49186795351689846e-8, 5.301676509057781574e-5, 0.1628675039678191167, -2.185193490132496053e-13, 1.048820673697426074e-11, -5.132819367467680132e-10, 4.65740943737299422e-8, -1.186794150862988921e-5, 0.01562499999779270706, -4.74041720979200985e-15, 2.578715253644144182e-13, -1.104148898414138857e-11, 6.850134201626289183e-10, -9.49167823417491964e-8, 5.301676277588728159e-5, 0.1628675039690033136, -1.75512205749384229e-13, 9.848723331445182397e-12, -5.094535425482245697e-10, 4.656255982268609304e-8, -1.186792402114394891e-5, 0.01562499998712198636 }; w = fabs(x); if (w < 1) { t = w * w; y = (((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]) * w; } else if (w < 8.5) { t = w * w * 0.0625; k = (int) t; t -= k + 0.5; k *= 13; y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * w; } else if (w < 12.5) { k = (int) w; t = w - (k + 0.5); k = 14 * (k - 8); y = ((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]; } else { v = 24 / w; t = v * v; k = 13 * ((int) t); y = ((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * sqrt(v); theta = (((((d[k + 7] * t + d[k + 8]) * t + d[k + 9]) * t + d[k + 10]) * t + d[k + 11]) * t + d[k + 12]) * v - 0.78539816339744830962; y *= sin(w + theta); } return x < 0 ? -y : y; } double bessel_Y0(double x) { int k; double t, y, v, theta; const static double a[16] = { -1.51249795e-12, 2.9979612902e-10, -4.317352912436e-8, 4.31735413787068e-6, -2.763106650893309e-4, 0.0099471839432433894, -0.15915494309189533339, 0.63661977236758134306, 4.09490035e-12, -7.6925095943e-10, 1.0358472550303e-7, -9.49500519343105e-6, 5.3860266685948738e-4, -0.01607396802593822992, 0.17760601686906713536, -0.07380429510868722524 }; const static double b[112] = { -2.958527319e-11, -4.799424787e-11, 7.0761365903e-10, 7.86916310954e-9, 4.40632174633e-8, 1.047420705431e-7, -7.0359581447993e-7, -1.068225180236166e-5, -7.636033201484949e-5, -3.4318294473105478e-4, -5.0019381740765567e-4, 0.00898034680285547482, 0.14783488851798565262, 0.01218096458136948754, -3.790394288e-11, -8.3012324083e-10, -4.16344143065e-9, -1.59750317942e-9, 1.1897479804282e-7, 8.9462034665663e-7, 2.7927785508031e-6, -7.10267818373816e-6, -1.4158631248747538e-4, -8.9512296835766028e-4, -0.00286419212921734238, 0.00448696141199596815, 0.16247276853497028694, 0.16806523426268420517, 4.9508820408e-10, 2.40256475451e-9, -3.4128702476e-9, -7.926555593644e-8, -2.7510687602104e-7, 8.2850014912691e-7, 1.202838962100801e-5, 4.446440998573947e-5, -6.345799532264893e-5, -0.00153636349657759957, -0.00784582749467635199, -0.01091113270659651752, 0.15855078058220179592, 0.33112075987570150227, -1.21381163034e-9, -1.85252445637e-9, 2.782181715752e-8, 9.983716245339e-8, -5.1382328105461e-7, -4.13045112612025e-6, 6.9219807212556e-7, 1.1346881914173059e-4, 4.485714262231131e-4, -7.5862241142011713e-4, -0.01330170710405210993, -0.04337207915110066583, 0.10708263075506099964, 0.46937172516119821029, 1.23954313286e-9, -1.3150647347e-9, -3.208158247443e-8, 6.936208476862e-8, 9.6326321605564e-7, -1.86813677726279e-6, -3.296596487362508e-5, -1.027532398838717e-5, 8.8296805857821394e-4, 0.00288502916411875494, -0.00981551522729451135, -0.08175499367255420548, -0.0197090243242566078, 0.51958016003260732459, -5.0293922567e-10, 2.5905819115e-9, 3.80069015768e-9, -1.257928760583e-7, 2.9666593806065e-7, 5.32199410651341e-6, -1.466013674557952e-5, -2.1196179800800308e-4, 1.488907515797525e-4, 0.00598670133725335804, 0.00917434640154761191, -0.08592436550224288681, -0.1970089491453584694, 0.41202451505149651586, 2.689416111e-11, -6.0225798842e-10, 7.16632287642e-9, -3.038834206093e-8, -4.9829955736697e-7, 3.6467866107985e-6, 2.599276311771812e-5, -1.6374249229498868e-4, -0.00112385259950125883, 0.00342431039748960465, 0.03016663018029814938, -0.02432512430353342927, -0.31797371916576712163, 0.14418001571733803493, 1.9463221e-12, -1.3451327719e-10, 3.36581427068e-9, 2.163920016772e-8, -5.0868502638387e-7, -1.26562372408989e-6, 3.554054033687039e-5, 7.490048474688881e-5, -0.0014238004200886133, -0.00355314274445060456, 0.03042001885994619102, 0.07365497405664882878, -0.26882214651298246524, -0.16578636480856581212 }; const static double c[126] = { 1.4133441141e-10, -1.16239182574e-9, 5.60813675548e-9, 4.361111919906e-8, -1.9980743680592e-7, -6.23828267379045e-6, 2.659779111113435e-5, 3.4429768949740887e-4, -0.00128058451746064875, -0.01165906901727504569, 0.03800023545011044967, 0.13079665132249175616, -0.30099732306965462304, -0.19470500862950453349, 2.985070388e-11, -4.3935370028e-10, -2.70094988368e-9, 5.27013936718e-8, 3.5596645009533e-7, -5.5939305510166e-6, -2.415386269153308e-5, 3.4989509210648774e-4, 9.8204687587121096e-4, -0.01241793885175385487, -0.0139851984097438996, 0.16758045653582919005, 0.02375823895638961834, -0.33948059288191103829, 3.440543098e-11, -1.492311224e-11, -5.50307983816e-9, 2.88861169685e-9, 6.5975576340131e-7, -6.4253433004282e-7, -5.095354686815779e-5, 6.35545499385876e-5, 0.00231750171436134067, -0.00344140664586595266, -0.04796153689875432703, 0.06553727330877767204, 0.27409127395927545297, -0.17324243491898233567, 1.869953108e-11, 3.5678205287e-10, -3.23369443017e-9, -4.932837601739e-8, 4.0636932259569e-7, 4.55294558480472e-6, -3.376596464782138e-5, -2.5758322585307069e-4, 0.00167416927479443727, 0.00735300543429220468, -0.03904554680817849396, -0.07593187710651205994, 0.25912851048611625179, 0.11731328614820863082, -1.168499781e-11, 4.049157062e-10, 1.76042185153e-9, -5.796810963324e-8, -1.7664264701199e-7, 5.65232278687159e-6, 1.060939366068237e-5, -3.4382320897779425e-4, -2.8786871040915476e-4, 0.0110369660250104046, 0.00105742483935856071, -0.13664188676516064192, 0.02616867939853747003, 0.27020510536578747599, -3.09714065e-11, 1.0275535029e-10, 5.07546062007e-9, -1.697584561546e-8, -5.8222618994516e-7, 1.92483899143098e-6, 4.3388818054202e-5, -1.3714074807064326e-4, -0.00184722933402281351, 0.0051736071998208299, 0.03611657815299529568, -0.07491163418624572802, -0.20317989938720766824, 0.17121062620272384486, -2.289344046e-11, -2.7762757821e-10, 3.9133021423e-9, 3.673304032817e-8, -4.7258696909223e-7, -3.23109113206792e-6, 3.749284946160478e-5, 1.7039067180362504e-4, -0.00172637004639815403, -0.00454152531086626043, 0.03717220530377418124, 0.04489395902785574534, -0.23370422835726857839, -0.06753037249787639679, 4.73299038e-12, -4.0489249115e-10, -5.6747261733e-10, 5.656135976496e-8, 3.564150059329e-8, -5.34821220288168e-6, 7.581385461348e-8, 3.1190256463318867e-4, -1.4634564376714538e-4, -0.0095821355155047985, 0.00624681472076521329, 0.11513529702572439703, -0.05794254714300082167, -0.22523211169118786537, 2.732444065e-11, -1.7726475495e-10, -4.37562701999e-9, 2.68153688556e-8, 4.8799100503315e-7, -2.76490187540644e-6, -3.513357925824063e-5, 1.7693155138571443e-4, 0.00144533233498513085, -0.00599106092630544975, -0.02759437856689911694, 0.07945362316083459396, 0.15383825653750118008, -0.17121430684466928734 }; const static double d[52] = { 1.059601355592185731e-14, -2.71150591218550377e-13, 8.6514809056201638e-12, -4.6264028554286627e-10, 5.0815403835647104e-8, -1.76722552048141208e-5, 0.16286750396763997378, 2.949651820598278873e-13, -8.818215611676125741e-12, 3.571119876162253451e-10, -2.63192412099371706e-8, 4.709502795656698909e-6, -0.005208333333333283282, 7.18344107717531977e-15, -2.51623725588410308e-13, 8.6017784918920604e-12, -4.6256876614290359e-10, 5.0815343220437937e-8, -1.7672255176494197e-5, 0.16286750396763433767, 2.2327570859680094777e-13, -8.464594853517051292e-12, 3.563766464349055183e-10, -2.631843986737892965e-8, 4.70950234228865941e-6, -0.0052083333332278466225, 5.15413392842889366e-15, -2.27740238380640162e-13, 8.4827767197609014e-12, -4.6224753682737618e-10, 5.0814848128929134e-8, -1.7672254763876748e-5, 0.16286750396748926663, 1.7316195320192170887e-13, -7.971122772293919646e-12, 3.544039469911895749e-10, -2.631443902081701081e-8, 4.709498228695400603e-6, -0.005208333331514365361, 3.84653681453798517e-15, -2.04464520778789011e-13, 8.3089298605177838e-12, -4.6155016158412096e-10, 5.081326369646665e-8, -1.76722528311426167e-5, 0.1628675039665006593, 1.3797879972460878797e-13, -7.448089381011684812e-12, 3.51273379710695978e-10, -2.630500895563592722e-8, 4.709483934775839193e-6, -0.0052083333227940760113 }; if (x < 0.85) { t = x * x; y = ((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]; y = ((((((a[8] * t + a[9]) * t + a[10]) * t + a[11]) * t + a[12]) * t + a[13]) * t + a[14]) * t + a[15] + y * log(x); } else if (x < 4.5) { t = x - 4 / x; k = (int) (t + 4); t -= k - 3.5; k *= 14; y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]; } else if (x < 12.5) { k = (int) x; t = x - (k + 0.5); k = 14 * (k - 4); y = ((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]; } else { v = 24 / x; t = v * v; k = 13 * ((int) t); y = ((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * sqrt(v); theta = (((((d[k + 7] * t + d[k + 8]) * t + d[k + 9]) * t + d[k + 10]) * t + d[k + 11]) * t + d[k + 12]) * v - 0.78539816339744830962; y *= sin(x + theta); } return y; } double bessel_Y1(double x) { int k; double t, y, v, theta; const static double a[16] = { -9.46499e-14, 2.141432796e-11, -3.5977944347e-9, 4.3173541397185e-7, -3.453883313621946e-5, 0.00165786399054057257, -0.03978873577297383381, 0.31830988618379067154, -5.571931463e-11, 8.93098810365e-9, -9.9267351748541e-7, 7.164268731546281e-5, -0.00295530533604595764, 0.05434868816050718549, -0.1960570906462388432, -0.63661977236758134367 }; const static double b[112] = { 2.553685555e-11, 7.384080449e-11, -2.9605446927e-10, -5.2081739106e-9, -3.676554001376e-8, -1.532652533627e-7, -1.3967947147386e-7, 3.88730181348638e-6, 4.052240780599446e-5, 2.5133005806772436e-4, 0.00109380629039004777, 0.00298157276348996763, 4.7188983238582062e-4, -0.19643830264444486066, 1.056916126e-11, 6.2160122556e-10, 3.85741197273e-9, 7.491469406e-9, -6.306874425799e-8, -6.869833657799e-7, -3.29785491054157e-6, -5.57893716372629e-6, 4.634569030169549e-5, 4.9086790937752985e-4, 0.00256488729380268318, 0.00822571374211646414, 0.01094512145046992425, -0.19159562910398869317, -4.0211480479e-10, -2.29721816531e-9, 6.2931855684e-10, 6.509879184236e-8, 3.1589903600713e-7, -3.093448289001e-8, -8.45532004628483e-6, -4.930719004112743e-5, -9.865914153735679e-5, 4.7059803263198826e-4, 0.00472271367216891688, 0.01915518502418162917, 0.0372239136138415874, -0.1693323078896687811, 1.10728466147e-9, 2.05608441891e-9, -2.536199750468e-8, -1.1751665325851e-7, 3.404534385077e-7, 4.36083390507752e-6, 8.34725302600388e-6, -7.154971448642437e-5, -5.1956165332380432e-4, -0.00100811886858456098, 0.00436854257164588225, 0.03425644258611852849, 0.0907397117201493499, -0.10791597118914788657, -1.17749768422e-9, 1.68403859797e-9, 3.471030171126e-8, -6.227816248757e-8, -1.18405395385178e-6, 1.4478514453927e-7, 3.630744090017806e-5, 1.0481065165516454e-4, -5.2483993430622472e-4, -0.00407014291708523893, -0.00574311514714191566, 0.03534768318503458091, 0.16539360869993020163, 0.01986240425870529979, 4.008050552e-10, -3.36044652853e-9, -9.2387130705e-10, 1.7840823064933e-7, -2.2643988836534e-7, -8.08896250262948e-6, -1.69403516892975e-6, 2.6617475073041589e-4, 7.2562705080786576e-4, -0.00399208199997748377, -0.02399816920965700841, -0.0092557474455754244, 0.2008281402282066699, 0.21040564991987672576, 6.692975871e-11, 1.672202705e-10, -1.433097981251e-8, 5.455077276306e-8, 1.04954046999028e-6, -3.39572219821681e-6, -5.541577161092338e-5, 4.344113487321887e-5, 0.00184798594297387512, 0.0030104150846815045, -0.02789739141907399514, -0.09421628519129373841, 0.09950212445529771576, 0.3749697583874640408, 4.528583204e-11, 6.6861092459e-10, -9.2464816857e-9, -8.002058622489e-8, 8.7578676979688e-7, 6.28456150216647e-6, -4.276239654834506e-5, -3.4630842915911896e-4, 8.9431202169021474e-4, 0.01086380107342193819, 0.00145563493724746238, -0.14193383817937981478, -0.15148562296986494725, 0.35720232689066512346 }; const static double c[126] = { 3.201620498e-10, -1.77431944127e-9, 1.367520951871e-8, -6.171755212447e-8, -4.3602779932091e-7, 1.79827173442894e-6, 4.990624965075363e-5, -1.8618453816525107e-4, -0.00206578613620093339, 0.00640292258731756063, 0.04663627606907821596, -0.11400070635033154332, -0.26159330264498333979, 0.30099732306965462346, -5.9774708e-13, -3.8827648808e-10, 5.27269271362e-9, 2.971059814012e-8, -5.2701406514027e-7, -3.20369808906187e-6, 4.475144442564492e-5, 1.6907703884518866e-4, -0.00209937055264007564, -0.00491023437935628693, 0.0496717554070154514, 0.04195559522923170315, -0.33516091307165838036, -0.02375823895638961835, 2.83380103e-12, -4.4715450235e-10, 1.769519961e-10, 6.05337984007e-8, -2.888550814408e-8, -5.93780185020349e-6, 5.14027455732102e-6, 3.5667482807472357e-4, -3.813272996260773e-4, -0.01158750857180657934, 0.01376562658346365929, 0.14388461069626297876, -0.1310745466175553429, -0.27409127395927545296, 2.683697058e-11, -2.4302161327e-10, -4.30151236236e-9, 3.557058903199e-8, 4.9328952592926e-7, -3.65732389065382e-6, -3.642356546467712e-5, 2.3636175253326716e-4, 0.00154549935517002108, -0.00837084637397210913, -0.02941202173717025197, 0.11713664042453548043, 0.15186375421302413107, -0.25912851048611625179, 2.914434604e-11, 1.5185121893e-10, -4.88084673389e-9, -1.936460341189e-8, 5.7968735781303e-7, 1.58978381365925e-6, -4.521858314881102e-5, -7.426575562367423e-5, 0.00206293925392279862, 0.00143934355204571641, -0.04414786410004317489, -0.00317227451807568106, 0.273283773530321296, -0.02616867939853747003, 6.44550655e-12, 4.0249587279e-10, -1.23789833341e-9, -5.58299757877e-8, 1.6975984093144e-7, 5.24003568623094e-6, -1.539871212028104e-5, -3.0372172637669852e-4, 8.2284448843625174e-4, 0.00923614667011392611, -0.02069442879928366384, -0.10834973445898588438, 0.14982326837249145873, 0.20317989938720766823, -2.115691215e-11, 2.9752035314e-10, 3.34739862269e-9, -4.304625868398e-8, -3.6733494871207e-7, 4.25328270524107e-6, 2.584872967637478e-5, -2.6244994622929809e-4, -0.00102234403086242668, 0.00863185023199066935, 0.01816610124346617164, -0.11151661591132254182, -0.0897879180557114995, 0.23370422835726857838, -2.957977086e-11, -6.150420279e-11, 4.88089472193e-9, 6.24218182859e-9, -5.6561995267846e-7, -3.2077350100271e-7, 4.27856984896483e-5, -5.3069698280036e-7, -0.0018714153878560023, 7.3172821883575326e-4, 0.03832854206202077374, -0.01874044416229564036, -0.2302705940514488064, 0.05794254714300082167, -1.203179184e-11, -3.5509887475e-10, 2.13620090322e-9, 4.813181550803e-8, -2.6815627351126e-7, -4.39191902440609e-6, 2.211921535574542e-5, 2.45935054805247e-4, -0.00106158930833741898, -0.00722666167492552731, 0.02396424370522244155, 0.08278313570069734843, -0.15890724632166919294, -0.15383825653750118007 }; const static double d[52] = { -1.272346002224188092e-14, 3.370464692346669075e-13, -1.144940314335484869e-11, 6.863141561083429745e-10, -9.491933932960924159e-8, 5.301676561445687562e-5, 0.162867503967639974, -3.652982212914147794e-13, 1.151126750560028914e-11, -5.165585095674343486e-10, 4.657991250060549892e-8, -1.186794704692706504e-5, 0.01562499999999994026, -8.713069680903981555e-15, 3.140780373478474935e-13, -1.139089186076256597e-11, 6.862299023338785566e-10, -9.491926788274594674e-8, 5.301676558106268323e-5, 0.162867503967646622, -2.792555727162752006e-13, 1.108650207651756807e-11, -5.156745588549830981e-10, 4.657894859077370979e-8, -1.186794650130550256e-5, 0.01562499999987299901, -6.304859171204770696e-15, 2.857249044208791652e-13, -1.124956921556753188e-11, 6.858482894906716661e-10, -9.49186795351689846e-8, 5.301676509057781574e-5, 0.1628675039678191167, -2.185193490132496053e-13, 1.048820673697426074e-11, -5.132819367467680132e-10, 4.65740943737299422e-8, -1.186794150862988921e-5, 0.01562499999779270706, -4.74041720979200985e-15, 2.578715253644144182e-13, -1.104148898414138857e-11, 6.850134201626289183e-10, -9.49167823417491964e-8, 5.301676277588728159e-5, 0.1628675039690033136, -1.75512205749384229e-13, 9.848723331445182397e-12, -5.094535425482245697e-10, 4.656255982268609304e-8, -1.186792402114394891e-5, 0.01562499998712198636 }; if (x < 0.85) { t = x * x; y = (((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]) * x; y = (((((((a[8] * t + a[9]) * t + a[10]) * t + a[11]) * t + a[12]) * t + a[13]) * t + a[14]) * t + a[15]) / x + y * log(x); } else if (x < 4.15) { v = 4 / x; t = x - v; k = (int) (t + 4); t -= k - 3.5; k *= 14; y = (((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]) * v; } else if (x < 12.5) { k = (int) x; t = x - (k + 0.5); k = 14 * (k - 4); y = ((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]; } else { v = 24 / x; t = v * v; k = 13 * ((int) t); y = ((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * sqrt(v); theta = (((((d[k + 7] * t + d[k + 8]) * t + d[k + 9]) * t + d[k + 10]) * t + d[k + 11]) * t + d[k + 12]) * v - 0.78539816339744830962; y *= -cos(x + theta); } return y; } double bessel_I0(double x) { int k; double w, t, y; const static double a[65] = { 8.5246820682016865877e-11, 2.5966600546497407288e-9, 7.9689994568640180274e-8, 1.9906710409667748239e-6, 4.0312469446528002532e-5, 6.4499871606224265421e-4, 0.0079012345761930579108, 0.071111111109207045212, 0.444444444444724909, 1.7777777777777532045, 4.0000000000000011182, 3.99999999999999998, 1.0000000000000000001, 1.1520919130377195927e-10, 2.2287613013610985225e-9, 8.1903951930694585113e-8, 1.9821560631611544984e-6, 4.0335461940910133184e-5, 6.4495330974432203401e-4, 0.0079013012611467520626, 0.071111038160875566622, 0.44444450319062699316, 1.7777777439146450067, 4.0000000132337935071, 3.9999999968569015366, 1.0000000003426703174, 1.5476870780515238488e-10, 1.2685004214732975355e-9, 9.2776861851114223267e-8, 1.9063070109379044378e-6, 4.0698004389917945832e-5, 6.4370447244298070713e-4, 0.0079044749458444976958, 0.071105052411749363882, 0.44445280640924755082, 1.7777694934432109713, 4.0000055808824003386, 3.9999977081165740932, 1.0000004333949319118, 2.0675200625006793075e-10, -6.1689554705125681442e-10, 1.2436765915401571654e-7, 1.5830429403520613423e-6, 4.2947227560776583326e-5, 6.3249861665073441312e-4, 0.0079454472840953930811, 0.070994327785661860575, 0.44467219586283000332, 1.7774588182255374745, 4.0003038986252717972, 3.9998233869142057195, 1.0000472932961288324, 2.7475684794982708655e-10, -3.8991472076521332023e-9, 1.9730170483976049388e-7, 5.9651531561967674521e-7, 5.1992971474748995357e-5, 5.7327338675433770752e-4, 0.0082293143836530412024, 0.069990934858728039037, 0.44726764292723985087, 1.7726685170014087784, 4.0062907863712704432, 3.9952750700487845355, 1.0016354346654179322 }; const static double b[70] = { 6.7852367144945531383e-8, 4.6266061382821826854e-7, 6.9703135812354071774e-6, 7.6637663462953234134e-5, 7.9113515222612691636e-4, 0.0073401204731103808981, 0.060677114958668837046, 0.43994941411651569622, 2.7420017097661750609, 14.289661921740860534, 59.820609640320710779, 188.78998681199150629, 399.8731367825601118, 427.56411572180478514, 1.8042097874891098754e-7, 1.2277164312044637357e-6, 1.8484393221474274861e-5, 2.0293995900091309208e-4, 0.0020918539850246207459, 0.019375315654033949297, 0.15985869016767185908, 1.1565260527420641724, 7.1896341224206072113, 37.354773811947484532, 155.80993164266268457, 489.5211371158540918, 1030.9147225169564806, 1093.5883545113746958, 4.8017305613187493564e-7, 3.261317843912380074e-6, 4.9073137508166159639e-5, 5.3806506676487583755e-4, 0.0055387918291051866561, 0.051223717488786549025, 0.42190298621367914765, 3.0463625987357355872, 18.895299447327733204, 97.915189029455461554, 407.13940115493494659, 1274.3088990480582632, 2670.9883037012547506, 2815.7166284662544712, 1.2789926338424623394e-6, 8.6718263067604918916e-6, 1.3041508821299929489e-4, 0.001428224737372747892, 0.014684070635768789378, 0.13561403190404185755, 1.1152592585977393953, 8.0387088559465389038, 49.761318895895479206, 257.2684232313529138, 1066.8543146269566231, 3328.3874581009636362, 6948.8586598121634874, 7288.4893398212481055, 3.409350368197032893e-6, 2.3079025203103376076e-5, 3.4691373283901830239e-4, 0.003794994977222908545, 0.038974209677945602145, 0.3594948380414878371, 2.9522878893539528226, 21.246564609514287056, 131.28727387146173141, 677.38107093296675421, 2802.3724744545046518, 8718.5731420798254081, 18141.348781638832286, 18948.925349296308859 }; const static double c[45] = { 2.5568678676452702768e-15, 3.0393953792305924324e-14, 6.3343751991094840009e-13, 1.5041298011833009649e-11, 4.4569436918556541414e-10, 1.746393051427167951e-8, 1.0059224011079852317e-6, 1.0729838945088577089e-4, 0.05150322693642527738, 5.2527963991711562216e-15, 7.202118481421005641e-15, 7.2561421229904797156e-13, 1.482312146673104251e-11, 4.4602670450376245434e-10, 1.7463600061788679671e-8, 1.005922609132234756e-6, 1.0729838937545111487e-4, 0.051503226936437300716, 1.3365917359358069908e-14, -1.2932643065888544835e-13, 1.7450199447905602915e-12, 1.0419051209056979788e-11, 4.58047881980598326e-10, 1.7442405450073548966e-8, 1.0059461453281292278e-6, 1.0729837434500161228e-4, 0.051503226940658446941, 5.3771611477352308649e-14, -1.1396193006413731702e-12, 1.2858641335221653409e-11, -5.9802086004570057703e-11, 7.3666894305929510222e-10, 1.6731837150730356448e-8, 1.0070831435812128922e-6, 1.0729733111203704813e-4, 0.051503227360726294675, 3.7819492084858931093e-14, -4.8600496888588034879e-13, 1.6898350504817224909e-12, 4.5884624327524255865e-11, 1.2521615963377513729e-10, 1.8959658437754727957e-8, 1.0020716710561353622e-6, 1.073037119856927559e-4, 0.05150322383300230775 }; w = fabs(x); if (w < 8.5) { t = w * w * 0.0625; k = 13 * ((int) t); y = (((((((((((a[k] * t + a[k + 1]) * t + a[k + 2]) * t + a[k + 3]) * t + a[k + 4]) * t + a[k + 5]) * t + a[k + 6]) * t + a[k + 7]) * t + a[k + 8]) * t + a[k + 9]) * t + a[k + 10]) * t + a[k + 11]) * t + a[k + 12]; } else if (w < 12.5) { k = (int) w; t = w - k; k = 14 * (k - 8); y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]; } else { t = 60 / w; k = 9 * ((int) t); y = ((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * sqrt(t) * exp(w); } return y; } double logbessel_I0(double x) { int k; double w, t, y; const static double a[65] = { 8.5246820682016865877e-11, 2.5966600546497407288e-9, 7.9689994568640180274e-8, 1.9906710409667748239e-6, 4.0312469446528002532e-5, 6.4499871606224265421e-4, 0.0079012345761930579108, 0.071111111109207045212, 0.444444444444724909, 1.7777777777777532045, 4.0000000000000011182, 3.99999999999999998, 1.0000000000000000001, 1.1520919130377195927e-10, 2.2287613013610985225e-9, 8.1903951930694585113e-8, 1.9821560631611544984e-6, 4.0335461940910133184e-5, 6.4495330974432203401e-4, 0.0079013012611467520626, 0.071111038160875566622, 0.44444450319062699316, 1.7777777439146450067, 4.0000000132337935071, 3.9999999968569015366, 1.0000000003426703174, 1.5476870780515238488e-10, 1.2685004214732975355e-9, 9.2776861851114223267e-8, 1.9063070109379044378e-6, 4.0698004389917945832e-5, 6.4370447244298070713e-4, 0.0079044749458444976958, 0.071105052411749363882, 0.44445280640924755082, 1.7777694934432109713, 4.0000055808824003386, 3.9999977081165740932, 1.0000004333949319118, 2.0675200625006793075e-10, -6.1689554705125681442e-10, 1.2436765915401571654e-7, 1.5830429403520613423e-6, 4.2947227560776583326e-5, 6.3249861665073441312e-4, 0.0079454472840953930811, 0.070994327785661860575, 0.44467219586283000332, 1.7774588182255374745, 4.0003038986252717972, 3.9998233869142057195, 1.0000472932961288324, 2.7475684794982708655e-10, -3.8991472076521332023e-9, 1.9730170483976049388e-7, 5.9651531561967674521e-7, 5.1992971474748995357e-5, 5.7327338675433770752e-4, 0.0082293143836530412024, 0.069990934858728039037, 0.44726764292723985087, 1.7726685170014087784, 4.0062907863712704432, 3.9952750700487845355, 1.0016354346654179322 }; const static double b[70] = { 6.7852367144945531383e-8, 4.6266061382821826854e-7, 6.9703135812354071774e-6, 7.6637663462953234134e-5, 7.9113515222612691636e-4, 0.0073401204731103808981, 0.060677114958668837046, 0.43994941411651569622, 2.7420017097661750609, 14.289661921740860534, 59.820609640320710779, 188.78998681199150629, 399.8731367825601118, 427.56411572180478514, 1.8042097874891098754e-7, 1.2277164312044637357e-6, 1.8484393221474274861e-5, 2.0293995900091309208e-4, 0.0020918539850246207459, 0.019375315654033949297, 0.15985869016767185908, 1.1565260527420641724, 7.1896341224206072113, 37.354773811947484532, 155.80993164266268457, 489.5211371158540918, 1030.9147225169564806, 1093.5883545113746958, 4.8017305613187493564e-7, 3.261317843912380074e-6, 4.9073137508166159639e-5, 5.3806506676487583755e-4, 0.0055387918291051866561, 0.051223717488786549025, 0.42190298621367914765, 3.0463625987357355872, 18.895299447327733204, 97.915189029455461554, 407.13940115493494659, 1274.3088990480582632, 2670.9883037012547506, 2815.7166284662544712, 1.2789926338424623394e-6, 8.6718263067604918916e-6, 1.3041508821299929489e-4, 0.001428224737372747892, 0.014684070635768789378, 0.13561403190404185755, 1.1152592585977393953, 8.0387088559465389038, 49.761318895895479206, 257.2684232313529138, 1066.8543146269566231, 3328.3874581009636362, 6948.8586598121634874, 7288.4893398212481055, 3.409350368197032893e-6, 2.3079025203103376076e-5, 3.4691373283901830239e-4, 0.003794994977222908545, 0.038974209677945602145, 0.3594948380414878371, 2.9522878893539528226, 21.246564609514287056, 131.28727387146173141, 677.38107093296675421, 2802.3724744545046518, 8718.5731420798254081, 18141.348781638832286, 18948.925349296308859 }; const static double c[45] = { 2.5568678676452702768e-15, 3.0393953792305924324e-14, 6.3343751991094840009e-13, 1.5041298011833009649e-11, 4.4569436918556541414e-10, 1.746393051427167951e-8, 1.0059224011079852317e-6, 1.0729838945088577089e-4, 0.05150322693642527738, 5.2527963991711562216e-15, 7.202118481421005641e-15, 7.2561421229904797156e-13, 1.482312146673104251e-11, 4.4602670450376245434e-10, 1.7463600061788679671e-8, 1.005922609132234756e-6, 1.0729838937545111487e-4, 0.051503226936437300716, 1.3365917359358069908e-14, -1.2932643065888544835e-13, 1.7450199447905602915e-12, 1.0419051209056979788e-11, 4.58047881980598326e-10, 1.7442405450073548966e-8, 1.0059461453281292278e-6, 1.0729837434500161228e-4, 0.051503226940658446941, 5.3771611477352308649e-14, -1.1396193006413731702e-12, 1.2858641335221653409e-11, -5.9802086004570057703e-11, 7.3666894305929510222e-10, 1.6731837150730356448e-8, 1.0070831435812128922e-6, 1.0729733111203704813e-4, 0.051503227360726294675, 3.7819492084858931093e-14, -4.8600496888588034879e-13, 1.6898350504817224909e-12, 4.5884624327524255865e-11, 1.2521615963377513729e-10, 1.8959658437754727957e-8, 1.0020716710561353622e-6, 1.073037119856927559e-4, 0.05150322383300230775 }; w = fabs(x); if (w < 8.5) { t = w * w * 0.0625; k = 13 * ((int) t); y = (((((((((((a[k] * t + a[k + 1]) * t + a[k + 2]) * t + a[k + 3]) * t + a[k + 4]) * t + a[k + 5]) * t + a[k + 6]) * t + a[k + 7]) * t + a[k + 8]) * t + a[k + 9]) * t + a[k + 10]) * t + a[k + 11]) * t + a[k + 12]; return log(y); } else if (w < 12.5) { k = (int) w; t = w - k; k = 14 * (k - 8); y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]; return log(y); } else { t = 60 / w; k = 9 * ((int) t); y = ((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]); return log(y)+w+0.5*log(t); } } double bessel_I1(double x) { int k; double w, t, y; const static double a[60] = { 1.2787464404046789181e-10, 3.5705860060088241077e-9, 9.961153761934733504e-8, 2.2395070088633043177e-6, 4.0312466928887462346e-5, 5.6437387840203722356e-4, 0.0059259259312934746096, 0.04444444444349900887, 0.22222222222232042719, 0.66666666666666139867, 1.0000000000000001106, 0.49999999999999999962, 1.7281952384448634449e-10, 3.064720455997639013e-9, 1.0237662138842827028e-7, 2.2299494417341498163e-6, 4.0335364374929326943e-5, 5.6433440269141349899e-4, 0.0059259754885893798654, 0.04444439941088039787, 0.2222222511283502673, 0.66666665422146063244, 1.0000000032274936821, 0.49999999961866867205, 2.3216048939948030996e-10, 1.7443372702334489579e-9, 1.1596478963485415499e-7, 2.1446755518623035147e-6, 4.0697440347437076195e-5, 5.6324394900433192204e-4, 0.0059283484996093060678, 0.044440673899150997921, 0.2222263801685265786, 0.66666358151576732094, 1.0000013834029985337, 0.49999971643129650249, 3.1013758938255172562e-10, -8.4813676145611694984e-10, 1.5544980187411802596e-7, 1.7811109378708045726e-6, 4.2945322199060856985e-5, 5.5344850176852353639e-4, 0.0059590327716950614802, 0.044371611097707060659, 0.22233578241986401111, 0.6665474730046331531, 1.0000756505206705927, 0.49997803664415994554, 4.1214758313965020365e-10, -5.361331773534742944e-9, 2.4661360807517345161e-7, 6.7144593918926723203e-7, 5.1988027944945587571e-5, 5.0165568586065803067e-4, 0.0061717530047005289953, 0.043745229577317251404, 0.22363147971477747996, 0.6647546913111766024, 1.0015686689447547657, 0.49941120439785391891 }; const static double b[70] = { 6.6324787943143095845e-8, 4.5125928898466638619e-7, 6.7937793134877246623e-6, 7.4580507871505926302e-5, 7.6866382927334005919e-4, 0.0071185174803491859307, 0.058721838073486424416, 0.42473949281714196041, 2.6396965606282079123, 13.710008536637016903, 57.158647688180932003, 179.46182892089389037, 377.57997362398478619, 399.87313678256009819, 1.7652713206027939711e-7, 1.1988179244834708057e-6, 1.8037851545747139231e-5, 1.9775785516370314656e-4, 0.0020354870702829387283, 0.0188221641910322536, 0.15500485219010424263, 1.119010001056057321, 6.9391565185406617552, 35.948170579648649345, 149.41909525103032616, 467.42979492780642582, 979.04227423171290408, 1030.9147225169564443, 4.7022299276154507603e-7, 3.1878571710170115972e-6, 4.7940153875711448496e-5, 5.2496623508411440227e-4, 0.0053968661134780824779, 0.049837081920693776234, 0.40979593830387765545, 2.9533186922862948404, 18.278176130722516369, 94.47649715018912107, 391.66075612645333624, 1221.4182034643210345, 2548.6177980961291004, 2670.9883037012546541, 1.2535083724002034147e-6, 8.484587142065570825e-6, 1.2753227372734042108e-4, 0.0013950105363562648921, 0.014325473993765291906, 0.13212452778932829125, 1.0849287786885151432, 7.8068089156260172673, 48.232254570679165833, 248.80659424902394371, 1029.0736929484210803, 3200.5629438795801652, 6656.7749162019607914, 6948.8586598121632302, 3.3439394490599745013e-6, 2.2600596902211837757e-5, 3.3955927589987356838e-4, 0.0037105306061050972474, 0.038065263634919156421, 0.35068223415665236079, 2.8760027832105027316, 20.665999500843274339, 127.47939148516390205, 656.43636874254000885, 2709.524283793247992, 8407.1174233600734871, 17437.146284159740233, 18141.3487816388316 }; const static double c[45] = { -2.8849790431465382128e-15, -3.5125350943844774657e-14, -7.485086701370741975e-13, -1.8383904048277485153e-11, -5.7303556446977223342e-10, -2.4449502737311496525e-8, -1.6765373351766929724e-6, -3.2189516835265773471e-4, 0.051503226936425277377, -5.8674306822281631119e-15, -9.4884898451194085565e-15, -8.503386513660036434e-13, -1.8142997866945285736e-11, -5.7340238386338193949e-10, -2.4449138101742183665e-8, -1.6765375646678855842e-6, -3.2189516826945356325e-4, 0.051503226936412017608, -1.4723362506764340882e-14, 1.3945147385179042899e-13, -1.9618041857586930923e-12, -1.3343606394065121821e-11, -5.8649674606973244159e-10, -2.4426060539669553778e-8, -1.6765631828366988006e-6, -3.2189515191449587253e-4, 0.051503226931820146445, -5.8203519372580372987e-14, 1.2266326995309845825e-12, -1.3921625844526453237e-11, 6.2228025878281625469e-11, -8.8636681342142794023e-10, -2.3661241616744818608e-8, -1.6777870960740520557e-6, -3.2189402882677074318e-4, 0.051503226479551959376, -4.5801527369223291722e-14, 6.7998819697143727209e-13, -4.1624857909290468421e-12, -3.2849009406112440998e-11, -3.247827569043111827e-10, -2.5739209934053714983e-8, -1.6730566573215739195e-6, -3.2190010909008684076e-4, 0.05150322986693207715 }; w = fabs(x); if (w < 8.5) { t = w * w * 0.0625; k = 12 * ((int) t); y = (((((((((((a[k] * t + a[k + 1]) * t + a[k + 2]) * t + a[k + 3]) * t + a[k + 4]) * t + a[k + 5]) * t + a[k + 6]) * t + a[k + 7]) * t + a[k + 8]) * t + a[k + 9]) * t + a[k + 10]) * t + a[k + 11]) * w; } else if (w < 12.5) { k = (int) w; t = w - k; k = 14 * (k - 8); y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]; } else { t = 60 / w; k = 9 * ((int) t); y = ((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * sqrt(t) * exp(w); } return x < 0 ? -y : y; } double bessel_K0(double x) { int k; double t, y, v, theta; const static double a[16] = { -1.51249795e-12, 2.9979612902e-10, -4.317352912436e-8, 4.31735413787068e-6, -2.763106650893309e-4, 0.0099471839432433894, -0.15915494309189533339, 0.63661977236758134306, 4.09490035e-12, -7.6925095943e-10, 1.0358472550303e-7, -9.49500519343105e-6, 5.3860266685948738e-4, -0.01607396802593822992, 0.17760601686906713536, -0.07380429510868722524 }; const static double b[112] = { -2.958527319e-11, -4.799424787e-11, 7.0761365903e-10, 7.86916310954e-9, 4.40632174633e-8, 1.047420705431e-7, -7.0359581447993e-7, -1.068225180236166e-5, -7.636033201484949e-5, -3.4318294473105478e-4, -5.0019381740765567e-4, 0.00898034680285547482, 0.14783488851798565262, 0.01218096458136948754, -3.790394288e-11, -8.3012324083e-10, -4.16344143065e-9, -1.59750317942e-9, 1.1897479804282e-7, 8.9462034665663e-7, 2.7927785508031e-6, -7.10267818373816e-6, -1.4158631248747538e-4, -8.9512296835766028e-4, -0.00286419212921734238, 0.00448696141199596815, 0.16247276853497028694, 0.16806523426268420517, 4.9508820408e-10, 2.40256475451e-9, -3.4128702476e-9, -7.926555593644e-8, -2.7510687602104e-7, 8.2850014912691e-7, 1.202838962100801e-5, 4.446440998573947e-5, -6.345799532264893e-5, -0.00153636349657759957, -0.00784582749467635199, -0.01091113270659651752, 0.15855078058220179592, 0.33112075987570150227, -1.21381163034e-9, -1.85252445637e-9, 2.782181715752e-8, 9.983716245339e-8, -5.1382328105461e-7, -4.13045112612025e-6, 6.9219807212556e-7, 1.1346881914173059e-4, 4.485714262231131e-4, -7.5862241142011713e-4, -0.01330170710405210993, -0.04337207915110066583, 0.10708263075506099964, 0.46937172516119821029, 1.23954313286e-9, -1.3150647347e-9, -3.208158247443e-8, 6.936208476862e-8, 9.6326321605564e-7, -1.86813677726279e-6, -3.296596487362508e-5, -1.027532398838717e-5, 8.8296805857821394e-4, 0.00288502916411875494, -0.00981551522729451135, -0.08175499367255420548, -0.0197090243242566078, 0.51958016003260732459, -5.0293922567e-10, 2.5905819115e-9, 3.80069015768e-9, -1.257928760583e-7, 2.9666593806065e-7, 5.32199410651341e-6, -1.466013674557952e-5, -2.1196179800800308e-4, 1.488907515797525e-4, 0.00598670133725335804, 0.00917434640154761191, -0.08592436550224288681, -0.1970089491453584694, 0.41202451505149651586, 2.689416111e-11, -6.0225798842e-10, 7.16632287642e-9, -3.038834206093e-8, -4.9829955736697e-7, 3.6467866107985e-6, 2.599276311771812e-5, -1.6374249229498868e-4, -0.00112385259950125883, 0.00342431039748960465, 0.03016663018029814938, -0.02432512430353342927, -0.31797371916576712163, 0.14418001571733803493, 1.9463221e-12, -1.3451327719e-10, 3.36581427068e-9, 2.163920016772e-8, -5.0868502638387e-7, -1.26562372408989e-6, 3.554054033687039e-5, 7.490048474688881e-5, -0.0014238004200886133, -0.00355314274445060456, 0.03042001885994619102, 0.07365497405664882878, -0.26882214651298246524, -0.16578636480856581212 }; const static double c[126] = { 1.4133441141e-10, -1.16239182574e-9, 5.60813675548e-9, 4.361111919906e-8, -1.9980743680592e-7, -6.23828267379045e-6, 2.659779111113435e-5, 3.4429768949740887e-4, -0.00128058451746064875, -0.01165906901727504569, 0.03800023545011044967, 0.13079665132249175616, -0.30099732306965462304, -0.19470500862950453349, 2.985070388e-11, -4.3935370028e-10, -2.70094988368e-9, 5.27013936718e-8, 3.5596645009533e-7, -5.5939305510166e-6, -2.415386269153308e-5, 3.4989509210648774e-4, 9.8204687587121096e-4, -0.01241793885175385487, -0.0139851984097438996, 0.16758045653582919005, 0.02375823895638961834, -0.33948059288191103829, 3.440543098e-11, -1.492311224e-11, -5.50307983816e-9, 2.88861169685e-9, 6.5975576340131e-7, -6.4253433004282e-7, -5.095354686815779e-5, 6.35545499385876e-5, 0.00231750171436134067, -0.00344140664586595266, -0.04796153689875432703, 0.06553727330877767204, 0.27409127395927545297, -0.17324243491898233567, 1.869953108e-11, 3.5678205287e-10, -3.23369443017e-9, -4.932837601739e-8, 4.0636932259569e-7, 4.55294558480472e-6, -3.376596464782138e-5, -2.5758322585307069e-4, 0.00167416927479443727, 0.00735300543429220468, -0.03904554680817849396, -0.07593187710651205994, 0.25912851048611625179, 0.11731328614820863082, -1.168499781e-11, 4.049157062e-10, 1.76042185153e-9, -5.796810963324e-8, -1.7664264701199e-7, 5.65232278687159e-6, 1.060939366068237e-5, -3.4382320897779425e-4, -2.8786871040915476e-4, 0.0110369660250104046, 0.00105742483935856071, -0.13664188676516064192, 0.02616867939853747003, 0.27020510536578747599, -3.09714065e-11, 1.0275535029e-10, 5.07546062007e-9, -1.697584561546e-8, -5.8222618994516e-7, 1.92483899143098e-6, 4.3388818054202e-5, -1.3714074807064326e-4, -0.00184722933402281351, 0.0051736071998208299, 0.03611657815299529568, -0.07491163418624572802, -0.20317989938720766824, 0.17121062620272384486, -2.289344046e-11, -2.7762757821e-10, 3.9133021423e-9, 3.673304032817e-8, -4.7258696909223e-7, -3.23109113206792e-6, 3.749284946160478e-5, 1.7039067180362504e-4, -0.00172637004639815403, -0.00454152531086626043, 0.03717220530377418124, 0.04489395902785574534, -0.23370422835726857839, -0.06753037249787639679, 4.73299038e-12, -4.0489249115e-10, -5.6747261733e-10, 5.656135976496e-8, 3.564150059329e-8, -5.34821220288168e-6, 7.581385461348e-8, 3.1190256463318867e-4, -1.4634564376714538e-4, -0.0095821355155047985, 0.00624681472076521329, 0.11513529702572439703, -0.05794254714300082167, -0.22523211169118786537, 2.732444065e-11, -1.7726475495e-10, -4.37562701999e-9, 2.68153688556e-8, 4.8799100503315e-7, -2.76490187540644e-6, -3.513357925824063e-5, 1.7693155138571443e-4, 0.00144533233498513085, -0.00599106092630544975, -0.02759437856689911694, 0.07945362316083459396, 0.15383825653750118008, -0.17121430684466928734 }; const static double d[52] = { 1.059601355592185731e-14, -2.71150591218550377e-13, 8.6514809056201638e-12, -4.6264028554286627e-10, 5.0815403835647104e-8, -1.76722552048141208e-5, 0.16286750396763997378, 2.949651820598278873e-13, -8.818215611676125741e-12, 3.571119876162253451e-10, -2.63192412099371706e-8, 4.709502795656698909e-6, -0.005208333333333283282, 7.18344107717531977e-15, -2.51623725588410308e-13, 8.6017784918920604e-12, -4.6256876614290359e-10, 5.0815343220437937e-8, -1.7672255176494197e-5, 0.16286750396763433767, 2.2327570859680094777e-13, -8.464594853517051292e-12, 3.563766464349055183e-10, -2.631843986737892965e-8, 4.70950234228865941e-6, -0.0052083333332278466225, 5.15413392842889366e-15, -2.27740238380640162e-13, 8.4827767197609014e-12, -4.6224753682737618e-10, 5.0814848128929134e-8, -1.7672254763876748e-5, 0.16286750396748926663, 1.7316195320192170887e-13, -7.971122772293919646e-12, 3.544039469911895749e-10, -2.631443902081701081e-8, 4.709498228695400603e-6, -0.005208333331514365361, 3.84653681453798517e-15, -2.04464520778789011e-13, 8.3089298605177838e-12, -4.6155016158412096e-10, 5.081326369646665e-8, -1.76722528311426167e-5, 0.1628675039665006593, 1.3797879972460878797e-13, -7.448089381011684812e-12, 3.51273379710695978e-10, -2.630500895563592722e-8, 4.709483934775839193e-6, -0.0052083333227940760113 }; if (x < 0.85) { t = x * x; y = ((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]; y = ((((((a[8] * t + a[9]) * t + a[10]) * t + a[11]) * t + a[12]) * t + a[13]) * t + a[14]) * t + a[15] + y * log(x); } else if (x < 4.5) { t = x - 4 / x; k = (int) (t + 4); t -= k - 3.5; k *= 14; y = ((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]; } else if (x < 12.5) { k = (int) x; t = x - (k + 0.5); k = 14 * (k - 4); y = ((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]; } else { v = 24 / x; t = v * v; k = 13 * ((int) t); y = ((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * sqrt(v); theta = (((((d[k + 7] * t + d[k + 8]) * t + d[k + 9]) * t + d[k + 10]) * t + d[k + 11]) * t + d[k + 12]) * v - 0.78539816339744830962; y *= sin(x + theta); } return y; } double bessel_K1(double x) { int k; double t, y, v; const static double a[16] = { 1.5151605362537935201e-13, 3.363790951353651035e-11, 5.6514041131016827202e-9, 6.7816840255069534052e-7, 5.4253472222259226487e-5, 0.0026041666666666637057, 0.06250000000000000009, 0.5, -8.9790303384748696588e-11, -1.4029047449249185771e-8, -1.5592893752540998113e-6, -1.1253607018469017569e-4, -0.0046421827665011579173, -0.085370719728648409609, -0.3079657578292062966, 1.0000000000000000004 }; const static double b[120] = { -9.4055461896630579928e-12, 3.1307934665844664773e-11, 4.2005295001519243251e-10, -4.1636196779679820012e-9, 1.4483026181700966164e-8, 1.1661000205428816914e-8, -3.5023996724943046209e-7, 1.4404279316339005012e-6, 5.358156415715824208e-7, -3.5249754038612334639e-5, 1.7150324075631641453e-4, -4.1276362611239191024e-5, -0.0046943110979636602591, 0.035085369853392357659, 0.20063574339907819159, 3.3998989888944034586e-11, 7.1558979072937373055e-11, -2.9226856932927698732e-9, 1.4591620256525610213e-8, -6.6141635609854161666e-9, -1.9991101838984472332e-7, 5.9185836628873530572e-7, 1.9562880347358085687e-6, -1.5814366450418102764e-5, 7.6791682910944612028e-6, 2.8354678948323983936e-4, -0.0010217932669418690641, -0.0032205661865210048433, 0.043497494842354644077, 0.16110284302315089935, -2.0933987679665541827e-10, 7.9503322090520447316e-10, 3.8000150948242575774e-9, -2.3076136195585571309e-8, -2.3902880302550799653e-8, 3.1914500937804377478e-7, 3.2639909831082417694e-7, -5.3166994792995439449e-6, -3.1109524694269240094e-6, 9.2575906966353273247e-5, 7.5063709094147644746e-7, -0.0017416491592625765379, 0.0012138560335171676007, 0.045879687144659643175, 0.11566544716132846709, 3.1582384905164908749e-10, -1.9959561818098999516e-9, 8.6959328920030927557e-10, 1.1642778282445577109e-8, 4.3552264337818440471e-8, -1.5057982160481803238e-7, -1.0101729117980989857e-6, 7.7002002510177612013e-7, 1.9580574235590194233e-5, 1.9358461980242834361e-5, -3.3932339942485532728e-4, -9.3416673584325090073e-4, 0.0055800080455912847227, 0.038668683062477179235, 0.072651643500517000658, -1.1554749629758510059e-10, 8.2270678758893273006e-10, -5.0211156951551538591e-10, -1.4929179050554858361e-9, -2.7107940791526366702e-8, -4.2204764086705349384e-8, 3.7253098167927628867e-7, 2.4374697215363361156e-6, 1.414194200690976837e-6, -4.8766389019473918231e-5, -2.1681387247526720978e-4, 2.9325729929653405236e-4, 0.0064087534504827239815, 0.026054628289709454356, 0.040156431128194184336, 2.5506555170746221691e-11, -1.3521164018407978152e-10, -8.3281235274106699399e-11, -9.7764849575562351891e-10, 3.4661828409940354542e-9, 3.9760633711791357544e-8, 1.590290664550452993e-7, -1.4919441249454941275e-7, -5.3779684992094351263e-6, -2.7513862296246223142e-5, -9.7880089725297162007e-6, 7.0787668964515789714e-4, 0.0046968199862345387583, 0.014745740181663320127, 0.020048622219583455723, -3.4824483072529265585e-12, 1.5157161810563380451e-12, 8.5303859696700686144e-12, 3.3455414203743741076e-10, 2.0226016353844285376e-9, 5.312815400326633499e-9, -3.0799322316418042137e-8, -4.4455408272954712128e-7, -2.4293274626893384034e-6, -3.2129079340119038354e-6, 5.922540368307538885e-5, 5.6822962576781683532e-4, 0.0027152446516406682732, 0.0074075873691848838485, 0.0093044450815739269849, -2.7683216166276377232e-13, 3.1986676777610155465e-12, 9.4142986954031445666e-12, 6.7934609179456399334e-11, 3.485152941147002933e-11, -2.5785248508896551557e-9, -2.8310220027112571258e-8, -1.6384131113072271115e-7, -3.2521663350596379097e-7, 4.038138875762230716e-6, 5.1917606978077281001e-5, 3.3420027947470126154e-4, 0.0013699550623118247094, 0.0034405619148342271096, 0.0041042919106665762794 }; const static double c[120] = { 4.5281968025889407937e-12, 1.0806749918195271176e-11, 9.6200972728717669027e-11, 5.721422706362526365e-10, 3.6077804282954825099e-9, 2.2465236858536681852e-8, 1.367696126430873523e-7, 7.9561767489531997361e-7, 4.3014380065615550573e-6, 2.092171390555028559e-5, 8.8079183950590176926e-5, 3.0549414408830252064e-4, 8.1295715613927890473e-4, 0.0014679809476357079195, 0.0013439197177355090057, 7.6019964430402432637e-13, -2.261619859915827119e-13, 1.7904450823779000744e-11, 9.1467054855312232717e-11, 7.1378582044879519122e-10, 4.9925255415445769102e-9, 3.3767315471315546644e-8, 2.1350774539167751457e-7, 1.2314353082655232903e-6, 6.2918685053670619181e-6, 2.7493229298777000013e-5, 9.8085825401369821771e-5, 2.6670282677770444935e-4, 4.8967895428135985381e-4, 4.5418248688489697144e-4, 9.4180115230375147213e-14, 7.5943117003734061145e-14, 3.0335730243874287654e-12, 2.0202796115462268051e-11, 1.6839020189186971198e-10, 1.2907875663127201526e-9, 9.354767612586579892e-9, 6.2471974110281880722e-8, 3.7585985422997380441e-7, 1.9838348288114906484e-6, 8.8884862203671982034e-6, 3.2333259238682810218e-5, 8.9266668913380400243e-5, 1.6589185669844051903e-4, 1.5536921180500113394e-4, 1.5425475332301107271e-14, 2.8674534590132490434e-14, 6.5078462279160216936e-13, 5.0939757793961391211e-12, 4.497983746074897552e-11, 3.6662925847520171711e-10, 2.7848878755089582413e-9, 1.929812005933947782e-8, 1.1950323861976892013e-7, 6.4513432758147478287e-7, 2.9422095033982461936e-6, 1.0854433321174584937e-5, 3.0307433185818899481e-5, 5.684098144306501785e-5, 5.3637016379451945253e-5, 3.1077953698439839352e-15, 8.6899496170729520378e-15, 1.6258562067326054104e-13, 1.4104842571366761537e-12, 1.3019455544084110747e-11, 1.1070466372863950239e-10, 8.6890603844230597917e-10, 6.1793722175049967488e-9, 3.9058865943755615801e-8, 2.1432806981070368523e-7, 9.9034657762983230155e-7, 3.6925185861895664251e-6, 1.0399877577259449786e-5, 1.9644939661550210015e-5, 1.8648773453825584597e-5, 7.2831555285336286457e-16, 2.6077534095895783532e-15, 4.4881202059263153495e-14, 4.1674329383944385626e-13, 3.9760100480223728037e-12, 3.483597635535118301e-11, 2.79932542127702497e-10, 2.0286513276830758107e-9, 1.3018343087118439152e-8, 7.2315927974997999365e-8, 3.3750708681924201599e-7, 1.2688020879407355571e-6, 3.5980954090811587848e-6, 6.8358260635246667316e-6, 6.5208606745808860557e-6, 1.9026412343503745875e-16, 8.0073765508732553766e-16, 1.3245754278055523992e-14, 1.2885201653055058502e-13, 1.2600129301230402587e-12, 1.1283306843147549277e-11, 9.2261481309646814329e-11, 6.7812033168299846818e-10, 4.4020645304595102132e-9, 2.4685719238301517679e-8, 1.1611886719473112509e-7, 4.3940380936523135466e-7, 1.2529878285546791905e-6, 2.3917218527087570384e-6, 2.290757464767187816e-6, 5.3709522135744366512e-17, 2.5239221050372845433e-16, 4.093314714589908336e-15, 4.1152784247617592367e-14, 4.0998840572769381012e-13, 3.7319354625807158852e-12, 3.0921671702920868014e-11, 2.2975898538634445343e-10, 1.5049754445782364328e-9, 8.5030864719789148982e-9, 4.025055939111842381e-8, 1.5312755642491878591e-7, 4.3865020375297892208e-7, 8.4059737392822153101e-7, 8.0785884122023473319e-7 }; const static double d[40] = { 9.2371554649979581914e-14, -2.3111336195788410887e-12, 5.7728710326649832559e-11, -1.8002298130091372598e-9, 7.6810375010517145638e-8, -5.2669973752193823306e-6, 0.0010112634961227401357, 0.16180215937964160466, 6.1381146507252683381e-14, -2.1034499679806301862e-12, 5.7090233460448415278e-11, -1.7990724350642330817e-9, 7.6809056078388019946e-8, -5.2669964425290062357e-6, 0.001011263495747828339, 0.16180215937970716383, 4.2458150578401296419e-14, -1.8435733128339016981e-12, 5.5534955081564656595e-11, -1.7938162188526358466e-9, 7.6798230945934117807e-8, -5.2669828728791921259e-6, 0.0010112634861753356559, 0.16180215938263409582, 3.0314798962267007518e-14, -1.5915009905364214455e-12, 5.3275907427402047438e-11, -1.7824862013841369751e-9, 7.676389035644707581e-8, -5.2669199860465945909e-6, 0.0010112634217687349189, 0.16180215941108227283, 2.2211515002229271212e-14, -1.3664088221521734796e-12, 5.0585177270502341602e-11, -1.7645432205894533462e-9, 7.6691805594577373698e-8, -5.2667455286976269634e-6, 0.001011263186281097458, 0.16180215954783127877 }; if (x < 0.8) { t = x * x; y = (((((((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4]) * t + a[5]) * t + a[6]) * t + a[7]) * x; y = (((((((a[8] * t + a[9]) * t + a[10]) * t + a[11]) * t + a[12]) * t + a[13]) * t + a[14]) * t + a[15]) / x + y * log(x); } else if (x < 5.5) { v = 3 / x; t = x - v; k = (int) (t + 3); t = (k - 2) - t; k *= 15; y = ((((((((((((((b[k] * t + b[k + 1]) * t + b[k + 2]) * t + b[k + 3]) * t + b[k + 4]) * t + b[k + 5]) * t + b[k + 6]) * t + b[k + 7]) * t + b[k + 8]) * t + b[k + 9]) * t + b[k + 10]) * t + b[k + 11]) * t + b[k + 12]) * t + b[k + 13]) * t + b[k + 14]) * v; } else if (x < 12.5) { k = (int) x; t = (k + 1) - x; k = 15 * (k - 5); y = (((((((((((((c[k] * t + c[k + 1]) * t + c[k + 2]) * t + c[k + 3]) * t + c[k + 4]) * t + c[k + 5]) * t + c[k + 6]) * t + c[k + 7]) * t + c[k + 8]) * t + c[k + 9]) * t + c[k + 10]) * t + c[k + 11]) * t + c[k + 12]) * t + c[k + 13]) * t + c[k + 14]; } else { t = 60 / x; k = 8 * ((int) t); y = (((((((d[k] * t + d[k + 1]) * t + d[k + 2]) * t + d[k + 3]) * t + d[k + 4]) * t + d[k + 5]) * t + d[k + 6]) * t + d[k + 7]) * sqrt(t) * exp(-x); } return y; } /* WFB code below. */ /* Root finding code */ /* Get lowest real root of x^3 + p x^2 + q x + r = 0 */ double cubic(double p, double q, double r) { double p_3, p_3sq; double u_3, v; double m, mcube, n, wsq, s, cosk; p_3 = p/3.0; p_3sq = p_3*p_3; v = r + p_3*(2.0*p_3sq - q); u_3 = q/3.0 - p_3sq; wsq = 4.0*u_3*u_3*u_3 + v*v; if(wsq >= 0.0) /* one real root */ { if(v <= 0.0) mcube = 0.5*(-v + sqrt(wsq)); else mcube = 0.5*(-v - sqrt(wsq)); m = cbrt(mcube); if(m != 0.0) n = -u_3/m; else n = 0.0; return m+n-p_3; } else { if(u_3 < 0.0) { s = sqrt(-u_3); cosk = cos(acos(0.5*v/(s*u_3))/3.0); if(p_3 < 0.0) return 2.0*s*cosk - p_3; else return s*(-cosk - sqrt(3.0-3.0*cosk*cosk)) - p_3; } else return cbrt(v) - p_3; } } /* Returns number of real roots. They are stored in rts. * for x^4 + a x^3 + b x^2 + c x + d = 0 */ int quarticroots(double a, double b, double c, double d, double *rts) { double y, p, q, r, A, B, C, m, n1, n2, asq, dis, rtdis; double A_4, B_m; int roots = 0; asq = a*a; A = b - asq*3.0/8.0; B = c + a*(asq/8.0 - b/2.0); C = d + asq*(b/16.0 - asq*3.0/256.0) - a*c/4.0; p = 2.0*A; q = A*A - 4.0*C; r = -B*B; y = cubic(p, q, r); if(y <= 0.0) return 0; m = sqrt(y); A_4 = 0.25*A; B_m = B/m; n1 = 0.5*(y + A + B_m); n2 = 0.5*(y + A - B_m); dis = y - 4.0*n1; if(dis >= 0.0) { rtdis = sqrt(dis); rts[roots++] = 0.5*(-m-rtdis) - A_4; rts[roots++] = 0.5*(-m+rtdis) - A_4; } dis = y - 4.0*n2; if(dis >= 0.0) { rtdis = sqrt(dis); rts[roots++] = 0.5*(-m-rtdis) - A_4; rts[roots++] = 0.5*(-m+rtdis) - A_4; } return roots; } cassbeam-1.1/mathfunc.h000066400000000000000000000025151275012243400151120ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __MATHFUNC_H__ #define __MATHFUNC_H__ #include #ifndef M_SQRT3 #define M_SQRT3 1.73205075688772935 #endif #ifndef C_EULER #define C_EULER 0.57721566490153286 #endif double pythag(double a, double b); double bessel_J0(double x); double bessel_J1(double x); double bessel_Y0(double x); double bessel_Y1(double x); double bessel_I0(double x); double logbessel_I0(double x); double bessel_I1(double x); double bessel_K0(double x); double bessel_K1(double x); double cubic(double p, double q, double r); int quarticroots(double a, double b, double c, double d, double *rts); #endif cassbeam-1.1/polygon.c000066400000000000000000000053031275012243400147650ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include "polygon.h" /* returns -1 if segment passes through 0,0, * 0 if segment doesn't intersect +x axis * 1 if segment touches +x axis over interval [0,1) */ static int testsegment(double x0, double y0, double x1, double y1) { double dx, dy, t; /* Check for pathological cases: */ if(x0 == 0.0 && y0 == 0.0) return -1; if(y0 == y1) { if(y0 == 0.0) { if(x0*x1 < 0.0) return -1; else return 0; } else return 0; } /* Now test the common cases: */ if(y0*y1 < 0.0) { dx = x1-x0; dy = y1-y0; t = -y0/dy; if(t < 0.0 || t >= 1.0) return 0; t = x0 + t*dx; if(t > 0.0) return 1; if(t == 0.0) return -1; } return 0; } /* returns 1 if x0, y0 is inside C(x, y), * 0 if x0, y0 is on C(x, y), * -1 if x0, y0 is outside C(x, y). */ int polygonside(const Vector x, const Vector y, double x0, double y0) { int i, n, a, b=0; g_assert(x); g_assert(y); n = VectorSize(x); g_assert(VectorSize(y) == n); for(i = 0; i < n; i++) { if(i == 0) a = testsegment(x[n-1]-x0, y[n-1]-y0, x[0] -x0, y[0] -y0); else a = testsegment(x[i-1]-x0, y[i-1]-y0, x[i] -x0, y[i] -y0); if(a == -1) return 0; /* point on polygon */ b += a; } if(b%2 == 1) return 1; return -1; } double polygonperimeter(const Vector x, const Vector y) { int i, n; double x0, y0, dx, dy, p=0.0; g_assert(x); g_assert(y); n = VectorSize(x); g_assert(VectorSize(y) == n); x0 = x[n-1]; y0 = y[n-1]; for(i = 0; i < n; i++) { dx = x[i] - x0; x0 = x[i]; dy = y[i] - y0; y0 = y[i]; p += sqrt(dx*dx + dy*dy); } return p; } /* positive for counter clockwise polygon */ double polygonarea(const Vector x, const Vector y) { int i, n; double x0, y0, x1, y1, a=0.0; g_assert(x); g_assert(y); n = VectorSize(x); g_assert(VectorSize(y) == n); x0 = x[n-1]; y0 = y[n-1]; for(i = 0; i < n; i++) { x1 = x[i]; y1 = y[i]; a += (y0+y1)*(x0-x1); x0 = x1; y0 = y1; } return 0.5*a; } cassbeam-1.1/polygon.h000066400000000000000000000022251275012243400147720ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __POLYGON_H__ #define __POLYGON_H__ #include "vector.h" /* returns 1 if x0, y0 is inside C(x, y), * 0 if x0, y0 is on C(x, y), * -1 if x0, y0 is outside C(x, y). */ int polygonside(const Vector x, const Vector y, double x0, double y0); double polygonperimeter(const Vector x, const Vector y); /* positive for counter clockwise polygon */ double polygonarea(const Vector x, const Vector y); #endif cassbeam-1.1/randdist.c000066400000000000000000000176471275012243400151240ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include "randdist.h" #include "vector.h" #include "image-vector.h" #include "mathfunc.h" /* return random number in [0, 1] */ double rand_one() { return rand()/(double)RAND_MAX; } /* return random number in [-1, 1] */ double rand_pm_one() { return 2.0*rand()/(double)RAND_MAX - 1.0; } /* return a random number with gaussian statistics */ double rand_gauss() { static int iset=0; static double gset; double fac, rsq, v1, v2; if(iset) { iset = 0; return gset; } else { iset = 1; do { v1 = 2.0*rand()/(double)RAND_MAX - 1.0; v2 = 2.0*rand()/(double)RAND_MAX - 1.0; rsq = v1*v1 + v2*v2; } while(rsq >= 1.0 || rsq == 0.0); fac = sqrt(-2.0*log(rsq)/rsq); gset = v1*fac; return v2*fac; } } /* return a random number with Rice statistics * for a good reference, see * http://www.ruca.ua.ac.be/visielab/theses/sijbers/html/node22.html */ double rand_rice(double m, double sigma) { double fac, x, y, v1, v2, rsq; do { v1 = 2.0*rand()/(double)RAND_MAX - 1.0; v2 = 2.0*rand()/(double)RAND_MAX - 1.0; rsq = v1*v1 + v2*v2; } while(rsq >= 1.0 || rsq == 0.0); fac = sqrt(-2.0*log(rsq)/rsq); x = fac*v1*sigma + m; y = fac*v2*sigma; return sqrt(x*x + y*y); } double rice_moment(double m, double sigma, int moment) { double r2; switch(moment) { case 0: return 1.0; case 1: r2 = m*m/(sigma*sigma); return sigma * sqrt(0.5*M_PI) * exp(-0.25*r2)* ( (1.0 + 0.5*r2)*bessel_I0(0.25*r2) + 0.5*r2*bessel_I1(0.25*r2) ); case 2: return m*m + 2.0*sigma*sigma; case 3: r2 = m*m/(sigma*sigma); return sigma*sigma*sigma*sqrt(0.5*M_PI)*exp(-0.25*r2)* ( (3.0+3.0*r2+0.5*r2*r2)*bessel_I0(0.25*r2) + (2.0*r2 + 0.5*r2*r2)*bessel_I1(0.25*r2) ); case 4: return m*m*m*m + 8.0*sigma*sigma*(m*m + sigma*sigma); default: g_assert(0); } return -1.0; } int rice_params2a(const Vector x, const Vector y, double *mag, double *sigma) { const int Q = 100; Vector ave, dif; int p, q, i, n; Matrix M; double v, m, mm, s, ss, dm, ds, dx, dy; g_assert(x); g_assert(y); n = VectorSize(x); g_assert(n == VectorSize(y)); if(n < 2) return 0; /* try to get reasonable starting values, accurate at snr=infinity */ m = s = ss = 0.0; for(i = 0; i < n; i++) { v = x[i]*x[i] + y[i]*y[i]; s += sqrt(v); ss += v; } s /= n; ss /= n; m = s; s = sqrt(ss - s*s); ave = newVector(n-1); dif = newVector(n-1); for(i = 0; i < n-1; i++) { dx = x[i]+x[i+1]; dy = y[i]+y[i+1]; ave[i] = 0.5*sqrt(dx*dx + dy*dy); dx = x[i]-x[i+1]; dy = y[i]-y[i+1]; dif[i] = sqrt(dx*dx + dy*dy); } M = newMatrix(Q, Q); zeroMatrix(M); v = 3.0/Q; dm = m*v; ds = s*v; for(p = 0; p < Q; p++) for(q = 0; q < Q; q++) { mm = (p+1)*dm; ss = (q+1)*ds; for(i = 0; i < n-1; i++) { M[p][q] += log(ave[i]/(ss*ss)); M[p][q] += log(dif[i]/(ss*ss)); M[p][q] += logbessel_I0(2.0*mm*ave[i]/(ss*ss)); M[p][q] += (-1.0/(2.0*ss*ss))* (0.5*dif[i]*dif[i] + 2.0*ave[i]*ave[i] + 2.0*mm*mm); } } Matrixmaxvalue(M, &p, &q); //printf("Inital peak up = %f %f\n", (p+1)*dm, (q+1)*ds); Matrixpeakup(M, p, q, 1, 1, &mm, &ss, 0, 0, 0); if(fabs(mm-p) >= 1.0 || fabs(ss-q) >= 1.0) { m = (p+1)*dm; s = (q+1)*ds; } else { m = (mm+1.0)*dm; s = (ss+1.0)*ds; } //printf("Second peak up = %f %f\n", m, s); applyfunctoMatrix(M, cbrt); saveMatrixaspgm(M, "Pmap.pgm"); deleteMatrix(M); deleteVector(dif); deleteVector(ave); if(mag) *mag = m; if(sigma) *sigma = s; return 1; } int rice_params2(const Vector x, const Vector y, double *mag, double *sigma) { const int niter = 500; Vector ave, dif; int i, n, iter; double L, L0, v, m, mm, s, ss, dm, ds, dx, dy; g_assert(x); g_assert(y); n = VectorSize(x); g_assert(n == VectorSize(y)); if(n < 2) return 0; /* try to get reasonable starting values, accurate at snr=infinity */ m = s = ss = 0.0; for(i = 0; i < n; i++) { v = x[i]*x[i] + y[i]*y[i]; s += sqrt(v); ss += v; } s /= n; ss /= n; m = s; s = sqrt(ss - s*s); ave = newVector(n-1); dif = newVector(n-1); for(i = 0; i < n-1; i++) { dx = x[i]+x[i+1]; dy = y[i]+y[i+1]; ave[i] = 0.5*sqrt(dx*dx + dy*dy); dx = x[i]-x[i+1]; dy = y[i]-y[i+1]; dif[i] = sqrt(dx*dx + dy*dy); } L0 = 0; v = 0.8; for(i = 0; i < n-1; i++) { L0 += log(ave[i]/(s*s)); L0 += log(dif[i]/(s*s)); L0 += logbessel_I0(2.0*m*ave[i]/(s*s)); L0 += (-1.0/(2.0*s*s))* (0.5*dif[i]*dif[i] + 2.0*ave[i]*ave[i] + 2.0*m*m); } for(iter = 0; iter < niter; iter++) { L = 0; while( (dm = v*m*rand_gauss()) + m <= 0.0); while( (ds = v*s*rand_gauss()) + s <= 0.0); v *= 0.998; ss = s+ds; mm = m+dm; for(i = 0; i < n-1; i++) { L += log(ave[i]/(ss*ss)); L += log(dif[i]/(ss*ss)); L += logbessel_I0(2.0*mm*ave[i]/(ss*ss)); L += (-1.0/(2.0*ss*ss))* (0.5*dif[i]*dif[i] + 2.0*ave[i]*ave[i] + 2.0*mm*mm); } if(L > L0) { L0 = L; s = ss; m = mm; } } deleteVector(dif); deleteVector(ave); if(mag) *mag = m; if(sigma) *sigma = s; return 1; } int rice_params(const Vector data, double *mag, double *sigma) { double m, s, mm, ss, dm, ds, v, M1, M2, d1, d2; int i, j, iter, p=20, q=2, a, b; Matrix M, S; M = newMatrix(2*p+1, 2*p+1); S = refsubMatrix(M, q, q, 2*p-q, 2*p-q); /* try to get reasonable starting values, accurate at snr=infinity */ VectormeanRMS(data, &m, &s); M1 = log(Vectormoment(data, 1)/VectorSize(data)); M2 = log(Vectormoment(data, 2)/VectorSize(data)); for(iter = 0; iter < 50; iter++) { if(m < 0.0) m = -m; if(s < 0.0) s = -s; v = 0.3/(p*sqrt(iter+4.0)); dm = m*v; ds = s*v; printf("Iter = %d m = %f, s = %f", iter, m, s); for(i = -p; i <= p; i++) for(j = -p; j <= p; j++) { d1 = log(rice_moment(m+i*dm, s+j*ds, 1)) - M1; d2 = log(rice_moment(m+i*dm, s+j*ds, 2)) - M2; M[i+p][j+p] = d1*d1 + d2*d2; } Matrixminvalue(S, &a, &b); /* go from S coords to M coords */ a+=q; b+=q; printf(" minvalue = %d %d", a, b); v = Matrixpeakup(M, a, b, q, q, &mm, &ss, 0, 0, 0); printf(" peakup = %f %f", mm, ss); if(fabs(mm - a) > 1.9) mm = a; if(fabs(ss - b) > 1.9) ss = b; printf(" peak = %f\n", v); m += (mm-p)*dm; s += (ss-p)*ds; } deleteMatrix(M); deleteMatrix(S); if(mag) *mag = m; if(sigma) *sigma = s; return 1; } /* return random (a, b) such that a^2 + b^2 <= 1 */ void rand_disc(double *a, double *b) { for(;;) { *a = 2.0*rand()/(double)RAND_MAX - 1.0; *b = 2.0*rand()/(double)RAND_MAX - 1.0; if((*a)*(*a) + (*b)*(*b) <= 1.0) return; } } /* return random (x, y, z) such that x*x + y*y + z*z = 1 */ void rand_shell(double *x, double *y, double *z) { double r; for(;;) { *x = 2.0*rand()/(double)RAND_MAX - 1.0; *y = 2.0*rand()/(double)RAND_MAX - 1.0; *z = 2.0*rand()/(double)RAND_MAX - 1.0; r = (*x)*(*x) + (*y)*(*y) + (*z)*(*z); if(r <= 1.0 && r > 0.0) break; } r = sqrt(r); *x /= r; *y /= r; *z /= r; } void rand_sphere(double *x, double *y, double *z) { for(;;) { *x = 2.0*rand()/(double)RAND_MAX - 1.0; *y = 2.0*rand()/(double)RAND_MAX - 1.0; *z = 2.0*rand()/(double)RAND_MAX - 1.0; if((*x)*(*x) + (*y)*(*y) + (*z)*(*z) <= 1.0) return; } } double Vectorrandomelement(const Vector v) { return v[rand_int(VectorSize(v))]; } cassbeam-1.1/randdist.h000066400000000000000000000030501275012243400151100ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __GAUSS__ #define __GAUSS__ #include #include "vector.h" #define rand_int(n) (1+(int)(((float)(n))/(RAND_MAX+1.0))) #define hypot(x, y) sqrt((x)*(x) + (y)*(y)) double rand_one(); double rand_pm_one(); double rand_gauss(); double rand_rice(double m, double sigma); double rice_moment(double m, double sigma, int moment); int rice_params2(const Vector x, const Vector y, double *mag, double *sigma); int rice_params2a(const Vector x, const Vector y, double *mag, double *sigma); int rice_params(const Vector data, double *mag, double *sigma); int rice_params3(const Vector data, double *mag, double *sigma); void rand_disc(double *a, double *b); void rand_shell(double *x, double *y, double *z); void rand_sphere(double *x, double *y, double *z); double Vectorrandomelement(const Vector v); #endif cassbeam-1.1/scripts/000077500000000000000000000000001275012243400146205ustar00rootroot00000000000000cassbeam-1.1/scripts/README000066400000000000000000000020411275012243400154750ustar00rootroot00000000000000Usage notes for generating a multi-frequency VLA beam Python scripts require: Numpy pyFITS pyrap Setup: multiBeamGen.py has a few hardcoded values that need to be changed. cbBin : the full path to cassbeam executable c2fScript : the full path to the cass2fits.py script Examples: 1. Generating a set of beam FITS files based on the freqneucies in a VLA measurement set: multiBeamGen.py -f 3C147-C-LO.MS -t vla-template.in -o vla_1330_1519 -p 512 --pixelsperbeam=64 -c -f : measurement set to determine the frequency information -t : cassBeam input file, see the cassbeam documentation -o : output filename prefix -p : number of pixels in the output file (it is actually +1, so 512 returns a 513 x 513 pixel image) --pixelsperbeam : pixels across the primary lobe for the lowest frequency generated files: [prefix]_xx_im.fits [prefix]_xx_re.fits [prefix]_xy_im.fits [prefix]_xy_re.fits [prefix]_yx_im.fits [prefix]_yx_re.fits [prefix]_yy_im.fits [prefix]_yy_re.fits cassbeam-1.1/scripts/beamGen.py000077500000000000000000000071551275012243400165430ustar00rootroot00000000000000#!/usr/bin/env python """ Batch script to generate a multi-frequency FITS beam from a template cassBeam input file """ import sys,os from subprocess import call import numpy as n import pyrap.tables as pt #HARDCODE cassbeam and cass2fits.py locations cbBin='/usr/local/bin/cassbeam' c2fScript='/home/foster/VLA/cassbeam/scripts/cass2fits.py' if __name__ == '__main__': from optparse import OptionParser o = OptionParser() o.set_usage('%prog [options] -t ') o.set_description(__doc__) o.add_option('-c','--clobber',dest='clobber',action='store_true', help='Clobber/overwrite output FITS files if they exist') o.add_option('-f','--freq',dest='freq',default='1000,1200,50', help='Frequnecy range to generate beams at, can set to an MS and freqs \ are pulled from the table or an a start,stop,step notaion (MHz). default: 1000,1200,50') o.add_option('-o','--output',dest='output',default='cassBeam', help='Output FITS filename prefix') o.add_option('-p','--pixels',dest='pixels',default=128, type='int', help='Number of pixels in the output FITS file, default: 128') o.add_option('-t','--template',dest='template',default=None, help='cassBeam input file to be used as the template, REQUIRED') o.add_option('--pixelsperbeam',dest='ppb',default=32, type='int', help='Pixels across the primary lobe for the lowest frequency, default: 32') opts, args = o.parse_args(sys.argv[1:]) #Sort out the frequencies, either they are input or from an MS if os.path.exists(opts.freq): print 'Getteing frequencies from %s'%opts.freq ms=pt.table(opts.freq+'/SPECTRAL_WINDOW',readonly=True) freqs=ms.getcol('CHAN_FREQ')[0] else: startFreq,stopFreq,stepFreq=map(float,opts.freq.split(',')) nfreqs=int((stopFreq-startFreq)/stepFreq)+1 freqs=[] for f in range(nfreqs): freqs.append(startFreq+f*stepFreq) freqs=n.array(freqs)*1e6 #convert freqs to GHz freqs/=1.e9 gridsize=2*(opts.pixels) ppb=opts.ppb*freqs[0]/freqs ppb=ppb.astype(int) #read template file fh=open(opts.template) templateLines=fh.readlines() fh.close() inputFiles=[] print 'Generating cassBeam input files' for f,pix in zip(freqs,ppb): outStr=opts.output+'-'+str(f*1.e3)+'MHz' outLines=[] for l in templateLines: if l.startswith('freq'): outLines.append('freq=%f\n'%f) elif l.startswith('gridsize'): outLines.append('gridsize=%i\n'%gridsize) elif l.startswith('out'): outLines.append('out=%s\n'%outStr) elif l.startswith('pixelsperbeam'): outLines.append('pixelsperbeam=%i\n'%pix) else: outLines.append(l) cassBeamFile=outStr inputFiles.append(cassBeamFile) fh=open(cassBeamFile+'.in','w') fh.writelines(outLines) fh.close() #run cassbeam for fid,fn in enumerate(inputFiles): print 'Running cassbeam with %s.in (%i of %i)'%(fn,fid+1,len(inputFiles)) print [cbBin,fn+'.in'] rcode=call([cbBin,fn+'.in']) #get the beampixelscale from the lowest frequency output param file fh=open(opts.output+'-'+str(freqs[0]*1.e3)+'MHz.params') paramLines=fh.readlines() for l in paramLines: if l.startswith('beampixelscale'): bps=float(l.split('=')[-1]) fh.close() #run cass2fits.py print 'Running %s'%c2fScript c2fArgs=' ' if opts.clobber: c2fArgs+='-c ' c2fArgs+='-p %f '%bps c2fArgs+='-o '+opts.output+'_ ' for fn in inputFiles: c2fArgs+=fn+'.jones.dat ' os.system(c2fScript+' '+c2fArgs) cassbeam-1.1/scripts/cass2fits.py000077500000000000000000000104021275012243400170730ustar00rootroot00000000000000#!/usr/bin/env python """ Convert cassbeam output Jones dat files into FITS beams for meqtrees Assumes cassbeam output files contain freq information in the filename of the form -MHz.jones.dat """ import sys,os import datetime import pyfits as pf import numpy as n if __name__ == '__main__': from optparse import OptionParser o = OptionParser() o.set_usage('%prog [options] ') o.set_description(__doc__) o.add_option('-c','--clobber',dest='clobber',action='store_true', help='Clobber/overwrite output FITS files if they exist') o.add_option('-o','--output',dest='output',default='cassBeam_', help='Output FITS filename prefix') o.add_option('-p','--pixel',dest='pixel',type='float',default=0.01, help='Pixel scale factor in radians, this is the beampixelscale in the cassbeam output parameter file, default: 0.01') opts, args = o.parse_args(sys.argv[1:]) freqs=[] beamCube=[] for fid,fn in enumerate(args): print 'Reading %s (%i of %i)'%(fn,fid+1,len(args)) freq=float(fn.split('/')[-1].split('-')[1].split('MHz')[0]) #parse filename for frequency freqs.append(freq) data=n.fromfile(fn,dtype=float,sep=' ') data=data.reshape((data.shape[0]/8,8)) beamCube.append(data) freqs=n.array(freqs)*1e6 beamCube=n.array(beamCube) dim=n.sqrt(beamCube.shape[1]) beamCube=beamCube.reshape((beamCube.shape[0],dim,dim,8)) #normalize cube so that peak value is 1.0, is this legit or required? beamCube/=n.max(n.abs(beamCube)) #generate a fits beam header templateCube=n.zeros((1,beamCube.shape[0],dim,dim),dtype=float) hdu=pf.PrimaryHDU(templateCube) ctime=datetime.datetime.today() hdu.header.update('DATE','%s'%ctime) hdu.header.update('DATE-OBS','%s'%ctime) hdu.header.update('ORIGIN', 'GFOSTER') hdu.header.update('TELESCOP', 'VLA') hdu.header.update('OBJECT', 'beam') hdu.header.update('EQUINOX', 2000.0) print 'Using pixel scale factor: %f radians'%opts.pixel # note: defining M as the fastest moving axis (FITS uses # FORTRAN-style indexing) produces an image that when # viewed with kview / ds9 etc looks correct on the sky # with M increasing to left and L increasing toward top # of displayed image if beamCube.shape[1]%2==0: crpixVal=int(beamCube.shape[1]/2) else: crpixVal=int(((beamCube.shape[1]-1)/2)+1) hdu.header.update('CTYPE1', 'M') hdu.header.update('CDELT1', (-1.0) * opts.pixel, 'in radians') hdu.header.update('CRPIX1', crpixVal, 'reference pixel (one relative)') hdu.header.update('CRVAL1', 0.0, 'M = 0 at beam peak') hdu.header.update('CTYPE2', 'L') hdu.header.update('CDELT2', opts.pixel, 'in radians') hdu.header.update('CRPIX2', crpixVal, 'reference pixel (one relative)') hdu.header.update('CRVAL2', 0.0, 'L = 0 at beam peak') #determine frequency step by assuming equal frequency steps and taking the difference of the first two frequencies sortFreqs=n.sort(freqs) if freqs.shape[0]>1: freqStep=(sortFreqs[-1]-sortFreqs[0])/freqs.shape[0]; else: freqStep=1. hdu.header.update('CTYPE3', 'FREQ') hdu.header.update('CDELT3', freqStep, 'frequency step in Hz') hdu.header.update('CRPIX3', 1, 'reference frequency postion') hdu.header.update('CRVAL3', sortFreqs[0], 'reference frequency') hdu.header.update('CTYPE4', 'STOKES') hdu.header.update('CDELT4', 1) hdu.header.update('CRPIX4', 1) hdu.header.update('CRVAL4', -5) # in case the frequency range is irregularly sampled, add keywords giving the actual frequency values for i,fq in enumerate(sortFreqs): hdu.header.update('GFREQ%d'%(i+1),fq); # create initial HDUList hdulist = pf.HDUList([hdu]) #for XX,XY,YX,YY,real,imag: write a fits file for pid,pol in enumerate(['rr','lr','rl','ll']): #for pid,pol in enumerate(['xx','xy','yx','yy']): for cid,cmplx in enumerate(['re','im']): #write data to FITS data hdu.data=beamCube[:,:,:,2*pid+cid] ofn=opts.output+pol+'_'+cmplx+'.fits' if opts.clobber or not os.path.isfile(ofn): hdulist.writeto(ofn,clobber=opts.clobber) else: print 'File: %s exists, and clobber parameter not set, skipping'%ofn cassbeam-1.1/scripts/multiBeamGen.py000077500000000000000000000104121275012243400175440ustar00rootroot00000000000000#!/usr/bin/env python """ Batch script to generate a multi-frequency FITS beam from a template cassBeam input file """ import sys,os,os.path from subprocess import call import numpy as n import pyrap.tables as pt #HARDCODE cassbeam and cass2fits.py locations cbBin='/usr/local/bin/cassbeam' c2fScript = os.path.dirname(__file__)+'/cass2fits.py' if __name__ == '__main__': from optparse import OptionParser o = OptionParser() o.set_usage('%prog [options] -t ') o.set_description(__doc__) o.add_option('-c','--clobber',dest='clobber',action='store_true', help='Clobber/overwrite output FITS files if they exist') o.add_option('-f','--freq',dest='freq',default='1000,1200', help='Frequency range to generate beams at, can set to an MS and freqs \ are pulled from the table or an a start,stop notation (MHz). Step sizes \ are picked based on maintatining pixel resolution. default: 1000,1200') o.add_option('-o','--output',dest='output',default='cassBeam', help='Output FITS filename prefix') o.add_option('-p','--pixels',dest='pixels',default=128, type='int', help='Number of pixels in the output FITS file, default: 128') o.add_option('-t','--template',dest='template',default='vla-template.in', help='cassBeam input file to be used as the template, default %default') o.add_option('--pixelsperbeam',dest='ppb',default=32, type='int', help='Pixels across the primary lobe for the lowest frequency, default: 32') opts, args = o.parse_args(sys.argv[1:]) if not opts.template: o.error("template must be specified with -t"); #Sort out the frequencies, either they are input or from an MS if os.path.exists(opts.freq): print 'Getteing frequencies from %s'%opts.freq ms=pt.table(opts.freq+'/SPECTRAL_WINDOW',readonly=True) freqs=ms.getcol('CHAN_FREQ')[0] startFreq=freqs[0] stopFreq=freqs[-1] else: startFreq,stopFreq=map(lambda x:float(x)*1e+6,opts.freq.split(',')) #compute the step freqs print 'Start Freq: %.4f GHz \t Stop Freq: %.4f GHz'%(startFreq/1.e9,stopFreq/1.e9) ppb0=opts.ppb freqs=[] b=0 ppb=[] cFreq=startFreq #current freq, increment until cFreq>stopFreq while cFreq. */ #include #include #include #include #include "vecarray.h" VecArray newVecArray(int n) { VecArray a; int i; a = g_new(VectorTypePointer, n+1); a++; VecArraySize(a) = n; for(i = 0; i < n; i++) a[i] = 0; return a; } VecArray newpopulatedVecArray(int n, int m) { VecArray a; int i; a = g_new(VectorTypePointer, n+1); a++; VecArraySize(a) = n; for(i = 0; i < n; i++) a[i] = newVector(m); return a; } void zeroVecArray(VecArray a) { int i, n; g_assert(a); n = VecArraySize(a); for(i = 0; i < n; i++) if(a[i]) zeroVector(a[i]); } void deleteVecArray(VecArray a) { g_assert(a); VecArraySize(a) = 0; g_free(a-1); } void deleteVecArrayandVectors(VecArray a) { int i, n; g_assert(a); n = VecArraySize(a); for(i = 0; i < n; i++) if(a[i]) deleteVector(a[i]); VecArraySize(a) = 0; g_free(a-1); } VecArray dupVecArray(const VecArray a) { VecArray b; int i, n; g_assert(a); n = VecArraySize(a); b = newVecArray(n); for(i = 0; i < n; i++) b[i] = a[i]; return b; } VecArray dupVecArrayandVectors(const VecArray a) { VecArray b; int i, n; g_assert(a); n = VecArraySize(a); b = newVecArray(n); for(i = 0; i < n; i++) if(a[i]) b[i] = dupVector(a[i]); return b; } void copytoVecArray(VecArray dest, const VecArray src) { int i, n; g_assert(dest); g_assert(src); n = VecArraySize(src); g_assert(n == VecArraySize(dest)); for(i = 0; i < n; i++) copytoVector(dest[i], src[i]); } VecArray VecArraysubset(const VecArray a, int col, int ncol) { VecArray b; int i; g_assert(a); g_assert(col > 0); g_assert(ncol > 0); g_assert(col+ncol <= VecArraySize(a)); b = newVecArray(ncol); for(i = 0; i < ncol; i++) b[i] = a[i+col]; return b; } VecArray dupVecArraysubset(const VecArray a, int col, int ncol) { VecArray b; int i; g_assert(a); g_assert(col >= 0); g_assert(ncol > 0); g_assert(col+ncol <= VecArraySize(a)); b = newVecArray(ncol); for(i = 0; i < ncol; i++) if(a[i]) b[i] = dupVector(a[i+col]); return b; } VecArray dupVecArrayrowsubset(const VecArray a, int row, int nrow) { VecArray b; int N, i, j; g_assert(a); N = VecArraySize(a); g_assert(row >= 0); g_assert(nrow > 0); g_assert(row+nrow <= VecArrayVectorSize(a)); b = newpopulatedVecArray(N, nrow); for(j = 0; j < nrow; j++) for(i = 0; i < N; i++) b[i][j] = a[i][j+row]; return b; } int VecArrayVectorSize(const VecArray a) { int i, n, s=-1; g_assert(a); n = VecArraySize(a); for(i = 0; i < n; i++) if(a[i]) { if(s < 0) s = VectorSize(a[i]); else if(s != VectorSize(a[i])) return -1; } return s; } int VecArrayVectorcolumns(const VecArray a) { int i, n, c=0; g_assert(a); n = VecArraySize(a); for(i = 0; i < n; i++) if(a[i]) c++; return c; } VecArray VecArraydeletecolumn(VecArray a, int col) { VecArray b; int i, n; g_assert(a); n = VecArraySize(a); g_assert(col >= 0 && col < n); if(n <= 1) { deleteVecArray(a); return 0; } b = newVecArray(n-1); if(col) for(i = 0; i < col; i++) b[i] = a[i]; if(col < n-1) for(i = col+1; i < n; i++) b[i-1] = a[i]; deleteVecArray(a); return b; } VecArray VecArrayinsertcolumn(VecArray a, int col) { VecArray b; int i, n; g_assert(col >= 0); if(a == 0) return newVecArray(1); n = VecArraySize(a); g_assert(col <= n); b = newVecArray(n+1); if(col > 0) for(i = 0; i < col; i++) b[i] = a[i]; if(col < n) for(i = col; i < n; i++) b[i+1] = a[i]; deleteVecArray(a); return b; } VecArray VecArrayappendcolumn(VecArray a) { VecArray b; int i, n; if(!a) return newVecArray(1); n = VecArraySize(a); b = newVecArray(n+1); for(i = 0; i < n; i++) b[i] = a[i]; deleteVecArray(a); return b; } VecArray VecArrayinsertVector(VecArray a, Vector v, int col) { VecArray b; b = VecArrayinsertcolumn(a, col); b[col] = v; return b; } VecArray VecArrayappendVector(VecArray a, Vector v) { VecArray b; int i, n; if(!a) { b = newVecArray(1); b[0] = v; return b; } n = VecArraySize(a); b = newVecArray(n+1); for(i = 0; i < n; i++) b[i] = a[i]; deleteVecArray(a); b[n] = v; return b; } VecArray VecArrayappendVectors(VecArray a, ...) { va_list ap; Vector v; va_start(ap, a); while((v = va_arg(ap, Vector))) a = VecArrayappendVector(a, v); va_end(ap); return a; } /* VecArray newVecArrayfromVectors(...) { va_list ap; VecArray a = 0; Vector v; va_start(ap, a); while((v = va_arg(ap, Vector))) a = VecArrayappendVector(a, v); va_end(ap); return a; } */ void VecArraysetcolumn(VecArray a, Vector v, int col) { g_assert(a); g_assert(col >= 0 && col < VecArraySize(a)); a[col] = v; } Matrix newMatrixfromVecArray(const VecArray a) { Matrix M; int m, n, i, j; g_assert(a); m = VecArrayVectorSize(a); if(m <= 0) return 0; n = VecArraySize(a); M = newMatrix(n, m); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = a[j][i]; return M; } VecArray newVecArrayfromMatrix(const Matrix M) { int i, j, m, n; VecArray a; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); a = newVecArray(n); for(j = 0; j < n; j++) { a[j] = newVector(m); for(i = 0; i < m; i++) a[j][i] = M[j][i]; } return a; } VecArray VecArrayconcat(VecArray a, VecArray b) { VecArray c; int i, na, nb; g_assert(a); g_assert(b); na = VecArraySize(a); nb = VecArraySize(b); c = newVecArray(na+nb); for(i = 0; i < na; i++) c[i] = a[i]; for(i = 0; i < nb; i++) c[i+na] = b[i]; deleteVecArray(a); deleteVecArray(b); return c; } VecArray VecArrayappendVecArray(VecArray a, const VecArray b) { VecArray c; int i, na, nb; g_assert(a); g_assert(b); na = VecArraySize(a); nb = VecArraySize(b); c = newVecArray(na+nb); for(i = 0; i < na; i++) c[i] = a[i]; for(i = 0; i < nb; i++) c[i+na] = b[i]; deleteVecArray(a); return c; } VecArray VecArrayappendVecArrays(VecArray a, ...) { va_list ap; VecArray b; va_start(ap, a); while((b = va_arg(ap, VecArray))) a = VecArrayappendVecArray(a, b); va_end(ap); return a; } VecArray reduceVecArraybymask(VecArray a, const intVector mask) { VecArray b; int i, m, j, n, c=0; g_assert(a); g_assert(mask); m = VecArrayVectorSize(a); g_assert(m == VectorSize(mask)); n = VecArraySize(a); for(i = 0; i < m; i++) if(mask[i] > 0) c++; b = newpopulatedVecArray(n, c); c = 0; for(i = 0; i < m; i++) if(mask[i]) { for(j = 0; j < n; j++) b[j][c] = a[j][i]; c++; } deleteVecArrayandVectors(a); return b; } VecArray VecArrayfromfile(const char *filename, int mincols) { VecArray a; Vector v; FILE *in; int nc = 0, nr = 0, n, i, row; char line[1024]; in = fopen(filename, "r"); if(!in) return 0; for(;;) { fgets(line, 1023, in); if(feof(in)) break; /* look for "standard" comment characters */ if(line[0] == '#' || line[0] > 57 || line[0] == '*' || line[0] == '!' || line[0] == ';') continue; n = stringtoVector(line, 0); if(n >= mincols) { if(nc == 0) nc = n; if(n >= nc) nr++; } } fclose(in); a = newpopulatedVecArray(nc, nr); v = newVector(nc); in = fopen(filename, "r"); for(row = 0; row < nr;) { fgets(line, 1023, in); if(feof(in)) break; if(line[0] == '#' || line[0] > 57 || line[0] == '*') continue; n = stringtoVector(line, v); if(n >= nc) { if(n >= nc) { for(i = 0; i < nc; i++) a[i][row] = v[i]; row++; } } } fclose(in); deleteVector(v); return a; } int VecArraytofile(const VecArray a, const char *filename, const char *format) { int m, n, i, j, needspace = 0; const char *f; FILE *out; g_assert(a); if(format == 0) f = "%10.5f"; else f = format; m = VecArrayVectorSize(a); if(m <= 0) { fprintf(stderr, "VecArraycolumnstofile : " "VecArray is too complicated\n"); return -1; } n = VecArraySize(a); out = fopen(filename, "w"); if(!out) { fprintf(stderr, "VecArraycolumnstofile : " "Cannot open file %s for write\n", filename); return -1; } for(i = 0; i < m; i++) { needspace = 0; for(j = 0; j < n; j++) if(a[j]) { if(needspace++) fprintf(out, " "); fprintf(out, f, a[j][i]); } fprintf(out, "\n"); } fclose(out); return needspace; } void VecArrayresize(const VecArray a, int newsize) { int i, j, m, nr, nc; Vector V; g_assert(a); nc = VecArraySize(a); nr = VecArrayVectorSize(a); g_assert(nr); g_assert(nc); if(newsize < nr) m = newsize; else m = nr; for(i = 0; i < nc; i++) { V = newVector(newsize); for(j = 0; j < m; j++) V[j] = a[i][j]; if(newsize > nr) for(j = nr; j < newsize; j++) a[i][j] = 0.0; deleteVector(a[i]); a[i] = V; } } /* Arithmetic operations */ void scaleVecArray(VecArray a, double f) { int N, j; g_assert(a); N = VecArraySize(a); for(j = 0; j < N; j++) if(a[j]) scaleVector(a[j], f); } void addtoVecArray(VecArray a, const VecArray b) { int i, M; g_assert(a); g_assert(b); M = VecArraySize(a); g_assert(M == VecArraySize(a)); for(i = 0; i < M; i++) addtoVector(a[i], b[i]); } Vector VecArrayVectoraverage(const VecArray a) { int N, M, j; Vector v; g_assert(a); N = VecArrayVectorSize(a); if(N <= 0) return 0; M = VecArraySize(a); v = newVector(N); zeroVector(v); for(j = 0; j < M; j++) addtoVector(v, a[j]); scaleVector(v, 1.0/M); return v; } /* reduce symmetric matrix to tridiagonal form * * From numerical recipes tred2 */ VecArray tridiagfromMatrix(Matrix a) { int n, i, j, k, l; double scale, hh, h, g, f; VecArray out; Vector d, e; g_assert(Matrixissquare(a)); n = MatrixSize1(a); out = newpopulatedVecArray(2, n); d = out[0]; e = out[1]; for(i = n-1; i > 0; i--) { l = i-1; h = scale = 0.0; if(l > 0) { for(k = 0; k <= l; k++) scale += fabs(a[i][k]); if(scale == 0.0) e[i] = a[i][i]; else { for(k = 0; k <= l; k++) { a[i][k] /= scale; h += a[i][k]*a[i][k]; } f = a[i][i]; g = (f >= 0.0 ? -sqrt(h) : sqrt(h)); e[i] = scale*g; h -= f*g; a[i][l] = f - g; f = 0.0; for(j = 0; j <= l; j++) { a[j][i] = a[i][j]/h; g = 0.0; for(k = 0; k <= j; k++) g += a[j][k]*a[i][k]; for(k = j+1; k <= l; k++) g += a[k][j]*a[i][k]; e[j] = g/h; f += e[j]*a[i][j]; } hh = 0.5*f/h; for(j = 0; j <= l; j++) { f=a[i][j]; e[j] = g = e[j] - hh*f; for(k = 0; k <= j; k++) a[j][k] -= (f*e[k] + g*a[i][k]); } } } else e[i] = a[i][l]; d[i] = h; } d[0] = e[0] = 0.0; for(i = 0; i < n; i++) { l = i - 1; if(i) { for(j = 0; j <= l; j++) { g = 0.0; for(k = 0; k <= l; k++) g += a[i][k]*a[k][j]; for(k = 1; k <= l; k++) a[k][j] -= g*a[k][i]; } } d[i] = a[i][i]; a[i][i] = 1.0; for(j = 0; j <= l;j++) a[j][i] = a[i][j] = 0.0; } return out; } void multVectorbytridiag(Vector v, const VecArray a) { int i, n; Vector w, d, e; g_assert(VecArraySize(a) == 2); n = VectorSize(v); g_assert(VecArrayVectorSize(a) == n); d = a[0]; e = a[1]; w = dupVector(v); v[0] = w[0]*d[0] + w[1]*e[1]; v[n-1] = w[n-1]*d[n-1] + w[n-2]*e[n-1]; for(i = 1; i < n-1; i++) v[i] = w[i]*d[i] + w[i-1]*e[i-1] + w[i+1]*e[i]; deleteVector(w); } cassbeam-1.1/vecarray.h000066400000000000000000000053211275012243400151170ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __VECARRAY__ #define __VECARRAY__ #include "vector.h" #ifdef FLOATVEC typedef float** VecArray; #else typedef double** VecArray; #endif #define VecArraySize(a) (((int *)(a))[-1]) VecArray newVecArray(int n); VecArray newpopulatedVecArray(int n, int m); //VecArray newVecArrayfromVectors(...); void zeroVecArray(VecArray a); void deleteVecArray(VecArray a); void deleteVecArrayandVectors(VecArray a); VecArray dupVecArray(const VecArray a); VecArray dupVecArrayandVectors(const VecArray a); void copytoVecArray(VecArray dest, const VecArray src); VecArray VecArraysubset(const VecArray a, int col, int ncol); VecArray dupVecArraysubset(const VecArray a, int col, int ncol); VecArray dupVecArrayrowsubset(const VecArray a, int row, int nrow); int VecArrayVectorSize(const VecArray a); int VecArrayVectorcolumns(const VecArray a); VecArray VecArraydeletecolumn(VecArray a, int col); VecArray VecArrayinsertcolumn(VecArray a, int col); VecArray VecArrayappendcolumn(VecArray a); VecArray VecArrayinsertVector(VecArray a, Vector v, int col); VecArray VecArrayappendVector(VecArray a, Vector v); VecArray VecArrayappendVectors(VecArray a, ...); VecArray appendtoVecArray(VecArray a, VecArray b); void VecArraysetcolumn(VecArray a, Vector v, int col); Matrix newMatrixfromVecArray(const VecArray a); VecArray newVecArrayfromMatrix(const Matrix M); VecArray VecArrayconcat(VecArray a, VecArray b); VecArray VecArrayappendVecArray(VecArray a, const VecArray b); VecArray VecArrayappendVecArrays(VecArray a, ...); VecArray reduceVecArraybymask(VecArray a, const intVector mask); VecArray VecArrayfromfile(const char *filename, int mincols); int VecArraytofile(const VecArray a, const char *filename, const char *format); void VecArrayresize(const VecArray a, int newsize); /* arithmetic */ void scaleVecArray(VecArray a, double f); void addtoVecArray(VecArray a, const VecArray b); Vector VecArrayVectoraverage(const VecArray a); /* tridiagonal matrix stuff */ VecArray tridiagfromMatrix(Matrix a); #endif cassbeam-1.1/vector-fftw.c000066400000000000000000000170741275012243400155540ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include "vector-fftw.h" inline double sinc(double x) { if(x == 0.0) return 1.0; else return sin(x)/x; } int Matrixcomplexgrid(Matrix M, double u, double v, double re, double im, int p) { int m, n; int i, j; int a, b, r, s; double du, dv, f; n = MatrixSize1(M); m = MatrixSize2(M)/2; while(u < 0.0) u += m; while(u >= m) u -= m; while(v < 0.0) v += n; while(v >= n) v -= n; a = (int)(u+0.5); b = (int)(v+0.5); du = u-a; dv = v-b; for(j = -p; j <= p; j++) for(i = -p; i <= p; i++) { f = sinc(M_PI*(i-du))*sinc(M_PI*(j-dv)); r = (b+j+n)%n; s = (a+i+m)%m; M[r][2*s] += f*re; M[r][2*s+1] += f*im; } return 1; } Vector VectorFFT(Vector V, fftw_direction dir) { Vector out; fftw_plan p; p = fftw_create_plan(Vectorlength(V)/2, dir, FFTW_ESTIMATE); out = newVector(Vectorlength(V)); fftw_one(p, (fftw_complex *)V, (fftw_complex *)out); fftw_destroy_plan(p); return out; } /* output vector is in FFTW half-complex format */ Vector VectorRFFT(Vector V, fftw_direction dir) { Vector out; rfftw_plan p; p = rfftw_create_plan(Vectorlength(V), dir, FFTW_ESTIMATE); out = newVector(Vectorlength(V)); rfftw_one(p, (fftw_real *)V, (fftw_real *)out); rfftw_destroy_plan(p); return out; } void smoothVector(Vector V, double width, int type) { int pad, trans, m, n, i; double fac, re, im; Vector K, ftK, W, ftW; if(width <= 0.0) return; g_assert(V); n = VectorSize(V); g_assert(n > 2.0*width); if(type == SMOOTH_GAUSS) pad = width*3; else pad = width; if(n%2 == 1) trans = width+1; else trans = width; m = n + pad*2 + trans; i = m%256; if(i) { trans += (256-i); m += (256-i); } W = newVector(m); for(i = 0; i < n; i++) W[i] = V[i]; for(i = n; i < n+pad; i++) W[i] = V[n-1]; for(i = n+pad+trans; i < m; i++) W[i] = V[0]; for(i = 0; i < trans; i++) W[n+pad+i] = V[n-1] + (V[0]-V[n-1])*(float)i/(float)trans; ftW = VectorRFFT(W, FFTW_REAL_TO_COMPLEX); deleteVector(W); K = newVector(m); zeroVector(K); K[0] = 1.0; switch(type) { case SMOOTH_GAUSS: for(i = 1; i <= m/2; i++) K[i] = K[m-i] = exp(-0.5*i*i/(width*width)); break; case SMOOTH_COS: for(i = 1; i < width; i++) K[i] = K[m-i] = cos(0.5*M_PI*i/width); break; case SMOOTH_COS1: for(i = 1; i < width; i++) K[i] = K[m-i] = 0.5+0.5*cos(M_PI*i/width); break; case SMOOTH_BOX: for(i = 1; i < width; i++) K[i] = K[m-i] = 1.0; break; case SMOOTH_TRIANGLE: for(i = 1; i < width; i++) K[i] = K[m-i] = 1.0 - i/width; break; } scaleVector(K, 1.0/Vectorsum(K)); ftK = VectorRFFT(K, FFTW_REAL_TO_COMPLEX); deleteVector(K); ftW[0] *= ftK[0]; ftW[m/2] *= ftK[m/2]; for(i = 1; i < m/2; i++) { re = ftW[i]; im = ftW[m-i]; ftW[i] = re*ftK[i] - im*ftK[m-i]; ftW[m-i] = im*ftK[i] + re*ftK[m-i]; } fac = 1.0/m; deleteVector(ftK); W = VectorRFFT(ftW, FFTW_COMPLEX_TO_REAL); deleteVector(ftW); for(i = 0; i < n; i++) V[i] = W[i]*fac; deleteVector(W); } /* This will not work on a padded Matrix */ void MatrixFFT(Matrix M, fftw_direction dir) { fftwnd_plan p; g_assert(M); g_assert(Matrixrowpad(M) == 0); p = fftw2d_create_plan(MatrixSize1(M), MatrixSize2(M)/2, dir, FFTW_ESTIMATE | FFTW_IN_PLACE); fftwnd_one(p, (fftw_complex *)(*M), 0); fftwnd_destroy_plan(p); } /* This will work on a padded or unpadded Matrix */ void MatrixFFTrows(Matrix M, fftw_direction dir) { fftw_plan p; g_assert(M); p = fftw_create_plan(MatrixSize2(M)/2, dir, FFTW_ESTIMATE | FFTW_IN_PLACE); fftw(p, MatrixSize1(M), (fftw_complex *)(*M), 1, Matrixstride(M)/2, 0, 0, 0); fftw_destroy_plan(p); } void MatrixFFTcolumns(Matrix M, fftw_direction dir) { fftw_plan p; g_assert(M); p = fftw_create_plan(MatrixSize1(M), dir, FFTW_ESTIMATE | FFTW_IN_PLACE); fftw(p, MatrixSize2(M)/2, (fftw_complex *)(*M), Matrixstride(M)/2, 1, 0, 0, 0); fftw_destroy_plan(p); } void MatrixRFFT(Matrix M, fftw_direction dir) { rfftwnd_plan p; g_assert(M); if(Matrixrowpad(M) != 2 - (MatrixSize2(M) % 2)) { fprintf(stderr, "MatrixRFFT: padding is: %d, should be %d\n", Matrixrowpad(M), 2 - (MatrixSize2(M) % 2)); g_assert(0); } p = rfftw2d_create_plan(MatrixSize1(M), MatrixSize2(M), dir, FFTW_ESTIMATE | FFTW_IN_PLACE); if(dir == FFTW_REAL_TO_COMPLEX) rfftwnd_one_real_to_complex(p, (fftw_real *)(*M), 0); else rfftwnd_one_complex_to_real(p, (fftw_complex *)(*M), 0); rfftwnd_destroy_plan(p); } void MatrixRFFTrows(Matrix M, fftw_direction dir) { rfftw_plan p; g_assert(M); p = rfftw_create_plan(MatrixSize2(M), dir, FFTW_ESTIMATE | FFTW_IN_PLACE); rfftw(p, MatrixSize1(M), (fftw_real *)(*M), 1, Matrixstride(M), 0, 0, 0); rfftw_destroy_plan(p); } void Matrixconvolve(Matrix M, const Matrix N) { int m, n, i, j; Matrix R, T; g_assert(M); g_assert(N); n = MatrixSize1(M); m = MatrixSize2(M); if(MatrixSize1(N) > n || MatrixSize2(N) > m) { fprintf(stderr, "Matrixconvolve: Size Problem\n"); return; } R = newpaddedMatrix(n, m, 2); copytoMatrix(R, M); T = newpaddedMatrix(n, m, 2); zeroMatrix(T); for(j = 0; j < MatrixSize1(N); j++) for(i = 0; i < MatrixSize2(N); i++) T[j][i] = N[j][i]; MatrixRFFT(T, FFTW_REAL_TO_COMPLEX); MatrixRFFT(R, FFTW_REAL_TO_COMPLEX); Matrixcomplexmultiply(R, T, 2); MatrixRFFT(R, FFTW_COMPLEX_TO_REAL); copytoMatrix(M, R); deleteMatrix(T); deleteMatrix(R); } Matrix Matrixautocorrelate(const Matrix M) { int m, n; Matrix R; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); R = newpaddedMatrix(n, m, 2); copytoMatrix(R, M); MatrixRFFT(R, FFTW_REAL_TO_COMPLEX); Matrixcomplexconjugatemultiply(R, R, 2); MatrixRFFT(R, FFTW_COMPLEX_TO_REAL); return R; } Matrix Matrixcrosscorrelate(const Matrix M, const Matrix N) { int m, n; Matrix R, T; g_assert(M); g_assert(N); n = MatrixSize1(M); m = MatrixSize2(M); if(MatrixSize1(N) != n || MatrixSize2(N) != m) { fprintf(stderr, "Matrixcrosscorrelate: Size Problem\n"); return 0; } R = newpaddedMatrix(n, m, 2); copytoMatrix(R, M); T = newpaddedMatrix(n, m, 2); copytoMatrix(T, N); MatrixRFFT(T, FFTW_REAL_TO_COMPLEX); MatrixRFFT(R, FFTW_REAL_TO_COMPLEX); Matrixcomplexconjugatemultiply(R, T, 2); MatrixRFFT(R, FFTW_COMPLEX_TO_REAL); deleteMatrix(T); return R; } void Matrixdeconvolve(Matrix M, const Matrix N) { int m, n, i, j; Matrix R, T; g_assert(M); g_assert(N); n = MatrixSize1(M); m = MatrixSize2(M); if(MatrixSize1(N) > n || MatrixSize2(N) > m) { fprintf(stderr, "Matrixconvolve: SizeProblem\n"); return; } R = newpaddedMatrix(n, m, 2); copytoMatrix(R, M); T = newpaddedMatrix(n, m, 2); zeroMatrix(T); for(j = 0; j < MatrixSize1(N); j++) for(i = 0; i < MatrixSize2(N); i++) T[j][i] = N[j][i]; MatrixRFFT(T, FFTW_REAL_TO_COMPLEX); MatrixRFFT(R, FFTW_REAL_TO_COMPLEX); Matrixcomplexdivide(R, T, 2); MatrixRFFT(R, FFTW_COMPLEX_TO_REAL); copytoMatrix(M, R); deleteMatrix(T); deleteMatrix(R); } cassbeam-1.1/vector-fftw.h000066400000000000000000000045071275012243400155560ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __VECTOR_FFTW_H__ #define __VECTOR_FFTW_H__ #include #include #include #include "vector.h" #define SMOOTH_GAUSS 1 #define SMOOTH_COS 2 #define SMOOTH_COS1 3 #define SMOOTH_BOX 4 #define SMOOTH_TRIANGLE 5 /* This function grids a non-evenly sampled datum onto the FT plane */ int Matrixcomplexgrid(Matrix M, double u, double v, double re, double im,int p); /* These use FFTW for the transform. Don't use these if many fast transforms * are needed -- use plans and the fftw functions in those cases * * dir is one of: FFTW_FORWARD or FFTW_BACKWARD for complex (FFT) transforms * or: FFTW_REAL_TO_COMPLEX or FFTW_REAL_TO_COMPLEX for real (RFFT) */ Vector VectorFFT(Vector V, fftw_direction dir); Vector VectorRFFT(Vector V, fftw_direction dir); void smoothVector(Vector V, double width, int type); /* Notes for Matrix transforms: * 1. all real side of RFFT transforms are represented in FFTW's * native order * 2. input arrays for all RFFT operations are assumed to have 2 extra * floating point values padding each row. These matrices can be * created with newpaddedMatrix(Ny, Nx, pad = 2) */ void MatrixFFT(Matrix M, fftw_direction dir); void MatrixFFTrows(Matrix M, fftw_direction dir); void MatrixFFTcolumns(Matrix M, fftw_direction dir); void MatrixRFFT(Matrix M, fftw_direction dir); void MatrixRFFTrows(Matrix M, fftw_direction dir); Matrix Matrixcrosscorrelate(const Matrix M, const Matrix N); Matrix Matrixautocorrelate(const Matrix M); void Matrixconvolve(Matrix M, const Matrix N); void Matrixdeconvolve(Matrix M, const Matrix N); #endif cassbeam-1.1/vector.c000066400000000000000000001402351275012243400146040ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include #include #include #include #include #include "vector.h" #include "randdist.h" static int totalvectordata = 0; int gettotalVectordata() { return totalvectordata; } /* routine that given matrix a and vector b, repaces a by its inverse, */ /* and replaces b with [a]^-1 * b */ /* Returns 1 on success, 0 on failure */ /* Adapted from Numerical Recipes */ int gaussjordan(Matrix a, Vector b) { double big, dum, pivinv, tmp; static int *indxc, *indxr, *ipiv; static int oldn = 0; int i, icol = 0, irow = 0, j, k, l, ll; int m, n, p; g_assert(a != 0); g_assert(b != 0); n = MatrixSize1(a); m = MatrixSize2(a); p = Vectorlength(b); g_assert(m == n); g_assert(m == p); if(n != oldn) { oldn = n; if(oldn > 0) { g_free(indxc); g_free(indxr); g_free(ipiv); } if(n > 0) { indxc = g_new(int, n); indxr = g_new(int, n); ipiv = g_new(int, n); } } if(n == 0) return 1; for(j = 0; j < n; j++) ipiv[j] = 0; for(i = 0; i < n; i++) { big = 0.0; for(j = 0; j < n; j++) if(ipiv[j] != 1) for(k=0; k < n; k++) { if(ipiv[k] == 0) { if(fabs(a[j][k]) >= big) { big = fabs(a[j][k]); irow=j; icol=k; } } else if(ipiv[k] > 1) return -1; } ipiv[icol]++; if(irow != icol) { for(l=0; l < n; l++) { tmp = a[irow][l]; a[irow][l] = a[icol][l]; a[icol][l] = tmp; } tmp = b[irow]; b[irow] = b[icol]; b[icol] = tmp; } indxr[i] = irow; indxc[i] = icol; if(a[icol][icol] == 0.0) return 0; pivinv = 1.0/a[icol][icol]; a[icol][icol] = 1.0; for(l = 0; l < n; l++) a[icol][l] *= pivinv; b[icol] *= pivinv; for(ll = 0; ll < n; ll++) if (ll != icol) { dum = a[ll][icol]; a[ll][icol] = 0.0; for(l = 0; l < n; l++) a[ll][l] -= a[icol][l]*dum; b[ll] -= b[icol]*dum; } } return 1; } /* Routine to fit an (n-1)-th order polynomial to (X, Y) data * eg. if order=3, then the 3 element output vector contains * coefficients for x^0, x^1, and X^2 */ Vector polyfit(const Vector X, const Vector Y, int order) { Matrix M; Vector V; Vector f; int i, j, k, n; int res; if(!VectorSizeSame(X, Y)) { fprintf(stderr, "polyfit : vectors not of same size\n"); return 0; } n = VectorSize(X); if(n < order) { fprintf(stderr, "polyfit : system undetermined\n"); return 0; } V = newVector(order); zeroVector(V); M = newMatrix(order, order); zeroMatrix(M); f = newVector(order); for(k = 0; k < n; k++) { f[0] = 1; for(i = 1; i < order; i++) f[i] = f[i-1]*X[k]; for(i = 0; i < order; i++) V[i] += Y[k]*f[i]; for(i = 0; i < order; i++) for(j = 0; j < order; j++) M[i][j] += f[i]*f[j]; } res = gaussjordan(M, V); deleteMatrix(M); deleteVector(f); if(res < 0) { deleteVector(V); fprintf(stderr, "polyfit : system not invertable\n"); return 0; } return V; } Vector weightedpolyfit(const Vector X, const Vector Y, const Vector W, int order) { Matrix M; Vector V; Vector f; int i, j, k, n; int res; if(!VectorSizeSame(X, Y) || !VectorSizeSame(X, W)) { fprintf(stderr, "weightedpolyfit : vectors not of same size\n"); return 0; } n = VectorSize(X); if(n < order) { fprintf(stderr, "weightedpolyfit : system undetermined\n"); return 0; } V = newVector(order); zeroVector(V); M = newMatrix(order, order); zeroMatrix(M); f = newVector(order); for(k = 0; k < n; k++) { f[0] = 1; for(i = 1; i < order; i++) f[i] = f[i-1]*X[k]; for(i = 0; i < order; i++) V[i] += W[k]*Y[k]*f[i]; for(i = 0; i < order; i++) for(j = 0; j < order; j++) M[i][j] += W[k]*f[i]*f[j]; } res = gaussjordan(M, V); deleteMatrix(M); deleteVector(f); if(res < 0) { deleteVector(V); fprintf(stderr, "weightedpolyfit : system not invertable\n"); return 0; } return V; } /* Routine to fit an (n-1)-th order polynomial to (X[i], Y[i-lag]) data * eg. if order=3, then the 3 element output vector contains * coefficients for x^0, x^1, and X^2 */ Vector polyfitwithlag(const Vector X, const Vector Y, int order, int lag) { Matrix M; Vector V; Vector f; int i, j, k, n; int res; int A, B; if(!VectorSizeSame(X, Y)) { fprintf(stderr, "polyfit : vectors not of same size\n"); return 0; } n = VectorSize(X)-abs(lag); if(n < order || order < 1) { fprintf(stderr, "polyfit : system undetermined\n"); return 0; } if(lag > 0) { A = lag; B = VectorSize(X); } else { A = 0; B = n; } V = newVector(order); zeroVector(V); M = newMatrix(order, order); zeroMatrix(M); f = newVector(order); for(k = A; k < B; k++) { f[0] = 1; for(i = 1; i < order; i++) f[i] = f[i-1]*X[k]; for(i = 0; i < order; i++) V[i] += Y[k-lag]*f[i]; for(i = 0; i < order; i++) for(j = 0; j < order; j++) M[i][j] += f[i]*f[j]; } res = gaussjordan(M, V); deleteMatrix(M); deleteVector(f); if(res < 0) { deleteVector(V); fprintf(stderr, "polyfit : system not invertable\n"); return 0; } return V; } /* Vector routines */ Vector newVector(int n) { Vector v; v = g_new(VectorType, n+1); v++; VectorSize(v) = n; totalvectordata += n; return v; } Vector newVectorfromarray(int n, const double *arr) { Vector v; int i; v = g_new(VectorType, n+1); v++; VectorSize(v) = n; totalvectordata += n; for(i = 0; i < n; i++) v[i] = arr[i]; return v; } Vector newVectorfromintVector(intVector v) { Vector u; int i, n; n = intVectorSize(v); u = newVector(n); for(i = 0; i < n; i++) u[i] = v[i]; return u; } void zeroVector(Vector v) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] = 0.0; } void fillVector(Vector v, double value) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] = value; } Vector dupVector(const Vector v) { int i, m; Vector v2; m = VectorSize(v); v2 = newVector(m); for(i = 0; i < m; i++) v2[i] = v[i]; return v2; } void deleteVector(Vector v) { totalvectordata -= VectorSize(v); g_free(v-1); } int Vectorisfinite(const Vector v) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) if(!finite(v[i])) return 0; return 1; } double dotVectors(const Vector v1, const Vector v2) { int i, m, n; double sum = 0; m = VectorSize(v1); n = VectorSize(v2); g_assert(m == n); for(i = 0; i < m; i++) sum += v1[i]*v2[i]; return sum; } void subfromVector(Vector a, const Vector b) { int i, m, n; m = VectorSize(a); n = VectorSize(b); g_assert(m == n); for(i = 0; i < m; i++) a[i] -= b[i]; } void addtoVector(Vector a, const Vector b) { int i, m; g_assert(VectorSizeSame(a, b)); m = VectorSize(a); for(i = 0; i < m; i++) a[i] += b[i]; } void addscaledVectortoVector(Vector a, const Vector b, double scale) { int i, m; if(scale == 0.0) return; g_assert(VectorSizeSame(a, b)); m = VectorSize(a); for(i = 0; i < m; i++) a[i] += scale*b[i]; } Vector addVectors(const Vector a, const Vector b) { int i, m; Vector Sum; g_assert(VectorSizeSame(a, b)); m = VectorSize(a); Sum = newVector(m); for(i = 0; i < m; i++) Sum[i] = a[i] + b[i]; return Sum; } Vector subVectors(const Vector a, const Vector b) { int i, m; Vector Dif; g_assert(VectorSizeSame(a, b)); m = VectorSize(a); Dif = newVector(m); for(i = 0; i < m; i++) Dif[i] = a[i] - b[i]; return Dif; } void copytoVector(Vector a, const Vector b) { int i, m; g_assert(a); g_assert(b); g_assert(VectorSizeSame(a, b)); m = VectorSize(a); for(i = 0; i < m; i++) a[i] = b[i]; } void scaleVector(Vector v, double f) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] *= f; } void biasVector(Vector v, double f) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] += f; } void squareVector(Vector v) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] = v[i]*v[i]; } void normalizeVector(Vector v) { scaleVector(v, 1.0/sqrt(Vectorsumsquare(v))); } void printVector(const Vector v) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) { if(i != 0) printf(" "); printf("%e", v[i]); } printf("\n"); } void applyfunctoVector(Vector v, double (*func)(double x)) { int i, m; m = VectorSize(v); for(i = 0; i < m; i++) v[i] = func(v[i]); } VectorType Vectormax(const Vector v) { VectorType max; int i, m; m = VectorSize(v); max = v[0]; for(i = 1; i < m; i++) if(v[i] > max) max = v[i]; return max; } VectorType Vectormin(const Vector v) { VectorType min; int i, m; m = VectorSize(v); min = v[0]; for(i = 1; i < m; i++) if(v[i] < min) min = v[i]; return min; } int Vectorfindmax(const Vector v) { VectorType max; int i, m, best; m = VectorSize(v); max = v[0]; best = 0; for(i = 1; i < m; i++) if(v[i] > max) { max = v[i]; best = i; } return best; } int Vectorfindmin(const Vector v) { VectorType min; int i, m, best; m = VectorSize(v); min = v[0]; best = 0; for(i = 1; i < m; i++) if(v[i] < min) { min = v[i]; best = i; } return best; } void Vectorminmax(const Vector v, VectorType *min, VectorType *max) { int i, m; m = VectorSize(v); *min = *max = v[0]; for(i = 1; i < m; i++) { if(v[i] < *min) *min = v[i]; if(v[i] > *max) *max = v[i]; } } VectorType interpolateVector(const Vector V, double index) { int N, i; double f; g_assert(V); N = VectorSize(V); if(index <= 0.0) return V[0]; if(index >= N-1) return V[N-1]; i = (int)index; f = index - i; return (1.0-f)*V[i] + f*V[i+1]; } #if 0 /* determine the interpolated index for a value */ double uninterpolateVector(const Vector V, double value) { double max, min; int i, N; g_assert(V); N = VectorSize(V); if( } #endif void saveVectorasascii(const Vector v, const char *filename) { FILE *out; int i, m; g_assert(v); out = fopen(filename, "w"); g_assert(out); m = VectorSize(v); for(i = 0; i < m; i++) fprintf(out, "%d %f\n", i, v[i]); fclose(out); } void saveVectorasformattedascii(const Vector v, const char *filename, const char *format) { FILE *out; int i, m; g_assert(v); out = fopen(filename, "w"); g_assert(out); m = VectorSize(v); for(i = 0; i < m; i++) { fprintf(out, "%d ", i); fprintf(out, format, v[i]); fprintf(out, "\n"); } fclose(out); } void Vectorsavebinary(const Vector v, const char *filename) { FILE *out; int m; g_assert(v); if(strcmp(filename, "-") == 0) out = stdout; else out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Vectorsavebinary : Error opening %s for write\n", filename); return; } m = VectorSize(v); fwrite(&m, sizeof(int), 1, out); fwrite(v, sizeof(VectorType), m, out); if(strcmp(filename, "-") != 0) fclose(out); } Vector Vectorloadbinary(const char *filename) { FILE *in; int m; Vector v; if(strcmp(filename, "-") == 0) in = stdin; else in = fopen(filename, "r"); if(!in) { fprintf(stderr, "Vectorloadbinary : Error opening %s for read\n", filename); return 0; } if(fread(&m, sizeof(int), 1, in) < 1) { fprintf(stderr, "Vectorloadbinary : Error reading from %s\n", filename); return 0; } g_assert(m > 0); v = newVector(m); g_assert(v); if(fread(v, sizeof(VectorType), m, in) < m) { fprintf(stderr, "WARNING: Vectorloadbinary : partial vector read from %s\n", filename); } if(strcmp(filename, "-") != 0) fclose(in); return v; } void VectormeanRMS(const Vector v, double *mean, double *rms) { double s=0.0, ss=0.0; int i, m; g_assert(v); m = VectorSize(v); for(i = 0; i < m; i++) { s += v[i]; ss += v[i]*v[i]; } s /= (float)m; ss /= (float)m; *mean = s; *rms = sqrt(ss-s*s); } double Vectorsum(const Vector v) { double s=0.0; int i, m; g_assert(v); m = VectorSize(v); for(i = 0; i < m; i++) s += v[i]; return s; } double Vectorsumsquare(const Vector v) { double s=0.0; int i, m; g_assert(v); m = VectorSize(v); for(i = 0; i < m; i++) s += v[i]*v[i]; return s; } double Vectormean(const Vector v) { double s=0.0; int i, m; g_assert(v); m = VectorSize(v); for(i = 0; i < m; i++) s += v[i]; return s / (float)m; } double Vectormeansquare(const Vector v) { double s=0.0; int i, m; g_assert(v); m = VectorSize(v); for(i = 0; i < m; i++) s += v[i]*v[1]; return s / (float)m; } double VectorRMS(const Vector v) { double mean, rms; VectormeanRMS(v, &mean, &rms); return rms; } double Vectormoment(const Vector v, int moment) { int i, n; double s = 0.0, val; g_assert(v); g_assert(moment >= 0); n = VectorSize(v); if(moment == 0) return n; for(i = 0; i < n; i++) { val = pow(fabs(v[i]), moment); if(moment % 2 && v[i] < 0.0) s -= val; else s += val; } return s; } /* New vector is factor smaller than src */ Vector rebinVector(const Vector src, int factor) { Vector v; int i, n, m; n = VectorSize(src); m = n/factor; n = m*factor; v = newVector(m); zeroVector(v); for(i = 0; i < n; i++) v[i/factor] += src[i]; scaleVector(v, 1.0/(float)factor); return v; } void Vectorboxcar(const Vector src, Vector dest, int s) { int i = 0, get, put, m=0; double sum = 0.0; int n; if(s <= 1) { if(s < 1) fprintf(stderr, "Vectorboxcar : Warning : s < 1\n"); copytoVector(dest, src); return; } n = VectorSize(src); get = 0; put = -s; for(;;) { if(get >= 0 && get < n) { sum += src[get]; m++; } if(put >= 0 && put < n) { sum -= src[put]; m--; } get++; put++; i = (get + put)/2; if(i < 0) continue; if(i >= n) break; dest[i] = sum/(double)m; } } double VectorAllanStandardDeviation(const Vector v, int lag, int pad, int step) { double ss = 0.0; double delta; int i = pad; int n; int m = 0; g_assert(v); n = VectorSize(v); if(step < 1) step = 1; for(i = pad; i < n - pad - lag; i += step) { delta = v[i] - v[i+lag]; ss += delta*delta; m++; } return sqrt(0.5*ss/(double)m); } intVector ComputeAllanLags(int n, double power) { intVector lags; double S; int lag, lastlag, m; lastlag = m = 0; for(S = 1.0; S < n/3.0; S*=power) { lag = (int)(S + 0.5); if(lag == lastlag) continue; m++; lastlag = lag; } lags = newintVector(m); lastlag = 0; m = 0; for(S = 1.0; S < n/3.0; S*=power) { lag = (int)(S + 0.5); if(lag == lastlag) continue; lags[m++] = lag; lastlag = lag; } return lags; } Vector VectorAllanStandardDeviations(const Vector v, const intVector lags) { Vector allanvar; Vector boxcar; int n, l, i, s; n = VectorSize(v); l = intVectorSize(lags); boxcar = newVector(n); allanvar = newVector(l); for(i = 0; i < l; i++) { s = lags[i]; Vectorboxcar(v, boxcar, s); allanvar[i] = VectorAllanStandardDeviation( boxcar, s, (s+1)/2, (s+3)/4); } deleteVector(boxcar); return allanvar; } int stringtoVector(const char *str, Vector v) { int n=0, l, i=0; double d; gchar *s; s = g_strdup(str); for(i = 0; s[i]; i++) { if(s[i] >= '0' && s[i] <= '9') continue; if(s[i] == '.' || s[i] == '+' || s[i] == '-') continue; if((s[i] == 'e' || s[i] == 'E') && (s[i+1] == '+' || s[i+1] == '-')) continue; s[i] = ' '; } i = 0; while(sscanf(s+n, "%lf%n", &d, &l) > 0) { if(v) if(i < VectorSize(v)) v[i] = d; i++; n+=l; } g_free(s); return i; } Vector newVectorfromstring(const char *str) { Vector v; int n; n = stringtoVector(str, 0); if(n == 0) return 0; v = newVector(n); stringtoVector(str, v); return v; } char *Vectortostring(const Vector v) { GString *str; gchar *out; char temp[100]; int i, n; g_assert(v); n = VectorSize(v); sprintf(temp, "%f", v[0]); str = g_string_new(temp); if(n > 1) for(i = 1; i < n; i++) { sprintf(temp, ", %f", v[i]); str = g_string_append(str, temp); } out = str->str; return out; } Vector *Vectorcolumnsfromfile(const char *filename, int mincols, int *ncol) { FILE *in; char format[] = "%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf"; double d[16]; int nc = 0, nr = 0, n, i, row; Vector *data; char l[1000]; in = fopen(filename, "r"); if(!in) { if(ncol != 0) *ncol = 0; return 0; } for(;;) { fgets(l, 999, in); if(feof(in)) break; if(l[0] == '#' || l[0] > 57 || l[0] == '*') continue; n = sscanf(l , format, d , d+1 , d+2 , d+3 , d+4 , d+5 , d+6 , d+7 , d+8 , d+9 , d+10, d+11, d+12, d+13, d+14, d+15); if(n >= mincols) { if(nc == 0) nc = n; if(n >= nc) nr++; } } fclose(in); data = g_new(Vector, nc+1); for(i = 0; i < nc; i++) data[i] = newVector(nr); data[nc] = 0; /* mark the end of the list. For code that ignores ncol */ in = fopen(filename, "r"); for(row = 0; row < nr;) { fgets(l, 999, in); if(feof(in)) break; if(l[0] == '#' || l[0] > 57) continue; n = sscanf(l , format, d , d+1 , d+2 , d+3 , d+4 , d+5 , d+6 , d+7 , d+8 , d+9 , d+10, d+11, d+12, d+13, d+14, d+15); if(n >= nc) { if(n >= nc) { for(i = 0; i < nc; i++) data[i][row] = d[i]; row++; } } } fclose(in); if(ncol != 0) *ncol = nc; return data; } int Vectorcolumnstofile(const Vector *data, const char *filename, int ncol) { FILE *out; int i, j, n; if(ncol <= 0) for(ncol = 0; data[ncol]; ncol++); for(i = 0; i < ncol; i++) { if(!data[i]) { fprintf(stderr, "Vectorcolumnstofile: null data " "column %d\n", i); return -1; } if(i > 0) if(!VectorSizeSame(data[0], data[i])) { fprintf(stderr, "Vectorcolumnstofile: vector size " "mismatch, cols %d %d\n", 0, i); return -1; } } n = VectorSize(data[0]); out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Vectorcolumnstofile: error opening file %s\n", filename); return -1; } for(j = 0; j < n; j++) { for(i = 0; i < ncol; i++) fprintf(out, "%10.5f ", data[i][j]); fprintf(out, "\n"); } fclose(out); return 0; } int Vectorcolumnstofilewithformat(const Vector *data, const char *filename, int ncol, const char *format) { FILE *out; int i, j, n; if(ncol <= 0) for(ncol = 0; data[ncol]; ncol++); for(i = 0; i < ncol; i++) { if(!data[i]) { fprintf(stderr, "Vectorcolumnstofile: null data " "column %d\n", i); return -1; } if(i > 0) if(!VectorSizeSame(data[0], data[i])) { fprintf(stderr, "Vectorcolumnstofile: vector size " "mismatch, cols %d %d\n", 0, i); return -1; } } n = VectorSize(data[0]); out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Vectorcolumnstofile: error opening file %s\n", filename); return -1; } for(j = 0; j < n; j++) { for(i = 0; i < ncol; i++) { fprintf(out, format, data[i][j]); fprintf(out, " "); } fprintf(out, "\n"); } fclose(out); return 0; } int Vectorcolumnstofilewithmask(const Vector *data, const Vector mask, const char *filename, int ncol) { FILE *out; int i, j, n; if(ncol <= 0) for(ncol = 0; data[ncol]; ncol++); for(i = 0; i < ncol; i++) { if(!data[i]) { fprintf(stderr, "Vectorcolumnstofile: null data " "column %d\n", i); return -1; } if(i > 0) if(!VectorSizeSame(data[0], data[i])) { fprintf(stderr, "Vectorcolumnstofile: vector size " "mismatch, cols %d %d\n", 0, i); return -1; } } n = VectorSize(data[0]); out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Vectorcolumnstofile: error opening file %s\n", filename); return -1; } for(j = 0; j < n; j++) { if(mask[j] < 0.5) continue; for(i = 0; i < ncol; i++) fprintf(out, "%10.5f ", data[i][j]); fprintf(out, "\n"); } fclose(out); return 0; } int Vectorcolumnstofilewithgaps(const Vector *data, const char *filename, int ncol, int refcol, double gap) { FILE *out; int i, j, n; if(ncol <= 0) for(ncol = 0; data[ncol]; ncol++); for(i = 0; i < ncol; i++) { if(!data[i]) { fprintf(stderr, "Vectorcolumnstofile: null data " "column %d\n", i); return -1; } if(i > 0) if(!VectorSizeSame(data[0], data[i])) { fprintf(stderr, "Vectorcolumnstofile: vector size " "mismatch, cols %d %d\n", 0, i); return -1; } } n = VectorSize(data[0]); out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Vectorcolumnstofile: error opening file %s\n", filename); return -1; } for(j = 0; j < n; j++) { if(j > 0) { if(data[refcol][j] > data[refcol][j-1]+gap) fprintf(out, "\n"); } for(i = 0; i < ncol; i++) fprintf(out, "%10.5f ", data[i][j]); fprintf(out, "\n"); } fclose(out); return 0; } Vector subVector(const Vector v, int n1, int n2) { Vector u; int i, m; g_assert(v); m = VectorSize(v); if(n1 < 0 || n2 < n1 || n2 > m) { fprintf(stderr, "subVector : range error\n"); return 0; } u = newVector(n2-n1+1); for(i = n1; i <= n2; i++) u[i-n1] = v[i]; return u; } Vector newunitVector(const Vector v) { Vector u; double l; l = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); if(l == 0.0) return 0; u = dupVector(v); u[0] /= l; u[1] /= l; u[2] /= l; return u; } int Vectorisincreasing(const Vector v) { int i, N; g_assert(v); N = VectorSize(v); if(N < 2) return 1; for(i = 1; i < N; i++) if(v[i] < v[i-1]) return 0; return 1; } int Vectorisdecreasing(const Vector v) { int i, N; g_assert(v); N = VectorSize(v); if(N < 2) return 1; for(i = 1; i < N; i++) if(v[i] > v[i-1]) return 0; return 1; } /* Matrix Routines */ /* newMatrix returns matrix with dimensions [n][m] */ Matrix newpaddedMatrix(int n, int m, int rowpad) { Matrix M; MatrixTypePointer D; int j, w; w = m+rowpad; D = g_new(MatrixType, w*n+MATRIXVALUESPERBLOCK)+MATRIXVALUESPERBLOCK; M = g_new(MatrixTypePointer, ((n>1) ? (n+MATRIXSTUBINDICES) : (2+MATRIXSTUBINDICES))); M += MATRIXSTUBINDICES; MatrixStub(M)->datastart = D; MatrixStub(M)->n = n; MatrixStub(M)->m = m; MatrixStub(M)->rowpad = rowpad; Matrixrefcount(M) = 1; for(j = 0; j < n; j++) M[j] = D + (j*w); /* Index array for [][] */ if(n == 1) M[1] = D + w; return M; } void deleteMatrix(Matrix M) { MatrixStubType *ms; g_assert(M); Matrixrefcount(M)--; ms = MatrixStub(M); if(Matrixrefcount(M) <= 0) { if(ms->datastart-MATRIXVALUESPERBLOCK == 0) fprintf(stderr, "ACK!!! matrix data gone!\n"); else g_free(ms->datastart-MATRIXVALUESPERBLOCK); } g_free(ms); } Matrix refsubMatrix(const Matrix M, int n1, int m1, int n2, int m2) { Matrix N; int j, m, n, w; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n) { fprintf(stderr, "subMatrix: limit error\n"); return 0; } w = Matrixstride(M); N = g_new(MatrixTypePointer, ((n>1) ? (n+MATRIXSTUBINDICES) : (2+MATRIXSTUBINDICES))); N += MATRIXSTUBINDICES; MatrixStub(N)->datastart = MatrixStub(M)->datastart; MatrixStub(N)->n = n2-n1+1; MatrixStub(N)->m = m2-m1+1; MatrixStub(N)->rowpad = w-(m2-m1+1); Matrixrefcount(M)++; for(j = 0; j <= n2-n1; j++) N[j] = M[n1] + m1 + (j*w); if(n2 == n1) N[1] = N[0]+w; return N; } void Matrixsavebinary(const Matrix M, const char *filename) { FILE *out; int m, n, p; g_assert(M); if(strcmp(filename, "-") == 0) out = stdout; else out = fopen(filename, "w"); if(!out) { fprintf(stderr, "Matrixsavebinary : Error opening %s for write\n", filename); return; } n = MatrixSize1(M); m = MatrixSize2(M); p = Matrixrowpad(M); fwrite(&n, sizeof(int), 1, out); fwrite(&m, sizeof(int), 1, out); fwrite(&p, sizeof(int), 1, out); fwrite(M[0], sizeof(MatrixType), n*(m+p), out); if(strcmp(filename, "-") != 0) fclose(out); } Matrix Matrixloadbinary(const char *filename) { FILE *in; int m, n, p; Matrix M; if(strcmp(filename, "-") == 0) in = stdin; else in = fopen(filename, "r"); if(!in) { fprintf(stderr, "Matrixloadbinary : Error opening %s for read\n", filename); return 0; } if(!fread(&n, sizeof(int), 1, in) || !fread(&m, sizeof(int), 1, in) || !fread(&p, sizeof(int), 1, in)) { fprintf(stderr, "Matrixloadbinary : Error reading from %s .\n", filename); return 0; } M = newpaddedMatrix(n, m, p); g_assert(M); if(fread(M[0], sizeof(MatrixType), n*(m+p), in) < n*(m+p)) fprintf(stderr, "WARNING: Matrixloadbinary : partial matrix loaded from %s\n", filename); return M; } void zeroMatrix(Matrix M) { int i, j, m, n; MatrixTypePointer Mrow; n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) { Mrow = M[j]; for(i = 0; i < m; i++) Mrow[i] = 0.0; } } Matrix dupMatrix(const Matrix M) { int i, j, m, n; Matrix M2; n = MatrixSize1(M); m = MatrixSize2(M); M2 = newpaddedMatrix(n, m, Matrixrowpad(M)); for(i = 0; i < m; i++) for(j = 0; j < n; j++) M2[j][i] = M[j][i]; return M2; } void printMatrix(const Matrix M) { int i, j, n, m; if(!M) { printf("printMatrix: NULL\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); printf("Matrix (%d by %d)\n", n, m); for(j = 0; j < n; j++) { for(i = 0; i < m; i++) printf("%12f ", M[j][i]); printf("\n"); } } Matrix repadMatrix(const Matrix M, int pad) { int i, j, m, n; Matrix M2; n = MatrixSize1(M); m = MatrixSize2(M); M2 = newpaddedMatrix(n, m, pad); for(i = 0; i < m; i++) for(j = 0; j < n; j++) M2[j][i] = M[j][i]; return M2; } MatrixType Matrixmax(const Matrix M) { MatrixType max; int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); max = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] > max) max = M[j][i]; return max; } MatrixType Matrixmaxvalue(const Matrix M, int *bestj, int *besti) { MatrixType max; int i, j, m, n, a, b; n = MatrixSize1(M); m = MatrixSize2(M); max = M[0][0]; a = b = 0; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] > max) { max = M[j][i]; a = i; b = j; } if(bestj) *bestj = b; if(besti) *besti = a; return max; } MatrixType Matrixmin(const Matrix M) { MatrixType min; int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); min = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] < min) min = M[j][i]; return min; } MatrixType Matrixminvalue(const Matrix M, int *bestj, int *besti) { MatrixType min; int i, j, m, n, a, b; n = MatrixSize1(M); m = MatrixSize2(M); min = M[0][0]; a = b = 0; for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(M[j][i] < min) { min = M[j][i]; a = i; b = j; } if(bestj) *bestj = b; if(besti) *besti = a; return min; } void Matrixminmax(const Matrix M, MatrixType *min, MatrixType *max) { int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); *min = *max = M[0][0]; for(i = 0; i < m; i++) for(j = 0; j < n; j++) { if(M[j][i] < *min) *min = M[j][i]; if(M[j][i] > *max) *max = M[j][i]; } } /* Find best fit to M(y, x) = Ayy (y-y0)^2 + Axy (x-x0) (y-y0) + Axx (x-x0)^2 +C to matrix M, using a patch of size (2 py + 1)*(2 px + 1) centered at y , x . The value C is returned */ double Matrixpeakup(const Matrix D, int y, int x, int py, int px, double *y0, double *x0, double *Ayy, double *Axy, double *Axx) { int m, n, i, j, a, b, u, v; Vector V; Matrix M; double f[6], C; int res; g_assert(D); n = MatrixSize1(D); m = MatrixSize2(D); V = newVector(6); M = newMatrix(6, 6); zeroVector(V); zeroMatrix(M); f[5] = 1.0; for(b = -py; b <= py; b++) { j = b + y; if(j < 0) j += n; else if(j >= n) j -= n; f[2] = b*b; f[4] = b; for(a = -px; a <= px; a++) { i = a + x; if(i < 0) i += m; else if(i >= m) i -= m; f[0] = a*a; f[1] = a*b; f[3] = a; for(u = 0; u < 6; u++) V[u] += f[u]*D[j][i]; for(v = 0; v < 6; v++) for(u = 0; u < 6; u++) M[v][u] += f[u]*f[v]; } } res = gaussjordan(M, V); g_assert(res == 1); deleteMatrix(M); if(Ayy) *Ayy = V[2]; if(Axy) *Axy = V[1]; if(Axx) *Axx = V[0]; C = 4.0*V[0]*V[2] - V[1]*V[1]; if(y0) *y0 = (float)y + (V[1]*V[3] - 2.0*V[0]*V[4])/C; if(x0) *x0 = (float)x + (V[1]*V[4] - 2.0*V[2]*V[3])/C; C = V[5]; deleteVector(V); return C; } void scaleMatrix(Matrix M, double f) { int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] *= f; } void addscaledMatrixtoMatrix(Matrix a, const Matrix b, double scale) { int i, j, m, n; if(scale == 0.0) return; g_assert(MatrixSizeSame(a, b)); n = MatrixSize1(a); m = MatrixSize2(a); for(j = 0; j < n; j++) for(i = 0; i < m; i++) a[j][i] += scale*b[j][i]; } void biasMatrix(Matrix M, double f) { int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] += f; } void addtoMatrix(Matrix M, const Matrix N) { int i, j, m, n; g_assert(MatrixSizeSame(M, N)); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] += N[j][i]; } void subfromMatrix(Matrix M, const Matrix N) { int i, j, m, n; g_assert(MatrixSizeSame(M, N)); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] -= N[j][i]; } Matrix addMatrices(const Matrix M, const Matrix N) { int i, j, m, n; Matrix Sum; g_assert(MatrixSizeSame(M, N)); n = MatrixSize1(M); m = MatrixSize2(M); Sum = newMatrix(n, m); for(j = 0; j < n; j++) for(i = 0; i < m; i++) Sum[j][i] = M[j][i] + N[j][i]; return Sum; } void copytoMatrix(Matrix M, const Matrix N) { int i, j, m, n; g_assert(MatrixSizeSame(M, N)); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = N[j][i]; } void applyfunctoMatrix(Matrix M, double (*func)(double x)) { int i, j, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = func(M[j][i]); } Matrix Matrixproduct(Vector v2, Vector v1) { Matrix M; int i, j, m, n; g_assert(v2); g_assert(v1); M = newMatrix(Vectorlength(v2), Vectorlength(v1)); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] = v2[j]*v1[i]; return M; } Matrix dupsubMatrix(const Matrix M, int n1, int m1, int n2, int m2) { Matrix N; int i, j, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n) { fprintf(stderr, "dupsubMatrix: limit error\n"); return 0; } N = newMatrix(n2-n1+1, m2-m1+1); for(j = n1; j <= n2; j++) for(i = m1; i <= m2; i++) N[j-n1][i-m1] = M[j][i]; return N; } /* Copy region (m1, n1)-(m2, n2) from M to region (m3, n3) in N */ void copysubMatrix(Matrix N, const Matrix M, int n1, int m1, int n2, int m2, int n3, int m3) { int i, j, m, n; g_assert(M); g_assert(N); n = MatrixSize1(M); m = MatrixSize2(M); if(n1 < 0) n1 = 0; if(n2 < 0) n2 = n-1; if(m1 < 0) m1 = 0; if(m2 < 0) m2 = m-1; if(n2 < n1 || m2 < m1 || m2 >= m || n2 >= n || n3 >= MatrixSize1(N) || m3 >= MatrixSize2(N)) { fprintf(stderr, "copysubMatrix: limit error\n"); return; } if(n3 < 0) n3 = MatrixSize1(N)-(n2-n1); if(m3 < 0) m3 = MatrixSize2(N)-(m2-m1); if(n3 < 0) { n1 -= n3; n3 = 0; } if(m3 < 0) { m1 -= m3; m3 = 0; } if(n3+n2-n1 >= MatrixSize1(N)) n2 = n1-n3+MatrixSize1(N)-1; if(m3+m2-m1 >= MatrixSize2(N)) m2 = m1-m3+MatrixSize2(N)-1; for(j = n1; j <= n2; j++) for(i = m1; i <= m2; i++) N[j+n1-n3][i+m1-m3] = M[j][i]; } Vector Matrixrow(const Matrix M, int row) { Vector V; int m, n, i; MatrixTypePointer Mrow; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(row < 0) row = n-row; g_assert((row < n) && (row >= 0)); Mrow = M[row]; V = newVector(m); for(i = 0; i < m; i++) V[i] = Mrow[i]; return V; } Vector Matrixcolumn(const Matrix M, int column) { Vector V; int m, n, j; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(column < 0) column = m-column; g_assert((column < m) && (column >= 0)); V = newVector(n); for(j = 0; j < n; j++) V[j] = M[j][column]; return V; } Vector sumMatrixrows(const Matrix M) { Vector V; int m, n, i, j; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); V = newVector(m); zeroVector(V); for(j = 0; j < n; j++) for(i = 0; i < m; i++) V[i] += M[j][i]; return V; } Vector sumMatrixcolumns(const Matrix M) { Vector V; int m, n, i, j; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); V = newVector(n); zeroVector(V); for(j = 0; j < n; j++) for(i = 0; i < m; i++) V[j] += M[j][i]; return V; } void MatrixmeanRMS(const Matrix M, double *rms, double *mean) { double s=0.0, ss = 0.0; int m, n, i, j; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) { s += M[j][i]; ss += M[j][i]*M[j][i]; } s /= (float)(m*n); ss /= (float)(m*n); *rms = s; *mean = sqrt(ss-s*s); } double Matrixmean(const Matrix M) { double mean, rms; MatrixmeanRMS(M, &mean, &rms); return mean; } double MatrixRMS(const Matrix M) { double mean, rms; MatrixmeanRMS(M, &mean, &rms); return rms; } /* C[i][k] = sum_j A[i][j] B[j][k] */ Matrix Matrixmultiply(const Matrix A, const Matrix B) { int i, j, k, l, m, n; Matrix C; g_assert(MatrixSize2(A) == MatrixSize1(B)); l = MatrixSize1(A); m = MatrixSize2(A); n = MatrixSize2(B); C = newMatrix(l, n); zeroMatrix(C); for(k = 0; k < n; k++) for(j = 0; j < m; j++) for(i = 0; i < l; i++) C[i][k] += A[i][j]*B[j][k]; return C; } /* C[i][k] = sum_j A[i][j] B[j][k] */ void copyMatrixmultiply(Matrix C, const Matrix A, const Matrix B) { int i, j, k, l, m, n; g_assert(MatrixSize2(A) == MatrixSize1(B)); g_assert(MatrixSize1(C) == MatrixSize1(A)); g_assert(MatrixSize2(C) == MatrixSize2(B)); l = MatrixSize1(A); m = MatrixSize2(A); n = MatrixSize2(B); zeroMatrix(C); for(k = 0; k < n; k++) for(j = 0; j < m; j++) for(i = 0; i < l; i++) C[i][k] += A[i][j]*B[j][k]; } Vector MatrixVectormultiply(const Matrix M, const Vector V) { int m, n; int i, j; Vector v; g_assert(M); g_assert(V); m = MatrixSize1(M); n = MatrixSize2(M); g_assert(VectorSize(V) == n); v = newVector(m); zeroVector(v); for(i = 0; i < m; i++) for(j = 0; j < n; j++) v[i] += M[i][j]*V[j]; return v; } void Matrixmultiplyelements(Matrix M, const Matrix N) { int m, n, i, j; g_assert(M); g_assert(N); if(!MatrixSizeSame(M, N)) { fprintf(stderr, "Matrixmultiply: dissimilar matrices\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] *= N[j][i]; } void Matrixdivideelements(Matrix M, const Matrix N) { int m, n, i, j; g_assert(M); g_assert(N); if(!MatrixSizeSame(M, N)) { fprintf(stderr, "Matrixdivide: dissimilar matrices\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) M[j][i] /= N[j][i]; } Matrix Matrixcomplexamplitudes(const Matrix M) { int m, n, i, j, p; Matrix N; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); p = Matrixrowpad(M); g_assert( (!(p%2)) && (!(m%2)) ); N = newpaddedMatrix(n, m/2, p/2); for(j = 0; j < n; j++) for(i = 0; i < (m+p)/2; i++) N[j][i] = sqrt(M[j][2*i]*M[j][2*i] + M[j][2*i+1]*M[j][2*i+1]); return N; } Matrix Matrixcomplexphases(const Matrix M) { int m, n, i, j, p; Matrix N; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); p = Matrixrowpad(M); g_assert( (!(p%2)) && (!(m%2)) ); N = newpaddedMatrix(n, m/2, p/2); for(j = 0; j < n; j++) for(i = 0; i < (m+p)/2; i++) N[j][i] = atan2(M[j][2*i+1], M[j][2*i]); return N; } /* M[i][j] = M[i][j] * N[i][j] */ void Matrixcomplexmultiply(Matrix M, const Matrix N, int pad) { int m, n, i, j; double re, im; g_assert(M); g_assert(N); if(!MatrixSizeSame(M, N)) { fprintf(stderr, "Matrixcomplexmultiply: dissimilar matrices\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); if(m%2) { fprintf(stderr, "Matrixcomplexmultiply: odd matrix size\n"); return; } for(j = 0; j < n; j++) for(i = 0; i < m+pad; i+=2) { re = M[j][i]*N[j][i] - M[j][i+1]*N[j][i+1]; im = M[j][i]*N[j][i+1] + M[j][i+1]*N[j][i]; M[j][i] = re; M[j][i+1] = im; } } /* M[i][j] = M[i][j] * N*[i][j] (M[i][j] times complex conjugate of N[i][j]) */ void Matrixcomplexconjugatemultiply(Matrix M, const Matrix N, int pad) { int m, n, i, j; double re, im; g_assert(M); g_assert(N); if(!MatrixSizeSame(M, N)) { fprintf(stderr, "Matrixcomplexmultiply: dissimilar matrices\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); if(m%2) { fprintf(stderr, "Matrixcomplexmultiply: odd matrix size\n"); return; } for(j = 0; j < n; j++) for(i = 0; i < m+pad; i+=2) { re = M[j][i]*N[j][i] + M[j][i+1]*N[j][i+1]; im = -M[j][i]*N[j][i+1] + M[j][i+1]*N[j][i]; M[j][i] = re; M[j][i+1] = im; } } /* M[i][j] = M[i][j] / N[i][j] */ void Matrixcomplexdivide(Matrix M, const Matrix N, int pad) { int m, n, i, j; double re, im, mag2; g_assert(M); g_assert(N); if(!MatrixSizeSame(M, N)) { fprintf(stderr, "Matrixcomplexmultiply: dissimilar matrices\n"); return; } n = MatrixSize1(M); m = MatrixSize2(M); if(m%2) { fprintf(stderr, "Matrixcomplexmultiply: odd matrix size\n"); return; } for(j = 0; j < n; j++) for(i = 0; i < m+pad; i+=2) { re = M[j][i]*N[j][i] + M[j][i+1]*N[j][i+1]; im = -M[j][i]*N[j][i+1] + M[j][i+1]*N[j][i]; mag2 = N[j][i]*N[j][i] + N[j][i+1]*N[j][i+1]; if(mag2 == 0.0) M[j][i] = M[j][i+1] = 0.0; else { M[j][i] = re/mag2; M[j][i+1] = im/mag2; } } } Vector Matrixhistogram(const Matrix M, int bins) { Vector V; MatrixType min, max; double delta; int m, n, i, j; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); Matrixminmax(M, &min, &max); V = newVector(bins); zeroVector(V); delta = ((float)bins-0.01)/(max-min); for(j = 0; j < n; j++) for(i = 0; i < m; i++) V[((int)((M[j][i]-min)*delta))] += 1.0; return V; } Matrix quarterbinMatrix(const Matrix M) { Matrix N; int i, j, m, n; g_assert(M); n = MatrixSize1(M)/2; m = MatrixSize2(M)/2; N = newMatrix(n, m); for(j = 0; j < n; j++) for(i = 0; i < m; i++) { N[j][i] = 0.25*(M[j*2][i*2] + M[j*2+1][i*2] + M[j*2][i*2+1] + M[j*2+1][i*2+1]); } return N; } Matrix rollMatrix(const Matrix M, int delta_n, int delta_m) { Matrix N; int i, j, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); N = newMatrix(n, m); for(j = 0; j < n; j++) for(i = 0; i < m; i++) N[j][i] = M[(j + delta_n) % n][(i + delta_m) % m]; return N; } void rollMatrixinplace(Matrix M, int delta_n, int delta_m) { Vector v; int rowcount; int startrow = 0, row; int i, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); delta_n = (n+delta_n) % n; delta_m = (m+delta_m) % m; v = Matrixrow(M, 0); row = (n-delta_n) % n; for(rowcount = n-1; rowcount >= 0; rowcount--) { if(row == startrow) { for(i = 0; i < m; i++) M[(row + delta_n) % n][(i+delta_m) % m] = v[i]; startrow = row = (row + 1) % n; if(rowcount) for(i = 0; i < m; i++) v[i] = M[row][i]; } else for(i = 0; i < m; i++) M[(row + delta_n) % n][(i + delta_m) % m] = M[row][i]; row = (row - delta_n + n) % n; } deleteVector(v); } Matrix transposeMatrix(const Matrix M) { Matrix N; int i, j, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); N = newMatrix(m, n); for(j = 0; j < n; j++) for(i = 0; i < m; i++) N[i][j] = M[j][i]; return N; } void transposeMatrixinplace(Matrix M) { int i, j, n; MatrixType t; g_assert(M); n = MatrixSize1(M); if(n != MatrixSize2(M)) { fprintf(stderr, "transposeMatrixinplace : not square\n"); return; } for(j = 1; j < n; j++) for(i = 0; i < j; i++) { t = M[i][j]; M[i][j] = M[j][i]; M[j][i] = t; } } /* reflect matrix such that M[j][i] <--> M[n-j-1][i] */ void reflectMatrix1inplace(Matrix M) { int i, j, m, n, n1, nmax; MatrixType t; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(n < 2) return; n1 = n-1; nmax = n/2; for(j = 0; j < nmax; j++) { for(i = 0; i < m; i++) { t = M[j][i]; M[j][i] = M[n1-j][i]; M[n1-j][i] = t; } } } /* reflect matrix such that M[j][i] <--> M[j][m-i-1] */ void reflectMatrix2inplace(Matrix M) { int i, j, m, n, m1, mmax; MatrixType t; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); if(m < 2) return; m1 = m-1; mmax = m/2; for(j = 0; j < n; j++) { for(i = 0; i < mmax; i++) { t = M[j][i]; M[j][i] = M[j][m1-i]; M[j][m1-i] = t; } } } void symmetrizeMatrixinplace(Matrix M) { int i, j, n; g_assert(M); g_assert(Matrixissquare(M)); n = MatrixSize1(M); for(i = 1; i < n; i++) for(j = 0; j < i; j++) M[i][j] = M[j][i] = 0.5*(M[i][j] + M[j][i]); } void antisymmetrizeMatrixinplace(Matrix M) { int i, j, n; g_assert(M); g_assert(Matrixissquare(M)); n = MatrixSize1(M); for(i = 0; i < n; i++) M[i][i] = 0.0; for(i = 1; i < n; i++) for(j = 0; j < i; j++) { M[j][i] = 0.5*(M[j][i] - M[i][j]); M[i][j] = -M[j][i]; } } /* Make rotation matrix. angles in degrees */ Matrix newrotationMatrix(double rx, double ry, double rz) { Matrix M; double mx[3][3], my[3][3], mz[3][3], m1[3][3]; int i, j, k; rx = rx*M_PI/180.0; ry = ry*M_PI/180.0; rz = rz*M_PI/180.0; M = newMatrix(3, 3); zeroMatrix(M); mx[0][0] = 1.0; mx[0][1] = 0.0; mx[0][2] = 0.0; mx[1][0] = 0.0; mx[1][1] = cos(rx); mx[1][2] = sin(rx); mx[2][0] = 0.0; mx[2][1] = -sin(rx); mx[2][2] = cos(rx); my[0][0] = cos(ry); my[0][1] = 0.0; my[0][2] = -sin(ry); my[1][0] = 0.0; my[1][1] = 1.0; my[1][2] = 0.0; my[2][0] = sin(ry); my[2][1] = 0.0; my[2][2] = cos(ry); mz[0][0] = cos(rz); mz[0][1] = sin(rz); mz[0][2] = 0.0; mz[1][0] = -sin(rz); mz[1][1] = cos(rz); mz[1][2] = 0.0; mz[2][0] = 0.0; mz[2][1] = 0.0; mz[2][2] = 1.0; for(j = 0; j < 3; j++) for(i = 0; i < 3; i++) m1[j][i] = 0.0; for(j = 0; j < 3; j++) for(i = 0; i < 3; i++) for(k = 0; k < 3; k++) m1[j][i] += mx[j][k]*my[k][i]; for(j = 0; j < 3; j++) for(i = 0; i < 3; i++) for(k = 0; k < 3; k++) M[j][i] += m1[j][k]*mz[k][i]; return M; } void clipMatrix(Matrix M, double min, double max) { int i, j, m, n; g_assert(M); n = MatrixSize1(M); m = MatrixSize2(M); for(j = 0; j < n; j++) for(i = 0; i < m; i++) { if(M[j][i] > max) M[j][i] = max; if(M[j][i] < min) M[j][i] = min; } } /* inverts a lower triangular matrix. The output is always lower triangular */ Matrix LMatrixinvert(const Matrix L) { Matrix a; Vector p; int i, j, k, n; double sum; g_assert(L); g_assert(Matrixislower(L)); a = dupMatrix(L); n = MatrixSize1(L); p = newVector(n); for(i = 0; i < n; i++) p[i] = a[i][i]; for(i = 0; i < n; i++) { a[i][i] = 1.0/p[i]; for(j = i+1; j < n; j++) { sum = 0.0; for(k = i; k < j; k++) sum -= a[j][k]*a[k][i]; a[j][i] = sum/p[j]; } } deleteVector(p); for(i = 1; i < n; i++) for(j = 0; j < i; j++) a[j][i] = 0.0; return a; } /* returned matrix is lower triangular, ie a[j][i] == 0 for j < i */ Matrix choleskydecompose(const Matrix A) { int N; Matrix a; Vector p; double sum; int i, j, k; g_assert(A); g_assert(Matrixissymmetric(A)); N = MatrixSize1(A); g_assert(N > 0); g_assert(MatrixSize2(A) == N); /* first decompose A a la Num Rec */ a = dupMatrix(A); p = newVector(N); for(i = 0; i < N; i++) for(j = i; j < N; j++) { sum = a[i][j]; if(i > 0) for(k = i-1; k >= 0; k--) sum -= a[i][k]*a[j][k]; if(i == j) { if(sum < 0.0) { deleteVector(p); deleteMatrix(a); return 0; } p[i] = sqrt(sum); } else a[j][i] = sum/p[i]; } for(i = 0; i < N; i++) a[i][i] = p[i]; for(i = 1; i < N; i++) for(j = 0; j < i; j++) a[j][i] = 0.0; deleteVector(p); return a; } /* same as above, but use long doubles internally */ Matrix choleskydecomposeld(const Matrix A) { int N; long double **a; long double *p; long double sum; Matrix M; int i, j, k; g_assert(A); g_assert(Matrixissymmetric(A)); N = MatrixSize1(A); g_assert(N > 0); g_assert(MatrixSize2(A) == N); /* first decompose A a la Num Rec */ a = g_new(long double *, N); for(i = 0; i < N; i++) { a[i] = g_new(long double, N); for(j = 0; j < N; j++) a[i][j] = A[i][j]; } p = g_new(long double, N); for(i = 0; i < N; i++) for(j = i; j < N; j++) { sum = a[i][j]; if(i > 0) for(k = i-1; k >= 0; k--) sum -= a[i][k]*a[j][k]; if(i == j) { if(sum < 0.0) { g_free(p); for(i = 0; i < N; i++) g_free(a[i]); g_free(a); return 0; } p[i] = sqrtl(sum); } else a[j][i] = sum/p[i]; } for(i = 0; i < N; i++) a[i][i] = p[i]; for(i = 1; i < N; i++) for(j = 0; j < i; j++) a[j][i] = 0.0; g_free(p); M = newMatrix(N, N); for(i = 0; i < N; i++) { for(j = 0; j < N; j++) M[i][j] = a[i][j]; g_free(a[i]); } g_free(a); return M; } /* Solved A*x = B for symmetric, pos. def. A * * call with B = 0 to just factor A into L L^t * * returns 0 if decomposition is not possible. If B != 0, return value * is the solution og A x = B. Else return non-zero pointer. */ Vector cholesky(const Matrix A, const Vector B) { int N; Matrix a; Vector p, x; double sum; int i, j, k; g_assert(A); g_assert(Matrixissymmetric(A)); N = MatrixSize1(A); g_assert(N > 0); g_assert(MatrixSize2(A) == N); /* first decompose A a la Num Rec */ a = dupMatrix(A); p = newVector(N); for(i = 0; i < N; i++) for(j = i; j < N; j++) { sum = a[i][j]; if(i > 0) for(k = i-1; k >= 0; k--) sum -= a[i][k]*a[j][k]; if(i == j) { if(sum <= 0.0) { deleteVector(p); deleteMatrix(a); return 0; } p[i] = sqrt(sum); } else a[j][i] = sum/p[i]; } if(B == 0) return A[0]; g_assert(VectorSize(B) == N); /* now solve */ x = newVector(N); x[0] = B[0]/p[0]; for(i = 1; i < N; i++) { sum = B[i]; for(k = i-1; k >= 0; k--) sum -= a[i][k]*x[k]; x[i] = sum/p[i]; } x[N-1] /= p[N-1]; for(i = N-2; i >= 0; i--) { sum = x[i]; for(k = i+1; k < N; k++) sum -= a[k][i]*x[k]; x[i] = sum/p[i]; } deleteVector(p); deleteMatrix(a); return x; } int choleskyinvert(Matrix A) { int i, j, k, N; Matrix L, Li; g_assert(Matrixissquare(A)); N = MatrixSize1(A); L = choleskydecompose(A); if(!L) { printf("Inversion failed\n"); return 0; } Li = LMatrixinvert(L); deleteMatrix(L); zeroMatrix(A); for(j = 0; j < N; j++) for(k = 0; k <= j; k++) for(i = 0; i <= j; i++) A[i][k] += Li[j][i]*Li[j][k]; deleteMatrix(Li); return 1; } int Matrixisposdef(const Matrix M) { Matrix N; int i, j, m; g_assert(Matrixissquare(M)); N = dupMatrix(M); m = MatrixSize1(M); /* symmetrize */ for(j = 0; j < m; j++) for(i = 0; i < j; i++) N[j][i] = N[i][j] = M[j][i] + M[i][j]; /* if cholesky decomposition is possible, then it is pos def. */ if(cholesky(N, 0) != 0) return 1; else return 0; } int Matrixisposdef2(const Matrix M, int niter) { Vector V; int i, j, k, m, neg=0; double sum; g_assert(Matrixissquare(M)); m = MatrixSize1(M); V = newVector(m); for(i = 0; i < niter; i++) { for(j = 0; j < m; j++) V[j] = rand_gauss(); sum = 0; for(j = 0; j < m; j++) for(k = 0; k < m; k++) sum += V[j]*M[j][k]*V[k]; printf("%f\n", sum); if(sum < 0) neg++; } printf("%d of %d were negative\n", neg, niter); deleteVector(V); if(neg == 0) return 1; else return 0; } int Matrixisfinite(const Matrix M) { int i, j, m, n; n = MatrixSize1(M); m = MatrixSize2(M); for(i = 0; i < m; i++) for(j = 0; j < n; j++) if(!finite(M[j][i])) return 0; return 1; } int Matrixislower(const Matrix M) { int i, j, n; if(!Matrixissquare(M)) return 0; n = MatrixSize1(M); for(j = 1; j < n; j++) for(i = 0; i < j; i++) if(M[i][j] != 0.0) return 0; return 1; } int Matrixisupper(const Matrix M) { int i, j, n; if(!Matrixissquare(M)) return 0; n = MatrixSize1(M); for(j = 1; j < n; j++) for(i = 0; i < j; i++) if(M[j][i] != 0.0) return 0; return 1; } int Matrixistridiag(const Matrix M) { int i, j, n; if(!Matrixissquare(M)) return 0; n = MatrixSize1(M); if(n < 3) return 1; for(j = 2; j < n; j++) for(i = 0; i < j-1; i++) if(M[j][i] != 0.0 || M[i][j] != 0.0) return 0; return 1; } int Matrixissymmetric(const Matrix M) { int i, j, n; if(!Matrixissquare(M)) return 0; n = MatrixSize1(M); for(j = 1; j < n; j++) for(i = 0; i < j; i++) if(M[i][j] != M[j][i]) return 0; return 1; } cassbeam-1.1/vector.h000066400000000000000000000215771275012243400146200ustar00rootroot00000000000000/* cassbeam - a Cassegrain antenna simulator Copyright (C) August 18, 2003 Walter Brisken This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifndef __VECTOR__ #define __VECTOR__ #include "intvector.h" /* TODO: Need to speed up matrix functions by defining Mrow = M[j] */ /* Uncomment next line to use floats instead of doubles */ // #define FLOATVECTOR */ #ifdef FLOATVECTOR typedef float* Vector; typedef float VectorType; typedef float* VectorTypePointer; typedef float** Matrix; typedef float MatrixType; typedef float* MatrixTypePointer; #else typedef double* Vector; typedef double VectorType; typedef double* VectorTypePointer; typedef double** Matrix; typedef double MatrixType; typedef double* MatrixTypePointer; #endif typedef struct { MatrixTypePointer datastart; int n, m, rowpad; } MatrixStubType; #define MATRIXALIGN 32 #define MATRIXSTUBBLOCKS (((sizeof(MatrixStubType)-1)/MATRIXALIGN)+1) #define MATRIXSTUBINDICES (((MATRIXALIGN*MATRIXSTUBBLOCKS-1)/ \ sizeof(MatrixTypePointer))+1) #define MATRIXVALUESPERBLOCK (((MATRIXALIGN-1)/sizeof(MatrixType))+1) #define MatrixStub(M) ((MatrixStubType *)(M-MATRIXSTUBINDICES)) #define constMatrixStub(M) ((const MatrixStubType *)(M-MATRIXSTUBINDICES)) #define VectorSize(v) (((int *)(v))[-1]) #define Vectorlength(v) (((const int *)(v))[-1]) #define MatrixSize1(M) (constMatrixStub((M))->n) #define MatrixSize2(M) (constMatrixStub((M))->m) #define Matrixrowpad(M) (constMatrixStub((M))->rowpad) #define Matrixstride(M) (((M)[1]-(M)[0])) #define Matrixrefcount(M) (*((int *)((MatrixStub((M))->datastart)- \ MATRIXVALUESPERBLOCK))) #define newMatrix(n, m) newpaddedMatrix((n), (m), 0) #define refMatrix(M) refsubMatrix((M), 0, 0, -1, -1) #define VectorSizeSame(U, V) (Vectorlength((U)) == Vectorlength((V))) #define MatrixSizeSame(M, N) ((MatrixSize1((M)) == MatrixSize1((N))) && \ (MatrixSize2((M)) == MatrixSize2((N)))) #define Matrixissquare(M) (MatrixSize1((M)) == MatrixSize2((M))) int gettotalVectordata(); int gaussjordan(Matrix a, Vector b); Vector polyfit(const Vector X, const Vector Y, int order); Vector weightedpolyfit(const Vector X, const Vector Y, const Vector W, int order); Vector polyfitwithlag(const Vector X, const Vector Y, int order, int lag); Vector newVector(int n); Vector newVectorfromarray(int n, const double *arr); Vector newVectorfromintVector(intVector v); void zeroVector(Vector v); void fillVector(Vector v, double value); Vector dupVector(const Vector v); void deleteVector(Vector v); int Vectorisfinite(const Vector v); double dotVectors(const Vector v1, const Vector v2); void subfromVector(Vector a, const Vector b); void addtoVector(Vector a, const Vector b); void addscaledVectortoVector(Vector a, const Vector b, double scale); Vector addVectors(const Vector a, const Vector b); Vector subVectors(const Vector a, const Vector b); void copytoVector(Vector a, const Vector b); void scaleVector(Vector v, double f); void biasVector(Vector v, double f); void squareVector(Vector v); void normalizeVector(Vector v); void printVector(const Vector v); void applyfunctoVector(Vector v, double (*func)(double x)); VectorType Vectormax(const Vector v); VectorType Vectormin(const Vector v); int Vectorfindmax(const Vector v); int Vectorfindmin(const Vector v); void Vectorminmax(const Vector v, VectorType *min, VectorType *max); VectorType interpolateVector(const Vector V, double index); void saveVectorasascii(const Vector v, const char *filename); void saveVectorasformattedascii(const Vector v, const char *filename, const char *format); void Vectorsavebinary(const Vector v, const char *filename); Vector Vectorloadbinary(const char *filename); void VectormeanRMS(const Vector v, double *mean, double *rms); double Vectorsum(const Vector v); double Vectorsumsquare(const Vector v); double Vectormean(const Vector v); double Vectormeansquare(const Vector v); double VectorRMS(const Vector v); double Vectormoment(const Vector v, int moment); void rollVector(Vector v, int deltan); Vector rebinVector(const Vector src, int factor); void Vectorboxcar(const Vector src, Vector dest, int s); double VectorAllanStandardDeviation(const Vector v, int lag, int pad, int step); intVector ComputeAllanLags(int n, double power); Vector VectorAllanStandardDeviations(const Vector v, const intVector lags); int stringtoVector(const char *str, Vector v); char *Vectortostring(const Vector v); Vector newVectorfromstring(const char *str); Vector *Vectorcolumnsfromfile(const char *filename, int mincols, int *ncol); int Vectorcolumnstofile(const Vector *data, const char *filename, int ncol); int Vectorcolumnstofilewithformat(const Vector *data, const char *filename, int ncol, const char *format); int Vectorcolumnstofilewithmask(const Vector *data, const Vector mask, const char *filename, int ncol); int Vectorcolumnstofilewithgaps(const Vector *data, const char *filename, int ncol, int refcol, double gap); Vector subVector(const Vector v, int n1, int n2); Vector newunitVector(const Vector v); int Vectorisincreasing(const Vector v); int Vectorisdecreasing(const Vector v); Matrix newpaddedMatrix(int n, int m, int rowpad); void deleteMatrix(Matrix M); Matrix refsubMatrix(const Matrix M, int n1, int m1, int n2, int m2); void zeroMatrix(Matrix M); Matrix dupMatrix(const Matrix M); void printMatrix(const Matrix M); Matrix repadMatrix(const Matrix M, int pad); void Matrixsavebinary(const Matrix M, const char *filename); Matrix Matrixloadbinary(const char *filename); MatrixType Matrixmax(const Matrix M); MatrixType Matrixmaxvalue(const Matrix M, int *bestj, int *besti); MatrixType Matrixmin(const Matrix M); MatrixType Matrixminvalue(const Matrix M, int *bestj, int *besti); void Matrixminmax(const Matrix M, MatrixType *min, MatrixType *max); double Matrixpeakup(const Matrix D, int y, int x, int py, int px, double *y0, double *x0, double *Ayy, double *Axy, double *Axx); void scaleMatrix(Matrix M, double f); void addscaledMatrixtoMatrix(Matrix a, const Matrix b, double scale); void biasMatrix(Matrix M, double f); void addtoMatrix(Matrix M, const Matrix N); void subfromMatrix(Matrix M, const Matrix N); Matrix addMatrices(const Matrix M, const Matrix N); void copytoMatrix(Matrix M, const Matrix N); void applyfunctoMatrix(Matrix M, double (*func)(double x)); Matrix Matrixproduct(Vector v2, Vector v1); Matrix dupsubMatrix(const Matrix M, int n1, int m1, int n2, int m2); void copysubMatrix(Matrix N, const Matrix M, int n1, int m1, int n2, int m2, int n3, int m3); Vector Matrixrow(const Matrix M, int row); Vector Matrixcolumn(const Matrix M, int column); Vector sumMatrixrows(const Matrix M); Vector sumMatrixcolumns(const Matrix M); void MatrixmeanRMS(const Matrix M, double *rms, double *mean); double Matrixmean(const Matrix M); double MatrixRMS(const Matrix M); Matrix Matrixmultiply(const Matrix A, const Matrix B); void copyMatrixmultiply(Matrix C, const Matrix A, const Matrix B); Vector MatrixVectormultiply(const Matrix M, const Vector V); void Matrixmultiplyelements(Matrix M, const Matrix N); void Matrixdivideelements(Matrix M, const Matrix N); Matrix Matrixcomplexamplitudes(const Matrix M); Matrix Matrixcomplexphases(const Matrix M); void Matrixcomplexmultiply(Matrix M, const Matrix N, int pad); void Matrixcomplexconjugatemultiply(Matrix M, const Matrix N, int pad); void Matrixcomplexdivide(Matrix M, const Matrix N, int pad); Vector Matrixhistogram(const Matrix M, int bins); Matrix quarterbinMatrix(const Matrix M); Matrix rollMatrix(const Matrix M, int delta_n, int delta_m); void rollMatrixinplace(Matrix M, int delta_n, int delta_m); Matrix transposeMatrix(const Matrix M); void transposeMatrixinplace(Matrix M); void reflectMatrix1inplace(Matrix M); void reflectMatrix2inplace(Matrix M); void symmetrizeMatrixinplace(Matrix M); void antisymmetrizeMatrixinplace(Matrix M); Matrix newrotationMatrix(double rx, double ry, double rz); void clipMatrix(Matrix M, double min, double max); Matrix LMatrixinvert(const Matrix L); Matrix choleskydecompose(const Matrix A); Matrix choleskydecomposeld(const Matrix A); Vector cholesky(const Matrix A, const Vector B); int choleskyinvert(Matrix A); int Matrixisposdef(const Matrix M); int Matrixisposdef2(const Matrix M, int niter); int Matrixisfinite(const Matrix M); int Matrixislower(const Matrix M); int Matrixisupper(const Matrix M); int Matrixistridiag(const Matrix M); int Matrixissymmetric(const Matrix M); #endif