Skip to main content

CTPLT Generation

CTPLT is generated From CXPLT. It Populates the CTPLT table by performing interpolations on the points in the CXPLT Table

Create a Concentration Array Interpolation Algorithm assume query return records in ascending time, distance order

            outData = new double[numTimeSteps * numDistanceSteps + 1][]; //Concentration value array

//Do Variable Initialization

//Interpolate River mile and concentration data to discreet river mile locations

//dataPt is a tuple of time, distance, concentration //Starting Next time step in data block //????????????????????????????????????????????????????????????????????????????????? // is the first data point in a time sequence from the CXPLT table always at mile 0 // if not the code in this block will be broken //????????????????????????????????????????????????????????????????????????????????? // If the concentration doesn't pass the minimum limit, leave it at default value of 0.0 //else add a new concentration value to outData array // Link the concentration to the current space, time point // Start the next mileIndex (as opposed to time index), not all paths make an indexes insert // Advance to the next data point //Add concentration to output at this time, space point //Added interpolated concentration to output at this time space point // prevent divide by zero errors

                                outData[outIndex] = new double[3] {currentCell[HOURS], previousCell[MILES] + ratio * (currentCell[MILES] - previousCell[MILES]),
previousCell[CONC] + ratio * (currentCell[CONC] - previousCell[CONC])};

//Advance to next timeStep
continue;


//Store the new result in the database