Wavelength-dependent Profiles¶
Real astronomical objects emit photons at a range of wavelengths according to a potentially complicated spectral energy distribution (SED). These photons then may be affected differently by the atmosphere and optics as part of the point-spread function (PSF). Then they typically pass through a bandpass filter with a variable transmission as a function of wavelength. Finally, there may be other wavelength-dependent effects when converting from photons to electrons in the sensor.
GalSim supplies a number of tools to simulate these chromatic effects.
An SED
is used to define the SED of the objects. There are a variety of options as to the units
of the input SED function; e.g. photons/cm^2/nm/sec, ergs/cm^2/Hz/s, etc. There are also ways
to adjust the normalization of the SED to give a particular observed magnitude when observed
in through particular Bandpass
. There is also a dimensionless option, which may be appropriate
for defining chromatic PSFs.
The Bandpass
class represents a spectral throughput function, which could be an
entire imaging system throughput response function (reflection off of mirrors, transmission through
filters, lenses and the atmosphere, quantum efficiency of detectors), or individual pieces thereof.
Both a Bandpass
and the SED
are necessary to compute the relative contribution of each
wavelength of a ChromaticObject
to a drawn image.
Then there are a number of kinds of ChromaticObject
to define the wavelength dependence of an
object’s surface brightness profile. The simplest one is when the spatial and spectral
dependencies are separable; i.e. every part of the profile has the same SED. In this case,
one forms the ChromaticObject
simply by multiplying a GSObject
by an SED
:
>>> obj = galsim.Sersic(n=2.3, half_light_radius=3.5)
>>> sed = galsim.SED('CWW_Sbc_ext.sed', wave_type'Ang', flux_type='flambda')
>>> chromatic_object = obj * sed
Other more complicated kinds of chromatic profiles are subclasses of ChromaticObject
and
have their own initialization arguments. See the listings below.
To draw any kind of ChromaticObject
, you call its drawImage()
method, which works largely the same as GSObject:drawImage()
, but requires a
galsim.Bandpass
argument to define what bandpass is being used for the observation:
>>> gband = galsim.Bandpass(lambda w:1.0, wave_type='nm', blue_limit=410, red_limit=550)
>>> image = chromatic_obj.drawImage(gband)
The transformation methods of ChromaticObject
, like dilate()
and
shift()
,
can also accept as an argument a function of wavelength (in nanometers)
that returns a wavelength-dependent dilation, shift, etc. These can be used to implement
chromatic PSFs. For example, a diffraction limited PSF might look like:
>>> psf500 = galsim.Airy(lam_over_diam=2.0)
>>> chromatic_psf = ChromaticObject(psf500).dilate(lambda w:(w/500)**1.0)
Spectral Energy Distributions¶
-
class
galsim.
SED
(spec, wave_type, flux_type, redshift=0.0, fast=True, _blue_limit=0.0, _red_limit=inf, _wave_list=None, _spectral=None)[source]¶ Object to represent the spectral energy distributions of stars and galaxies.
SEDs are callable, usually returning the flux density in photons/nm/cm^2/s as a function of wavelength, though SEDs are also used by GalSim to track dimensionless wavelength-dependent normalizations, and may thus also return dimensionless values. By default, the above wavelength used by __call__ is nanometers, but it’s possible to use other units via the astropy.units module (at least, if the SED keyword argument
fast=False
, see below). For instance,:>>> sed = galsim.SED(...) >>> from astropy import units as u >>> assert sed(500) == sed(5000 * u.AA) # 500 nm == 5000 Angstroms
The python type of the return value depends on the type of the input wavelength(s). A scalar input wavelength yields a scalar flux density, a tuple yields a tuple, a list yields a list, and a numpy.ndarray yields a numpy.ndarray. A scalar astropy.units.Quantity yields a python scalar, and a vector astropy.units.Quantity yields a numpy.ndarray.
SEDs are immutable; all transformative SED methods return new SEDs, and leave their originating SEDs unaltered.
SEDs have
blue_limit
andred_limit
attributes, which indicate the range over which the SED is defined. An exception will be raised if the flux density or normalization is requested outside of this range. Note thatblue_limit
andred_limit
are always in nanometers and in the observed frame whenredshift != 0
.SEDs may be multiplied by scalars or scalar functions of wavelength. In particular, an SED multiplied by a
Bandpass
will yield the appropriately filtered SED. Two SEDs may be multiplied together if at least one of them represents a dimensionless normalization.SEDs may be added together if they are at the same redshift. The resulting SED will only be defined on the wavelength region where both of the operand SEDs are defined.
blue_limit
andred_limit
will be reset accordingly.The input parameter,
spec
, may be one of several possible forms:a regular python function (or an object that acts like a function)
a LookupTable
a file from which a LookupTable can be read in
a string which can be evaluated into a function of
wave
via eval(‘lambda wave : ‘+spec), e.g., spec = ‘0.8 + 0.2 * (wave-800)’a python scalar (only possible for dimensionless SEDs)
The argument of
spec
should be the wavelength in units specified bywave_type
, which should be an instance ofastropy.units.Unit
of equivalency classastropy.units.spectral
, or one of the case-insensitive aliases ‘nm’, ‘nanometer’, ‘nanometers’, ‘A’, ‘Ang’, ‘Angstrom’, or ‘Angstroms’. Note thatastropy.units.spectral
includes not only units with dimensions of length, but also frequency, energy, or wavenumber.The return value of
spec
should be a spectral density with units specified byflux_type
, which should be an instance ofastropy.units.Unit
of equivalency classastropy.units.spectral_density
, or one of the case-insensitive aliases:‘flambda’: erg/wave_type/cm^2/s, where wave_type is as above.
‘fnu’: erg/Hz/cm^2/s
‘fphotons’: photons/wave_type/cm^2/s, where wave_type is as above.
‘1’: dimensionless
Note that the
astropy.units.spectral_density
class includes units with dimensions of [energy/time/area/unit-wavelength], [energy/time/area/unit-frequency], [photons/time/area/unit-wavelength], and so on.Finally, the optional
fast
keyword option is used to specify when unit and dimension changes are executed, particularly for SEDs specified by a LookupTable. Iffast=True
, the default, then the input units/dimensions may be converted to an internal working unit before interpolation in wavelength is performed. Alternatively,fast=False
implies that interpolation should take place in the native units of the inputspec
, and subsequently flux density converted to photons/cm^2/s/nm afterwards. Generally, the former option is faster, but may be less accurate since interpolation and dimensionality conversion do not commute. One consequence of usingfast=True
is that __call__ can not accept anastropy.units.Quantity
in this case.- Parameters
spec – Function defining the z=0 spectrum at each wavelength. See above for valid options for this parameter.
wave_type – String or astropy.unit specifying units for wavelength input to
spec
.flux_type – String or astropy.unit specifying what type of spectral density or dimensionless normalization
spec
represents. See above for valid options for this parameter.redshift – Optionally shift the spectrum to the given redshift. [default: 0]
fast – Convert units on initialization instead of on __call__. [default: True]
-
atRedshift
(redshift)[source]¶ Return a new SED with redshifted wavelengths.
- Parameters
redshift – The redshift for the returned SED
- Returns
the redshifted SED.
-
calculateDCRMomentShifts
(bandpass, **kwargs)[source]¶ Calculates shifts in first and second moments of PSF due to differential chromatic refraction (DCR). I.e., equations (1) and (2) from Plazas and Bernstein (2012) (http://arxiv.org/abs/1204.1346).
- Parameters
bandpass – Bandpass through which object is being imaged.
zenith_angle – Angle from object to zenith, expressed as an Angle
parallactic_angle – Parallactic angle, i.e. the position angle of the zenith, measured from North through East. [default: 0]
obj_coord – Celestial coordinates of the object being drawn as a CelestialCoord. [default: None]
zenith_coord – Celestial coordinates of the zenith as a CelestialCoord. [default: None]
HA – Hour angle of the object as an Angle. [default: None]
latitude – Latitude of the observer as an Angle. [default: None]
pressure – Air pressure in kiloPascals. [default: 69.328 kPa]
temperature – Temperature in Kelvins. [default: 293.15 K]
H2O_pressure – Water vapor pressure in kiloPascals. [default: 1.067 kPa]
- Returns
The first element is the vector of DCR first moment shifts
The second element is the 2x2 matrix of DCR second (central) moment shifts.
- Return type
a tuple
-
calculateFlux
(bandpass)[source]¶ Return the flux (photons/cm^2/s) of the SED through the bandpass.
- Parameters
bandpass – A Bandpass object representing a filter, or None to compute the bolometric flux. For the bolometric flux the integration limits will be set to (0, infinity), which implies that the SED needs to be evaluable over this entire range.
- Returns
the flux through the bandpass.
-
calculateMagnitude
(bandpass)[source]¶ Return the SED magnitude through a Bandpass
bandpass
. Note that this requiresbandpass
to have been assigned a zeropoint usingBandpass.withZeropoint
.- Parameters
bandpass – A Bandpass object representing a filter, or None to compute the bolometric magnitude. For the bolometric magnitude the integration limits will be set to (0, infinity), which implies that the SED needs to be evaluable over this entire range.
- Returns
the bandpass magnitude.
-
calculateSeeingMomentRatio
(bandpass, alpha=-0.2, base_wavelength=500)[source]¶ Calculates the relative size of a PSF compared to the monochromatic PSF size at wavelength
base_wavelength
.- Parameters
bandpass – Bandpass through which object is being imaged.
alpha – Power law index for wavelength-dependent seeing. [default: -0.2, the prediction for Kolmogorov turbulence]
base_wavelength – Reference wavelength in nm from which to compute the relative PSF size. [default: 500]
- Returns
the ratio of the PSF second moments to the second moments of the reference PSF.
-
check_spectral
()[source]¶ Return boolean indicating if SED has units compatible with a spectral density.
-
sampleWavelength
(nphotons, bandpass, rng=None, npoints=None)[source]¶ Sample a number of random wavelength values from the SED, possibly as observed through a bandpass.
- Parameters
nphotons – Number of samples (photons) to randomly draw.
bandpass – A Bandpass object representing a filter, or None to sample over the full SED wavelength range.
rng – If provided, a random number generator that is any kind of BaseDeviate object. If
rng
is None, one will be automatically created from the system. [default: None]npoints – Number of points DistDeviate should use for its internal interpolation tables. [default: None, which uses the DistDeviate default]
-
thin
(rel_err=0.0001, trim_zeros=True, preserve_range=True, fast_search=True)[source]¶ If the SED was initialized with a LookupTable or from a file (which internally creates a LookupTable), then remove tabulated values while keeping the integral over the set of tabulated values still accurate to
rel_err
.- Parameters
rel_err – The relative error allowed in the integral over the SED [default: 1.e-4]
trim_zeros – Remove redundant leading and trailing points where f=0? (The last leading point with f=0 and the first trailing point with f=0 will be retained). Note that if both trim_leading_zeros and preserve_range are True, then the only the range of
x
after zero trimming is preserved. [default: True]preserve_range – Should the original range (
blue_limit
andred_limit
) of the SED be preserved? (True) Or should the ends be trimmed to include only the region where the integral is significant? (False) [default: True]fast_search – If set to True, then the underlying algorithm will use a relatively fast O(N) algorithm to select points to include in the thinned approximation. If set to False, then a slower O(N^2) algorithm will be used. We have found that the slower algorithm tends to yield a thinned representation that retains fewer samples while still meeting the relative error requirement. [default: True]
- Returns
the thinned SED.
-
withFlux
(target_flux, bandpass)[source]¶ Return a new SED with flux through the Bandpass
bandpass
set totarget_flux
. See ChromaticObject docstring for information about how SED normalization affects ChromaticObject normalization.- Parameters
target_flux – The desired flux normalization of the SED.
bandpass – A Bandpass object defining a filter bandpass.
- Returns
the new normalized SED.
-
withFluxDensity
(target_flux_density, wavelength)[source]¶ Return a new SED with flux density set to
target_flux_density
at wavelengthwavelength
. See ChromaticObject docstring for information about how SED normalization affects ChromaticObject normalization.- Parameters
target_flux_density – The target normalization in photons/nm/cm^2/s.
wavelength – The wavelength, in nm, at which the flux density will be set.
- Returns
the new normalized SED.
-
withMagnitude
(target_magnitude, bandpass)[source]¶ Return a new SED with magnitude through
bandpass
set totarget_magnitude
. Note that this requiresbandpass
to have been assigned a zeropoint usingBandpass.withZeropoint
. See ChromaticObject docstring for information about how SED normalization affects ChromaticObject normalization.- Parameters
target_magnitude – The desired magnitude of the SED.
bandpass – A Bandpass object defining a filter bandpass.
- Returns
the new normalized SED.
Bandpass Filters¶
-
class
galsim.
Bandpass
(throughput, wave_type, blue_limit=None, red_limit=None, zeropoint=None, _wave_list=None, _tp=None)[source]¶ Simple bandpass object, which models the transmission fraction of incident light as a function of wavelength, for either an entire optical path (e.g., atmosphere, reflecting and refracting optics, filters, CCD quantum efficiency), or some intermediate piece thereof. Bandpasses representing individual components may be combined through the
*
operator to form a new Bandpass object representing the composite optical path.Bandpasses are callable, returning dimensionless throughput as a function of wavelength in nm.
Bandpasses are immutable; all transformative methods return new Bandpasses, and leave their originating Bandpasses unaltered.
Bandpasses require
blue_limit
andred_limit
attributes, which may either be explicitly set at initialization, or are inferred from the initializing galsim.LookupTable or 2-column file.Outside of the wavelength interval between
blue_limit
andred_limit
, the throughput is returned as zero, regardless of thethroughput
input parameter.Bandpasses may be multiplied by other Bandpasses, functions, scalars, or SEDs. The product of a Bandpass with an SED is a new SED.
The Bandpass effective wavelength is stored in the python property
effective_wavelength
. We use throughput-weighted average wavelength (which is independent of any SED) as our definition for effective wavelength.For Bandpasses defined using a LookupTable, a numpy.array of wavelengths,
wave_list
, defining the table is maintained. Bandpasses defined as products of two other Bandpasses will define theirwave_list
as the union of multiplicandwave_list
values, although limited to the range between the new productblue_limit
andred_limit
. (This implementation detail may affect the choice of integrator used to draw ChromaticObjects.)The input parameter, throughput, may be one of several possible forms:
a regular python function (or an object that acts like a function)
a galsim.LookupTable
a file from which a LookupTable can be read in
a string which can be evaluated into a function of
wave
viaeval('lambda wave : '+throughput)
e.g. throughput = ‘0.8 + 0.2 * (wave-800)’
The argument of
throughput
will be the wavelength in units specified bywave_type
. (See below.) The output should be the dimensionless throughput at that wavelength. (Note we usewave
rather thanlambda
, sincelambda
is a python reserved word.)The argument
wave_type
specifies the units to assume for wavelength and must be one of ‘nm’, ‘nanometer’, ‘nanometers’, ‘A’, ‘Ang’, ‘Angstrom’, or ‘Angstroms’, or an astropy distance unit. (For the string values, case is unimportant.) If given, blue_limit and red_limit are taken to be in these units as well.Note that the
wave_type
parameter does not propagate into other methods ofBandpass
. For instance, Bandpass.__call__ assumes its input argument is in nanometers.Finally, a Bandpass may have zeropoint attribute, which is a float used to convert flux (in photons/s/cm^2) to magnitudes:
mag = -2.5*log10(flux) + zeropoint
You can either set the zeropoint at initialization, or via the
withZeropoint
method. Note that the zeropoint attribute does not propagate if you get a new Bandpass by multiplying or dividing an old Bandpass.- Parameters
throughput – Function defining the throughput at each wavelength. See above for valid options for this parameter.
wave_type – The units to use for the wavelength argument of the
throughput
function. See above for details.blue_limit – Hard cut off of bandpass on the blue side. [default: None, but required if throughput is not a LookupTable or file. See above.]
red_limit – Hard cut off of bandpass on the red side. [default: None, but required if throughput is not a LookupTable or file. See above.]
zeropoint – Set the zero-point for this Bandpass. Here, this can only be a float value. See the method
withZeropoint
for other options for how to set this using a particular spectrum (AB, Vega, etc.) [default: None]
-
calculateEffectiveWavelength
(precise=False)[source]¶ Calculate, store, and return the effective wavelength for this bandpass. We define the effective wavelength as the throughput-weighted average wavelength, which is SED-independent. Units are nanometers.
- Parameters
precise – Optionally use a more precise integration method when the bandpass uses a LookupTable rather than the normal trapezoid rule. [default: False]
-
thin
(rel_err=0.0001, trim_zeros=True, preserve_range=True, fast_search=True, preserve_zp=True)[source]¶ Thin out the internal wavelengths of a Bandpass that uses a LookupTable.
If the bandpass was initialized with a LookupTable or from a file (which internally creates a LookupTable), this function removes tabulated values while keeping the integral over the set of tabulated values still accurate to the given relative error.
That is, the integral of the bandpass function is preserved to a relative precision of
rel_err
, while eliminating as many internal wavelength values as possible. This process will usually help speed up integrations using this bandpass. You should weigh the speed improvements against your fidelity requirements for your particular use case.By default, this routine will preserve the zeropoint of the original bandpass by assigning it to the new thinned bandpass. The justification for this choice is that when using an AB zeropoint, a typical optical bandpass, and the default thinning
rel_err
value, the zeropoint for the new and thinned bandpasses changes by 10^-6. However, if you are thinning a lot, and/or want to do extremely precise tests, you can setpreserve_zp=False
and then recalculate the zeropoint after thinning.- Parameters
rel_err – The relative error allowed in the integral over the throughput function. [default: 1.e-4]
trim_zeros – Remove redundant leading and trailing points where f=0? (The last leading point with f=0 and the first trailing point with f=0 will be retained). Note that if both trim_leading_zeros and preserve_range are True, then the only the range of
x
after zero trimming is preserved. [default: True]preserve_range – Should the original range (
blue_limit
andred_limit
) of the Bandpass be preserved? (True) Or should the ends be trimmed to include only the region where the integral is significant? (False) [default: True]fast_search – If set to True, then the underlying algorithm will use a relatively fast O(N) algorithm to select points to include in the thinned approximation. If set to False, then a slower O(N^2) algorithm will be used. We have found that the slower algorithm tends to yield a thinned representation that retains fewer samples while still meeting the relative error requirement, and may also be somewhat more robust when computing SED fluxes through Bandpasses when a significant fraction of the integrated flux passes through low throughput bandpass light leaks. [default: True]
preserve_zp – If True, the new thinned Bandpass will be assigned the same zeropoint as the original. If False, the new thinned Bandpass will have a zeropoint of None. [default: True]
- Returns
the thinned Bandpass.
-
truncate
(blue_limit=None, red_limit=None, relative_throughput=None, preserve_zp='auto')[source]¶ Return a bandpass with its wavelength range truncated.
This function truncate the range of the bandpass either explicitly (with
blue_limit
orred_limit
or both) or automatically, just trimming off leading and trailing wavelength ranges where the relative throughput is less than some amount (relative_throughput
).This second option using relative_throughput is only available for bandpasses initialized with a LookupTable or from a file, not when using a regular python function or a string evaluation.
This function does not remove any intermediate wavelength ranges, but see thin() for a method that can thin out the intermediate values.
When truncating a bandpass that already has an assigned zeropoint, there are several possibilities for what should happen to the new (returned) bandpass by default. If red and/or blue limits are given, then the new bandpass will have no assigned zeropoint because it is difficult to predict what should happen if the bandpass is being arbitrarily truncated. If
relative_throughput
is given, often corresponding to low-level truncation that results in little change in observed quantities, then the new bandpass is assigned the same zeropoint as the original. This default behavior is called ‘auto’. The user can also give boolean True or False values.- Parameters
blue_limit – Truncate blue side of bandpass at this wavelength in nm. [default: None]
red_limit – Truncate red side of bandpass at this wavelength in nm. [default: None]
relative_throughput – Truncate leading or trailing wavelengths that are below this relative throughput level. (See above for details.) Either
blue_limit
and/orred_limit
should be supplied, orrelative_throughput
should be supplied – butrelative_throughput
should not be combined with one of the limits. [default: None]preserve_zp – If True, the new truncated Bandpass will be assigned the same zeropoint as the original. If False, the new truncated Bandpass will have a zeropoint of None. If ‘auto’, the new truncated Bandpass will have the same zeropoint as the original when truncating using
relative_throughput
, but will have a zeropoint of None when truncating using ‘blue_limit’ and/or ‘red_limit’. [default: ‘auto’]
- Returns
the truncated Bandpass.
-
withZeropoint
(zeropoint)[source]¶ Assign a zeropoint to this Bandpass.
A bandpass zeropoint is a float used to convert flux (in photons/s/cm^2) to magnitudes:
mag = -2.5*log10(flux) + zeropoint
Note that the zeropoint attribute does not propagate if you get a new Bandpass by multiplying or dividing an old Bandpass.
The
zeropoint
argument can take a variety of possible forms:a number, which will be the zeropoint
a galsim.SED. In this case, the zeropoint is set such that the magnitude of the supplied SED through the bandpass is 0.0
the string ‘AB’. In this case, use an AB zeropoint.
the string ‘Vega’. Use a Vega zeropoint.
the string ‘ST’. Use a HST STmag zeropoint.
- Parameters
zeropoint – See above for valid input options
- Returns
new Bandpass with zeropoint set.
Chromatic Profiles¶
-
class
galsim.
ChromaticObject
(obj)[source]¶ Base class for defining wavelength-dependent objects.
This class primarily serves as the base class for chromatic subclasses. See the docstrings for subclasses for more details.
A ChromaticObject can be instantiated directly from an existing GSObject. In this case, the newly created ChromaticObject will act in nearly the same way as the original GSObject works, except that it has access to the ChromaticObject transformation methods described below (e.g., expand(), dilate(), shift(), withFlux(), …) These can all take functions as arguments to describe wavelength-dependent transformations. E.g.,:
>>> gsobj = galsim.Gaussian(fwhm=1) >>> chrom_obj = galsim.ChromaticObject(gsobj).dilate(lambda wave: (wave/500.)**(-0.2))
In this and similar cases, the argument to the transformation method should be a python callable that accepts wavelength in nanometers and returns whatever type the transformation method normally accepts (so an int or float above).
One caveat to creating ChromaticObjects directly from GSObjects like this is that even though the source GSObject instance has flux units in photons/s/cm^2, the newly formed ChromaticObject will be interpreted as dimensionless, i.e., it will have a dimensionless SED (and have its .dimensionless attribute set to True). See below for more discussion about the dimensions of ChromaticObjects.
Another way to instantiate a ChromaticObject from a GSObject is to multiply by an SED. This can be useful to consistently generate the same galaxy observed through different filters, or, with ChromaticSum, to construct multi-component galaxies, each component with a different SED. For example, a bulge+disk galaxy could be constructed:
>>> bulge_SED = user_function_to_get_bulge_spectrum() >>> disk_SED = user_function_to_get_disk_spectrum() >>> bulge_mono = galsim.DeVaucouleurs(half_light_radius=1.0) >>> disk_mono = galsim.Exponential(half_light_radius=2.0) >>> bulge = bulge_mono * bulge_SED >>> disk = disk_mono * disk_SED >>> gal = bulge + disk
The SEDs above describe the flux density in photons/nm/cm^2/s of an object, possibly normalized with either the sed.withFlux(bandpass) or sed.withMagnitude(bandpass) methods (see the docstrings in the SED class for details about these and other normalization options). Note that for dimensional consistency, in this case, the
flux
attribute of the multiplied GSObject is interpreted as being dimensionless instead of in its normal units of [photons/s/cm^2]. The photons/s/cm^2 units are (optionally) carried by the SED instead, or even left out entirely if the SED is dimensionless itself (see discussion on ChromaticObject dimensions below). The GSObjectflux
attribute does still contribute to the ChromaticObject normalization, though. For example, the following are equivalent:>>> chrom_obj = (sed * 3.0) * gsobj >>> chrom_obj2 = sed * (gsobj * 3.0)
Subclasses that instantiate a ChromaticObject directly also exist, such as ChromaticAtmosphere. Even in this case, however, the underlying implementation always eventually wraps one or more GSObjects.
Dimensions:
ChromaticObjects can generally be sorted into two distinct types: those that represent galaxies or stars and have dimensions of [photons/wavelength-interval/area/time/solid-angle], and those that represent other types of wavelength dependence besides flux, like chromatic PSFs (these have dimensions of [1/solid-angle]). The former category of ChromaticObjects will have their
.spectral
attribute set to True, while the latter category of ChromaticObjects will have their.dimensionless
attribute set to True. These two classes of ChromaticObjects have different restrictions associated with them. For example, only spectral ChromaticObjects can be drawn using chrom_obj.drawImage(bandpass, …), only ChromaticObjects of the same type can be added together, and at most one spectral ChromaticObject can be part of a ChromaticConvolution.Multiplying a dimensionless ChromaticObject a spectral SED produces a spectral ChromaticObject (though note that the new object’s SED may not be equal to the SED being multiplied by since the original ChromaticObject may not have had unit normalization.)
Methods:
gsobj = chrom_obj.evaluateAtWavelength(wave) returns the monochromatic surface brightness profile (as a GSObject) at a given wavelength (in nanometers).
The interpolate() method can be used for non-separable ChromaticObjects to expedite the image rendering process. See the docstring of that method for more details and discussion of when this is a useful tool (and the interplay between interpolation, object transformations, and convolutions).
Also, ChromaticObject has most of the same methods as GSObjects with the following exceptions:
The GSObject access methods (e.g. xValue(), maxk, etc.) are not available. Instead, you would need to evaluate the profile at a particular wavelength and access what you want from that.
The withFlux(), withFluxDensity, and withMagnitude() methods will return a new chromatic object with the appropriate spatially integrated flux, flux density, or magnitude.
The drawImage() method draws the object as observed through a particular bandpass, so the arguments are somewhat different. See the docstring for ChromaticObject.drawImage() for more details.
-
calculateCentroid
(bandpass)[source]¶ Determine the centroid of the wavelength-integrated surface brightness profile.
- Parameters
bandpass – The bandpass through which the observation is made.
- Returns
the centroid of the integrated surface brightness profile, as a PositionD.
-
calculateFlux
(bandpass)[source]¶ Return the flux (photons/cm^2/s) of the ChromaticObject through the bandpass.
- Parameters
bandpass – A Bandpass object representing a filter, or None to compute the bolometric flux. For the bolometric flux the integration limits will be set to (0, infinity) unless overridden by non-
None
SED attributesblue_limit
orred_limit
. Note that SEDs defined usingLookupTable
automatically haveblue_limit
andred_limit
set.- Returns
the flux through the bandpass.
-
calculateMagnitude
(bandpass)[source]¶ Return the ChromaticObject magnitude through a Bandpass
bandpass
. Note that this requiresbandpass
to have been assigned a zeropoint usingBandpass.withZeropoint
.- Parameters
bandpass – A Bandpass object representing a filter, or None to compute the bolometric magnitude. For the bolometric magnitude the integration limits will be set to (0, infinity) unless overridden by non-
None
SED attributesblue_limit
orred_limit
. Note that SEDs defined usingLookupTable
automatically haveblue_limit
andred_limit
set.- Returns
the bandpass magnitude.
-
dilate
(scale)[source]¶ Dilate the linear size of the profile by the given (possibly wavelength-dependent)
scale
, while preserving flux.e.g.
half_light_radius
<–half_light_radius * scale
See expand() and magnify() for versions that preserve surface brightness, and thus change the flux.
- Parameters
scale – The linear rescaling factor to apply. In addition,
scale
may be a callable function, in which case the argument should be wavelength in nanometers and the return value the scale for that wavelength.- Returns
the dilated object.
-
property
dimensionless
¶ Boolean indicating if ChromaticObject is dimensionless.
-
drawImage
(bandpass, image=None, integrator='trapezoidal', **kwargs)[source]¶ Base implementation for drawing an image of a ChromaticObject.
Some subclasses may choose to override this for specific efficiency gains. For instance, most GalSim use cases will probably finish with a convolution, in which case ChromaticConvolution.drawImage() will be used.
The task of drawImage() in a chromatic context is to integrate a chromatic surface brightness profile multiplied by the throughput of
bandpass
, over the wavelength interval indicated bybandpass
.Several integrators are available in galsim.integ to do this integration when using the first method (non-interpolated integration). By default,
galsim.integ.SampleIntegrator(rule=galsim.integ.trapzRule)
will be used if eitherbandpass.wave_list
orself.wave_list
have len() > 0. If lengths of both are zero, which may happen if both the bandpass throughput and the SED associated withself
are analytic python functions, for example, thengalsim.integ.ContinuousIntegrator(rule=galsim.integ.trapzRule)
will be used instead. This latter case by default will evaluate the integrand at 250 equally-spaced wavelengths betweenbandpass.blue_limit
andbandpass.red_limit
.By default, the above two integrators will use the trapezoidal rule for integration. The midpoint rule for integration can be specified instead by passing an integrator that has been initialized with the
rule=galsim.integ.midptRule
argument. When creating a ContinuousIntegrator, the number of samplesN
is also an argument. For example:>>> integrator = galsim.ContinuousIntegrator(rule=galsim.integ.midptRule, N=100) >>> image = chromatic_obj.drawImage(bandpass, integrator=integrator)
Finally, this method uses a cache to avoid recomputing the integral over the product of the bandpass and object SED when possible (i.e., for separable profiles). Because the cache size is finite, users may find that it is more efficient when drawing many images to group images using the same SEDs and bandpasses together in order to hit the cache more often. The default cache size is 10, but may be resized using the
ChromaticObject.resize_multiplier_cache
method.- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – Optionally, the Image to draw onto. (See GSObject.drawImage() for details.) [default: None]
integrator – When doing the exact evaluation of the profile, this argument should be one of the image integrators from galsim.integ, or a string ‘trapezoidal’ or ‘midpoint’, in which case the routine will use a SampleIntegrator or ContinuousIntegrator depending on whether or not the object has a
wave_list
. [default: ‘trapezoidal’, which will try to select an appropriate integrator using the trapezoidal integration rule automatically.]**kwargs – For all other kwarg options, see GSObject.drawImage()
- Returns
the drawn Image.
-
drawKImage
(bandpass, image=None, integrator='trapezoidal', **kwargs)[source]¶ Base implementation for drawing the Fourier transform of a ChromaticObject.
The task of drawKImage() in a chromatic context is exactly analogous to the task of drawImage() in a chromatic context: to integrate the
SED * bandpass
weighted Fourier profiles over wavelength.See drawImage() for details on integration options.
- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – If provided, this will be the ImageC onto which to draw the k-space image. If
image
is None, then an automatically-sized image will be created. Ifimage
is given, but its bounds are undefined, then it will be resized appropriately based on the profile’s size. [default: None]integrator – When doing the exact evaluation of the profile, this argument should be one of the image integrators from galsim.integ, or a string ‘trapezoidal’ or ‘midpoint’, in which case the routine will use a SampleIntegrator or ContinuousIntegrator depending on whether or not the object has a
wave_list
. [default: ‘trapezoidal’, which will try to select an appropriate integrator using the trapezoidal integration rule automatically.]**kwargs – For all other kwarg options, see GSObject.drawKImage()
- Returns
an ImageC instance (created if necessary)
-
evaluateAtWavelength
(wave)[source]¶ Evaluate this chromatic object at a particular wavelength.
- Parameters
wave – Wavelength in nanometers.
- Returns
the monochromatic object at the given wavelength.
-
expand
(scale)[source]¶ Expand the linear size of the profile by the given (possibly wavelength-dependent) scale factor
scale
, while preserving surface brightness.This doesn’t correspond to either of the normal operations one would typically want to do to a galaxy. The functions dilate() and magnify() are the more typical usage. But this function is conceptually simple. It rescales the linear dimension of the profile, while preserving surface brightness. As a result, the flux will necessarily change as well.
See dilate() for a version that applies a linear scale factor while preserving flux.
See magnify() for a version that applies a scale factor to the area while preserving surface brightness.
- Parameters
scale – The factor by which to scale the linear dimension of the object. In addition,
scale
may be a callable function, in which case the argument should be wavelength in nanometers and the return value the scale for that wavelength.- Returns
the expanded object
-
interpolate
(waves, **kwargs)[source]¶ This method is used as a pre-processing step that can expedite image rendering using objects that have to be built up as sums of GSObjects with different parameters at each wavelength, by interpolating between Images at each wavelength instead of making a more costly instantiation of the relevant GSObject at each value of wavelength at which the bandpass is defined. This routine does a costly initialization process to build up a grid of images to be used for the interpolation later on. However, the object can get reused with different bandpasses, so there should not be any need to make many versions of this object, and there is a significant savings each time it is drawn into an image. As a general rule of thumb, chromatic objects that are separable do not benefit from this particular optimization, whereas those that involve making GSObjects with wavelength-dependent keywords or transformations do benefit from it. Note that the interpolation scheme is simple linear interpolation in wavelength, and no extrapolation beyond the originally-provided range of wavelengths is permitted. However, the overall flux at each wavelength will use the exact SED at that wavelength to give more accurate final flux values. You can disable this feature by setting
use_exact_SED = False
.The speedup involved in using interpolation depends in part on the bandpass used for rendering (since that determines how many full profile evaluations are involved in rendering the image). However, for ChromaticAtmosphere with simple profiles like Kolmogorov, the speedup in some simple example cases is roughly a factor of three, whereas for more expensive to render profiles like the ChromaticOpticalPSF, the speedup is more typically a factor of 10-50.
Achromatic transformations can be applied either before or after setting up interpolation, with the best option depending on the application. For example, when rendering many times with the same achromatic transformation applied, it is typically advantageous to apply the transformation before setting up the interpolation. But there is no value in this when applying different achromatic transformation to each object. Chromatic transformations should be applied before setting up interpolation; attempts to render images of ChromaticObjects with interpolation followed by a chromatic transformation will result in the interpolation being unset and the full calculation being done.
Because of the clever way that the ChromaticConvolution routine works, convolutions of separable chromatic objects with non-separable ones that use interpolation will still benefit from these optimizations. For example, a non-separable chromatic PSF that uses interpolation, when convolved with a sum of two separable galaxy components each with their own SED, will be able to take advantage of this optimization. In contrast, when convolving two non-separable profiles that already have interpolation set up, there is no way to take advantage of that interpolation optimization, so it will be ignored and the full calculation will be done. However, interpolation can be set up for the convolution of two non-separable profiles, after the convolution step. This could be beneficial for example when convolving a chromatic optical PSF and chromatic atmosphere, before convolving with multiple galaxy profiles.
For use cases requiring a high level of precision, we recommend a comparison between the interpolated and the more accurate calculation for at least one case, to ensure that the required precision has been reached.
The input parameter
waves
determines the input grid on which images are precomputed. It is difficult to give completely general guidance as to how many wavelengths to choose or how they should be spaced; some experimentation compared with the exact calculation is warranted for each particular application. The best choice of settings might depend on how strongly the parameters of the object depend on wavelength.- Parameters
waves – The list, tuple, or NumPy array of wavelengths to be used when building up the grid of images for interpolation. The wavelengths should be given in nanometers, and they should span the full range of wavelengths covered by any bandpass to be used for drawing Images (i.e., this class will not extrapolate beyond the given range of wavelengths). They can be spaced any way the user likes, not necessarily linearly, though interpolation will be linear in wavelength between the specified wavelengths.
oversample_fac – Factor by which to oversample the stored profiles compared to the default, which is to sample them at the Nyquist frequency for whichever wavelength has the highest Nyquist frequency.
oversample_fac
>1 results in higher accuracy but costlier pre-computations (more memory and time). [default: 1]use_exact_SED – If true, then rescale the interpolated image for a given wavelength by the ratio of the exact SED at that wavelength to the linearly interpolated SED at that wavelength. Thus, the flux of the interpolated object should be correct, at the possible expense of other features. [default: True]
- Returns
the version of the Chromatic object that uses interpolation (This will be an InterpolatedChromaticObject instance.)
-
lens
(g1, g2, mu)[source]¶ Apply a lensing shear and magnification to this object.
This ChromaticObject method applies a lensing (reduced) shear and magnification. The shear must be specified using the g1, g2 definition of shear (see Shear documentation for more details). This is the same definition as the outputs of the PowerSpectrum and NFWHalo classes, which compute shears according to some lensing power spectrum or lensing by an NFW dark matter halo. The magnification determines the rescaling factor for the object area and flux, preserving surface brightness.
While gravitational lensing is achromatic, we do allow the parameters
g1
,g2
, andmu
to be callable functions to be parallel to all the other transformations of chromatic objects. In this case, the functions should take the wavelength in nanometers as the argument, and the return values are the corresponding value at that wavelength.- Parameters
g1 – First component of lensing (reduced) shear to apply to the object.
g2 – Second component of lensing (reduced) shear to apply to the object.
mu – Lensing magnification to apply to the object. This is the factor by which the solid angle subtended by the object is magnified, preserving surface brightness.
- Returns
the lensed object.
-
magnify
(mu)[source]¶ Apply a lensing magnification, scaling the area and flux by
mu
at fixed surface brightness.This process applies a lensing magnification
mu
, which scales the linear dimensions of the image by the factor sqrt(mu), i.e.,half_light_radius
<–half_light_radius * sqrt(mu)
while increasing the flux by a factor ofmu
. Thus, magnify() preserves surface brightness.See dilate() for a version that applies a linear scale factor while preserving flux.
- Parameters
mu – The lensing magnification to apply. In addition,
mu
may be a callable function, in which case the argument should be wavelength in nanometers and the return value the magnification for that wavelength.- Returns
the magnified object.
-
static
resize_multiplier_cache
(maxsize)[source]¶ Resize the cache (default size=10) containing the integral over the product of an SED and a Bandpass, which is used by ChromaticObject.drawImage().
- Parameters
maxsize – The new number of products to cache.
-
rotate
(theta)[source]¶ Rotate this object by an Angle
theta
.- Parameters
theta – Rotation angle (Angle object, +ve anticlockwise). In addition,
theta
may be a callable function, in which case the argument should be wavelength in nanometers and the return value the rotation angle for that wavelength, returned as a galsim.Angle instance.- Returns
the rotated object.
-
shear
(*args, **kwargs)[source]¶ Apply an area-preserving shear to this object, where arguments are either a Shear, or arguments that will be used to initialize one.
For more details about the allowed keyword arguments, see the documentation for Shear (for doxygen documentation, see galsim.shear.Shear).
The shear() method precisely preserves the area. To include a lensing distortion with the appropriate change in area, either use shear() with magnify(), or use lens(), which combines both operations.
Note that, while gravitational shear is monochromatic, the shear method may be used for many other use cases including some which may be wavelength-dependent, such as intrinsic galaxy shape, telescope dilation, atmospheric PSF shape, etc. Thus, the shear argument is allowed to be a function of wavelength like other transformations.
- Parameters
shear – The shear to be applied. Or, as described above, you may instead supply parameters to construct a Shear directly. eg.
obj.shear(g1=g1,g2=g2)
. In addition, theshear
parameter may be a callable function, in which case the argument should be wavelength in nanometers and the return value the shear for that wavelength, returned as a galsim.Shear instance.- Returns
the sheared object.
-
shift
(*args, **kwargs)[source]¶ Apply a (possibly wavelength-dependent) (dx, dy) shift to this chromatic object.
For a wavelength-independent shift, you may supply
dx,dy
as either two arguments, as a tuple, or as a PositionD or PositionI object.For a wavelength-dependent shift, you may supply two functions of wavelength in nanometers which will be interpreted as
dx(wave)
anddy(wave)
, or a single function of wavelength in nanometers that returns either a 2-tuple, PositionD, or PositionI.- Parameters
dx – Horizontal shift to apply (float or function).
dy – Vertical shift to apply (float or function).
- Returns
the shifted object.
-
property
spectral
¶ Boolean indicating if ChromaticObject has units compatible with a spectral density.
-
transform
(dudx, dudy, dvdx, dvdy)[source]¶ Apply a transformation to this object defined by an arbitrary Jacobian matrix.
This works the same as GSObject.transform(), so see that method’s docstring for more details.
As with the other more specific chromatic trasnformations, dudx, dudy, dvdx, and dvdy may be callable functions, in which case the argument should be wavelength in nanometers and the return value the appropriate value for that wavelength.
- Parameters
dudx – du/dx, where (x,y) are the current coords, and (u,v) are the new coords.
dudy – du/dy, where (x,y) are the current coords, and (u,v) are the new coords.
dvdx – dv/dx, where (x,y) are the current coords, and (u,v) are the new coords.
dvdy – dv/dy, where (x,y) are the current coords, and (u,v) are the new coords.
- Returns
the transformed object.
-
withFlux
(target_flux, bandpass)[source]¶ Return a new ChromaticObject with flux through the Bandpass
bandpass
set totarget_flux
.- Parameters
target_flux – The desired flux normalization of the ChromaticObject.
bandpass – A Bandpass object defining a filter bandpass.
- Returns
the new normalized ChromaticObject.
-
withFluxDensity
(target_flux_density, wavelength)[source]¶ Return a new ChromaticObject with flux density set to
target_flux_density
at wavelengthwavelength
.- Parameters
target_flux_density – The target normalization in photons/nm/cm^2/s.
wavelength – The wavelength, in nm, at which the flux density will be set.
- Returns
the new normalized SED.
-
withGSParams
(gsparams)[source]¶ Create a version of the current object with the given gsparams
Note: if this object wraps other objects (e.g. Convolution, Sum, Transformation, etc.) those component objects will also have their gsparams updated to the new value.
-
withMagnitude
(target_magnitude, bandpass)[source]¶ Return a new ChromaticObject with magnitude through
bandpass
set totarget_magnitude
. Note that this requiresbandpass
to have been assigned a zeropoint usingBandpass.withZeropoint
.- Parameters
target_magnitude – The desired magnitude of the ChromaticObject.
bandpass – A Bandpass object defining a filter bandpass.
- Returns
the new normalized ChromaticObject.
-
withScaledFlux
(flux_ratio)[source]¶ Multiply the flux of the object by
flux_ratio
- Parameters
flux_ratio – The factor by which to scale the normalization of the object.
flux_ratio
may be a float, univariate callable function, in which case the argument should be wavelength in nanometers and return value the flux ratio for that wavelength, or an SED.- Returns
a new object with scaled flux.
-
-
class
galsim.
ChromaticAtmosphere
(base_obj, base_wavelength, scale_unit=None, **kwargs)[source]¶ A ChromaticObject implementing two atmospheric chromatic effects: differential chromatic refraction (DCR) and wavelength-dependent seeing.
Due to DCR, blue photons land closer to the zenith than red photons. Kolmogorov turbulence also predicts that blue photons get spread out more by the atmosphere than red photons, specifically FWHM is proportional to wavelength^(-0.2). Both of these effects can be implemented by wavelength-dependent shifts and dilations.
Since DCR depends on the zenith angle and the parallactic angle (which is the position angle of the zenith measured from North through East) of the object being drawn, these must be specified via keywords. There are four ways to specify these values:
explicitly provide
zenith_angle = ...
as a keyword of type Angle, andparallactic_angle
will be assumed to be 0 by default.explicitly provide both
zenith_angle = ...
andparallactic_angle = ...
as keywords of type Angle.provide the coordinates of the object
obj_coord = ...
and the coordinates of the zenithzenith_coord = ...
as keywords of type CelestialCoord.provide the coordinates of the object
obj_coord = ...
as a CelestialCoord, the hour angle of the objectHA = ...
as an Angle, and the latitude of the observerlatitude = ...
as an Angle.
DCR also depends on temperature, pressure and water vapor pressure of the atmosphere. The default values for these are expected to be appropriate for LSST at Cerro Pachon, Chile, but they are broadly reasonable for most observatories.
Note that a ChromaticAtmosphere by itself is NOT the correct thing to use to draw an image of a star. Stars (and galaxies too, of course) have an SED that is not flat. To draw a real star, you should either multiply the ChromaticAtmosphere object by an SED, or convolve it with a point source multiplied by an SED:
>>> psf = galsim.ChromaticAtmosphere(...) >>> star = galsim.DeltaFunction() * psf_sed >>> final_star = galsim.Convolve( [psf, star] ) >>> final_star.drawImage(bandpass = bp, ...)
- Parameters
base_obj – Fiducial PSF, equal to the monochromatic PSF at
base_wavelength
base_wavelength – Wavelength represented by the fiducial PSF, in nanometers.
scale_unit – Units used by base_obj for its linear dimensions. [default: galsim.arcsec]
alpha – Power law index for wavelength-dependent seeing. [default: -0.2, the prediction for Kolmogorov turbulence]
zenith_angle – Angle from object to zenith, expressed as an Angle [default: 0]
parallactic_angle – Parallactic angle, i.e. the position angle of the zenith, measured from North through East. [default: 0]
obj_coord – Celestial coordinates of the object being drawn as a CelestialCoord. [default: None]
zenith_coord – Celestial coordinates of the zenith as a CelestialCoord. [default: None]
HA – Hour angle of the object as an Angle. [default: None]
latitude – Latitude of the observer as an Angle. [default: None]
pressure – Air pressure in kiloPascals. [default: 69.328 kPa]
temperature – Temperature in Kelvins. [default: 293.15 K]
H2O_pressure – Water vapor pressure in kiloPascals. [default: 1.067 kPa]
-
build_obj
()[source]¶ Build a ChromaticTransformation object for this ChromaticAtmosphere.
We don’t do this right away to help make ChromaticAtmosphere objects be picklable. Building this is quite fast, so we do it on the fly in evaluateAtWavelength and drawImage.
-
class
galsim.
ChromaticOpticalPSF
(lam, diam=None, lam_over_diam=None, aberrations=None, scale_unit=None, gsparams=None, **kwargs)[source]¶ A subclass of ChromaticObject meant to represent chromatic optical PSFs.
Chromaticity plays two roles in optical PSFs. First, it determines the diffraction limit, via the wavelength/diameter factor. Second, aberrations such as defocus, coma, etc. are typically defined in physical distances, but their impact on the PSF depends on their size in units of wavelength. Other aspects of the optical PSF do not require explicit specification of their chromaticity, e.g., once the obscuration and struts are specified in units of the aperture diameter, their chromatic dependence gets taken care of automatically. Note that the ChromaticOpticalPSF implicitly defines diffraction limits in units of
scale_units
, which by default are arcsec, but can in principle be set to any of our GalSim angle units.When using interpolation to speed up image rendering (see ChromaticObject.interpolate() method for details), the ideal number of wavelengths to use across a given bandpass depends on the application and accuracy requirements. In general it will be necessary to do a test in comparison with a more exact calculation to ensure convergence. However, a typical calculation might use ~10-15 samples across a typical optical bandpass, with
oversample_fac
in the range 1.5-2; for moderate accuracy, ~5 samples across the bandpass andoversample_fac=1
may suffice. All of these statements assume that aberrations are not very large (typically <~0.25 waves, which is commonly satisfied by space telescopes); if they are larger than that, then more stringent settings are required.Note that a ChromaticOpticalPSF by itself is NOT the correct thing to use to draw an image of a star. Stars (and galaxies too, of course) have an SED that is not flat. To draw a real star, you should either multiply the ChromaticOpticalPSF object by an SED, or convolve it with a point source multiplied by an SED:
>>> psf = galsim.ChromaticOpticalPSF(...) >>> star = galsim.DeltaFunction() * psf_sed >>> final_star = galsim.Convolve( [psf, star] ) >>> final_star.drawImage(bandpass = bp, ...)
- Parameters
lam – Fiducial wavelength for which diffraction limit and aberrations are initially defined, in nanometers.
diam – Telescope diameter in meters. Either
diam
orlam_over_diam
must be specified.lam_over_diam – Ratio of (fiducial wavelength) / telescope diameter in units of
scale_unit
. Eitherdiam
orlam_over_diam
must be specified.aberrations – An array of aberrations, in units of fiducial wavelength
lam
. The size and format of this array is described in the OpticalPSF docstring.scale_unit – Units used to define the diffraction limit and draw images. [default: galsim.arcsec]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
**kwargs – Any other keyword arguments to be passed to OpticalPSF, for example, related to struts, obscuration, oversampling, etc. See OpticalPSF docstring for a complete list of options.
-
class
galsim.
ChromaticAiry
(lam, diam=None, lam_over_diam=None, scale_unit=None, gsparams=None, **kwargs)[source]¶ A subclass of ChromaticObject meant to represent chromatic Airy profiles.
For more information about the basics of Airy profiles, please see help(galsim.Airy).
This class is a chromatic representation of Airy profiles, including the wavelength-dependent diffraction limit. One can also get this functionality using the ChromaticOpticalPSF class, but that class includes additional complications beyond a simple Airy profile, and thus has a more complicated internal representation. For users who only want a (possibly obscured) Airy profile, the ChromaticAiry class is likely to be a less computationally expensive and more accurate option.
- Parameters
lam – Fiducial wavelength for which diffraction limit is initially defined, in nanometers.
diam – Telescope diameter in meters. Either
diam
orlam_over_diam
must be specified.lam_over_diam – Ratio of (fiducial wavelength) / telescope diameter in units of
scale_unit
. Eitherdiam
orlam_over_diam
must be specified.scale_unit – Units used to define the diffraction limit and draw images. [default: galsim.arcsec]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
**kwargs – Any other keyword arguments to be passed to Airy: either flux, or gsparams. See galsim.Airy docstring for a complete description of these options.
-
class
galsim.
ChromaticRealGalaxy
(real_galaxy_catalogs, index=None, id=None, random=False, rng=None, gsparams=None, logger=None, **kwargs)[source]¶ A class describing real galaxies over multiple wavelengths, using some multi-band training dataset. The underlying implementation models multi-band images of individual galaxies as chromatic PSF convolutions (and integrations over wavelength) with a sum of profiles separable into spatial and spectral components. The spectral components are specified by the user, and the spatial components are determined one Fourier mode at a time by the class. This decomposition can be thought of as a constrained chromatic deconvolution of the multi-band images by the associated PSFs, similar in spirit to RealGalaxy.
Because ChromaticRealGalaxy involves an InterpolatedKImage,
method = 'phot'
is unavailable for the drawImage() function.Fundamentally, the required inputs for this class are (1) a series of high resolution input Images of a single galaxy in different bands, (2) the Bandpasses corresponding to those images, (3) the PSFs of those images as either GSObjects or ChromaticObjects, and (4) the noise properties of the input images as instances of either
CorrelatedNoise
orUncorrelatedNoise
. If you want to specify these inputs directly, that is possible via the.makeFromImages
factory method of this class:>>> crg = galsim.ChromaticRealGalaxy.makeFromImages(imgs, bands, PSFs, xis, ...)
Alternatively, you may create a ChromaticRealGalaxy via a list of RealGalaxyCatalogs that correspond to a set of galaxies observed in different bands:
>>> crg = galsim.ChromaticRealGalaxy(real_galaxy_catalogs, index=0, ...)
The above will use the 1st object in the catalogs, which should be the same galaxy, just observed in different bands. Note that there are multiple keywords for choosing a galaxy from a catalog; exactly one must be set. In the future we may add more such options, e.g., to choose at random but accounting for the non-constant weight factors (probabilities for objects to make it into the training sample).
The flux normalization of the returned object will by default match the original data, scaled to correspond to a 1 second HST exposure (though see the
area_norm
parameter). If you want a flux appropriate for a longer exposure or telescope with different collecting area, you can use theChromaticObject
methodwithScaledFlux
on the returned object, or use theexptime
andarea
keywords todrawImage
. Note that while you can also use theChromaticObject
methodswithFlux
,withMagnitude
, andwithFluxDensity
to set the absolute normalization, these methods technically adjust the flux of the entire postage stamp image (including noise!) and not necessarily the flux of the galaxy itself. (These two fluxes will be strongly correlated for high signal-to-noise ratio galaxies, but may be considerably different at low signal-to-noise ratio.)Note that ChromaticRealGalaxy objects use arcsec for the units of their linear dimension. If you are using a different unit for other things (the PSF, WCS, etc.), then you should dilate the resulting object with
gal.dilate(galsim.arcsec / scale_unit)
.Noise from the original images is propagated by this class, though certain restrictions apply to when and how that noise is made available. The propagated noise depends on which Bandpass the ChromaticRealGalaxy is being imaged through, so the noise is only available after the
drawImage(bandpass, ...)
method has been called. Also, since ChromaticRealGalaxy will only produce reasonable images when convolved with a (suitably wide) PSF, the noise attribute is attached to theChromaticConvolution
(orChromaticTransformation
of theChromaticConvolution
) which holds as one of its convolutants theChromaticRealGalaxy
.:>>> crg = galsim.ChromaticRealGalaxy(...) >>> psf = ... >>> obj = galsim.Convolve(crg, psf) >>> bandpass = galsim.Bandpass(...) >>> assert not hasattr(obj, 'noise') >>> image = obj.drawImage(bandpass) >>> assert hasattr(obj, 'noise') >>> noise1 = obj.noise
Note that the noise attribute is only associated with the most recently used bandpass. If you draw another image of the same object using a different bandpass, the noise object will be replaced.:
>>> bandpass2 = galsim.Bandpass(...) >>> image2 = obj.drawImage(bandpass2) >>> assert noise1 != obj.noise
- Parameters
real_galaxy_catalogs – A list of
RealGalaxyCatalog
objects from which to createChromaticRealGalaxy
objects. Each catalog should represent the same set of galaxies, and in the same order, just imaged through different filters. Note that the number of catalogs must be equal to or larger than the number of SEDs.index – Index of the desired galaxy in the catalog. [One of
index
,id
, orrandom
is required.]id – Object ID for the desired galaxy in the catalog. [One of
index
,id
, orrandom
is required.]random – If True, then just select a completely random galaxy from the catalog. [One of
index
,id
, orrandom
is required.]rng – A random number generator to use for selecting a random galaxy (may be any kind of BaseDeviate or None) and to use in generating any noise field when padding. This user-input random number generator takes precedence over any stored within a user-input CorrelatedNoise instance (see
noise_pad
parameter below). [default: None]SEDs – An optional list of
SED
to use when representing real galaxies as sums of separable profiles. By default, len(real_galaxy_catalogs) SEDs that are polynomials in wavelength will be used. Note that the number of SEDs must be equal to or smaller than the number of catalogs. [default: see above]k_interpolant – Either an Interpolant instance or a string indicating which k-space interpolant should be used. Options are ‘nearest’, ‘sinc’, ‘linear’, ‘cubic’, ‘quintic’, or ‘lanczosN’ where N should be the integer order to use. We strongly recommend leaving this parameter at its default value; see text above for details. [default: galsim.Quintic()]
maxk – Optional maxk argument. If you know you will be convolving the resulting
ChromaticRealGalaxy
with a “fat” PSF in a subsequent step, then it can be more efficient to limit the range of Fourier modes used when solving for the sum of separable profiles below. [default: None]pad_factor – Factor by which to internally oversample the Fourier-space images that represent the ChromaticRealGalaxy (equivalent to zero-padding the real-space profiles). We strongly recommend leaving this parameter at its default value; see text in Realgalaxy docstring for details. [default: 4]
noise_pad_size – If provided, the image will be padded out to this size (in arcsec) with the noise specified in the real galaxy catalog. This is important if you are planning to whiten the resulting image. You should make sure that the padded image is larger than the postage stamp onto which you are drawing this object. [default: None]
area_norm – Area in cm^2 by which to normalize the flux of the returned object. When area_norm=1 (the default), drawing with
drawImage
keywords exptime=1 and area=1 will simulate an image with the appropriate number of counts for a 1 second exposure with the original telescope/camera (e.g., with HST when using the COSMOS catalog). If you would rather explicitly specify the collecting area of the telescope when usingdrawImage
with aChromaticRealGalaxy
, then you should set area_norm equal to the collecting area of the source catalog telescope when creating theChromaticRealGalaxy
(e.g., area_norm=45238.93416 for HST). [default: 1]gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
logger – A logger object for output of progress statements if the user wants them. [default: None]
-
classmethod
makeFromImages
(images, bands, PSFs, xis, **kwargs)[source]¶ Create a ChromaticRealGalaxy directly from images, bandpasses, PSFs, and noise descriptions. See the ChromaticRealGalaxy docstring for more information.
- Parameters
images – An iterable of high resolution
Images
of a galaxy through different bandpasses.bands – An iterable of
Bandpass
objects corresponding to the input images.PSFs – Either an iterable of
GSObject
orChromaticObject
indicating the PSFs of the different input images, or potentially a singleGSObject
orChromaticObject
that will be used as the PSF for all images.xis – An iterable of either
CorrelatedNoise
orUncorrelatedNoise
objects characterizing the noise in the input images.SEDs – An optional list of
SED
to use when representing real galaxies as sums of separable profiles. By default, len(images) SEDs that are polynomials in wavelength will be used. Note that the number of SEDs must be equal to or smaller than the number of catalogs. [default: see above]k_interpolant – Either an Interpolant instance or a string indicating which k-space interpolant should be used. Options are ‘nearest’, ‘sinc’, ‘linear’, ‘cubic’, ‘quintic’, or ‘lanczosN’ where N should be the integer order to use. We strongly recommend leaving this parameter at its default value; see text above for details. [default: galsim.Quintic()]
maxk – Optional maxk argument. If you know you will be convolving the resulting
ChromaticRealGalaxy
with a “fat” PSF in a subsequent step, then it can be more efficient to limit the range of Fourier modes used when solving for the sum of separable profiles below. [default: None]pad_factor – Factor by which to internally oversample the Fourier-space images that represent the ChromaticRealGalaxy (equivalent to zero-padding the real-space profiles). We strongly recommend leaving this parameter at its default value; see text in Realgalaxy docstring for details. [default: 4]
noise_pad_size – If provided, the image will be padded out to this size (in arcsec) with the noise specified in the real galaxy catalog. This is important if you are planning to whiten the resulting image. You should make sure that the padded image is larger than the postage stamp onto which you are drawing this object. [default: None]
area_norm – Area in cm^2 by which to normalize the flux of the returned object. When area_norm=1 (the default), drawing with
drawImage
keywords exptime=1 and area=1 will simulate an image with the appropriate number of counts for a 1 second exposure with the original telescope/camera (e.g., with HST when using the COSMOS catalog). If you would rather explicitly specify the collecting area of the telescope when usingdrawImage
with aChromaticRealGalaxy
, then you should set area_norm equal to the collecting area of the source catalog telescope when creating theChromaticRealGalaxy
(e.g., area_norm=45238.93416 for HST). [default: 1]gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
logger – A logger object for output of progress statements if the user wants them. [default: None]
-
class
galsim.
InterpolatedChromaticObject
(original, waves, oversample_fac=1.0, use_exact_SED=True)[source]¶ A ChromaticObject that uses interpolation of predrawn images to speed up subsequent rendering.
This class wraps another ChromaticObject, which is stored in the attribute
deinterpolated
. Any ChromaticObject can be used, although the interpolation procedure is most effective for non-separable objects, which can sometimes be very slow to render.Normally, you would not create an InterpolatedChromaticObject directly. It is the return type from
chrom_obj.interpolate()
. See the description of that function for more details.- Parameters
original – The ChromaticObject to be interpolated.
waves – The list, tuple, or NumPy array of wavelengths to be used when building up the grid of images for interpolation. The wavelengths should be given in nanometers, and they should span the full range of wavelengths covered by any bandpass to be used for drawing Images (i.e., this class will not extrapolate beyond the given range of wavelengths). They can be spaced any way the user likes, not necessarily linearly, though interpolation will be linear in wavelength between the specified wavelengths.
oversample_fac – Factor by which to oversample the stored profiles compared to the default, which is to sample them at the Nyquist frequency for whichever wavelength has the highest Nyquist frequency.
oversample_fac
>1 results in higher accuracy but costlier pre-computations (more memory and time). [default: 1]use_exact_SED – If true, then rescale the interpolated image for a given wavelength by the ratio of the exact SED at that wavelength to the linearly interpolated SED at that wavelength. Thus, the flux of the interpolated object should be correct, at the possible expense of other features. [default: True]
-
drawImage
(bandpass, image=None, integrator='trapezoidal', **kwargs)[source]¶ Draw an image as seen through a particular bandpass using the stored interpolated images at the specified wavelengths.
This integration will take place using interpolation between stored images that were setup when the object was constructed. (See interpolate() for more details.)
- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – Optionally, the Image to draw onto. (See GSObject.drawImage() for details.) [default: None]
integrator – The integration algorithm to use, given as a string. Either ‘midpoint’ or ‘trapezoidal’ is allowed. [default: ‘trapezoidal’]
**kwargs – For all other kwarg options, see GSObject.drawImage()
- Returns
the drawn Image.
-
class
galsim.
ChromaticSum
(*args, **kwargs)[source]¶ Add ChromaticObjects and/or GSObjects together. If a GSObject is part of a sum, then its SED is assumed to be flat with spectral density of 1 photon/s/cm**2/nm.
This is the type returned from
galsim.Add(objects)
if any of the objects are a ChromaticObject.Typically, you do not need to construct a ChromaticSum object explicitly. Normally, you would just use the + operator, which returns a ChromaticSum when used with chromatic objects:
>>> bulge = galsim.Sersic(n=3, half_light_radius=0.8) * bulge_sed >>> disk = galsim.Exponential(half_light_radius=1.4) * disk_sed >>> gal = bulge + disk
You can also use the Add() factory function, which returns a ChromaticSum object if any of the individual objects are chromatic:
>>> gal = galsim.Add([bulge,disk])
- Parameters
args – Unnamed args should be a list of objects to add.
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
drawImage
(bandpass, image=None, integrator='trapezoidal', **kwargs)[source]¶ Slightly optimized draw method for ChromaticSum instances.
Draws each summand individually and add resulting images together. This might waste time if two or more summands are separable and have the same SED, and another summand with a different SED is also added, in which case the summands should be added together first and the resulting Sum object can then be chromaticized. In general, however, drawing individual sums independently can help with speed by identifying chromatic profiles that are separable into spectral and spatial factors.
- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – Optionally, the Image to draw onto. (See GSObject.drawImage() for details.) [default: None]
integrator – When doing the exact evaluation of the profile, this argument should be one of the image integrators from galsim.integ, or a string ‘trapezoidal’ or ‘midpoint’, in which case the routine will use a SampleIntegrator or ContinuousIntegrator depending on whether or not the object has a
wave_list
. [default: ‘trapezoidal’, which will try to select an appropriate integrator using the trapezoidal integration rule automatically.]**kwargs – For all other kwarg options, see GSObject.drawImage()
- Returns
the drawn Image.
-
evaluateAtWavelength
(wave)[source]¶ Evaluate this chromatic object at a particular wavelength
wave
.- Parameters
wave – Wavelength in nanometers.
- Returns
the monochromatic object at the given wavelength.
-
class
galsim.
ChromaticConvolution
(*args, **kwargs)[source]¶ Convolve ChromaticObjects and/or GSObjects together. GSObjects are treated as having flat spectra (in photons/sec/cm**2/nm).
This is the type returned from
galsim.Convolve(objects)
if any of the objects is a ChromaticObject.The normal way to use this class is to use the Convolve() factory function:
>>> gal = galsim.Sersic(n, half_light_radius) * galsim.SED(sed_file, 'nm', 'flambda') >>> psf = galsim.ChromaticAtmosphere(...) >>> final = galsim.Convolve([gal, psf])
The objects to be convolved may be provided either as multiple unnamed arguments (e.g.
Convolve(psf, gal, pix)
) or as a list (e.g.Convolve([psf, gal, pix])
). Any number of objects may be provided using either syntax. (Well, the list has to include at least 1 item.)- Parameters
args – Unnamed args should be a list of objects to convolve.
real_space – Whether to use real space convolution. [default: None, which means to automatically decide this according to whether the objects have hard edges.]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
drawImage
(bandpass, image=None, integrator='trapezoidal', iimult=None, **kwargs)[source]¶ Optimized draw method for the ChromaticConvolution class.
Works by finding sums of profiles which include separable portions, which can then be integrated before doing any convolutions, which are pushed to the end.
This method uses a cache to avoid recomputing ‘effective’ profiles, which are the wavelength-integrated products of inseparable profiles, the spectral components of separable profiles, and the bandpass. Because the cache size is finite, users may find that it is more efficient when drawing many images to group images using the same SEDs, bandpasses, and inseparable profiles (generally PSFs) together in order to hit the cache more often. The default cache size is 10, but may be resized using the
ChromaticConvolution.resize_effective_prof_cache
method.- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – Optionally, the Image to draw onto. (See GSObject.drawImage() for details.) [default: None]
integrator – When doing the exact evaluation of the profile, this argument should be one of the image integrators from galsim.integ, or a string ‘trapezoidal’ or ‘midpoint’, in which case the routine will use a SampleIntegrator or ContinuousIntegrator depending on whether or not the object has a
wave_list
. [default: ‘trapezoidal’, which will try to select an appropriate integrator using the trapezoidal integration rule automatically.]iimult – Oversample any intermediate InterpolatedImages created to hold effective profiles by this amount. [default: None]
**kwargs – For all other kwarg options, see GSObject.drawImage()
- Returns
the drawn Image.
-
evaluateAtWavelength
(wave)[source]¶ Evaluate this chromatic object at a particular wavelength
wave
.- Parameters
wave – Wavelength in nanometers.
- Returns
the monochromatic object at the given wavelength.
-
static
resize_effective_prof_cache
(maxsize)[source]¶ Resize the cache containing effective profiles, (i.e., wavelength-integrated products of separable profile SEDs, inseparable profiles, and Bandpasses), which are used by ChromaticConvolution.drawImage().
- Parameters
maxsize – The new number of effective profiles to cache.
-
class
galsim.
ChromaticDeconvolution
(obj, gsparams=None, propagate_gsparams=True)[source]¶ A class for deconvolving a ChromaticObject.
The ChromaticDeconvolution class represents a wavelength-dependent deconvolution kernel.
You may also specify a gsparams argument. See the docstring for GSParams using help(galsim.GSParams) for more information about this option. Note: if
gsparams
is unspecified (or None), then the ChromaticDeconvolution instance inherits the same GSParams as the object being deconvolved.- Parameters
obj – The object to deconvolve.
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
class
galsim.
ChromaticAutoConvolution
(obj, real_space=None, gsparams=None, propagate_gsparams=True)[source]¶ A special class for convolving a ChromaticObject with itself.
It is equivalent in functionality to
galsim.Convolve([obj,obj])
, but takes advantage of the fact that the two profiles are the same for some efficiency gains.- Parameters
obj – The object to be convolved with itself.
real_space – Whether to use real space convolution. [default: None, which means to automatically decide this according to whether the objects have hard edges.]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
class
galsim.
ChromaticAutoCorrelation
(obj, real_space=None, gsparams=None, propagate_gsparams=True)[source]¶ A special class for correlating a ChromaticObject with itself.
It is equivalent in functionality to:
galsim.Convolve([obj,obj.rotate(180.*galsim.degrees)])
but takes advantage of the fact that the two profiles are the same for some efficiency gains.
- Parameters
obj – The object to be convolved with itself.
real_space – Whether to use real space convolution. [default: None, which means to automatically decide this according to whether the objects have hard edges.]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
class
galsim.
ChromaticTransformation
(obj, jac=array([[1., 0.], [0., 1.]]), offset=(0.0, 0.0), flux_ratio=1.0, gsparams=None, propagate_gsparams=True)[source]¶ A class for modeling a wavelength-dependent affine transformation of a ChromaticObject instance.
Typically, you do not need to construct a ChromaticTransformation object explicitly. This is the type returned by the various transformation methods of ChromaticObject such as shear(), rotate(), shift(), transform(), etc. All the various transformations can be described as a combination of transform() and shift(), which are described by (dudx,dudy,dvdx,dvdy) and (dx,dy) respectively.
- Parameters
obj – The object to be transformed.
jac – A list or tuple ( dudx, dudy, dvdx, dvdy ), or a numpy.array object [[dudx, dudy], [dvdx, dvdy]] describing the Jacobian to apply. May also be a function of wavelength returning a numpy array. [default: (1,0,0,1)]
offset – A galsim.PositionD or list or tuple or numpy array giving the offset by which to shift the profile. May also be a function of wavelength returning a numpy array. [default: (0,0)]
flux_ratio – A factor by which to multiply the flux of the object. [default: 1]
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]
-
drawImage
(bandpass, image=None, integrator='trapezoidal', **kwargs)[source]¶ See ChromaticObject.drawImage for a full description.
This version usually just calls that one, but if the transformed object (self.original) is an InterpolatedChromaticObject, and the transformation is achromatic, then it will still be able to use the interpolation.
- Parameters
bandpass – A Bandpass object representing the filter against which to integrate.
image – Optionally, the Image to draw onto. (See GSObject.drawImage() for details.) [default: None]
integrator – When doing the exact evaluation of the profile, this argument should be one of the image integrators from galsim.integ, or a string ‘trapezoidal’ or ‘midpoint’, in which case the routine will use a SampleIntegrator or ContinuousIntegrator depending on whether or not the object has a
wave_list
. [default: ‘trapezoidal’, which will try to select an appropriate integrator using the trapezoidal integration rule automatically.] If the object being transformed is an InterpolatedChromaticObject, thenintegrator
can only be a string, either ‘midpoint’ or ‘trapezoidal’.**kwargs – For all other kwarg options, see GSObject.drawImage()
- Returns
the drawn Image.
-
class
galsim.
ChromaticFourierSqrtProfile
(obj, gsparams=None, propagate_gsparams=True)[source]¶ A class for computing the Fourier-space square root of a ChromaticObject.
The ChromaticFourierSqrtProfile class represents a wavelength-dependent Fourier-space square root of a profile.
You may also specify a gsparams argument. See the docstring for GSParams using help(galsim.GSParams) for more information about this option. Note: if
gsparams
is unspecified (or None), then the ChromaticFourierSqrtProfile instance inherits the same GSParams as the object being operated on.The normal way to use this class is to use the FourierSqrt() factory function:
>>> fourier_sqrt = galsim.FourierSqrt(chromatic_obj)
If
chromatic_obj
is indeed a ChromaticObject, then that function will create a ChromaticFourierSqrtProfile object.- Parameters
obj – The object to compute the Fourier-space square root of.
gsparams – An optional GSParams argument. See the docstring for GSParams for details. [default: None]
propagate_gsparams – Whether to propagate gsparams to each of the components. This is normally a good idea, but there may be use cases where one would not want to do this. [default: True]


