A setter for the wavelength

        Parameters
        ----------
        wavelength: astropy.units.quantity.Quantity
            The array with units
512767
def wave(self, wavelength):
        
        # Test units
        if not isinstance(wavelength, q.quantity.Quantity):
            raise ValueError("Wavelength must be in length units.")

        self._wave = wavelength
        self.wave_units = wavelength.unit
522770
def pivot_wavelength(self):
        
        wl = self.registry._pivot_wavelengths.get((self.telescope, self.band))
        if wl is not None:
            return wl

        wl = self.calc_pivot_wavelength()
        self.registry.register_pivot_wavelength(self.telescope, self.band, wl)
        return wl
618541
def set(self, varname, value, idx=0, units=None):
        ''''''
        if not varname in self.mapping.vars:
            raise fgFDMError('Unknown variable %s' % varname)
        if idx >= self.mapping.vars[varname].arraylength:
            raise fgFDMError('index of %s beyond end of array idx=%u arraylength=%u' % (
                varname, idx, self.mapping.vars[varname].arraylength))
        if units:
            value = self.convert(value, units, self.mapping.vars[varname].units)
        # avoid range errors when packing into 4 byte floats
        if math.isinf(value) or math.isnan(value) or math.fabs(value) > 3.4e38:
            value = 0
        self.values[self.mapping.vars[varname].index + idx] = value
670697
def to(self, unit):
        """"""
        from astropy.units import au
        return (self.au * au).to(unit)
1253048
def intensities(self):
        
        buf = ffi.new("double[]", self.size)
        ims.spectrum_intensities(self.ptr, buf)
        return list(buf)
255315
def _get_binned_arrays(self, wavelengths, flux_unit, area=None,
                           vegaspec=None):
        """"""
        x = self._validate_binned_wavelengths(wavelengths)
        y = self.sample_binned(wavelengths=x, flux_unit=flux_unit, area=area,
                               vegaspec=vegaspec)

        if isinstance(wavelengths, u.Quantity):
            w = x.to(wavelengths.unit, u.spectral())
        else:
            w = x

        return w, y
378130
def pivot_wavelength_ee(bpass):
    
    from scipy.integrate import simps
    return np.sqrt(simps(bpass.resp, bpass.wlen) /
                   simps(bpass.resp / bpass.wlen**2, bpass.wlen))
492467
def to(self, unit):
        """"""
        from astropy.units import au, d
        return (self.au_per_d * au / d).to(unit)
1319644
def solar_constant(self):
        """"""
        if self.wavenumber is not None:
            return np.trapz(self.irradiance, self.wavenumber)
        elif self.wavelength is not None:
            return np.trapz(self.irradiance, self.wavelength)
        else:
            raise TypeError('Neither wavelengths nor wavenumbers available!')
919966
def _load_data(self, band):
        
        d = bandpass_data_fits('sw' + self._band_map[band] + '_20041120v106.arf')[1].data

        # note:
        #   data.WAVE_MIN[i] < data.WAVE_MIN[i+1], but
        #   data.WAVE_MIN[i] > data.WAVE_MAX[i] (!)
        #   data.WAVE_MIN[i] = data.WAVE_MAX[i+1] (!)

        wmid = 0.5 * (d.WAVE_MIN + d.WAVE_MAX) # in Ångström
        df = pd.DataFrame({'wlen': wmid, 'resp': d.SPECRESP,
                           'wlo': d.WAVE_MAX, 'whi': d.WAVE_MIN})
        return df
695386
def _set_params(self):
        
        deriv0 = np.poly1d(self.eos_params)
        deriv1 = np.polyder(deriv0, 1)
        deriv2 = np.polyder(deriv1, 1)
        deriv3 = np.polyder(deriv2, 1)

        for x in np.roots(deriv1):
            if x > 0 and deriv2(x) > 0:
                v0 = x**(-3./2.)
                break
        else:
            raise EOSError("No minimum could be found")

        derivV2 = 4./9. * x**5. * deriv2(x)
        derivV3 = (-20./9. * x**(13./2.) * deriv2(x) - 8./27. *
                   x**(15./2.) * deriv3(x))
        b0 = derivV2 / x**(3./2.)
        b1 = -1 - x**(-3./2.) * derivV3 / derivV2

        # e0, b0, b1, v0
        self._params = [deriv0(v0**(-2./3.)), b0, b1, v0]
520836
def quantity(self):
        
        if not _has_astropy:
            raise ImportError("astropy must be installed for unit/quantity support")

        if self.unit is None:
            raise ValueError("unit is not set, cannot convert to quantity")

        return self.array * self.unit
169267
def _set_axis(self, param, unit):
        
        axisValues = []
        for astroObject in self.objectList:
            try:
                value = eval('astroObject.{0}'.format(param))
            except ac.HierarchyError:  # ie trying to call planet.star and one planet is a lone ranger
                value = np.nan

            if unit is None:  # no unit to rescale (a aq.unitless quanitity would otherwise fail with ValueError)
                axisValues.append(value)
            else:
                try:
                    axisValues.append(value.rescale(unit))
                except AttributeError:  # either nan or unitless
                    axisValues.append(value)

        return axisValues
866872
def set_unit(self):
        """"""
        label = ''
        if self._parameter.frequency:
            label = self._parameter.frequency
        if self._parameter.unit.plural:
            label = '%s %s' % (self._parameter.unit.plural, label)
        elif self._parameter.unit.name:
            label = '%s %s' % (self._parameter.unit.name, label)
        self._unit_widget = QLabel(label)
        if self._parameter.unit.help_text:
            self._unit_widget.setToolTip(self._parameter.unit.help_text)
638141
def params(self):
        """"""
        par = {"radius": self.radius,
               "sphere_index": self.sphere_index,
               "pha_offset": self.pha_offset,
               "center": [self.posx_offset, self.posy_offset]
               }
        return par
480082
def params(self):
        
        params = dict(format=RESPONSE_FORMAT,
                      verbose=self.verbose,
                      epoch1=str(self.search_start_date),
                      epoch2=str(self.search_end_date),
                      search=self.orbit_method,
                      eunits=self.error_units,
                      eellipse=self.error_ellipse,
                      extres=self.resolve_extension,
                      xyres=self.resolve_position,
                      telinst=self.telescope_instrument)

        if self.orbit_method == 'bynameHorizons':
            params['object'] = NEW_LINE.join((str(target_name) for target_name in self.observations))
        else:
            params['obs'] = NEW_LINE.join((str(observation) for observation in self.observations))
        return params
334254
def units(self):
        
        self._units, value = self.get_attr_string(self._units, 'units')
        return value