diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 31bf0d474a..33e7b84063 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,7 +13,7 @@ API Changes if the angle arrays have not been either set or explicitly allocated. One should be sure to either set them (e.g. using ``photon_array.dxdz = [...]``) or explicitly allocate them (using ``photon_array.allocateAngles()``). (#1191) -- Changed the ``.SED`` attribute name of `ChromaticObject`s to lowercase ``.sed``. (#1245) +- Changed the ``.SED`` attribute name of `ChromaticObject` to lowercase ``.sed``. (#1245) Config Updates @@ -35,14 +35,14 @@ New Features - Updated Roman telescope data to Phase C (aka Cycle 9) specifications (#1017) - Added `ShapeData.applyWCS` method to convert HSM shapes to sky coordinates. Also added - the option ``use_sky_coords=True`` to `FindAdaptiveMom` to apply this automatically. (#1219) + the option ``use_sky_coords=True`` to `hsm.FindAdaptiveMom` to apply this automatically. (#1219) - Added `DoubleZernike` class and related functionality. (#1221) - Added some utility functions that we have found useful in our test suite, and which other people might want to use to the installed galsim.utilities. (#1240) -- Added `galsim.utilities.merge_sorted` which merges two or more sorted numpy arrays faster than +- Added `utilities.merge_sorted` which merges two or more sorted numpy arrays faster than the available numpy options. (#1243) -- Added `galsim.EmissionLine` class to represent emission line SEDs. (#1247, #1249) -- Updated data in galsim.roman module to Phase C (Cycle 9) information. (#1017, #1251) +- Added `EmissionLine` class to represent emission line SEDs. (#1247, #1249) +- Updated data in `roman` module to Phase C (Cycle 9) information. (#1017, #1251) Performance Improvements @@ -55,12 +55,12 @@ Performance Improvements Now it only adds it if there is not already one given by the user. (#1229, #1236) - Work around an OMP bug that disables multiprocessing on some systems when omp_get_max_threads is called. (#1241) -- Sped up the `combine_wave_lists` function, using the new `merge_sorted` function. (#1243) -- No longer keep a separate ``wave_list`` array in `ChromaticObject`s. These are always +- Sped up the `combine_wave_list` function, using the new `merge_sorted` function. (#1243) +- No longer keep a separate ``wave_list`` array in `ChromaticObject`. These are always equal to the ``wave_list`` in the ``sed`` attribute, so there is no need to duplicate the work of computing the ``wave_list``. (#1245) -- Delayed the calculation of the `sed` attributes of `ChromaticObject`s until they are actually - needed. Since sometimes they aren't needed, this is a performance improvement in those cases. +- Delayed the calculation of the ``sed`` attributes of `ChromaticObject` until they are actually + needed. Since sometimes they are not needed, this is a performance improvement in those cases. (#1245) - Reduce long-term memory usage of Silicon class after drawing onto a very large stamp and then moving on to smaller stamps. (#1246) diff --git a/docs/config_input.rst b/docs/config_input.rst index fe2ebe4d1e..63e105caba 100644 --- a/docs/config_input.rst +++ b/docs/config_input.rst @@ -114,6 +114,12 @@ The ``input`` fields defined by GalSim are: * ``index`` = *str_value* (optional) If set, the power spectrum will only be computed when this index changed. E.g. if ``index`` is 'file_num', then it will only update with each new file, not with each image. * ``variance`` = *float_value* (optional) If set, rescale the overall variance of the generated shears to this value. +* ``initial_image`` specifies an initial image (read from an FITS file) to draw onto, rather than create a new blank image. + + * ``file_name`` = *str_value* (required) The name fo the file with the desired initial image. + * ``dir`` = *str_value* (default = '.') The directory the file is in. + * ``read_header`` = *bool_value* (default = False) Whether to read the header as well. + Another feature of the ``input`` field is that it may optionally be a list. So you can have multiple input catalogs for instance; one for object parameters and one for overall image parameters perhaps. When using values with the type 'InputCatalog', you would specify which catalog to use with ``num``. If you only have a single item for one of the inputs, you can omit the ``num`` parameter when you are using it. Custom Input Types diff --git a/docs/config_objects.rst b/docs/config_objects.rst index 0f8a16218b..d80049b448 100644 --- a/docs/config_objects.rst +++ b/docs/config_objects.rst @@ -237,6 +237,9 @@ Generic Types * ``items`` = *list* (required) A list of profiles. * ``index`` = *int_value* (default = 'Sequence' from 0 to len(items)-1) Which item in the list to select each time. +* 'Eval' Use Python's ``eval`` function to evaluate a given string as a GSObject. + + * ``str`` = *str_value* (required) The string to evaluate. Other Attributes ---------------- diff --git a/docs/sed.rst b/docs/sed.rst index 8a1e914cef..0df775a851 100644 --- a/docs/sed.rst +++ b/docs/sed.rst @@ -9,3 +9,6 @@ Spectral Energy Distributions .. automethod:: galsim.SED._mul_sed .. automethod:: galsim.SED._mul_bandpass .. automethod:: galsim.SED._mul_scalar + +.. autoclass:: galsim.EmissionLine + :members: diff --git a/docs/zernike.rst b/docs/zernike.rst index 3fc1105083..80eab7368e 100644 --- a/docs/zernike.rst +++ b/docs/zernike.rst @@ -11,7 +11,11 @@ Zernike Functions .. automethod:: galsim.zernike.Zernike.__rmul__ .. automethod:: galsim.zernike.Zernike.__call__ +.. autoclass:: galsim.zernike.DoubleZernike + .. autofunction:: galsim.zernike.noll_to_zern .. autofunction:: galsim.zernike.zernikeRotMatrix .. autofunction:: galsim.zernike.zernikeBasis +.. autofunction:: galsim.zernike.zernikeGradBases +.. autofunction:: galsim.zernike.doubleZernikeBasis .. autofunction:: galsim.zernike.describe_zernike diff --git a/galsim/chromatic.py b/galsim/chromatic.py index 0db2abbe0d..42e46ec828 100644 --- a/galsim/chromatic.py +++ b/galsim/chromatic.py @@ -89,7 +89,7 @@ class ChromaticObject: >>> gal = bulge + disk The ``sed`` instances above describe the flux density in photons/nm/cm^2/s of an object, possibly - normalized with either the `sed.withFlux` or `sed.withMagnitude` methods (see their docstrings + normalized with either the `SED.withFlux` or `SED.withMagnitude` methods (see their docstrings 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 diff --git a/galsim/hsm.py b/galsim/hsm.py index 6855445341..f007557d9f 100644 --- a/galsim/hsm.py +++ b/galsim/hsm.py @@ -233,9 +233,9 @@ def applyWCS(self, wcs, image_pos): The values that are different from the original are: - moments_sigma is changed to be in units of arcsec. - observed_shape is changed to be in (u,v) coordinates. - moments_centroid is changed to be in (u,v) coordinates relative to image_pos. + * ``moments_sigma`` is changed to be in units of arcsec. + * ``observed_shape`` is changed to be in (u,v) coordinates. + * ``moments_centroid`` is changed to be in (u,v) coordinates relative to image_pos. .. note:: @@ -704,7 +704,7 @@ def FindAdaptiveMom(object_image, weight=None, badpix=None, guess_sig=5.0, preci for the coordinate variables. These coordinates are measured in arcsec and are oriented such that +v is towards North and +u is towards West. In this case, the returned values are all in arcsec, and are based instead on Iuu, Ivv, and Iuv. To enable this feature, use - ``use_sky_coords=True`. See also the method `ShapeData.applyWCS` for more details. + ``use_sky_coords=True``. See also the method `ShapeData.applyWCS` for more details. .. note:: diff --git a/galsim/utilities.py b/galsim/utilities.py index 4e93c2c7ed..7a690d450b 100644 --- a/galsim/utilities.py +++ b/galsim/utilities.py @@ -1702,7 +1702,7 @@ class CaptureLog: """A context manager that saves logging output into a string that is accessible for checking in unit tests. - After exiting the context, the attribute `output` will have the logging output. + After exiting the context, the attribute ``output`` will have the logging output. Sample usage: diff --git a/galsim/zernike.py b/galsim/zernike.py index f18bcd3b48..0dbd5585f8 100644 --- a/galsim/zernike.py +++ b/galsim/zernike.py @@ -961,19 +961,19 @@ class DoubleZernike: separate annuli: .. math:: - DZ_{k, j}(u, v, x, y) = Z_k(u, v) Z_j(x, y) + DZ_{k,j}(u, v, x, y) = Z_k(u, v) Z_j(x, y) The double Zernike's therefore satisfy the orthonormality condition: .. math:: - \int_{annuli} DZ_(k, j) DZ_(k', j') = A1 A2 \delta_{k, k'} \delta_{j, j'} + \int_{annuli} DZ_{k,j} DZ_{k',j'} = A_1 A_2 \delta_{k, k'} \delta_{j, j'} - where A1 and A2 are the areas of the two annuli. + where :math:`A_1` and :math:`A_2` are the areas of the two annuli. Double Zernikes series are useful for representing the field and pupil dependent wavefronts of a telescope. We adopt the typical convention that - the first index (the `k` index) corresponds to the field-dependence, while - the second index (the `j` index) corresponds to the pupil-dependence. + the first index (the ``k`` index) corresponds to the field-dependence, while + the second index (the ``j`` index) corresponds to the pupil-dependence. Parameters: coef: [kmax, jmax] array of double Zernike coefficients. Like the @@ -1131,8 +1131,8 @@ def coef(self): """DoubleZernike coefficients. The coefficients are stored in a 2D array, where the first index - corresponds to the `uv` dependence and the second index corresponds to - the `xy` dependence. The indices are Noll indices. As an example, when + corresponds to the ``uv`` dependence and the second index corresponds to + the ``xy`` dependence. The indices are Noll indices. As an example, when describing a telescope wavefront the (1, 4) tuple corresponds to a constant (over the field) pupil defocus. The (2, 5) term is a linear (over the field) astigmatism, etc.