i
Reporter
Speak up. Ask for help.
Log out
Red-Flags Status
Draft
Under Investigation
Resolved
Rejected
Interventions Status
Draft
Under Investigation
Resolved
Rejected
Record ID
Username
Record Type
Report
Status
Update


Source code for src.encryption_ops.decryption
# -*- coding: utf-8 -*-
"""
@author: Jatin Goel
"""
from Cryptodome.PublicKey import RSA
from Cryptodome.Cipher import (
AES,
PKCS1_OAEP
)
from constants import PRIVATE_KEY_PATH
from encrypt import Encrypt
[docs]class Decryption(Encrypt):
"""Class for decryption operations using the given encrypted session key and nonce."""
def __init__(self, enc_session_key, nonce):
"""Creates an object of AES cipher using the RSA Private key and the
given encrypted session key and nonce.
"""
self._decryption_cipher = None
self.enc_session_key = enc_session_key
self.nonce = nonce
self._generate_cipher()
def _generate_cipher(self):
"""Creates an object of AES cipher using the RSA Private key and the
given encrypted session key and nonce.
"""
self._decryption_cipher = AES.new(
PKCS1_OAEP.new(
RSA.import_key(open(PRIVATE_KEY_PATH).read())
).decrypt(self.enc_session_key),
AES.MODE_EAX,
self.nonce
)
@property
def decryption_cipher(self):
"""Returns instance of the decryption cipher."""
if self._decryption_cipher:
return self._decryption_cipher
raise Exception('Decryption cipher is not initialized')
[docs] def decrypt(self, message):
"""Decrypts the given message."""
try:
if not isinstance(message, tuple) and len(message) != 2:
raise Exception(
'Message should be a tuple with the length 2, as returned by encrypt'
)
return self.decryption_cipher.decrypt_and_verify(*message)
except ValueError:
raise Exception('Invalid Ciphertext. Please check the text again!')
[docs] def destroy(self):
super().destroy()
self._decryption_cipher = None


