CDMS/src/CDMS/kscheck
diff -N CreateRoadMapFile.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ CreateRoadMapFile.java 13 Dec 2010 22:17:50 -0000 1.1
@@ -0,0 +1,229 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package CDMS.kscheck;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.StreamTokenizer;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Formatter;
+//import hep.physics.matrix.Matrix;
+//import hep.physics.matrix.BasicMatrix;
+//import hep.physics.matrix.MatrixOp;
+
+/**
+ *
+ * @author kschneck
+ * Creates auto-run file that takes high-res pictures of each TES
+ *
+ * @param file of TES coordinates (assumes the coordinates are sorted),
+ * size of pixels (depends on magnification) in mm
+ * @return file with OGP commands that drive along TES lines taking pictures
+ *
+ */
+public class CreateRoadMapFile {
+
+ public List<Double[]> _coordinates;
+// public BasicMatrix XcoordsMatrix;
+// public BasicMatrix YcoordsVector;
+// public BasicMatrix functionVector;
+
+ public CreateRoadMapFile(String inputCoordsFile, String outputOGPscript, double pixelSize) throws FileNotFoundException, IOException {
+
+ FileReader fr = new FileReader(inputCoordsFile);
+ StreamTokenizer tok = new StreamTokenizer(fr);
+ tok.resetSyntax();
+ tok.wordChars(33, 126);
+ tok.parseNumbers();
+ tok.whitespaceChars(0, 32);
+ tok.eolIsSignificant(true);
+
+ FileWriter fw = new FileWriter(outputOGPscript);
+ BufferedWriter output = new BufferedWriter(fw);
+
+ _coordinates = new ArrayList<Double[]>();
+
+ double TESlength = 0.7; //length in mm
+ double TESwidth = 0.22; //width in mm
+ double xDim = (640)*pixelSize; //number of pixels in horizontal direction = 640
+ double yDim = (480)*pixelSize; //number of pixels in vertical direction = 480
+
+
+ // Loop over the input coordinate file entries
+ while (true) {
+ List<Double> args = getNumbersInLine(tok);
+
+ //break out of loop if there are no more coords to add
+ if (args.isEmpty()){
+ break;
+ }
+
+ Double xcoord = args.get(0);
+ Double ycoord = args.get(1);
+ Double angle = args.get(2);
+ Double TEStype = args.get(3);
+
+ //add all coordinates to _coordinates ArrayList
+ Double pos[] = {xcoord, ycoord, angle, TEStype};
+ _coordinates.add(pos);
+
+ }
+
+ int ncoords = _coordinates.size();
+
+ output.write("BEGIN_RUN\n");
+ output.write("MM\n");
+ output.write("SET_DATUM\n");
+ output.write("c:\\Partrtn\\IZipDatum_PeaceSide1_x2.RTN\n");
+
+ for(int i = 0; i<ncoords; i++){
+ Double [] coords1 = _coordinates.get(i);
+
+ Double x1 = 0.001*coords1[0]; //coords are given in um, OGP routine needs them in mm
+ Double y1 = 0.001*coords1[1];
+ Double angle1 = coords1[2];
+
+ double length_x = Math.abs(TESlength*Math.cos(angle1))+Math.abs(TESwidth*Math.sin(angle1));
+ double length_y = Math.abs(TESlength*Math.sin(angle1))+Math.abs(TESwidth*Math.cos(angle1));
+
+ //take m by n array of pictures to cover entire TES
+
+ //find m (horizontal number of pics) and n (vertical number of pics)
+ int m = (int) Math.ceil(length_x/xDim);
+ int n = (int) Math.ceil(length_y/yDim);
+
+ //write proper commands to output autorun file
+ for(int j = 0; j < m; j++){
+ for(int k = 0; k < n; k++){
+ Formatter fmt1 = new Formatter();
+ Formatter fmt2 = new Formatter();
+ fmt1.format("%.6f", x1-(0.5*(m-1))*xDim+j*xDim);
+ fmt2.format("%.6f", y1-(0.5*(n-1))*yDim+k*yDim);
+ output.write("c:\\Partrtn\\IZipOriginTakePicture_x2.RTN,"+fmt1+","+fmt2+",0,0,0,0\n");
+
+ }
+
+ }
+
+ //find cubic function that fits the wiring between adjacent TESs
+ //Do this by solving system of linear equations for (A,B,C,D):
+ //row 1: A*x1^3 + B*x1^2 + C*x1 + D == y1
+ //row 2: A*x2^3 + B*x2^2 + C*x2 + D == y2
+ //row 3: derivative of LHS of row 1 wrt x1 == tan(angle1) (=slope at x1)
+ //row 4: derivative of LHS of row 2 wrt x2 == tan(angle2) (=slope at x2)
+ //It turns out that this method for taking pictures of the wiring between TESs
+ // is redundant at the resolutions we're working with--everything is covered by
+ // the m by n array of the above code. I'm commenting this section out but
+ // leaving it here in case it ever becomes needed.
+
+ //It should be noted that this method is not completely accurate for large angles
+ // between the TESs--theta ~ pi/2 or so.
+
+ //don't do this for the last coord in the file--there's nothing after it!
+// if(i != ncoords-1){
+//
+// Double [] coords2 = _coordinates.get(i+1);
+//
+// Double x2 = 0.001*coords2[0];
+// Double y2 = 0.001*coords2[1];
+// Double angle2 = coords2[2];
+//
+// XcoordsMatrix = new BasicMatrix(4,4);
+// YcoordsVector = new BasicMatrix(4,1);
+// functionVector = new BasicMatrix(4,1);
+//
+// //create XcoordsMatrix
+// XcoordsMatrix.setElement(0, 0, Math.pow(x1,3));
+// XcoordsMatrix.setElement(0, 1, Math.pow(x1,2));
+// XcoordsMatrix.setElement(0, 2, x1);
+// XcoordsMatrix.setElement(0, 3, 1);
+// XcoordsMatrix.setElement(1, 0, Math.pow(x2,3));
+// XcoordsMatrix.setElement(1, 1, Math.pow(x2,2));
+// XcoordsMatrix.setElement(1, 2, x2);
+// XcoordsMatrix.setElement(1, 3, 1);
+// XcoordsMatrix.setElement(2, 0, 3*Math.pow(x1,2));
+// XcoordsMatrix.setElement(2, 1, 2*x1);
+// XcoordsMatrix.setElement(2, 2, 1);
+// XcoordsMatrix.setElement(2, 3, 0);
+// XcoordsMatrix.setElement(3, 0, 3*Math.pow(x2,2));
+// XcoordsMatrix.setElement(3, 1, 2*x2);
+// XcoordsMatrix.setElement(3, 2, 1);
+// XcoordsMatrix.setElement(3, 3, 0);
+//
+// YcoordsVector.setElement(0,0, y1);
+// YcoordsVector.setElement(1,0, y2);
+// YcoordsVector.setElement(2,0, Math.tan(angle1));
+// YcoordsVector.setElement(3,0, Math.tan(angle2));
+//
+// Matrix inverse = MatrixOp.inverse(XcoordsMatrix);
+//
+// //find A,B,C,D by inverting XcoordsMatrix
+// Matrix paramVector = MatrixOp.mult(inverse,YcoordsVector);
+//
+// double A = paramVector.e(0,0);
+// double B = paramVector.e(1,0);
+// double C = paramVector.e(2,0);
+// double D = paramVector.e(3,0);
+//
+// //choose some x between x1 and x2, then calculate y using paramVector
+// if(x1 != x2){
+// Formatter fmt1 = new Formatter();
+// Formatter fmt2 = new Formatter();
+// double xavg = (x1+x2)/2;
+// double yvalue = A*Math.pow(xavg,3)+B*Math.pow(xavg,2)+C*xavg+D;
+// fmt1.format("%.6f", xavg);
+// fmt2.format("%.6f", yvalue);
+// output.write("c:\\Partrtn\\IZipOriginTakePicture_x2.RTN,"+fmt1+","+fmt2+",0,0,0,0\n");
+//
+// }
+// else{ //there might be a problem for x1 = x2, so try this
+// Formatter fmt = new Formatter();
+// double yavg = (y1+y2);
+// fmt.format("%.6f", yavg);
+// output.write("c:\\Partrtn\\IZipOriginTakePicture_x2.RTN,"+x1+","+fmt+",0,0,0,0\n");
+//
+// }
+//
+// }
+
+ }
+
+ output.write("END_RUN\n");
+
+ output.close();
+ }
+
+
+ /**
+ * Get a list of numbers in a line on the input stream
+ *
+ * @param tok StreamTokenizer with the next token being the first number
+ * @return List of numbers in the current line
+ * @throws IOException
+ */
+ private List<Double> getNumbersInLine(StreamTokenizer tok) throws IOException {
+
+ // Create a list of numbers that the tokenizer finds
+ List<Double> nums = new ArrayList<Double>();
+
+ // Loop looking for either end of line or end of file
+ while (tok.nextToken() != StreamTokenizer.TT_EOF) {
+ if (tok.ttype == StreamTokenizer.TT_EOL) break;
+
+ // Check to make sure that we have a numeric token
+ if (tok.ttype != StreamTokenizer.TT_NUMBER) continue;
+
+ // Found a number token - add it to the list
+ nums.add(tok.nval);
+
+ }
+ return nums;
+ }
+}
CDMS/src/CDMS/kscheck
diff -N SortCoordsFile.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SortCoordsFile.java 13 Dec 2010 22:17:50 -0000 1.1
@@ -0,0 +1,156 @@
+/*
+ * SortCoordsFile.java
+ */
+
+package CDMS.kscheck;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.StreamTokenizer;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author Kristi Schneck
+ */
+public class SortCoordsFile {
+
+ private List<Double[]> _coordinates;
+ public List<Double[]> sortedCoords;
+
+ public SortCoordsFile(String inputCoordsFile, String outputSortedFile) throws FileNotFoundException, IOException {
+
+ // Open the autorun file and setup a StreamTokenizer for a space delimited list
+ FileReader fr = new FileReader(inputCoordsFile);
+ FileWriter fw = new FileWriter(outputSortedFile);
+ BufferedWriter output = new BufferedWriter(fw);
+ StreamTokenizer tok = new StreamTokenizer(fr);
+ tok.resetSyntax();
+ tok.wordChars(33, 126);
+ tok.parseNumbers();
+ tok.whitespaceChars(0, 32);
+ tok.eolIsSignificant(true);
+
+ _coordinates = new ArrayList<Double[]>();
+
+ // Loop over the input coordinate file entries
+ while (true) {
+ List<Double> args = getNumbersInLine(tok);
+
+ //break out of loop if there are no more coords to add
+ if (args.isEmpty()){
+ break;
+ }
+
+ Double xcoord = args.get(0);
+ Double ycoord = args.get(1);
+ Double angle = args.get(2);
+ Double TEStype = args.get(3);
+
+ //add all coordinates to _coordinates ArrayList
+ Double pos[] = {xcoord, ycoord, angle, TEStype};
+ _coordinates.add(pos);
+
+ }
+
+ int ncoords = _coordinates.size();
+
+ sortedCoords = new ArrayList<Double[]>();
+ //add first element of _coordinates to sortedCoords
+ //this becomes the first element in the sorted list
+ sortedCoords.add(_coordinates.get(0));
+ //remove this element from _coordinates
+ _coordinates.remove(0);
+
+
+ //sort by looking for minimum distance between coords
+ while(sortedCoords.size()<=ncoords){
+ double minDist = 10000000000.0;//some really large number
+ Double[] minCoords = {10000000000000.0,10000000000000.0,10000000000000.0,10000000000000.0};
+ //look at last element (most recently added) of sortedCoords
+ Double[] coords1 = sortedCoords.get(sortedCoords.size()-1);
+ Double x1 = coords1[0];
+ Double y1 = coords1[1];
+ //loop over all elements in _coordinates
+ for(int j = 0; j < ncoords-1; j++){
+ //get next coords for comparison
+ Double[] coords2 = _coordinates.get(j);
+ Double x2 = coords2[0];
+ Double y2 = coords2[1];
+
+ //calculate distance squared between coords1 and coords2
+ double dist = Math.pow((x1-x2),2)+Math.pow((y1-y2),2);
+ //assign coords2 to minCoords if the distance is smaller than previous
+ // distances and if coords2 is not already in sortedCoords
+ if(dist <= minDist && dist != 0.0){
+ if(sortedCoords.contains(coords2)==false){
+ minCoords = coords2;
+ minDist = dist;
+ }
+
+ }
+
+ }
+ //add resulting minCoords to sortedCoords
+ sortedCoords.add(minCoords);
+
+ }
+
+ //write all elements in sortedCoords to the output file
+ Double[] coordsToAdd;
+ for(int k = 0; k < ncoords; k++){
+ coordsToAdd = sortedCoords.get(k);
+ Double x = coordsToAdd[0];
+ Double y = coordsToAdd[1];
+ Double angle = coordsToAdd[2];
+ Double type = coordsToAdd[3];
+ String xString = String.valueOf(x);
+ String yString = String.valueOf(y);
+ String angleString = String.valueOf(angle);
+ String typeString = String.valueOf(type);
+ output.write(xString+" "+yString+" "+angleString+" "+typeString+"\n");
+ }
+ output.close();
+ }
+
+ public List<Double[]> getImageCoordinates() {
+ return _coordinates;
+ }
+
+ public Double[] getImageCoordinates(int i) {
+ return _coordinates.get(i);
+ }
+
+ /**
+ * Get a list of numbers in a line on the input stream
+ *
+ * @param tok StreamTokenizer with the next token being the first number
+ * @return List of numbers in the current line
+ * @throws IOException
+ */
+ private List<Double> getNumbersInLine(StreamTokenizer tok) throws IOException {
+
+ // Create a list of numbers that the tokenizer finds
+ List<Double> nums = new ArrayList<Double>();
+
+ // Loop looking for either end of line or end of file
+ while (tok.nextToken() != StreamTokenizer.TT_EOF) {
+ if (tok.ttype == StreamTokenizer.TT_EOL) break;
+
+ // Check to make sure that we have a numeric token
+ if (tok.ttype != StreamTokenizer.TT_NUMBER) continue;
+
+ // Found a number token - add it to the list
+ nums.add(tok.nval);
+
+ }
+ return nums;
+ }
+
+
+
+}
\ No newline at end of file
CDMS/src/CDMS/kscheck
diff -N SortCoordsTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SortCoordsTest.java 13 Dec 2010 22:17:50 -0000 1.1
@@ -0,0 +1,27 @@
+
+package CDMS.kscheck;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+//import java.io.FileWriter;
+//import java.io.BufferedWriter;
+
+/**
+ *
+ * @author kschneck
+ */
+public class SortCoordsTest {
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) throws FileNotFoundException, IOException {
+
+ //SortCoordsFile pcfile = new SortCoordsFile("side1.txt","sortedCoords.txt");
+ //CreateRoadMapFile roadmap1 = new CreateRoadMapFile("shortTest.txt","testautorun1.txt",0.00067);
+ //CreateRoadMapFile roadmap2 = new CreateRoadMapFile("shortTest2.txt","testautorun2.txt",0.00067);
+ //CreateRoadMapFile roadmap3 = new CreateRoadMapFile("longTest.txt","testautorun3.txt",0.00067);
+ SplitSortedFile splitfile = new SplitSortedFile("sortedCoords.txt","splittest.txt");
+ }
+
+}
CDMS/src/CDMS/kscheck
diff -N SplitSortedFile.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SplitSortedFile.java 13 Dec 2010 22:17:50 -0000 1.1
@@ -0,0 +1,245 @@
+
+package CDMS.kscheck;
+
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.io.FileReader;
+import java.io.StreamTokenizer;
+
+/**
+ *
+ * @author kschneck
+ *
+ * Splits sorted coordinate file into the four separate TES arrays on the detector
+ *
+ * @param txt file of sorted coordinates
+ * @return txt file of coordinates with \n between different arrays
+ *
+ */
+
+ public class SplitSortedFile {
+
+ public List<Double[]> TESarray1;
+ public List<Double[]> TESarray2;
+ public List<Double[]> TESarray3;
+ public List<Double[]> TESarray4;
+ public List<Double[]> sortedCoords;
+
+ public SplitSortedFile(String inputSortedFile, String outputSplitFile) throws FileNotFoundException, IOException {
+
+ FileReader fr = new FileReader(inputSortedFile);
+ StreamTokenizer tok = new StreamTokenizer(fr);
+ tok.resetSyntax();
+ tok.wordChars(33, 126);
+ tok.parseNumbers();
+ tok.whitespaceChars(0, 32);
+ tok.eolIsSignificant(true);
+
+ FileWriter fw = new FileWriter(outputSplitFile);
+ BufferedWriter output = new BufferedWriter(fw);
+
+
+ TESarray1 = new ArrayList<Double[]>();
+ TESarray2 = new ArrayList<Double[]>();
+ TESarray3 = new ArrayList<Double[]>();
+ TESarray4 = new ArrayList<Double[]>();
+ sortedCoords = new ArrayList<Double[]>();
+
+ // Loop over the input coordinate file entries
+ while (true) {
+ List<Double> args = getNumbersInLine(tok);
+
+ //break out of loop if there are no more coords to add
+ if (args.isEmpty()){
+ break;
+ }
+
+ Double xcoord = args.get(0);
+ Double ycoord = args.get(1);
+ Double angle = args.get(2);
+ Double TEStype = args.get(3);
+
+ //add all coordinates to _coordinates ArrayList
+ Double pos[] = {xcoord, ycoord, angle, TEStype};
+ sortedCoords.add(pos);
+
+ }
+
+
+ int ncoords = sortedCoords.size();
+
+ //iterate over sorted file, comparing distances between adjacent TESs
+ for(int j = 0; j<ncoords-1; j++){
+
+ Double[] coords1 = sortedCoords.get(j);
+ Double x1 = coords1[0];
+ Double y1 = coords1[1];
+
+ Double[] coords2 = sortedCoords.get(j+1);
+ Double x2 = coords2[0];
+ Double y2 = coords2[1];
+
+ //calculate distance squared between adjacent elements in sortedCoords
+ double dist = Math.pow((x1-x2),2)+Math.pow((y1-y2),2);
+
+ //split file if distance between adjacent TESs is larger than distance between
+ //TES and charge line
+ //Note: dist between TES & charge line = 1.1 mm = 1100 microns
+ //dist between centers of adjacent TESs ~ 900 microns
+ if(dist > 111000000.0){
+ //System.out.println("found a big distance");
+
+ //add elements 0-j to TESarray arraylist
+ //but how to account for separate roadmaps?
+ if(TESarray1.isEmpty()){
+ for(int k = 0; k <= j; k++){
+ TESarray1.add(sortedCoords.get(k));
+ sortedCoords.remove(k);
+ }
+ }
+ else if(TESarray2.isEmpty()){
+ for(int k = 0; k <= j; k++){
+ TESarray2.add(sortedCoords.get(k));
+ sortedCoords.remove(k);
+ }
+ }
+ else if(TESarray3.isEmpty()){
+ for(int k = 0; k <= j; k++){
+ TESarray3.add(sortedCoords.get(k));
+ sortedCoords.remove(k);
+ }
+ }
+ else if(TESarray4.isEmpty()){
+ for(int k = 0; k <= j; k++){
+ TESarray4.add(sortedCoords.get(k));
+ sortedCoords.remove(k);
+ }
+ }
+ else{
+ //put remaining coords into proper place
+ for(int i = 0; i < sortedCoords.size(); i++){
+
+ }
+
+ }
+
+ //recalculate size of sortedCoords since it changed
+ ncoords = sortedCoords.size();
+ }
+
+
+
+ }
+
+
+ Double[] coordsToAdd1;
+ for(int k = 0; k < TESarray1.size(); k++){
+ coordsToAdd1 = TESarray1.get(k);
+ Double x = coordsToAdd1[0];
+ Double y = coordsToAdd1[1];
+ Double angle = coordsToAdd1[2];
+ Double type = coordsToAdd1[3];
+ String xString = String.valueOf(x);
+ String yString = String.valueOf(y);
+ String angleString = String.valueOf(angle);
+ String typeString = String.valueOf(type);
+ output.write(xString+" "+yString+" "+angleString+" "+typeString+"\n");
+ }
+
+ output.write("\n");
+ Double[] coordsToAdd2;
+ for(int l = 0; l < TESarray2.size(); l++){
+ coordsToAdd2 = TESarray2.get(l);
+ Double x2 = coordsToAdd2[0];
+ Double y2 = coordsToAdd2[1];
+ Double angle2 = coordsToAdd2[2];
+ Double type2 = coordsToAdd2[3];
+ String xString2 = String.valueOf(x2);
+ String yString2 = String.valueOf(y2);
+ String angleString2 = String.valueOf(angle2);
+ String typeString2 = String.valueOf(type2);
+ output.write(xString2+" "+yString2+" "+angleString2+" "+typeString2+"\n");
+ }
+
+ output.write("\n");
+ Double[] coordsToAdd3;
+ for(int m = 0; m < TESarray3.size(); m++){
+ coordsToAdd3 = TESarray3.get(m);
+ Double x3 = coordsToAdd3[0];
+ Double y3 = coordsToAdd3[1];
+ Double angle3 = coordsToAdd3[2];
+ Double type3 = coordsToAdd3[3];
+ String xString3 = String.valueOf(x3);
+ String yString3 = String.valueOf(y3);
+ String angleString3 = String.valueOf(angle3);
+ String typeString3 = String.valueOf(type3);
+ output.write(xString3+" "+yString3+" "+angleString3+" "+typeString3+"\n");
+ }
+
+ output.write("\n");
+ Double[] coordsToAdd4;
+ for(int n = 0; n < TESarray4.size(); n++){
+ coordsToAdd4 = TESarray4.get(n);
+ Double x4 = coordsToAdd4[0];
+ Double y4 = coordsToAdd4[1];
+ Double angle4 = coordsToAdd4[2];
+ Double type4 = coordsToAdd4[3];
+ String xString4 = String.valueOf(x4);
+ String yString4 = String.valueOf(y4);
+ String angleString4 = String.valueOf(angle4);
+ String typeString4 = String.valueOf(type4);
+ output.write(xString4+" "+yString4+" "+angleString4+" "+typeString4+"\n");
+ }
+
+ output.write("\n");
+ Double[] remainingCoords;
+ for(int p = 0; p < sortedCoords.size(); p++){
+ remainingCoords = sortedCoords.get(p);
+ Double xr = remainingCoords[0];
+ Double yr = remainingCoords[1];
+ Double angler = remainingCoords[2];
+ Double typer = remainingCoords[3];
+ String xStringr = String.valueOf(xr);
+ String yStringr = String.valueOf(yr);
+ String angleStringr = String.valueOf(angler);
+ String typeStringr = String.valueOf(typer);
+ output.write("\n");
+ output.write(xStringr+" "+yStringr+" "+angleStringr+" "+typeStringr+"\n");
+ }
+
+
+ output.close();
+
+ }
+
+ /**
+ * Get a list of numbers in a line on the input stream
+ *
+ * @param tok StreamTokenizer with the next token being the first number
+ * @return List of numbers in the current line
+ * @throws IOException
+ */
+ private List<Double> getNumbersInLine(StreamTokenizer tok) throws IOException {
+
+ // Create a list of numbers that the tokenizer finds
+ List<Double> nums = new ArrayList<Double>();
+
+ // Loop looking for either end of line or end of file
+ while (tok.nextToken() != StreamTokenizer.TT_EOF) {
+ if (tok.ttype == StreamTokenizer.TT_EOL) break;
+
+ // Check to make sure that we have a numeric token
+ if (tok.ttype != StreamTokenizer.TT_NUMBER) continue;
+
+ // Found a number token - add it to the list
+ nums.add(tok.nval);
+
+ }
+ return nums;
+ }
+
+}