crisThickMaps package author: bruce sears released: 3-19-97 This package is used for determining the absolute thickness of a cris detector given the stack location of the cris detector and a point (x, y) on the detector. The stack location is a string of the form "T6-1B", "T2C", "T7-2A", etc. See the comments in parseStackDetectorID.c for more details. There are some mid-sized databases intertwined with these routines. For speed in running, these databases are not read from the text files included in this package. Instead, pre-compiler scripts are run which read the text databases and embed them into C arrays inside the C code prior to compilation. For this reason, some of the .c files are quite long. All of the c code will be near the end of these files (after the arrays.) You do not need to worry about this process, as the .c files have already been generated and are ready to be compiled here. But if you are curious or need to understand the pre-process method, see the section below called PRE-COMPILATION PROCESSING DETAILS. If you will be modifying any of the code in this package, you should probably read it. Most users will only be interested in the .c files here. PRE-COMPILATION PROCESSING DETAILS: Some of the .c files in this package have a .src and a generate script involved with them. The .src file has all of the C code in it with the exception of having tags where constants and arrays will be placed. The scripts (written in perl) parse all the databases in the package and replace the tags in the .src file with values and arrays in order to create the .c file. For this reason, if you are planning on fooling with any of this, be aware that such .c files are automatically generated from the script and the contents of the .src file. Edits of the C code would be done in the .src file, then the generate script would be run, producing the .c file. version 2.00: ported to c from idl (version 1.xx) some declarations (from the header file): struct dblAndInt { double dbl; int i; }; this struct is merely an easy way to return a double and an int struct dblAndInt getCrisThickness(char* stackDetectorID, double x, double y); usage: struct dblAndInt thicknessAndExtrapCount; double thickness; int extrapCount; thicknessAndExtrapCount = getCrisThickness(stackDetectorID, x, y); thickness = thicknessAndExtrapCount.dbl; extrapCount = thicknessAndExtrapCount.i; stackDetectorID = detector's location in the cris stacks. It is a string of format "T2A", or "T6-2D" for telescope partitions with multiple detectors. x, y = "bs-coordinates" location on said detector. bs-coords are defined at http://www.srl.caltech.edu/ACE/forum/topics/ACE thickness = thickness at (x, y) in microns extrapCount = the value of thickness at (x, y) is interpolated between the 4 nodes at the corners of 3 mm x 3 mm pixels. The nodes correspond to the points which were measured by the MSU particle maps of the cris detectors. At the edges of the detector, the thickness has been extrapolated to the nodes outside of the actual measurments. extrapCount will usually return as 0, but near the edges of the detector may be from 1 to 3. if extrapCount = 4, the point you are looking at is probably not physically on the detector even though get_cris_thickness may return a thickness value using 4 extrapolated nodes. (integer) IMPORTANT: Version 2.00 returns 0 thicknesses for all extrapolated values. This will be fixed in the next version. compiling: edit the Makefile in the main directory as directed therein, and then type "make". if you are not using a unix system, then you will need to get help from your local systems people. make may be available on other systems as well. it is merely a nice utility for compiling and linking sets of code. please contact me if there are any questions or problems here. the end result of this make is a library of compiled object files, libCrisThickMaps.a example compilation and use: in the directory USAGE_TEST, there is a sample program which calls getCrisThickness. there is also another Makefile there which illustrates how to link in libCrisThickMaps.a.