Codey Sivley Course Schedule
Spring Semester 2022
These are my classes. I wish I had more time to enjoy them but instead I must contribute to capitalism, and thus I am forced to rush through them.
- Fall 2021
- CS 414 - Programming Languages
- This class was an interesting foray into different types of programming languages.
Our education tends to lean towards object oriented code, so functional programming was challenging to implement.
There were several students who complained heartily about using Scheme and Lisp. Cry me a river. Backus-Naur Form says hello.
- CS 417 - Object Oriented Programming
- This course was a good "bread and butter" computing course. Could easily be called "CS 417 - Design Patterns." Much was learned about iterators.
- MA 310 - Linear Algebra & Matrices
- Very interesting but a heavy workload. Eigenvalues are cool but challenging. Unfortunately had to drop just before finals.
- MA 227 - Calculus III
- Everything that wouldn't fit into Calc II. Intro to multivariable calculus & vector calculus.
- Spring 2022
- CS 472 - Algorithms
- Discrete mathematics and depression.
- CS 415 - Operating Systems
- Make your own BASH, and learn what happens when you hit the big orange power button.
- CS 380 - Programming for the Web
- Starting off nice and easy with HTML. Beyond here there be dragons.
- Summer 2022
- CS Embedded Systems
- Interfacing with ARM microcontrollers and things without screens.
- MA 310 - Linear Algebra & Matrices
- Will try this again, with less despair.
- That Class You Need Before Capstone
- Fall is going to be a tough semester.


