Package jsky.science

Examples of jsky.science.Wavelength


                            fArray.setNumPoints(data.getNRows());

                            for (int i = 0; i < fArray.getNumPoints(); i++) {
                                Object rawWl = data.getElement(i, wlCol);
                                float foo = ((float[]) rawWl)[0];
                                fArray.setWavelengthAtIndex(i, new Wavelength(((float[]) rawWl)[0], fWlUnits));

                                Object rawData = data.getElement(i, flCol);
                                float foo2 = ((float[]) rawData)[0];
                                fArray.setValueAtIndex(i, ((float[]) rawData)[0]);
                            }
View Full Code Here


     * Creates a new Wavelength1DFormula, with
     * default number of points (100 points), and
     * default wavelength range (100 to 1100 nanometers).
     **/
    public Wavelength1DFormula() {
        this(null, new Wavelength(100, Wavelength.NANOMETER),
             new Wavelength(1100, Wavelength.NANOMETER),
             100);
    }
View Full Code Here

     * Creates a new Wavelength1DFormula of specified number of points,
     * no name, and default wavelength
     * range
     **/
    public Wavelength1DFormula(int inPoints) {
        this(null, new Wavelength(100, Wavelength.NANOMETER),
             new Wavelength(1100, Wavelength.NANOMETER),
             inPoints);
    }
View Full Code Here

    /**
     * Creates a new Wavelength1DFormula with specified name and default
     * number of points and range.
     **/
    public Wavelength1DFormula(String inName) {
        this(inName, new Wavelength(100, Wavelength.NANOMETER),
             new Wavelength(1100, Wavelength.NANOMETER),
             100);
    }
View Full Code Here

    }

    public void setMinWavelength(Wavelength newWL) {
        if (fMinWavelength != null) fMinWavelength.removePropertyChangeListener(this);

        Wavelength oldWL = fMinWavelength;
        fMinWavelength = newWL;

        if (fMinWavelength != null) fMinWavelength.addPropertyChangeListener(this);
        firePropertyChange(MINWAVELENGTH_PROPERTY, oldWL, newWL);
    }
View Full Code Here

    }

    public void setMaxWavelength(Wavelength newWL) {
        if (fMaxWavelength != null) fMaxWavelength.removePropertyChangeListener(this);

        Wavelength oldWL = fMaxWavelength;
        fMaxWavelength = newWL;

        if (fMaxWavelength != null) fMaxWavelength.addPropertyChangeListener(this);
        firePropertyChange(MAXWAVELENGTH_PROPERTY, oldWL, newWL);
    }
View Full Code Here

    public double[] toArrayData() {
        double[] array = new double[fNumPoints];
        double wl = fMinWavelength.getValue();
        double inc = (fMaxWavelength.getValue() - wl) / fNumPoints;
        for (int i = 0; i < fNumPoints; i++) {
            array[i] = getValue(new Wavelength(wl));
            wl += inc;
        }
        return array;
    }
View Full Code Here

    /**
     * Returns the wavelength data value for specified index as a Wavelength
     **/
    public Wavelength getWavelengthAtIndex(int index) {
        return new Wavelength(getWavelengthAtIndexAsDouble(index));
    }
View Full Code Here

    /*
     * Returns an attribute value for the cell at columnIndex and rowIndex.
    */
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (columnIndex == 0)
            return new Wavelength(fWavelengths[rowIndex]);
        else
            return new Double(fValues[rowIndex]);
    }
View Full Code Here

                        fArray.setNumPoints(fArray.getNumPoints() + addStep);
                    }
                    if (expectingData) {
                        fArray.setValueAtIndex(i++, streamer.nval);
                    } else {
                        fArray.setWavelengthAtIndex(i, new Wavelength(streamer.nval, fWlUnits));
                    }
                    expectingData = !expectingData;
                }
                nextT = streamer.nextToken();
                nToks++;
View Full Code Here

TOP

Related Classes of jsky.science.Wavelength

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.