SkyModel¶
- class rubin_sim.skybrightness.SkyModel(observatory=None, twilight=True, zodiacal=True, moon=True, airglow=True, lower_atm=False, upper_atm=False, scattered_star=False, merged_spec=True, mags=False, precise_alt_az=False, airmass_limit=3.0)¶
Bases:
object
Methods Summary
Return the intermediate values that are caluculated by set_ra_dec_mjd and used for interpolation.
return_mags
([bandpasses])Convert the computed spectra to a magnitude using the supplied bandpass, or, if self.mags=True, return the mags in the LSST filters
Return the wavelength and spectra.
set_params
([airmass, azs, alts, moon_phase, ...])Set parameters manually.
set_ra_dec_alt_az_mjd
(ra, dec, alt, az, mjd)Set the sky parameters by computing the sky conditions on a given MJD and sky location.
set_ra_dec_mjd
(lon, lat, mjd[, degrees, ...])Set the sky parameters by computing the sky conditions on a given MJD and sky location.
Methods Documentation
- get_computed_vals()¶
Return the intermediate values that are caluculated by set_ra_dec_mjd and used for interpolation. All of these values are also accesible as class atributes, this is a convience method to grab them all at once and document the formats.
- Returns:
- outdict
Dictionary of all the intermediate calculated values that may be of use outside
- (the key:values in the output dict)
- ranumpy.array
RA of the interpolation points (radians)
- decnp.array
Dec of the interpolation points (radians)
- altsnp.array
Altitude (radians)
- azsnp.array
Azimuth of interpolation points (radians)
- airmassnp.array
Airmass values for each point, computed via 1./np.cos(np.pi/2.-self.alts).
- solar_fluxfloat
The solar flux used (SFU).
- sunAzfloat
Azimuth of the sun (radians)
- sunAltfloat
Altitude of the sun (radians)
- sunRAfloat
RA of the sun (radians)
- sunDecfloat
Dec of the sun (radians)
- azRelSunnp.array
Azimuth of each point relative to the sun (0=same direction as sun) (radians)
- moonAzfloat
Azimuth of the moon (radians)
- moonAltfloat
Altitude of the moon (radians)
- moonRAfloat
RA of the moon (radians)
- moonDecfloat
Dec of the moon (radians). Note, if you want distances
- moon_phasefloat
Phase of the moon (0-100)
- moonSunSepfloat
Seperation of moon and sun (radians)
- azRelMoonnp.array
Azimuth of each point relative to teh moon
- eclipLonnp.array
Ecliptic longitude (radians) of each point
- eclipLatnp.array
Ecliptic latitude (radians) of each point
- sunEclipLon: np.array
Ecliptic longitude (radians) of each point with the sun at longitude zero
- Note that since the alt and az can be calculated using the fast approximation, if one wants
- to compute the distance between the the points and the sun or moon, it is probably better to
- use the ra,dec positions rather than the alt,az positions.
- return_mags(bandpasses=None)¶
Convert the computed spectra to a magnitude using the supplied bandpass, or, if self.mags=True, return the mags in the LSST filters
If mags=True when initialized, return mags returns an structured array with dtype names u,g,r,i,z,y.
bandpasses: optional dictionary with bandpass name keys and bandpass object values.
- return_wave_spec()¶
Return the wavelength and spectra. Wavelenth in nm spectra is flambda in ergs/cm^2/s/nm
- set_params(airmass=1.0, azs=90.0, alts=None, moon_phase=31.67, moon_alt=45.0, moon_az=0.0, sun_alt=-12.0, sun_az=0.0, sun_eclip_lon=0.0, eclip_lon=135.0, eclip_lat=90.0, degrees=True, solar_flux=130.0, filter_names=['u', 'g', 'r', 'i', 'z', 'y'])¶
Set parameters manually. Note, you can put in unphysical combinations of Parameters if you want to (e.g., put a full moon at zenith at sunset). if the alts kwarg is set it will override the airmass kwarg. MoonPhase is percent of moon illuminated (0-100)
- set_ra_dec_alt_az_mjd(ra, dec, alt, az, mjd, degrees=False, solar_flux=130.0, filter_names=['u', 'g', 'r', 'i', 'z', 'y'])¶
Set the sky parameters by computing the sky conditions on a given MJD and sky location.
Use if you already have alt az coordinates so you can skip the coordinate conversion.
- set_ra_dec_mjd(lon, lat, mjd, degrees=False, az_alt=False, solar_flux=130.0, filter_names=['u', 'g', 'r', 'i', 'z', 'y'])¶
Set the sky parameters by computing the sky conditions on a given MJD and sky location.
lon: Longitude-like (RA or Azimuth). Can be single number, list, or numpy array lat: Latitude-like (Dec or Altitude) mjd: Modified Julian Date for the calculation. Must be single number. degrees: (False) Assumes lon and lat are radians unless degrees=True az_alt: (False) Assume lon, lat are RA, Dec unless az_alt=True solar_flux: solar flux in SFU Between 50 and 310. Default=130. 1 SFU=10^4 Jy. filter_names: list of fitlers to return magnitudes for (if initialized with mags=True).