# # ###### # #### #### # # ###### # # # # # # # # ## ## # # # ##### # # # # # ## # ##### # ## # # # # # # # # # ## ## # # # # # # # # # # # ###### ###### #### #### # # ######
paragraph #1.
paragraph #2.
a line break
Text Formatting Elements:
This is regular text
small text
big text
italic text
Emphasis text
bold text
strong text
subscripted text
superscripted text
inserted text
deleted text
Definition: the formal statement of the meaning or significance of a word
Definition (stand with mouse on word)
Enter something here
שלום
Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications.
Hypertext Markup Language (HTML)
is the standard markup language for creating web pages and web applications.
function funcPrint()
{
var FName = funcInFunc("kim");
var fullName = FName("jam");
var test;
console.log(fullName);
}


| 1 |
Calvo_2012 |
Severe acute respiratory syndrome coronavirus accessory proteins 6 and 9b interact in vivo |
Calvo, Enrique; DeDiego, Marta L.; García, Pilar; López, Juan A.; Pérez-Breña, Pilar; Falcón, Ana |
2012 |
2012-10-31 |
PMC |
N |
PMC7114373 |
22820404.0 |
10.1016/j.virusres.2012.07.012 |
bomn9bvt |
0.842330 |
|
|
| 2 |
Keng_2006 |
The human severe acute respiratory syndrome coronavirus (SARS-CoV) 8b protein is distinct from its counterpart in animal SARS-CoV and down-regulates the expression of the envelope protein in infected cells |
Keng, Choong-Tat; Choi, Yook-Wah; Welkers, Matthijs R.A.; Chan, Daphne Z.L.; Shen, Shuo; Gee Lim, Seng; Hong, Wanjin; Tan, Yee-Joo |
2006 |
2006-10-10 |
PMC |
N |
PMC7111915 |
16876844.0 |
10.1016/j.virol.2006.06.026 |
9fe2rq9s |
0.814969 |
|
|
| 3 |
He_R_2003 |
Activation of AP-1 signal transduction pathway by SARS coronavirus nucleocapsid protein |
He, Runtao; Leeson, Andrew; Andonov, Anton; Li, Yan; Bastien, Nathalie; Cao, Jingxin; Osiowy, Carla; Dobie, Frederick; Cutts, Todd; Ballantine, Melissa; Li, Xuguang |
2003 |
2003-11-28 |
PMC |
Y |
PMC7111052 |
14623261.0 |
10.1016/j.bbrc.2003.10.075 |
ymi398ef |
0.776501 |
|
Liao_2005 |
| 4 |
Law_P_2006 |
Expression and functional characterization of the putative protein 8b of the severe acute respiratory syndrome-associated coronavirus |
Law, Pui Ying Peggy; Liu, Yuet-Man; Geng, Hua; Kwan, Ka Ho; Waye, Mary Miu-Yee; Ho, Yuan-Yuan |
2006 |
2006-06-26 |
PMC |
N |
PMC7094570 |
16753150.0 |
10.1016/j.febslet.2006.05.051 |
anbetkt3 |
0.773561 |
|
|
| 5 |
Liao_2005 |
Activation of NF-κB by the Full-length Nucleocapsid Protein of the SARS Coronavirus |
Liao, Qing-Jiao; Ye, Lin-Bai; Timani, Khalid Amine; Zeng, Ying-Chun; She, Ying-Long; Ye, Li; Wu, Zheng-Hui |
2005 |
2005-09-23 |
PMC |
N |
PMC7109668 |
16143815.0 |
10.1111/j.1745-7270.2005.00082.x |
k59re8qv |
0.664677 |
|
He_R_2003 |
| 6 |
Tan_Y_2006 |
Understanding the accessory viral proteins unique to the severe acute respiratory syndrome (SARS) coronavirus |
Tan, Yee-Joo; Lim, Seng Gee; Hong, Wanjin |
2006 |
2006-11-30 |
PMC |
Y |
PMC7114237 |
16820226.0 |
10.1016/j.antiviral.2006.05.010 |
45rhlb8k |
0.620495 |
|
McBride_2012 |
| 7 |
Tan_Y_2005 |
Characterization of viral proteins encoded by the SARS-coronavirus genome |
Tan, Yee-Joo; Lim, Seng Gee; Hong, Wanjin |
2005 |
2005-02-28 |
PMC |
Y |
PMC7114173 |
15708633.0 |
10.1016/j.antiviral.2004.10.001 |
vranj125 |
0.556968 |
|
|
| 8 |
McBride_2012 |
The Role of Severe Acute Respiratory Syndrome (SARS)-Coronavirus Accessory Proteins in Virus Pathogenesis |
McBride, Ruth; Fielding, Burtram C. |
2012 |
2012-11-07 |
COMM-USE |
Y |
PMC3509677 |
23202509.0 |
10.3390/v4112902 |
de2o91t3 |
0.555933 |
|
Tan_Y_2006 |
| 9 |
Liu_S_2003 |
Bioinformatical study on the proteomics and evolution of SARS-CoV |
Liu, Shuqun; Guo, Tao; Ji, Xinglai; Sun, Zhirong |
2003 |
2003-01-01 |
PMC |
Y |
PMC7089238 |
|
10.1007/bf03184163 |
brnza997 |
0.509578 |
|
|
| 10 |
Surjit_2004 |
The SARS coronavirus nucleocapsid protein induces actin reorganization and apoptosis in COS-1 cells in the absence of growth factors |
Surjit, Milan; Liu, Boping; Jameel, Shahid; Chow, Vincent T. K.; Lal, Sunil K. |
2004 |
2004-09-24 |
PMC |
Y |
PMC1134038 |
15294014.0 |
10.1042/bj20040984 |
k0c7drau |
0.466623 |
|
He_R_2003, Liao_2005 |
| 11 |
Qiu_M_2005 |
Antibody responses to individual proteins of SARS coronavirus and their neutralization activities |
Qiu, Maofeng; Shi, Yuling; Guo, Zhaobiao; Chen, Zeliang; He, Rongqiao; Chen, Runsheng; Zhou, Dongsheng; Dai, Erhei; Wang, Xiaoyi; Si, Bingyin; Song, Yajun; Li, Jingxiang; Yang, Ling; Wang, Jin; Wang, Hongxia; Pang, Xin; Zhai, Junhui; Du, Zongmin; Liu, Ying; Zhang, Yong; Li, Linhai; Wang, Jian; Sun, Bing; Yang, Ruifu |
2005 |
2005-05-31 |
PMC |
Y |
PMC7110836 |
15878679.0 |
10.1016/j.micinf.2005.02.006 |
nc82a70n |
0.463815 |
|
|
| 12 |
Gan_Y_2006 |
Synthesis and activity of an octapeptide inhibitor designed for SARS coronavirus main proteinase |
Gan, Yi-Ru; Huang, He; Huang, Yong-Dong; Rao, Chun-Ming; Zhao, Yang; Liu, Jin-Sheng; Wu, Lei; Wei, Dong-Qing |
2006 |
2006-04-30 |
PMC |
N |
PMC7115688 |
16242214.0 |
10.1016/j.peptides.2005.09.006 |
hp6m6qrn |
0.435521 |
|
|
| 13 |
Chan_2005 |
Coronaviral hypothetical and structural proteins were found in the intestinal surface enterocytes and pneumocytes of severe acute respiratory syndrome (SARS) |
Chan, Wai S; Wu, Chun; Chow, Sammy C S; Cheung, To; To, Ka-Fai; Leung, Wai-Keung; Chan, Paul K S; Lee, Kam-Cheong; Ng, Ho-Keung; Au, Deborah M Y; Lo, Anthony W I |
2005 |
2005-05-13 |
PMC |
Y |
PMC7100671 |
15920543.0 |
10.1038/modpathol.3800439 |
rmlrhyf2 |
0.415769 |
|
|
| 14 |
Siu_K_2014 |
Comparative analysis of the activation of unfolded protein response by spike proteins of severe acute respiratory syndrome coronavirus and human coronavirus HKU1 |
Siu, Kam-Leung; Chan, Ching-Ping; Kok, Kin-Hang; Woo, Patrick C-Y; Jin, Dong-Yan |
2014 |
2014-01-13 |
COMM-USE |
N |
PMC3930072 |
24410900.0 |
10.1186/2045-3701-4-3 |
dmqfij6j |
0.317590 |
|
|


{% load staticfiles %}
{{message}}
No resources on this site are shared with you. Ask the site owner to grant you access, or try a different email: