diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..0bf7cfc --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,3 @@ +Changes from v0.0.0 to v0.0.1 +========================= +Made repo public. \ No newline at end of file diff --git a/config/README.md b/config/README.md deleted file mode 100644 index bc79c08..0000000 --- a/config/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Config imsim - -`was.yaml`: _euclidlike_imsim exemple_ config file. -You will want to update the following entries: - -- `input.obseq_data.file_name`: path to the observing sequence. Link to `euclidlike/data/euclid_obseq.fits` -- `input.sky_catalog.file_name`: path to the skyCatalog to use -- `output.dir`: path to the output directory for the simulated images -- `output.truth.dir`: path to the ouput directory for the true catalogs - -To run the code: -```bash -galsim was.yaml -``` - -You might want to specify some config entries in the command line, likes: -```bash -galsim was.yaml input.obseq_data.visit=33690 image.CCD=1 -``` - -## Config SLURM - -`slurm_runner.sh` contain the SLURM configuration to run "large scale" simulations. -You will want to update the following line: -- `#!/bin/zsh`: depending on the shell you are using you might want to change it to: `#!/bin/bash` -- `#SBATCH --output=/path/to/slurm-%A-%a.out`: slurm stdout file -- `#SBATCH --error=/path/to/slurm-%A-%a.err`: slurm stderr file -- `source activate [env_name]`: conda environment to use -- `file_list='/path/to/run_list.txt'`: file containing the pointings to simulate (see note below) - -the `run_list.txt` is a 2 columns file with the pointing and the CCD_ID to simulate. It should lookq like: -``` -33688 0 -33688 1 -33688 2 -[...] -33688 35 -33689 0 -33689 1 -[...] -``` diff --git a/config/README.rst b/config/README.rst new file mode 100644 index 0000000..fb823c3 --- /dev/null +++ b/config/README.rst @@ -0,0 +1,49 @@ +Config imsim +============ + +``was.yaml``: *euclidlike_imsim example* config file. +You will want to update the following entries: + +- ``input.obseq_data.file_name``: path to the observing sequence. Link to ``euclidlike/data/euclid_obseq.fits`` +- ``input.sky_catalog.file_name``: path to the skyCatalog to use +- ``output.dir``: path to the output directory for the simulated images +- ``output.truth.dir``: path to the output directory for the true catalogs + +To run the code: + +.. code-block:: bash + + galsim was.yaml + +You might want to specify some config entries on the command line, like: + +.. code-block:: bash + + galsim was.yaml input.obseq_data.visit=33690 image.CCD=1 + + +Config SLURM +============ + +``slurm_runner.sh`` contains the SLURM configuration to run "large scale" simulations. +You will want to update the following lines: + +- ``#!/bin/zsh``: depending on the shell you are using, you might want to change it to: ``#!/bin/bash`` +- ``#SBATCH --output=/path/to/slurm-%A-%a.out``: SLURM stdout file +- ``#SBATCH --error=/path/to/slurm-%A-%a.err``: SLURM stderr file +- ``source activate [env_name]``: conda environment to use +- ``file_list='/path/to/run_list.txt'``: file containing the pointings to simulate (see note below) + +The ``run_list.txt`` is a 2-column file with the pointing and the ``CCD_ID`` to simulate. It should look like: + +.. code-block:: text + + 33688 0 + 33688 1 + 33688 2 + [...] + 33688 35 + 33689 0 + 33689 1 + [...] + diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 2d9ec1c..d38556f 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/euclidlike.doctree b/docs/_build/doctrees/euclidlike.doctree index 3147a25..a6e6f7e 100644 Binary files a/docs/_build/doctrees/euclidlike.doctree and b/docs/_build/doctrees/euclidlike.doctree differ diff --git a/docs/_build/doctrees/euclidlike_imsim.doctree b/docs/_build/doctrees/euclidlike_imsim.doctree index 590b7be..f46c640 100644 Binary files a/docs/_build/doctrees/euclidlike_imsim.doctree and b/docs/_build/doctrees/euclidlike_imsim.doctree differ diff --git a/docs/_build/doctrees/examples.doctree b/docs/_build/doctrees/examples.doctree new file mode 100644 index 0000000..f39ec92 Binary files /dev/null and b/docs/_build/doctrees/examples.doctree differ diff --git a/docs/_build/doctrees/history.doctree b/docs/_build/doctrees/history.doctree new file mode 100644 index 0000000..68423cc Binary files /dev/null and b/docs/_build/doctrees/history.doctree differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index e619b1a..79b0e2b 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/doctrees/install.doctree b/docs/_build/doctrees/install.doctree new file mode 100644 index 0000000..895b106 Binary files /dev/null and b/docs/_build/doctrees/install.doctree differ diff --git a/docs/_build/doctrees/modules.doctree b/docs/_build/doctrees/modules.doctree index 186a5a8..696c7e8 100644 Binary files a/docs/_build/doctrees/modules.doctree and b/docs/_build/doctrees/modules.doctree differ diff --git a/docs/_build/doctrees/overview.doctree b/docs/_build/doctrees/overview.doctree new file mode 100644 index 0000000..6efbd28 Binary files /dev/null and b/docs/_build/doctrees/overview.doctree differ diff --git a/docs/_build/doctrees/scripts.doctree b/docs/_build/doctrees/scripts.doctree index 13bc54c..37d1451 100644 Binary files a/docs/_build/doctrees/scripts.doctree and b/docs/_build/doctrees/scripts.doctree differ diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index acd1aed..cbbaf3d 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: cec21682d6cc0df78936fbd198ac0c57 +config: 11d168bc3ba21763cf541d100b9a19c3 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/_modules/euclidlike/backgrounds.html b/docs/_build/html/_modules/euclidlike/backgrounds.html index 1041421..82899f6 100644 --- a/docs/_build/html/_modules/euclidlike/backgrounds.html +++ b/docs/_build/html/_modules/euclidlike/backgrounds.html @@ -38,7 +38,7 @@

Source code for euclidlike.backgrounds

 import galsim
 
 
-[docs] +[docs] def getSkyLevel(bandpass, world_pos=None, exptime=None, epoch=2025, date=None): """ Get the expected sky level for a Euclid observation due to zodiacal light for this bandpass @@ -121,8 +121,6 @@

Source code for euclidlike.backgrounds

     return sky_val  
-
-[docs] def getZodiBackground(ecl_lat, ecl_dlon, lambda_min, lambda_max, Tlambda, T): """ This helper routine is used with permission from Chris Hirata's Exposure Time Calculator and enables the @@ -258,8 +256,7 @@

Source code for euclidlike.backgrounds

             5.03411747e10*lambda_* np.interp(lambda_,Tlambda,T)
 
     # We now have the zodi level in photons/m^2/sr/sec. Convert to photons/m^2/arcsec^2/sec.
-    return (zodi_tot / 4.2545170296152206e10)
- + return (zodi_tot / 4.2545170296152206e10)
@@ -288,6 +285,14 @@

GalSim-Euclid-Like

Navigation

+

Related Topics

diff --git a/docs/_build/html/_modules/euclidlike/bandpass.html b/docs/_build/html/_modules/euclidlike/bandpass.html index 05560f0..76a7977 100644 --- a/docs/_build/html/_modules/euclidlike/bandpass.html +++ b/docs/_build/html/_modules/euclidlike/bandpass.html @@ -52,7 +52,7 @@

Source code for euclidlike.bandpass

 from . import vis_red_limit, vis_blue_limit
 
 
-[docs] +[docs] def getBandpasses(AB_zeropoint=True, default_thin_trunc=True, full_bandpass=False, **kwargs): """ Function to get the bandpass information for the Euclid VIS band and the three Euclid NISP passbands. @@ -185,6 +185,14 @@

GalSim-Euclid-Like

Navigation

+

Related Topics

diff --git a/docs/_build/html/_modules/euclidlike/euclidlike_psf.html b/docs/_build/html/_modules/euclidlike/euclidlike_psf.html index 47409b6..3b5022b 100644 --- a/docs/_build/html/_modules/euclidlike/euclidlike_psf.html +++ b/docs/_build/html/_modules/euclidlike/euclidlike_psf.html @@ -100,7 +100,7 @@

Source code for euclidlike.euclidlike_psf

 _get_quadrant_psf = LRU_Cache(__get_quadrant_psf)
 
 
-[docs] +[docs] def getPSF( ccd, bandpass, ccd_pos=None, wcs=None, @@ -231,7 +231,7 @@

Source code for euclidlike.euclidlike_psf

 
 
 
-[docs] +[docs] def getBrightPSF( ccd, bandpass, @@ -433,6 +433,14 @@

GalSim-Euclid-Like

Navigation

+

Related Topics

diff --git a/docs/_build/html/_modules/euclidlike/euclidlike_wcs.html b/docs/_build/html/_modules/euclidlike/euclidlike_wcs.html index 284db9a..ae3388b 100644 --- a/docs/_build/html/_modules/euclidlike/euclidlike_wcs.html +++ b/docs/_build/html/_modules/euclidlike/euclidlike_wcs.html @@ -119,7 +119,7 @@

Source code for euclidlike.euclidlike_wcs

 
 
 
-[docs] +[docs] def getWCS(world_pos, PA=None, date=None, CCDs=None, PA_is_FPA=False, SAA=None): """ This routine returns a dict containing a WCS for each of the Euclid CCDs. @@ -246,8 +246,6 @@

Source code for euclidlike.euclidlike_wcs

 
 
 
-
-[docs] def convertCenter(world_pos, CCD, PA=None, date=None, SAA=None, PA_is_FPA=False, tol=0.5*coord.arcsec): """ This is a simple helper routine that takes an input position ``world_pos`` that is meant to @@ -316,12 +314,11 @@

Source code for euclidlike.euclidlike_wcs

         shift_val = np.abs(world_pos.distanceTo(test_sca_pos)/coord.arcsec)
         fpa_cent = coord.CelestialCoord(fpa_cent.ra + delta_ra, fpa_cent.dec + delta_dec)
 
-    return fpa_cent
- + return fpa_cent
-[docs] +[docs] def findCCD(wcs_dict, world_pos, include_border=False): """ This is a subroutine to take a dict of WCS (one per CCD) from euclidlike.getWCS() and query @@ -583,8 +580,6 @@

Source code for euclidlike.euclidlike_wcs

     return date, CCDs, pa_fpa, pa_obsy
 
 
-
-[docs] def allowedPos(world_pos, date, SAA=None): """ This routine can be used to check whether Euclid would be allowed to look at a particular @@ -623,12 +618,9 @@

Source code for euclidlike.euclidlike_wcs

     # Check if it's within tolerance.
     min_ang = 90. - min_sun_angle/coord.degrees
     max_ang = 90. + max_sun_angle/coord.degrees
-    return min_ang <= angle_deg <= max_ang
- + return min_ang <= angle_deg <= max_ang -
-[docs] def bestPA(world_pos, date, SAA=None): """ This routine determines the best position angle for the observatory for a given observation date @@ -671,8 +663,7 @@

Source code for euclidlike.euclidlike_wcs

     # celestial north pole.  It is defined as position angle east of north.
     north = coord.CelestialCoord(y_obs.ra, 90.*coord.degrees)
     obs_pa = world_pos.angleBetween(y_obs, north)
-    return obs_pa
- + return obs_pa
@@ -700,6 +691,14 @@

GalSim-Euclid-Like

Navigation

+

Related Topics

diff --git a/docs/_build/html/_modules/euclidlike_imsim/bandpass.html b/docs/_build/html/_modules/euclidlike_imsim/bandpass.html new file mode 100644 index 0000000..5c34fef --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/bandpass.html @@ -0,0 +1,144 @@ + + + + + + + euclidlike_imsim.bandpass — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.bandpass

+import euclidlike
+from galsim.config import BandpassBuilder, RegisterBandpassType, GetAllParams
+
+
+
+[docs] +class EuclidlikeBandpassBuilder(BandpassBuilder): + """A class for loading a Bandpass from a file + + FileBandpass expected the following parameter: + + name (str) The name of the Euclid filter to get. (required) + """ +
+[docs] + def buildBandpass(self, config, base, logger): + """Build the Bandpass based on the specifications in the config dict. + + Parameters: + config: The configuration dict for the bandpass type. + base: The base configuration dict. + logger: If provided, a logger for logging debug statements. + + Returns: + the constructed Bandpass object. + """ + req = {'name': str} + kwargs, safe = GetAllParams(config, base, req=req) + + name = kwargs['name'] + # Hard set the limit due to PSF definition + bandpass = euclidlike.getBandpasses()[name] + + return bandpass, safe
+
+ + + +RegisterBandpassType('EuclidlikeBandpass', EuclidlikeBandpassBuilder()) +RegisterBandpassType('EuclidlikeBandpassTrimmed', EuclidlikeBandpassBuilder()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/ccd.html b/docs/_build/html/_modules/euclidlike_imsim/ccd.html new file mode 100644 index 0000000..db285cb --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/ccd.html @@ -0,0 +1,331 @@ + + + + + + + euclidlike_imsim.ccd — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.ccd

+import galsim
+import galsim.config
+from galsim.config import RegisterImageType
+from galsim.config.image_scattered import ScatteredImageBuilder
+from galsim.errors import GalSimConfigValueError
+from galsim.image import Image
+from astropy.time import Time
+import numpy as np
+
+import euclidlike
+from euclidlike.instrument_params import gain, saturation
+from .noise import cfg_noise_key, parse_noise_config, get_noise
+
+
+
+[docs] +class EuclidlikeCCDImageBuilder(ScatteredImageBuilder): + +
+[docs] + def setup(self, config, base, image_num, obj_num, ignore, logger): + """Do the initialization and setup for building the image. + + This figures out the size that the image will be, but doesn't actually build it yet. + + Parameters: + config: The configuration dict for the image field. + base: The base configuration dict. + image_num: The current image number. + obj_num: The first object number in the image. + ignore: A list of parameters that are allowed to be in config that we can + ignore here. i.e. it won't be an error if these parameters are present. + logger: If given, a logger object to log progress. + + Returns: + xsize, ysize + """ + logger.debug( + "image %d: Building EuclidlikeCCD: image, obj = %d,%d", + image_num, + image_num, + obj_num, + ) + + self.nobjects = self.getNObj(config, base, image_num, logger=logger) + logger.debug("image %d: nobj = %d", image_num, self.nobjects) + + # These are allowed for Scattered, but we don't use them here. + extra_ignore = [ + "image_pos", + "world_pos", + "stamp_size", + "stamp_xsize", + "stamp_ysize", + "nobjects", + ] + req = {"CCD": int, "filter": str, "mjd": float, "exptime": float} + opt = { + "draw_method": str, + } + opt.update({key: bool for key in cfg_noise_key}) + params = galsim.config.GetAllParams( + config, base, req=req, opt=opt, ignore=ignore + extra_ignore + )[0] + + self.ccd = params["CCD"] + base["CCD"] = self.ccd + self.filter = params["filter"] + self.mjd = params["mjd"] + self.exptime = params["exptime"] + + self.cfg_noise = parse_noise_config(params) + + # If draw_method isn't in image field, it may be in stamp. Check. + self.draw_method = params.get( + "draw_method", base.get("stamp", {}).get("draw_method", "auto") + ) + + # If user hasn't overridden the bandpass to use, get the standard one. + if "bandpass" not in config: + base["bandpass"] = galsim.config.BuildBandpass( + base["image"], "bandpass", base, logger=logger + ) + + return euclidlike.n_pix_col, euclidlike.n_pix_row
+ + +
+[docs] + def buildImage(self, config, base, image_num, obj_num, logger): + """Build an Image containing multiple objects placed at arbitrary locations. + + Parameters: + config: The configuration dict for the image field. + base: The base configuration dict. + image_num: The current image number. + obj_num: The first object number in the image. + logger: If given, a logger object to log progress. + + Returns: + the final image and the current noise variance in the image as a tuple + """ + full_xsize = base["image_xsize"] + full_ysize = base["image_ysize"] + wcs = base["wcs"] + + full_image = Image(full_xsize, full_ysize, dtype=float) + full_image.setOrigin(base["image_origin"]) + full_image.wcs = wcs + full_image.setZero() + + full_image.header = galsim.FitsHeader() + full_image.header["EXPTIME"] = self.exptime + full_image.header["MJD-OBS"] = self.mjd + full_image.header["DATE-OBS"] = str(Time(self.mjd, format="mjd").datetime) + full_image.header["FILTER"] = self.filter + full_image.header["GAIN"] = gain + full_image.header["ZPTMAG"] = 2.5 * np.log10( + self.exptime * euclidlike.collecting_area + ) + + base["current_image"] = full_image + + if "image_pos" in config and "world_pos" in config: + raise GalSimConfigValueError( + "Both image_pos and world_pos specified for Scattered image.", + (config["image_pos"], config["world_pos"]), + ) + + if "image_pos" not in config and "world_pos" not in config: + xmin = base["image_origin"].x + xmax = xmin + full_xsize - 1 + ymin = base["image_origin"].y + ymax = ymin + full_ysize - 1 + config["image_pos"] = { + "type": "XY", + "x": {"type": "Random", "min": xmin, "max": xmax}, + "y": {"type": "Random", "min": ymin, "max": ymax}, + } + + nbatch = self.nobjects // 1000 + 1 + for batch in range(nbatch): + start_obj_num = self.nobjects * batch // nbatch + end_obj_num = self.nobjects * (batch + 1) // nbatch + nobj_batch = end_obj_num - start_obj_num + if nbatch > 1: + logger.warning( + "Start batch %d/%d with %d objects [%d, %d)", + batch + 1, + nbatch, + nobj_batch, + start_obj_num, + end_obj_num, + ) + stamps, current_vars = galsim.config.BuildStamps( + nobj_batch, base, logger=logger, obj_num=start_obj_num, do_noise=False + ) + base["index_key"] = "image_num" + + for k in range(nobj_batch): + # This is our signal that the object was skipped. + if stamps[k] is None: + continue + bounds = stamps[k].bounds & full_image.bounds + if not bounds.isDefined(): # pragma: no cover + # These noramlly show up as stamp==None, but technically it is possible + # to get a stamp that is off the main image, so check for that here to + # avoid an error. But this isn't covered in the imsim test suite. + continue + + logger.debug( + "image %d: full bounds = %s", image_num, str(full_image.bounds) + ) + logger.debug( + "image %d: stamp %d bounds = %s", + image_num, + k + start_obj_num, + str(stamps[k].bounds), + ) + logger.debug("image %d: Overlap = %s", image_num, str(bounds)) + full_image[bounds] += stamps[k][bounds] + stamps = None + + return full_image, None
+ + +
+[docs] + def addNoise(self, image, config, base, image_num, obj_num, current_var, logger): + """Add the final noise to a Scattered image + + Parameters: + image: The image onto which to add the noise. + config: The configuration dict for the image field. + base: The base configuration dict. + image_num: The current image number. + obj_num: The first object number in the image. + current_var: The current noise variance in each postage stamps. + logger: If given, a logger object to log progress. + """ + # check ignore noise + if self.cfg_noise["ignore_noise"]: + return + + if "noise_image" not in base.keys(): + get_noise(self.cfg_noise, config, base, logger) + + # We first have to apply gain and quantize the image + image /= gain + image.quantize() + + image += base["noise_image"] + + # Apply saturation + saturation_ADU = np.round(saturation/gain) + mask_saturated = image.array > saturation_ADU + base["saturated_mask"] = mask_saturated + image.array[mask_saturated] = saturation_ADU + + if self.cfg_noise["sky_subtract"]: + image -= base["sky_image"]
+
+ + + +# Register this as a valid type +RegisterImageType("euclidlike_ccd", EuclidlikeCCDImageBuilder()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/noise.html b/docs/_build/html/_modules/euclidlike_imsim/noise.html new file mode 100644 index 0000000..36a03a4 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/noise.html @@ -0,0 +1,384 @@ + + + + + + + euclidlike_imsim.noise — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.noise

+import numpy as np
+
+from astropy.time import Time
+
+import galsim
+from galsim.errors import GalSimConfigError
+
+import euclidlike
+from euclidlike.instrument_params import gain, read_noise
+
+# Some place holder stuff, will need to update later in euclidlike
+# This is just to avoid changing the code and don't have "errors"
+stray_light_fraction = 0.
+dark_current = 0.
+
+cfg_noise_key = [
+    "ignore_noise",
+    "stray_light",
+    "thermal_background",
+    "reciprocity_failure",
+    "dark_current",
+    "nonlinearity",
+    "ipc",
+    "read_noise",
+    "sky_subtract",
+]
+
+
+
+[docs] +def parse_noise_config(params): + + cfg_noise = {} + for key in cfg_noise_key: + cfg_noise[key] = params.get(key, False) + + cfg_noise["exptime"] = params["exptime"] + cfg_noise["mjd"] = params["mjd"] + + return cfg_noise
+ + + +
+[docs] +def get_noise(cfg_noise, cfg_image, base, logger): + + noise_img = base["current_image"].copy() + noise_img.fill(0) + + wcs = base["wcs"] + bp = base["bandpass"] + rng = galsim.config.GetRNG(cfg_image, base) + logger.info( + "image %d: Start EuclidlikeCCD detector effects", base.get("image_num", 0) + ) + + # Things that will eventually be subtracted (if sky_subtract) will have their expectation + # value added to sky_image. So technically, this includes things that aren't just sky. + # E.g. includes dark_current and thermal backgrounds. + sky_image = noise_img.copy() + sky_level = euclidlike.getSkyLevel( + bp, + world_pos=wcs.toWorld(noise_img.true_center), + date=Time(cfg_noise["mjd"], format="mjd").datetime, + ) + logger.debug("Adding sky_level = %s", sky_level) + if cfg_noise["stray_light"]: + logger.debug("Stray light fraction = %s", stray_light_fraction) + sky_level *= 1.0 + stray_light_fraction + wcs.makeSkyImage(sky_image, sky_level) + + # The image up to here is an expectation value. + # Realize it as an integer number of photons. + poisson_noise = galsim.noise.PoissonNoise(rng) + logger.debug("Adding poisson noise to sky photons") + sky_image1 = sky_image.copy() + sky_image1.addNoise(poisson_noise) + noise_img.quantize() + # the image won't necessarily be integers. + noise_img += sky_image1 + + # Apply the detector effects here. Not all of these are "noise" per se, but they + # happen interspersed with various noise effects, so apply them all in this step. + + if cfg_noise["dark_current"]: + dc = dark_current * cfg_noise["exptime"] + logger.debug("Adding dark current: %s", dc) + sky_image += dc + dark_noise = galsim.noise.DeviateNoise( + galsim.random.PoissonDeviate(rng, dc) + ) + noise_img.addNoise(dark_noise) + + if cfg_noise["read_noise"]: + logger.debug("Adding read noise %s", read_noise) + noise_img.addNoise(galsim.GaussianNoise(rng, sigma=read_noise)) + + logger.debug("Applying gain %s", gain) + noise_img /= gain + + # Make integer ADU now. + noise_img.quantize() + + sky_image /= gain + sky_image.quantize() + + base["noise_image"] = noise_img + base["sky_image"] = sky_image
+ + + +
+[docs] +class NoiseImageBuilder(galsim.config.ExtraOutputBuilder): + +
+[docs] + def initialize(self, data, scratch, config, base, logger): + """Do any initial setup for this builder at the start of a new output file. + + The base class implementation saves two work space items into self.data and self.scratch + that can be used to safely communicate across multiple processes. + + Parameters: + data: An empty list of length nimages to use as work space. + scratch: An empty dict that can be used as work space. + config: The configuration field for this output object. + base: The base configuration dict. + logger: If given, a logger object to log progress. [default: None] + """ + req = {"CCD": int, "filter": str, "mjd": float, "exptime": float} + opt = {key: bool for key in cfg_noise_key} + ignore = galsim.config.image.image_ignore + extra_ignore = [ + "image_pos", + "world_pos", + "stamp_size", + "stamp_xsize", + "stamp_ysize", + "nobjects", + ] + params = galsim.config.GetAllParams( + base["image"], base, req=req, opt=opt, ignore=ignore+extra_ignore, + )[0] + self.cfg_noise = parse_noise_config(params) + + self._check_input() + + self.data = data + self.scratch = scratch + self.final_data = None
+ + + def _check_input(self): + if self.cfg_noise["ignore_noise"]: + raise GalSimConfigError( + "You cannot ignore the noise and request the noise image at the same time." + " Either active the noise or remove the output noise image." + ) + +
+[docs] + def processImage(self, index, obj_nums, config, base, logger): + """Perform any necessary processing at the end of each image construction. + + This function will be called after each full image is built. + + Compute the noise for the current image and add it to the image. + It will also create an independent noise image. + The code optionally subtract the background if requested. + + Parameters: + index: The index in self.data to use for this image. This isn't the image_num + (which can be accessed at base['image_num'] if needed), but rather + an index that starts at 0 for the first image being worked on and + goes up to nimages-1. + obj_nums: The object numbers that were used for this image. + config: The configuration field for this output object. + base: The base configuration dict. + logger: If given, a logger object to log progress. [default: None] + """ + if "noise_image" not in base.keys(): + get_noise(self.cfg_noise, config, base, logger) + + noise_image = base["noise_image"].copy() + + if self.cfg_noise["sky_subtract"]: + noise_image -= base["sky_image"] + + self.data[index] = noise_image
+
+ + + +
+[docs] +class SkyImageBuilder(NoiseImageBuilder): + + def _check_input(self): + if self.cfg_noise["ignore_noise"]: + raise GalSimConfigError( + "You cannot ignore the noise and request the sky image at the same time." + " Either activate the noise or remove the output sky image." + ) + +
+[docs] + def processImage(self, index, obj_nums, config, base, logger): + """Perform any necessary processing at the end of each image construction. + + This function will be called after each full image is built. + + Compute the sky background and return it in an image. + + Parameters: + index: The index in self.data to use for this image. This isn't the image_num + (which can be accessed at base['image_num'] if needed), but rather + an index that starts at 0 for the first image being worked on and + goes up to nimages-1. + obj_nums: The object numbers that were used for this image. + config: The configuration field for this output object. + base: The base configuration dict. + logger: If given, a logger object to log progress. [default: None] + """ + if "noise_image" not in base.keys(): + get_noise(self.cfg_noise, config, base, logger) + + self.data[index] = base["sky_image"].copy()
+
+ + + +
+[docs] +class WeightImageBuilder(NoiseImageBuilder): + + def _check_input(self): + if self.cfg_noise["ignore_noise"]: + raise GalSimConfigError( + "You cannot ignore the noise and request the weight image at the same time." + " Either activate the noise or remove the output sky image." + ) + +
+[docs] + def processImage(self, index, obj_nums, config, base, logger): + """Perform any necessary processing at the end of each image construction. + + This function will be called after each full image is built. + + Compute the weight map from the noise image and return it in an image. + + Parameters: + index: The index in self.data to use for this image. This isn't the image_num + (which can be accessed at base['image_num'] if needed), but rather + an index that starts at 0 for the first image being worked on and + goes up to nimages-1. + obj_nums: The object numbers that were used for this image. + config: The configuration field for this output object. + base: The base configuration dict. + logger: If given, a logger object to log progress. [default: None] + """ + if "noise_image" not in base.keys(): + get_noise(self.cfg_noise, config, base, logger) + + noise_var = np.var(base["noise_image"].array) + + weight_image = galsim.ImageF(base["image_bounds"]) + weight_image += noise_var + weight_image.invertSelf() + + self.data[index] = weight_image
+
+ + + +galsim.config.RegisterExtraOutput('noise_image', NoiseImageBuilder()) +galsim.config.RegisterExtraOutput('sky_image', SkyImageBuilder()) +galsim.config.RegisterExtraOutput('weight_image', WeightImageBuilder()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/obseq.html b/docs/_build/html/_modules/euclidlike_imsim/obseq.html new file mode 100644 index 0000000..74ece02 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/obseq.html @@ -0,0 +1,227 @@ + + + + + + + euclidlike_imsim.obseq — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.obseq

+from astropy.time import Time
+import pandas as pd
+import galsim
+import galsim.config
+from galsim.angle import Angle
+from galsim.config import InputLoader, RegisterValueType, RegisterInputType
+from galsim.errors import GalSimConfigValueError
+
+
+OBS_KIND = [
+    "VIS_LONG",
+    "VIS_SHORT",
+    "NISP_J",
+    "NISP_H",
+    "NISP_Y",
+]
+
+
+[docs] +class ObSeqDataLoader(object): + """Read the exposure information from the observation sequence.""" + + _req_params = {"file_name": str, "visit": int, "obs_kind": str, "CCD": int} + + def __init__(self, file_name, visit, obs_kind, CCD, logger=None): + self.logger = galsim.config.LoggerWrapper(logger) + self.file_name = file_name + self.visit = visit + self.ccd = CCD + + if obs_kind not in OBS_KIND: + raise GalSimConfigValueError( + "Invalid obs_kind.", obs_kind, OBS_KIND + ) + self.obs_kind = obs_kind + + # try: + self.read_obseq() + # except: + # # Read visit info from the config file. + # self.logger.warning('Reading visit info from config file.') + +
+[docs] + def read_obseq(self): + """Read visit info from the obseq file.""" + if self.file_name is None: + raise ValueError( + "No obseq filename provided, trying to build from config information." + ) + if self.visit is None: + raise ValueError( + "The visit must be set when reading visit info from an obseq file." + ) + + self.logger.warning( + "Reading info from obseq file %s for visit %s", self.file_name, self.visit + ) + + ob = pd.read_pickle(self.file_name).loc[self.visit] + + self.ob = {} + for obs_kind in OBS_KIND: + _ob = {} + _ob["visit"] = self.visit + _ob["ccd"] = self.ccd + _ob["ra"] = ob.loc[obs_kind]["ra"] * galsim.degrees + _ob["dec"] = ob.loc[obs_kind]["dec"] * galsim.degrees + _ob["pa"] = ob.loc[obs_kind]["pa"] * galsim.degrees + _ob["saa"] = ob.loc[obs_kind]["saa"] * galsim.degrees + _ob["date"] = Time(ob.loc[obs_kind]["date"], format="mjd").datetime + _ob["mjd"] = ob.loc[obs_kind]["date"] + _ob["filter"] = ob.loc[obs_kind]["filter"] + _ob["exptime"] = ob.loc[obs_kind]["exptime"] + self.ob[obs_kind] = _ob
+ + +
+[docs] + def get(self, field, default=None, obs_kind=None): + + if obs_kind is None: + obs_kind = self.obs_kind + else: + if obs_kind not in OBS_KIND: + raise KeyError( + f"OpsimData obs_kind {obs_kind} not present in ob, " + f"must be in {OBS_KIND}." + ) + ob = self.ob[obs_kind] + + if field not in ob and default is None: + raise KeyError("OpsimData field %s not present in ob" % field) + + return ob.get(field, default)
+
+ + + +
+[docs] +def ObSeqData(config, base, value_type): + """Returns the obseq data for a pointing.""" + pointing = galsim.config.GetInputObj("obseq_data", config, base, "OpSeqDataLoader") + + req = {"field": str} + opt = {"obs_kind": str} + + kwargs, safe = galsim.config.GetAllParams(config, base, req=req, opt=opt) + field = kwargs["field"] + obs_kind = kwargs.get("obs_kind", None) + + val = value_type(pointing.get(field, obs_kind=obs_kind)) + return val, safe
+ + + +RegisterInputType( + "obseq_data", InputLoader(ObSeqDataLoader, file_scope=True, takes_logger=True) +) +RegisterValueType( + "ObSeqData", ObSeqData, [float, int, str, Angle], input_type="obseq_data" +) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/photonOps.html b/docs/_build/html/_modules/euclidlike_imsim/photonOps.html new file mode 100644 index 0000000..e60a325 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/photonOps.html @@ -0,0 +1,194 @@ + + + + + + + euclidlike_imsim.photonOps — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.photonOps

+_w1 = 0.17519
+_w2 = 0.53146
+_w3 = 0.29335
+_s  = 0.3279
+_s1 = 0.4522*_s
+_s2 = 0.8050*_s
+_s3 = 1.4329*_s
+
+import numpy as np
+from galsim import PhotonOp,UniformDeviate,GaussianDeviate
+from galsim.config import PhotonOpBuilder,RegisterPhotonOpType,get_cls_params,GetAllParams,GetRNG
+
+
+[docs] +class ChargeDiff(PhotonOp): + """A photon operator that applies the effect of charge diffusion via a probablistic model limit. + """ + def __init__(self, rng=None, **kwargs): + + self.ud = UniformDeviate(rng) + self.gd1 = GaussianDeviate(rng, sigma=_s1) + self.gd2 = GaussianDeviate(rng, sigma=_s2) + self.gd3 = GaussianDeviate(rng, sigma=_s3) + +
+[docs] + def applyTo(self, photon_array, local_wcs=None, rng=None): + """Apply the charge diffusion effect to the photons + + Parameters: + photon_array: A `PhotonArray` to apply the operator to. + local_wcs: A `LocalWCS` instance defining the local WCS for the current photon + bundle in case the operator needs this information. [default: None] + rng: A random number generator to use if needed. [default: None] + """ + + # Choose which weighted Gausian to use in sech model approximation + u = np.empty(len(photon_array.x)) + self.ud.generate(u) + + # Selects appropriate fraction of photons corresponding to the first gaussian in the sech model + mask = u<_w1 + dx = np.empty(np.sum(mask)) + dy = np.empty(np.sum(mask)) + # Generate and apply the 2D gaussian shifts corresponding to the first gaussian + self.gd1.generate(dx) + self.gd1.generate(dy) + photon_array.x[mask] += dx + photon_array.y[mask] += dy + + # Selects appropriate fraction of photons corresponding to the second gaussian in the sech model + mask = (u>=_w1)&(u<=(1.-_w3)) + dx = np.empty(np.sum(mask)) + dy = np.empty(np.sum(mask)) + # Generate and apply the 2D gaussian shifts corresponding to the second gaussian + self.gd2.generate(dx) + self.gd2.generate(dy) + photon_array.x[mask] += dx + photon_array.y[mask] += dy + + # Selects appropriate fraction of photons corresponding to the third gaussian in the sech model + mask = u>(1.-_w3) + dx = np.empty(np.sum(mask)) + dy = np.empty(np.sum(mask)) + # Generate and apply the 2D gaussian shifts corresponding to the second gaussian + self.gd3.generate(dx) + self.gd3.generate(dy) + photon_array.x[mask] += dx + photon_array.y[mask] += dy
+
+ + + +
+[docs] +class ChargeDiffBuilder(PhotonOpBuilder): + """Build ChargeDiff photonOp + """ +
+[docs] + def buildPhotonOp(self, config, base, logger): + req, opt, single, takes_rng = get_cls_params(ChargeDiff) + kwargs, safe = GetAllParams(config, base, req, opt, single) + rng = GetRNG(config, base, logger, "Roman_stamp") + kwargs['rng'] = rng + return ChargeDiff(**kwargs)
+
+ + +RegisterPhotonOpType('ChargeDiff', ChargeDiffBuilder()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/psf.html b/docs/_build/html/_modules/euclidlike_imsim/psf.html new file mode 100644 index 0000000..361ca93 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/psf.html @@ -0,0 +1,304 @@ + + + + + + + euclidlike_imsim.psf — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.psf

+import galsim
+import euclidlike
+import galsim.config
+from galsim.config import RegisterObjectType, RegisterInputType, OpticalPSF, InputLoader
+
+import euclidlike
+
+
+
+[docs] +class EuclidlikePSF(object): + """Class building needed Euclidlike PSFs.""" + + def __init__( + self, + CCD=None, + WCS=None, + n_waves=None, + bpass=None, + extra_aberrations=None, + logger=None, + ): + + logger = galsim.config.LoggerWrapper(logger) + # n_waves parameter is only used for treatment of bright objects. In here we use n_waves = 5 + # to speed up computation of the ChromaticOpticalPSF used for bright objects. + if n_waves == -1: + n_waves = 5 + + corners = [ + galsim.PositionD(1, 1), + galsim.PositionD(1, euclidlike.n_pix_row), + galsim.PositionD(euclidlike.n_pix_col, 1), + galsim.PositionD(euclidlike.n_pix_col, euclidlike.n_pix_row), + ] + cc = galsim.PositionD(euclidlike.n_pix_col / 2, euclidlike.n_pix_row/ 2) + tags = ["ll", "lu", "ul", "uu"] + self.PSF = {} + pupil_bin = 8 + self.PSF[pupil_bin] = {} + for tag, CCD_pos in tuple(zip(tags, corners)): + self.PSF[pupil_bin][tag] = self._psf_call( + CCD, bpass, CCD_pos, WCS, pupil_bin, n_waves, logger, extra_aberrations + ) + for pupil_bin in [4, 2, "achromatic"]: + self.PSF[pupil_bin] = self._psf_call( + CCD, bpass, cc, WCS, pupil_bin, n_waves, logger, extra_aberrations + ) + + def _parse_pupil_bin(self, pupil_bin): + if pupil_bin == "achromatic": + return 8 + else: + return pupil_bin + + def _psf_call( + self, CCD, bpass, CCD_pos, WCS, pupil_bin, n_waves, logger, extra_aberrations + ): + + if pupil_bin == 8: + psf = euclidlike.getPSF( + CCD, + bpass.name, + ccd_pos=CCD_pos, + wcs=WCS, + # pupil_bin=pupil_bin, + # n_waves=n_waves, + logger=logger, + # Don't set wavelength for this one. + # We want this to be chromatic for photon shooting. + # wavelength = bpass.effective_wavelength, + # extra_aberrations=extra_aberrations, + ) + else: + psf = euclidlike.getBrightPSF( + CCD, + bpass.name, + ccd_pos=CCD_pos, + wcs=WCS, + pupil_bin=self._parse_pupil_bin(pupil_bin), + n_waves=n_waves, + logger=logger, + # Note: setting wavelength makes it achromatic. + # We only use pupil_bin = 2,4 for FFT objects. + wavelength=bpass.effective_wavelength, + ) + + # psf = euclidlike.getPSF( + # CCD, + # bpass.name, + # ccd_pos=CCD_pos, + # wcs=WCS, + # # pupil_bin=self._parse_pupil_bin(pupil_bin), + # # n_waves=n_waves, + # logger=logger, + # # Note: setting wavelength makes it achromatic. + # # We only use pupil_bin = 2,4 for FFT objects. + # wavelength=bpass.effective_wavelength, + # # extra_aberrations=extra_aberrations, + # ) + if pupil_bin == 4: + return psf.withGSParams(maximum_fft_size=16384, folding_threshold=1e-3) + elif pupil_bin == 2: + return psf.withGSParams(maximum_fft_size=16384, folding_threshold=1e-4) + else: + return psf.withGSParams(maximum_fft_size=16384) + +
+[docs] + def getPSF(self, pupil_bin, pos): + """ + Return a PSF to be convolved with sources. + PSF is sampled at 4 quadrants for each CCD. Returned PSF + corresponds to that of the quadrant of the CCD position. + + @param [in] what pupil binning to request. + """ + ## For now no interpolation is used + #wll = (euclidlike.n_pix_col - pos.x) * (euclidlike.n_pix_row - pos.y) + #wlu = (euclidlike.n_pix_col - pos.x) * (pos.y - 1) + #wul = (pos.x - 1) * (euclidlike.n_pix_row - pos.y) + #wuu = (pos.x - 1) * (pos.y - 1) + #return ( + # wll * psf["ll"] + wlu * psf["lu"] + wul * psf["ul"] + wuu * psf["uu"] + #) / ((euclidlike.n_pix_row - 1) * (euclidlike.n_pix_col - 1)) + + + psf = self.PSF[pupil_bin] + if pupil_bin != 8: + return psf + + quad_row = 'l' + quad_col = 'l' + if pos.y > euclidlike.n_pix_row/2: + quad_row = 'u' + if pos.x > euclidlike.n_pix_col/2: + quad_col = 'u' + quad_pos = quad_col + quad_row + return psf[quad_pos]
+
+ + + + + +
+[docs] +class PSFLoader(InputLoader): + """PSF loader.""" + + def __init__(self): + # Override some defaults in the base init. + super().__init__(init_func=EuclidlikePSF, takes_logger=True, use_proxy=False) + +
+[docs] + def getKwargs(self, config, base, logger): + logger.debug("Get kwargs for PSF") + + req = {} + opt = { + "n_waves": int, + } + ignore = ["extra_aberrations"] + + # If CCD is in base, then don't require it in the config file. + # (Presumably because using Euclidlike image type, which sets it there for convenience.) + if "CCD" in base: + opt["CCD"] = int + else: + req["CCD"] = int + + kwargs, safe = galsim.config.GetAllParams( + config, base, req=req, opt=opt, ignore=ignore + ) + + # If not given in kwargs, then it must have been in base, so this is ok. + if "CCD" not in kwargs: + kwargs["CCD"] = base["CCD"] + + kwargs["extra_aberrations"] = galsim.config.ParseAberrations( + "extra_aberrations", config, base, "EuclidlikePSF" + ) + kwargs["WCS"] = galsim.config.BuildWCS( + base["image"], "wcs", base, logger=logger + ) + kwargs["bpass"] = galsim.config.BuildBandpass( + base["image"], "bandpass", base, logger + )[0] + + logger.debug("kwargs = %s", kwargs) + + return kwargs, False
+
+ + + +# Register this as a valid type +RegisterInputType("euclidlike_psf", PSFLoader()) +# RegisterObjectType('euclidlike_psf', BuildEuclidlikePSF, input_type='euclidlikepsf_loader') +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/skycat.html b/docs/_build/html/_modules/euclidlike_imsim/skycat.html new file mode 100644 index 0000000..f31c627 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/skycat.html @@ -0,0 +1,631 @@ + + + + + + + euclidlike_imsim.skycat — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.skycat

+"""
+Interface to obtain objects from skyCatalogs.
+"""
+
+import os
+import numpy as np
+import galsim
+from galsim.config import (
+    InputLoader,
+    RegisterInputType,
+    RegisterValueType,
+    RegisterObjectType,
+)
+
+import euclidlike
+
+
+
+[docs] +class SkyCatalogInterface: + """Interface to skyCatalogs package.""" + + _trivial_sed = galsim.SED( + galsim.LookupTable([100, 2600], [1, 1], interpolant="linear"), + wave_type="nm", + flux_type="fphotons", + ) + + def __init__( + self, + file_name, + exptime, + wcs=None, + mjd=None, + bandpass=None, + xsize=None, + ysize=None, + obj_types=None, + edge_pix=100, + max_flux=None, + logger=None, + ): + """ + Parameters + ---------- + file_name : str + Name of skyCatalogs yaml config file. + wcs : galsim.WCS + WCS of the image to render. + mjd : float + MJD of the midpoint of the exposure. + exptime : float + Exposure time. + xsize : int + Size in pixels of CCD in x-direction. + ysize : int + Size in pixels of CCD in y-direction. + obj_types : list-like [None] + List or tuple of object types to render, e.g., ('star', 'galaxy'). + If None, then consider all object types. + edge_pix : float [100] + Size in pixels of the buffer region around nominal image + to consider objects. + logger : logging.Logger [None] + Logger object. + """ + self.file_name = file_name + self.wcs = wcs + self.mjd = mjd + self.exptime = exptime + self.bandpass = bandpass + if xsize is not None: + self.xsize = xsize + else: + self.xsize = euclidlike.n_pix_col + if ysize is not None: + self.ysize = ysize + else: + self.ysize = euclidlike.n_pix_row + self.obj_types = obj_types + self.edge_pix = edge_pix + self.logger = galsim.config.LoggerWrapper(logger) + + if obj_types is not None: + self.logger.warning(f"Object types restricted to {obj_types}") + self.ccd_center = wcs.toWorld( + galsim.PositionD(self.xsize / 2.0, self.ysize / 2.0) + ) + self._objects = None + + @property + def objects(self): + from skycatalogs import skyCatalogs + + if self._objects is None: + + # Select objects from polygonal region bounded by CCD edges + corners = ( + (-self.edge_pix, -self.edge_pix), + (self.xsize + self.edge_pix, -self.edge_pix), + (self.xsize + self.edge_pix, self.ysize + self.edge_pix), + (-self.edge_pix, self.ysize + self.edge_pix), + ) + vertices = [] + for x, y in corners: + sky_coord = self.wcs.toWorld(galsim.PositionD(x, y)) + vertices.append( + (sky_coord.ra / galsim.degrees, sky_coord.dec / galsim.degrees) + ) + region = skyCatalogs.PolygonalRegion(vertices) + sky_cat = skyCatalogs.open_catalog(self.file_name) + self._objects = sky_cat.get_objects_by_region( + region, obj_type_set=self.obj_types, mjd=self.mjd + ) + if not self._objects: + self.logger.warning("No objects found on image.") + else: + self._build_dtype_dict() + return self._objects + + def _build_dtype_dict(self): + self._dtype_dict = {} + obj_types = [] + for coll in self._objects.get_collections(): + objects_type = coll._object_type_unique + if objects_type in obj_types: + continue + col_names = list(coll.native_columns) + for col_name in col_names: + try: + # Some columns cannot be read in snana + np_type = coll.get_native_attribute(col_name).dtype.type() + except Exception as e: + self.logger.warning( + f"The column {col_name} could not be read from skyCatalog." + ) + continue + if np_type is None: + py_type = str + else: + py_type = type(np_type.astype(object)) + self._dtype_dict[col_name] = py_type + +
+[docs] + def get_ccd_center(self): + """ + Return the CCD center. + """ + return self.ccd_center
+ + +
+[docs] + def getNObjects(self): + """ + Return the number of GSObjects to render + """ + return len(self.objects)
+ + +
+[docs] + def getApproxNObjects(self): + """ + Return the approximate number of GSObjects to render, as set in + the class initializer. + """ + return self.getNObjects()
+ + +
+[docs] + def getWorldPos(self, index): + """ + Return the sky coordinates of the skyCatalog object + corresponding to the specified index. + + Parameters + ---------- + index : int + Index of the (object_index, subcomponent) combination. + + Returns + ------- + galsim.CelestialCoord + """ + skycat_obj = self.objects[index] + ra, dec = skycat_obj.ra, skycat_obj.dec + return galsim.CelestialCoord(ra * galsim.degrees, dec * galsim.degrees)
+ + +
+[docs] + def getFlux(self, index, filter=None, mjd=None, exptime=None): + """ + Return the flux associated to an object. + + Parameters + ---------- + index : int + Index of the object in the self.objects catalog. + filter : str, optional + Name of the filter for which the flux is computed. If None, use the + filter provided during initialization. [Default: None] + mjd : float, optional + Date of the observation in MJD format. If None, use the + mjd provided during initialization. [Default: None] + exptime : int or float, optional + Exposure time of the observation. If None, use the + exptime provided during initialization. [Default: None] + + Returns + ------- + flux + Computer flux at the given date for the requested exposure time and + filter. + """ + + if filter is None: + filter = self.bandpass.name + if mjd is None: + mjd = self.mjd + if exptime is None: + exptime = self.exptime + + skycat_obj = self.objects[index] + # We cache the SEDs for potential later use + self._seds = skycat_obj.get_observer_sed_components() + for i, sed in enumerate(self._seds.values()): + if i == 0: + sed_sum = sed + else: + sed_sum += sed + raw_flux = skycat_obj.get_euclid_flux( + filter, + sed_sum, + mjd=mjd, + cache=False + ) + if hasattr(skycat_obj, "get_wl_params"): + _, _, mu = skycat_obj.get_wl_params() + else: + mu = 1. + flux = raw_flux * mu * exptime * euclidlike.collecting_area + + return flux
+ + +
+[docs] + def getValue(self, index, field): + """ + Return a skyCatalog value for the an object. + + Parameters + ---------- + index : int + Index of the object in the self.objects catalog. + field : str + Name of the field for which you want the value. + + Returns + ------- + int or float or str or None + The value associated to the field or None if the field do not exist. + """ + + skycat_obj = self.objects[index] + + if field not in self._dtype_dict: + # We cannot raise an error because one could have a field for snana + # in the config and we don't want to crash because there are no SN + # in this particular image. We then default to False which might not + # be the right type for the required column but we have no way of knowing + # the correct type if the column do not exist. + self.logger.warning(f"The field {field} was not found in skyCatalog.") + return None + elif field not in skycat_obj.native_columns: + if self._dtype_dict[field] is int: + # There are no "special value" for integer so we default to + # hopefully something completely off + return -9999 + elif self._dtype_dict[field] is float: + return np.nan + elif self._dtype_dict[field] is str: + return None + else: + return skycat_obj.get_native_attribute(field)
+ + +
+[docs] + def getObj(self, index, gsparams=None, rng=None, exptime=30): + """ + Return the galsim object for the skyCatalog object + corresponding to the specified index. If the skyCatalog + object is a galaxy, the returned galsim object will be + a galsim.Sum. + + Parameters + ---------- + index : int + Index of the object in the self.objects catalog. + + Returns + ------- + galsim.GSObject + """ + if not self.objects: + raise RuntimeError("Trying to get an object from an empty sky catalog") + + faint = False + skycat_obj = self.objects[index] + gsobjs = skycat_obj.get_gsobject_components(gsparams) + + # Compute the flux or get the cached value. + flux = self.getFlux(index) + if np.isnan(flux): + return None + + # Set up simple SED if too faint + if flux < 40: + faint = True + if not faint: + seds = skycat_obj.get_observer_sed_components(mjd=self.mjd) + + gs_obj_list = [] + for component in gsobjs: + if faint: + gsobjs[component] = gsobjs[component].evaluateAtWavelength( + self.bandpass + ) + gs_obj_list.append( + gsobjs[component] + * self._trivial_sed + * self.exptime + * euclidlike.collecting_area + ) + else: + if component in seds: + gs_obj_list.append( + gsobjs[component] + * seds[component] + * self.exptime + * euclidlike.collecting_area + ) + + if not gs_obj_list: + return None + + if len(gs_obj_list) == 1: + gs_object = gs_obj_list[0] + else: + gs_object = galsim.Add(gs_obj_list) + + # Give the object the right flux + gs_object.flux = flux + gs_object.withFlux(gs_object.flux, self.bandpass) + + # Get the object type + if (skycat_obj.object_type == "diffsky_galaxy") | ( + skycat_obj.object_type == "galaxy" + ): + gs_object.object_type = "galaxy" + if skycat_obj.object_type == "star": + gs_object.object_type = "star" + if skycat_obj.object_type == "snana": + gs_object.object_type = "transient" + + return gs_object
+
+ + + +
+[docs] +class SkyCatalogLoader(InputLoader): + """ + Class to load SkyCatalogInterface object. + """ + +
+[docs] + def getKwargs(self, config, base, logger): + req = {"file_name": str, "exptime": float} + opt = { + "edge_pix": float, + "obj_types": list, + "mjd": float, + } + kwargs, safe = galsim.config.GetAllParams(config, base, req=req, opt=opt) + wcs = galsim.config.BuildWCS(base["image"], "wcs", base, logger=logger) + kwargs["wcs"] = wcs + kwargs["logger"] = logger + + if "bandpass" not in config: + base["bandpass"] = galsim.config.BuildBandpass( + base["image"], "bandpass", base, logger=logger + )[0] + + kwargs["bandpass"] = base["bandpass"] + # Sky catalog object lists are created per CCD, so they are + # not safe to reuse. + safe = False + return kwargs, safe
+
+ + + +
+[docs] +def SkyCatObj(config, base, ignore, gsparams, logger): + """ + Build an object according to info in the sky catalog. + """ + skycat = galsim.config.GetInputObj("sky_catalog", config, base, "SkyCatObj") + + # Ensure that this sky catalog matches the CCD being simulated by + # comparing center locations on the sky. + world_center = base["world_center"] + ccd_center = skycat.get_ccd_center() + sep = ccd_center.distanceTo(base["world_center"]) / galsim.arcsec + # Centers must agree to within at least 1 arcsec: + if sep > 1.0: + message = ( + "skyCatalogs selection and CCD center do not agree: \n" + "skycat.ccd_center: " + f"{ccd_center.ra/galsim.degrees:.5f}, " + f"{ccd_center.dec/galsim.degrees:.5f}\n" + "world_center: " + f"{world_center.ra/galsim.degrees:.5f}, " + f"{world_center.dec/galsim.degrees:.5f} \n" + f"Separation: {sep:.2e} arcsec" + ) + raise RuntimeError(message) + + # Setup the indexing sequence if it hasn't been specified. The + # normal thing with a catalog is to just use each object in order, + # so we don't require the user to specify that by hand. We can do + # it for them. + galsim.config.SetDefaultIndex(config, skycat.getNObjects()) + + req = {"index": int} + opt = {"num": int} + kwargs, safe = galsim.config.GetAllParams(config, base, req=req, opt=opt) + index = kwargs["index"] + + rng = galsim.config.GetRNG(config, base, logger, "SkyCatObj") + + obj = skycat.getObj(index, gsparams=gsparams, rng=rng) + base["object_id"] = skycat.objects[index].id + + return obj, safe
+ + + +
+[docs] +def SkyCatWorldPos(config, base, value_type): + """Return a value from the object part of the skyCatalog""" + skycat = galsim.config.GetInputObj("sky_catalog", config, base, "SkyCatWorldPos") + + # Setup the indexing sequence if it hasn't been specified. The + # normal thing with a catalog is to just use each object in order, + # so we don't require the user to specify that by hand. We can do + # it for them. + galsim.config.SetDefaultIndex(config, skycat.getNObjects()) + + req = {"index": int} + opt = {"num": int} + kwargs, safe = galsim.config.GetAllParams(config, base, req=req, opt=opt) + index = kwargs["index"] + + pos = skycat.getWorldPos(index) + return pos, safe
+ + + +
+[docs] +def SkyCatValue(config, base, value_type): + """Return a value from the object part of the skyCatalog + """ + + skycat = galsim.config.GetInputObj("sky_catalog", config, base, "SkyCatValue") + + # Setup the indexing sequence if it hasn't been specified. The + # normal thing with a catalog is to just use each object in order, + # so we don't require the user to specify that by hand. We can do + # it for them. + galsim.config.SetDefaultIndex(config, skycat.getNObjects()) + + req = {"field": str, "index": int} + opt = {"obs_kind": str} + params, safe = galsim.config.GetAllParams(config, base, req=req, opt=opt) + field = params["field"] + index = params["index"] + obs_kind = params.get("obs_kind", None) + + if field == "flux": + if obs_kind is None: + val = skycat.getFlux(index) + else: + pointing = galsim.config.GetInputObj("obseq_data", config, base, "OpSeqDataLoader") + filter = pointing.get("filter", obs_kind=obs_kind) + exptime = pointing.get("exptime", obs_kind=obs_kind) + mjd = pointing.get("mjd", obs_kind=obs_kind) + val = skycat.getFlux(index, filter=filter, exptime=exptime, mjd=mjd) + else: + val = skycat.getValue(index, field) + + return val, safe
+ + + + +RegisterInputType("sky_catalog", SkyCatalogLoader(SkyCatalogInterface, has_nobj=True)) +RegisterObjectType("SkyCatObj", SkyCatObj, input_type="sky_catalog") +RegisterValueType( + "SkyCatWorldPos", SkyCatWorldPos, [galsim.CelestialCoord], input_type="sky_catalog" +) + +# Here we have to provide None as a type otherwise Galsim complains but I don't know why.. +RegisterValueType( + "SkyCatValue", SkyCatValue, [float, int, str, None] # , input_type="sky_catalog" +) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/stamp.html b/docs/_build/html/_modules/euclidlike_imsim/stamp.html new file mode 100644 index 0000000..00c4a59 --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/stamp.html @@ -0,0 +1,454 @@ + + + + + + + euclidlike_imsim.stamp — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.stamp

+import numpy as np
+import galsim
+import euclidlike
+import galsim.config
+from galsim.config import RegisterStampType, StampBuilder
+# import os, psutil
+# process = psutil.Process()
+
+# Parameter below determines the flux at which we switch from using Euclid-like PSF to the bright star PSF
+# This is done to avoid visual artifacts from using the Euclid-like PSF for very bright objects.
+# Tests to determine this value can be found here: https://github.com/GalSim-developers/GalSim-Euclid-Like/issues/46
+psf_switch_limit = 8e5
+
+
+[docs] +class Euclidlike_stamp(StampBuilder): + """This performs the tasks necessary for building the stamp for a single object. + + It uses the regular Basic functions for most things. + It specializes the quickSkip, buildProfile, and draw methods. + """ + _trivial_sed = galsim.SED( + galsim.LookupTable( + [100, 2600], + [1, 1], + interpolant='linear' + ), + wave_type='nm', flux_type='fphotons' + ) + +
+[docs] + def setup(self, config, base, xsize, ysize, ignore, logger): + """ + Do the initialization and setup for building a postage stamp. + + In the base class, we check for and parse the appropriate size and position values in + config (aka base['stamp'] or base['image']. + + Values given in base['stamp'] take precedence if these are given in both places (which + would be confusing, so probably shouldn't do that, but there might be a use case where it + would make sense). + + Parameters: + config: The configuration dict for the stamp field. + base: The base configuration dict. + xsize: The xsize of the image to build (if known). + ysize: The ysize of the image to build (if known). + ignore: A list of parameters that are allowed to be in config that we can + ignore here. i.e. it won't be an error if these parameters are present. + logger: A logger object to log progress. + + Returns: + xsize, ysize, image_pos, world_pos + """ + # print('stamp setup',process.memory_info().rss) + + gal = galsim.config.BuildGSObject(base, 'gal', logger=logger)[0] + if gal is None: + raise galsim.config.SkipThisObject('gal is None (invalid parameters)') + base['object_type'] = gal.object_type + bandpass = base['bandpass'] + if not hasattr(gal, 'flux'): + # In this case, the object flux has not been precomputed + # or cached by the skyCatalogs code. + gal.flux = gal.calculateFlux(bandpass) + self.flux = gal.flux + # Cap (star) flux at 30M photons to avoid gross artifacts when trying to draw the Euclid PSF in finite time and memory + flux_cap = 3e7 + if self.flux > flux_cap: + if (hasattr(gal, 'original') and hasattr(gal.original, 'original') and isinstance(gal.original.original, galsim.DeltaFunction)) or (isinstance(gal, galsim.DeltaFunction)): + gal = gal.withFlux(flux_cap, bandpass) + self.flux = flux_cap + gal.flux = flux_cap + base['flux'] = gal.flux + base['mag'] = -2.5 * np.log10(gal.flux) + bandpass.zeropoint + # print('stamp setup2',process.memory_info().rss) + + # Compute or retrieve the realized flux. + self.rng = galsim.config.GetRNG(config, base, logger, "Euclidlike_stamp") + self.realized_flux = galsim.PoissonDeviate(self.rng, mean=self.flux)() + base['realized_flux'] = self.realized_flux + + # Check if the realized flux is 0. + if self.realized_flux == 0: + # If so, we'll skip everything after this. + # The mechanism within GalSim to do this is to raise a special SkipThisObject class. + raise galsim.config.SkipThisObject('realized flux=0') + + # Otherwise figure out the stamp size + if self.flux < 10: + # For really faint things, don't try too hard. Just use 32x32. + image_size = 32 + self.pupil_bin = 'achromatic' + + else: + gal_achrom = gal.evaluateAtWavelength(bandpass.effective_wavelength) + if (hasattr(gal_achrom, 'original') and isinstance(gal_achrom.original, galsim.DeltaFunction)): + # For bright stars, set the following stamp size limits + if self.flux < psf_switch_limit: + image_size = 500 + self.pupil_bin = 8 + elif self.flux < 6e6: + image_size = 1000 + self.pupil_bin = 4 + else: + image_size = 1600 + self.pupil_bin = 2 + else: + self.pupil_bin = 8 + # # Get storead achromatic PSF + # psf = galsim.config.BuildGSObject(base, 'psf', logger=logger)[0]['achromatic'] + # obj = galsim.Convolve(gal_achrom, psf).withFlux(self.flux) + obj = gal_achrom.withGSParams(galsim.GSParams(stepk_minimum_hlr=20)) + image_size = obj.getGoodImageSize(euclidlike.pixel_scale) + + # print('stamp setup3',process.memory_info().rss) + base['pupil_bin'] = self.pupil_bin + logger.info('Object flux is %d', self.flux) + logger.info('Object %d will use stamp size = %s', base.get('obj_num', 0), image_size) + + # Determine where this object is going to go: + # This is the same as what the base StampBuilder does: + if 'image_pos' in config: + image_pos = galsim.config.ParseValue(config, 'image_pos', base, galsim.PositionD)[0] + else: + image_pos = None + + if 'world_pos' in config: + world_pos = galsim.config.ParseWorldPos(config, 'world_pos', base, logger) + else: + world_pos = None + + return image_size, image_size, image_pos, world_pos
+ + +
+[docs] + def buildPSF(self, config, base, gsparams, logger): + """Build the PSF object. + + For the Basic stamp type, this builds a PSF from the base['psf'] dict, if present, + else returns None. + + Parameters: + config: The configuration dict for the stamp field. + base: The base configuration dict. + gsparams: A dict of kwargs to use for a GSParams. More may be added to this + list by the galaxy object. + logger: A logger object to log progress. + + Returns: + the PSF + """ + if base.get('psf', {}).get('type', 'euclidlike_psf') != 'euclidlike_psf': + return galsim.config.BuildGSObject(base, 'psf', gsparams=gsparams, logger=logger)[0] + + euclidlike_psf = galsim.config.GetInputObj('euclidlike_psf', config, base, 'buildPSF') + psf = euclidlike_psf.getPSF(self.pupil_bin, base['image_pos']) + return psf
+ + +
+[docs] + def getDrawMethod(self, config, base, logger): + """Determine the draw method to use. + + @param config The configuration dict for the stamp field. + @param base The base configuration dict. + @param logger A logger object to log progress. + + @returns method + """ + method = galsim.config.ParseValue(config,'draw_method',base,str)[0] + if method not in galsim.config.valid_draw_methods: + raise galsim.GalSimConfigValueError("Invalid draw_method.", method, + galsim.config.valid_draw_methods) + if method == 'auto': + if self.pupil_bin in [4,2]: + logger.info('Auto -> Use FFT drawing for object %d.',base['obj_num']) + return 'fft' + else: + logger.info('Auto -> Use photon shooting for object %d.',base['obj_num']) + return 'phot' + else: + # If user sets something specific for the method, rather than auto, + # then respect their wishes. + logger.info('Use specified method=%s for object %d.',method,base['obj_num']) + return method
+ + +
+[docs] + @classmethod + def fix_seds(cls, prof, bandpass): + # If any SEDs are not currently using a LookupTable for the function or if they are + # using spline interpolation, then the codepath is quite slow. + # Better to fix them before doing WavelengthSampler. + + if (isinstance(prof, galsim.SimpleChromaticTransformation) and + (not isinstance(prof._flux_ratio._spec, galsim.LookupTable) + or prof._flux_ratio._spec.interpolant != 'linear')): + original = prof._original + sed = prof._flux_ratio + wave_list, _, _ = galsim.utilities.combine_wave_list(sed, bandpass) + f = np.broadcast_to(sed(wave_list), wave_list.shape) + new_spec = galsim.LookupTable(wave_list, f, interpolant='linear') + new_sed = galsim.SED( + new_spec, + 'nm', + 'fphotons' if sed.spectral else '1' + ) + prof._flux_ratio = new_sed + + # Also recurse onto any components. + if isinstance(prof, galsim.ChromaticObject): + if hasattr(prof, 'obj_list'): + for obj in prof.obj_list: + cls.fix_seds(obj, bandpass) + if hasattr(prof, 'original'): + cls.fix_seds(prof.original, bandpass)
+ + +
+[docs] + def draw(self, prof, image, method, offset, config, base, logger): + """Draw the profile on the postage stamp image. + + Parameters: + prof: The profile to draw. + image: The image onto which to draw the profile (which may be None). + method: The method to use in drawImage. + offset: The offset to apply when drawing. + config: The configuration dict for the stamp field. + base: The base configuration dict. + logger: A logger object to log progress. + + Returns: + the resulting image + """ + if prof is None: + # If was decide to do any rejection steps, this could be set to None, in which case, + # don't draw anything. + return image + + # Prof is normally a convolution here with obj_list being [gal, psf1, psf2,...] + # for some number of component PSFs. + # print('stamp draw',process.memory_info().rss) + + gal, *psfs = prof.obj_list if hasattr(prof, 'obj_list') else [prof] + + faint = self.flux < 40 + bandpass = base['bandpass'] + if faint: + logger.info("Flux = %.0f Using trivial sed", self.flux) + else: + self.fix_seds(gal, bandpass) + + image.wcs = base['wcs'] + + # Set limit on the size of photons batches to consider when + # calling gsobject.drawImage. + maxN = int(1e6) + if 'maxN' in config: + maxN = galsim.config.ParseValue(config, 'maxN', base, int)[0] + # print('stamp draw2',process.memory_info().rss) + + if method == 'fft': + fft_image = image.copy() + fft_offset = offset + kwargs = dict( + method='fft', + offset=fft_offset, + image=fft_image, + ) + if not faint and config.get('fft_photon_ops'): + kwargs.update({ + "photon_ops": galsim.config.BuildPhotonOps(config, 'fft_photon_ops', base, logger), + "maxN": maxN, + "rng": self.rng, + "n_subsample": 1, + }) + + # Go back to a combined convolution for fft drawing. + gal = gal.withFlux(self.flux, bandpass) + prof = galsim.Convolve([gal] + psfs) + try: + prof.drawImage(bandpass, **kwargs) + except galsim.errors.GalSimFFTSizeError as e: + # I think this shouldn't happen with the updates I made to how the image size + # is calculated, even for extremely bright things. So it should be ok to + # just report what happened, give some extra information to diagonose the problem + # and raise the error. + logger.error('Caught error trying to draw using FFT:') + logger.error('%s', e) + logger.error('You may need to add a gsparams field with maximum_fft_size to') + logger.error('either the psf or gal field to allow larger FFTs.') + logger.info('prof = %r', prof) + logger.info('fft_image = %s', fft_image) + logger.info('offset = %r', offset) + logger.info('wcs = %r', image.wcs) + raise + # Some pixels can end up negative from FFT numerics. Just set them to 0. + fft_image.array[fft_image.array < 0] = 0. + fft_image.addNoise(galsim.PoissonNoise(rng=self.rng)) + # In case we had to make a bigger image, just copy the part we need. + image += fft_image[image.bounds] + + else: + # We already calculated realized_flux above. Use that now and tell GalSim not + # recalculate the Poisson realization of the flux. + gal = gal.withFlux(self.realized_flux, bandpass) + # print('stamp draw3b ',process.memory_info().rss) + + if not faint and 'photon_ops' in config: + photon_ops = galsim.config.BuildPhotonOps(config, 'photon_ops', base, logger) + else: + photon_ops = [] + + # Put the psfs at the start of the photon_ops. + # Probably a little better to put them a bit later than the start in some cases + # (e.g. after TimeSampler, PupilAnnulusSampler), but leave that as a todo for now. + photon_ops = psfs + photon_ops + + # prof = galsim.Convolve([gal] + psfs) + + # print('-------- gal ----------',gal) + # print('-------- psf ----------',psfs) + + # print('stamp draw3a',process.memory_info().rss) + gal.drawImage(bandpass, + method='phot', + offset=offset, + rng=self.rng, + maxN=maxN, + n_photons=self.realized_flux, + image=image, + photon_ops=photon_ops, + sensor=None, + add_to_image=True, + poisson_flux=False) + # print('stamp draw3',process.memory_info().rss) + + return image
+
+ + + +# Register this as a valid type +RegisterStampType('Euclidlike_stamp', Euclidlike_stamp()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/utils.html b/docs/_build/html/_modules/euclidlike_imsim/utils.html new file mode 100644 index 0000000..dfadbec --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/utils.html @@ -0,0 +1,250 @@ + + + + + + + euclidlike_imsim.utils — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.utils

+import numpy as np
+import galsim
+import galsim.config
+import galsim.roman as roman
+
+
+[docs] +class roman_utils(object): + """ + Class to contain a variety of helper routines to work with the simulation data. + """ + def __init__(self, config_file,visit=None,sca=None,image_name=None,setup_skycat=False): + """ + Setup information about a simulated Roman image. + Parameters: + config_file: the GalSim config file that produced the simulation + visit: the visit (observation sequence) number of the pointing + sca: the SCA number + image_name: the filename of the image (can be used instead of visit, sca) + setup_skycat: setup the skycatalog information to have access to + """ + config = galsim.config.ReadConfig(config_file)[0] + + self.visit,self.sca = self.check_input(visit,sca,image_name) + + if not setup_skycat: + del config['input']['sky_catalog'] + config['input']['obseq_data']['visit'] = self.visit + config['image']['SCA'] = self.sca + galsim.config.ProcessInput(config) + if setup_skycat: + self.skycat = galsim.config.GetInputObj('sky_catalog',config['input']['sky_catalog'],config,'sky_catalog') + self.PSF = galsim.config.GetInputObj('roman_psf',config['input']['roman_psf'],config,'roman_psf') + self.wcs = galsim.config.BuildWCS(config['image'], 'wcs', config) + self.bpass = galsim.config.BuildBandpass(config['image'], 'bandpass', config, None)[0] + self.photon_ops = galsim.config.BuildPhotonOps(config['stamp'], 'photon_ops', config, None) + self.rng = galsim.config.GetRNG(config, config['image'], None, "psf_image") + +
+[docs] + def check_input(self,visit,sca,image_name): + if image_name is not None: + print('Inferring visit and sca from image_name.') + start = 21 + end = -5 + if 'simple_model' in image_name: + start = 28 + if 'gz' in image_name: + end = -8 + tmp = np.array(image_name[start:end].split('_')).astype(int) + return tmp[0],tmp[1] + if (visit is None) | (sca is None): + raise ValueError('Insufficient information to construct visit info - all inputs are None.') + return visit,sca
+ + +
+[docs] + def getPSF(self,x=None,y=None,pupil_bin=8): + """ + Return Roman PSF for some image position. + Parameters: + x: x-position in SCA + y: y-position in SCA + pupil_bin: pupil image binning factor + Returns: + the chromatic GalSim PSF model object (does not include additional effects like charge diffusion!) + """ + if pupil_bin!=8: + if (x is not None)|(y is not None): + raise ValueError('x,y position for pupil_bin values other than 8 not supported. Using SCA center.') + return self.PSF.getPSF(pupil_bin,galsim.PositionD(roman.n_pix/2,roman.n_pix/2)) + if (x is None) | (y is None): + return self.PSF.getPSF(8,galsim.PositionD(roman.n_pix/2,roman.n_pix/2)) + return self.PSF.getPSF(8,galsim.PositionD(x,y))
+ + +
+[docs] + def getWCS(self): + """ + Return Roman WCS for image + """ + return self.wcs
+ + +
+[docs] + def getLocalWCS(self,x,y): + """ + Return Roman WCS for image + """ + return self.wcs.local(galsim.PositionD(x,y))
+ + +
+[docs] + def getBandpass(self): + """ + Return Roman bandpass for image + """ + return self.bpass
+ + +
+[docs] + def getPSF_Image(self,stamp_size,x=None,y=None,pupil_bin=8,sed=None, + oversampling_factor=1,include_photonOps=False,n_phot=1e6): + """ + Return a Roman PSF image for some image position + Parameters: + stamp_size: size of output PSF model stamp in native roman pixel_scale (oversampling_factor=1) + x: x-position in SCA + y: y-position in SCA + pupil_bin: pupil image binning factor + sed: SED to be used to draw the PSF - default is a flat SED. + oversampling_factor: factor by which to oversample native roman pixel_scale + include_photonOps: include additional contributions from other photon operators in effective psf image + Returns: + the PSF GalSim image object (use image.array to get a numpy array representation) + """ + if sed is None: + sed = galsim.SED(galsim.LookupTable([100, 2600], [1,1], interpolant='linear'), + wave_type='nm', flux_type='fphotons') + point = galsim.DeltaFunction()*sed + point = point.withFlux(1,self.bpass) + local_wcs = self.getLocalWCS(x,y) + wcs = galsim.JacobianWCS(dudx=local_wcs.dudx/oversampling_factor, + dudy=local_wcs.dudy/oversampling_factor, + dvdx=local_wcs.dvdx/oversampling_factor, + dvdy=local_wcs.dvdy/oversampling_factor) + stamp = galsim.Image(stamp_size*oversampling_factor,stamp_size*oversampling_factor,wcs=wcs) + if not include_photonOps: + psf = galsim.Convolve(point, self.getPSF(x,y,pupil_bin)) + return psf.drawImage(self.bpass,image=stamp,wcs=wcs,method='no_pixel') + photon_ops = [self.getPSF(x,y,pupil_bin)] + self.photon_ops + return point.drawImage(self.bpass, + method='phot', + rng=self.rng, + maxN=1e6, + n_photons=1e6, + image=stamp, + photon_ops=photon_ops, + poisson_flux=False)
+
+ +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/euclidlike_imsim/wcs.html b/docs/_build/html/_modules/euclidlike_imsim/wcs.html new file mode 100644 index 0000000..9c8bdad --- /dev/null +++ b/docs/_build/html/_modules/euclidlike_imsim/wcs.html @@ -0,0 +1,169 @@ + + + + + + + euclidlike_imsim.wcs — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Source code for euclidlike_imsim.wcs

+from astropy.time import Time
+import galsim
+import euclidlike
+from galsim.config import WCSBuilder, RegisterWCSType
+from galsim.angle import Angle
+from galsim.celestial import CelestialCoord
+
+
+
+[docs] +class EuclidlikeWCS(WCSBuilder): + +
+[docs] + def buildWCS(self, config, base, logger): + + req = { + "CCD": int, + "ra": Angle, + "dec": Angle, + "pa": Angle, + "mjd": float, + } + opt = { + "saa": Angle, + "min_sun_angle": float, + "max_sun_angle": float, + "force_cvz": bool, + } + + kwargs, safe = galsim.config.GetAllParams( + config, + base, + req=req, + opt=opt, + ) + if "min_sun_angle" in kwargs: + euclidlike.instrument_params.min_sun_angle = \ + kwargs["min_sun_angle"] * galsim.degrees + euclidlike.euclidlike_wcs.min_sun_angle = \ + kwargs["min_sun_angle"] * galsim.degrees + if "max_sun_angle" in kwargs: + euclidlike.instrument_params.max_sun_angle = \ + kwargs["max_sun_angle"] * galsim.degrees + euclidlike.euclidlike_wcs.max_sun_angle = \ + kwargs["max_sun_angle"] * galsim.degrees + if "saa" in kwargs: + SAA = kwargs["saa"] + else: + SAA = None + pointing = CelestialCoord(ra=kwargs["ra"], dec=kwargs["dec"]) + wcs = euclidlike.getWCS( + world_pos=pointing, + PA=kwargs["pa"], + date=Time(kwargs["mjd"], format="mjd").datetime, + CCDs=kwargs["CCD"], + PA_is_FPA=True, + SAA=SAA, + )[kwargs["CCD"]] + return wcs
+
+ + + +RegisterWCSType("EuclidlikeWCS", EuclidlikeWCS()) +
+ +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html index 4b0a73d..5eea8e7 100644 --- a/docs/_build/html/_modules/index.html +++ b/docs/_build/html/_modules/index.html @@ -35,6 +35,18 @@

All modules for which code is available

  • euclidlike.bandpass
  • euclidlike.euclidlike_psf
  • euclidlike.euclidlike_wcs
  • +
  • euclidlike_imsim.bandpass
  • +
  • euclidlike_imsim.ccd
  • +
  • euclidlike_imsim.noise
  • +
  • euclidlike_imsim.obseq
  • +
  • euclidlike_imsim.photonOps
  • +
  • euclidlike_imsim.psf
  • +
  • euclidlike_imsim.skycat
  • +
  • euclidlike_imsim.stamp
  • +
  • euclidlike_imsim.utils
  • +
  • euclidlike_imsim.wcs
  • +
  • scripts.download_psf
  • +
  • scripts.make_euclidlike_pupil_plane
  • @@ -62,6 +74,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/_modules/scripts/download_psf.html b/docs/_build/html/_modules/scripts/download_psf.html new file mode 100644 index 0000000..f4f4a05 --- /dev/null +++ b/docs/_build/html/_modules/scripts/download_psf.html @@ -0,0 +1,619 @@ + + + + + + + scripts.download_psf — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +

    Source code for scripts.download_psf

    +
    +"""
    +A program to download the Euclid-like PSF sampled across the focal plane for discrete wavelengths.
    +The code below was adapted from: https://github.com/GalSim-developers/GalSim/blob/releases/2.5/galsim/download_cosmos.py
    +"""
    +
    +import os, sys, zipfile, subprocess, shutil, json
    +import argparse
    +import logging
    +from urllib.request import urlopen
    +
    +from galsim._version import __version__ as version
    +#from .meta_data import share_dir
    +from galsim.utilities import ensure_dir
    +from galsim.main import make_logger
    +
    +script_name = 'euclidlike_download_psf'
    +script_dir = os.path.dirname(__file__)
    +share_dir = os.path.join(script_dir, '..', 'euclidlike', 'data')
    +
    +
    +[docs] +def parse_args(command_args): + """Handle the command line arguments using either argparse (if available) or optparse. + """ + # Another potential option we might want to add is to download the smaller training sample + # rather than the full 4 GB file. Right now, this just downloads the larger catalog. + + # Short description strings common to both parsing mechanisms + description = "This program will download the Euclid-like PSF \n" + description += "and place them in the GalSim-Euclid-Like data directory so they can be used as\n " + description += "the default files for the euclid-like PSF.\n" + description += "See https://github.com/GalSim-developers/GalSim-Euclid-Like/wiki/Euclid-Like-PSF\n" + description += "for more details about the files being downloaded." + epilog = "Note: The unpacked files total almost 4 GB in size!\n" + + # Build the parser and add arguments + parser = argparse.ArgumentParser(description=description, epilog=epilog, add_help=True) + parser.add_argument( + '-v', '--verbosity', type=int, action='store', default=2, choices=(0, 1, 2, 3), + help='Integer verbosity level: min=0, max=3 [default=2]') + parser.add_argument( + '-f', '--force', action='store_const', default=False, const=True, + help='Force overwriting the current file if one exists') + parser.add_argument( + '-q', '--quiet', action='store_const', default=False, const=True, + help="Don't ask about re-downloading an existing file. (implied by verbosity=0)") + parser.add_argument( + '-u', '--unpack', action='store_const', default=False, const=True, + help='Re-unpack the tar file if not downloading') + parser.add_argument( + '--save', action='store_const', default=False, const=True, + help="Save the tarball after unpacking.") + parser.add_argument( + '-d', '--dir', action='store', default=None, + help="Install into an alternate directory and link from the euclidlike/data directory") + parser.add_argument( + '--nolink', action='store_const', default=False, const=True, + help="Don't link to the alternate directory from euclidlike/data") + args = parser.parse_args(command_args) + args.log_file = None + args.log_format = None + + # Return the args + return args
    + + +
    +[docs] +def get_input(): # pragma: no cover + # A level of indirection to make it easier to test functions using input. + # This one isn't covered, since we always mock it. + return input()
    + + +# Based on recipe 577058: http://code.activestate.com/recipes/577058/ +
    +[docs] +def query_yes_no(question, default="yes"): + """Ask a yes/no question via input() and return their answer. + + "question" is a string that is presented to the user. + "default" is the presumed answer if the user just hits <Enter>. + It must be "yes" (the default), "no" or None (meaning + an answer is required of the user). + + The "answer" return value is one of "yes" or "no". + """ + valid = {"yes":"yes", "y":"yes", "ye":"yes", + "no":"no", "n":"no"} + if default == None: + prompt = " [y/n] " + elif default == "yes": + prompt = " [Y/n] " + elif default == "no": + prompt = " [y/N] " + else: + raise ValueError("invalid default answer: '%s'" % default) + + while 1: + sys.stdout.write(question + prompt) + choice = get_input().lower() + if default is not None and choice == '': + choice = default + break + elif choice in valid.keys(): + break + else: + sys.stdout.write("Please respond with 'yes' or 'no' "\ + "(or 'y' or 'n').\n") + return valid[choice]
    + + + +
    +[docs] +def get_names(args, logger): + if args.dir is not None: + target_dir = os.path.expanduser(args.dir) + do_link = not args.nolink + else: + target_dir = share_dir + do_link = False + + url ='https://cosmo.vera.psc.edu/Euclid-like-PSFs/monopsfs_euclidlike.zip' + file_name = os.path.basename(url) + target = os.path.join(target_dir, file_name) + link_dir = os.path.join(share_dir, file_name)[:-len('.zip')] + unpack_dir = target[:-len('.zip')] + logger.warning('Downloading from url:\n %s',url) + logger.warning('Target location is:\n %s',target) + target_dir = unpack_dir + + return url, target, target_dir, link_dir, unpack_dir, do_link
    + + + + +
    +[docs] +def get_meta(url, args, logger): + logger.info('') + + # See how large the file to be downloaded is. + u = urlopen(url) + meta = u.info() + logger.debug("Meta information about url:\n%s",str(meta)) + file_name = os.path.basename(url) + file_size = int(meta.get("Content-Length")) + logger.info("Size of %s: %d MBytes" , file_name, file_size/1024**2) + + return meta
    + + +
    +[docs] +def check_existing(target, unpack_dir, meta, args, logger): + # Make sure the directory we want to put this file exists. + ensure_dir(target) + + do_download = True + # If file already exists + if os.path.isfile(target): + file_size = int(meta.get("Content-Length")) + logger.info("") + existing_file_size = os.path.getsize(target) + if args.force: + logger.info("Target file already exists. Size = %d MBytes. Forced re-download.", + existing_file_size/1024**2) + elif file_size == existing_file_size: + if args.quiet: + logger.info("Target file already exists. Not re-downloading.") + do_download = False + else: + q = "Target file already exists. Overwrite?" + yn = query_yes_no(q, default='no') + if yn == 'no': + do_download = False + else: + logger.warning("Target file already exists, but it seems to be either incomplete, " + "corrupt, or obsolete") + if args.quiet: + logger.info("Size of existing file = %d MBytes. Re-downloading.", + existing_file_size/1024**2) + else: + q = "Size of existing file = %d MBytes. Re-download?"%(existing_file_size/1024**2) + yn = query_yes_no(q, default='yes') + if yn == 'no': + do_download = False + elif unpack_dir is not None and os.path.isdir(unpack_dir): + logger.info("") + + # Check that this is the current version. + meta_file = os.path.join(unpack_dir, 'meta.json') + logger.debug('meta_file = %s',meta_file) + if os.path.isfile(meta_file): + logger.debug('meta_file exists') + with open(meta_file) as fp: + saved_meta_dict = json.load(fp) + # Get rid of the unicode + saved_meta_dict = dict([ (str(k),str(v)) for k,v in saved_meta_dict.items()]) + saved_meta_dict = {k.lower():v for k,v in saved_meta_dict.items()} + logger.debug("current meta information is %s",saved_meta_dict) + meta_dict = dict(meta) + meta_dict = {k.lower():v for k,v in meta_dict.items()} + logger.debug("url's meta information is %s",meta_dict) + + # There are several checksum tags. If any of them are present and match, + # then file is current. If they don't match, file is obsolete. + # If none are present, then they changed something, so do a longer check. + # (And try to get around to updating this list of checksum keys.) + checksum_keys = ['oc-checksum', 'content-md5', 'etag'] + obsolete = None + for k in checksum_keys: + if k in saved_meta_dict and k in meta_dict: + if saved_meta_dict[k] == meta_dict[k]: + logger.info("Checksum key %s matches. File is up to date."%k) + obsolete = False + else: + logger.info("Checksum key %s doesn't matches. File is obsolete."%k) + obsolete = True + break + + if obsolete is None: + # Check all meta data. If it all matches, then it's fine. + # Otherwise, the file is obsolete. + obsolete = False + for k in meta_dict: + # Skip some keys that don't imply obselescence. + if k.startswith('x-') or k.startswith('retry') or k.startswith('set-cookie'): + continue + if k == 'date' or k == 'last-modified' or k == 'server': + continue + # Others that are missing or different imply obsolete + if k not in saved_meta_dict: + logger.debug("key %s is missing in saved meta information",k) + obsolete = True + elif meta_dict[k] != saved_meta_dict[k]: + logger.debug("key %s differs: %s != %s",k,meta_dict[k],saved_meta_dict[k]) + obsolete = True + else: + logger.debug("key %s matches",k) + else: + logger.debug('meta_file does not exist') + obsolete = True + + if obsolete: + if args.quiet or args.force: + logger.warning("The version currently on disk is obsolete. " + "Downloading new version.") + else: + q = "The version currently on disk is obsolete. Download new version?" + yn = query_yes_no(q, default='yes') + if yn == 'no': + do_download = False + elif args.force: + logger.info("Target file has already been downloaded and unpacked. " + "Forced re-download.") + elif args.quiet: + logger.info("Target file has already been downloaded and unpacked. " + "Not re-downloading.") + args.save = True # Don't delete it! + do_download = False + else: + q = "Target file has already been downloaded and unpacked. Re-download?" + yn = query_yes_no(q, default='no') + if yn == 'no': + args.save = True + do_download = False + return do_download
    + + +
    +[docs] +def download(do_download, url, target, meta, args, logger): + if not do_download: return + logger.info("") + u = urlopen(url) + # This bit is based on one of the answers here: (by PabloG) + # http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python + # The progress feature in that answer is important here, since downloading such a large file + # will take a while. + file_size = int(meta.get("Content-Length")) + try: + with open(target, 'wb') as f: + file_size_dl = 0 + block_sz = 32 * 1024 + next_dot = file_size/100. # For verbosity==1, the next size for writing a dot. + while True: + buffer = u.read(block_sz) + if not buffer: + break + + file_size_dl += len(buffer) + f.write(buffer) + + # Status bar + if args.verbosity >= 2: + status = r"Downloading: %5d / %d MBytes [%3.2f%%]" % ( + file_size_dl/1024**2, file_size/1024**2, file_size_dl*100./file_size) + status = status + '\b'*len(status) + sys.stdout.write(status) + sys.stdout.flush() + elif args.verbosity >= 1 and file_size_dl > next_dot: + sys.stdout.write('.') + sys.stdout.flush() + next_dot += file_size/100. + logger.info("Download complete.") + logger.info("") + except OSError as e: + # Try to give a reasonable suggestion for some common OSErrors. + logger.error("\n\nOSError: %s",str(e)) + if 'Permission denied' in str(e): + logger.error("Rerun using sudo %s",script_name) + logger.error("If this is not possible, you can download to an alternate location:") + logger.error(" %s -d dir_name --nolink\n",script_name) + elif 'Disk quota' in str(e) or 'No space' in str(e): + logger.error("You might need to download this in an alternate location and link:") + logger.error(" %s -d dir_name\n",script_name) + raise
    + + +
    +[docs] +def check_unpack(do_download, unpack_dir, target, args): + # Usually we unpack if we downloaded the tarball or if specified by the command line option. + do_unpack = do_download or args.unpack + + # If the unpack dir is missing, then need to unpack + if not os.path.exists(unpack_dir): + do_unpack = True + + # But of course if there is no tarball, we can't unpack it + if not os.path.isfile(target): + do_unpack = False + + # If we have a downloaded tar file, ask if it should be re-unpacked. + if not do_unpack and not args.quiet and os.path.isfile(target): + q = "Zip file is already unpacked. Re-unpack?" + yn = query_yes_no(q, default='no') + if yn == 'yes': + do_unpack=True + return do_unpack
    + + +
    +[docs] +def unpack(do_unpack, target, target_dir, unpack_dir, meta, args, logger): + if not do_unpack: return + logger.info("Unpacking the zip file...") + with zipfile.ZipFile(target, 'r') as zip_ref: + if args.verbosity >= 3: + zip_ref.printdir() + elif args.verbosity >= 2: + zip_ref.printdir() + + def is_within_directory(directory, target): + abs_directory = os.path.abspath(directory) + abs_target = os.path.abspath(target) + prefix = os.path.commonprefix([abs_directory, abs_target]) + return prefix == abs_directory + + def safe_extract(zip_ref, path=".", members=None): + # This is somewhat gratuitous for our use case, since we directly control the zip file, + # but it's a good practice to avoid security vulnerabilities. + members = [] + for member in zip_ref.namelist(): + if member != 'VIS_response.fits.gz': # not interested in downloading this file + members.append(member) + member_path = os.path.join(path, member) + if not is_within_directory(path, member_path): # pragma: no cover + raise Exception("Attempted Path Traversal in Zip File") + + zip_ref.extractall(path, members) + + safe_extract(zip_ref, target_dir) + + # Write the meta information to a file, meta.json to mark what version this all is. + meta_file = os.path.join(unpack_dir, 'meta.json') + with open(meta_file, 'w') as fp: + json.dump(dict(meta), fp) + + logger.info("Extracted contents of zip file.") + logger.info("")
    + + + +
    +[docs] +def check_remove(do_unpack, target, args): + # Usually, we remove the tarball if we unpacked it and command line doesn't specify to save it. + do_remove = do_unpack and not args.save + + # But if we didn't unpack it, and they didn't say to save it, ask if we should remove it. + if os.path.isfile(target) and not do_remove and not args.save and not args.quiet: + q = "Remove the zipfile?" + yn = query_yes_no(q, default='no') + if yn == 'yes': + do_remove = True + return do_remove
    + + +
    +[docs] +def remove_tarball(do_remove, target, logger): + if do_remove: + logger.info("Removing the zipfile to save space") + os.remove(target)
    + + + + + + +
    +[docs] +def download_psf(args, logger): + """The main script given the ArgParsed args and a logger + """ + # Give diagnostic about GalSim version + logger.debug("GalSim version: %s",version) + logger.debug("This download script is: %s",__file__) + logger.info("Type %s -h to see command line options.\n",script_name) + + # Some definitions: + # share_dir is the base galsim share directory, e.g. /usr/local/share/galsim/ + # url is the url from which we will download the tarball. + # target is the full path of the downloaded tarball + # target_dir is where we will put the downloaded file, usually == share_dir. + # link_dir is the directory where this would normally have been unpacked. + # unpack_dir is the directory that the tarball will unpack into. + + # caution about storage and ask user if they want to proceed. + q = "You are about to download 4Gb, do you want to proceed?" + yn = query_yes_no(q, default='no') + if yn == 'no': + return + + url, target, target_dir, link_dir, unpack_dir, do_link = get_names(args, logger) + + meta = get_meta(url, args, logger) + + # Check if the file already exists and if it is the right size + do_download = check_existing(target, unpack_dir, meta, args, logger) + + # Download the tarball + download(do_download, url, target, meta, args, logger) + + # Unpack the tarball + do_unpack = check_unpack(do_download, unpack_dir, target, args) + unpack(do_unpack, target, target_dir, unpack_dir, meta, args, logger) + + # Remove the tarball + do_remove = check_remove(do_unpack, target, args) + remove_tarball(do_remove, target, logger) + + # If we are downloading to an alternate directory, we (usually) link to it from share/galsim + make_link(do_link, unpack_dir, link_dir, args, logger)
    + + +
    +[docs] +def main(command_args): + """The whole process given command-line parameters in their native (non-ArgParse) form. + """ + args = parse_args(command_args) + logger = make_logger(args) + download_psf(args, logger)
    + + +
    +[docs] +def run_main(): + """Kick off the process grabbing the command-line parameters from sys.argv + """ + main(sys.argv[1:])
    + +
    + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/scripts/make_euclidlike_pupil_plane.html b/docs/_build/html/_modules/scripts/make_euclidlike_pupil_plane.html new file mode 100644 index 0000000..39caf0c --- /dev/null +++ b/docs/_build/html/_modules/scripts/make_euclidlike_pupil_plane.html @@ -0,0 +1,295 @@ + + + + + + + scripts.make_euclidlike_pupil_plane — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +

    Source code for scripts.make_euclidlike_pupil_plane

    +"""
    +This code has been taken from https://github.com/CosmoStat/wf-psf Liaudat et al.
    +
    +This is an implementation of the function `generate_pupil_obscurations` https://github.com/CosmoStat/wf-psf/blob/87e0c8e9770199cd276f5f0551054cb4902d53bb/src/wf_psf/sims/SimPSFToolkit.py#L233
    +
    +NOTE from Tobias Liaudat:
    +"Simple procedure considering only the 2D plane.
    +No 3D projections wrt the angle of the FoV is done."
    +"""  # noqa
    +from argparse import ArgumentParser
    +import os
    +import importlib.util
    +from importlib.resources import files
    +
    +import numpy as np
    +from scipy.signal import convolve2d
    +
    +import galsim
    +
    +
    +# Telescope parameters
    +AS_diam = 1200  # Aperture stop diameter [mm]
    +M1_diam = 395  # Mirror 1 cap stopper diameter [mm]
    +
    +sp_lenght = 700  # Spider length [mm]
    +sp_width = 12  # Spider width [mm]
    +
    +AS_centre = [0, 0]
    +M1_centre = [0, 51]
    +
    +sp1_angle = 106.78 - 90  # [degrees]
    +sp2_angle = 50.11 - 90  # [degrees]
    +sp3_angle = -10.76 - 90  # [degrees]
    +
    +sp1_x_pos = 260  # [mm]
    +sp1_y_pos = 240  # [mm]
    +sp2_x_pos = -330  # [mm]
    +sp2_y_pos = 130  # [mm]
    +sp3_x_pos = 70  # [mm]
    +sp3_y_pos = -330  # [mm]
    +
    +
    +
    +[docs] +def make_EuclidLike_pupil_plane(N_pix=2048, do_filter=True, N_filter=3): + # Build pupil plane + pupil_plane = np.ones((N_pix, N_pix)) + + # coordinates of map in [mm] + W, H = np.meshgrid( + np.linspace(-AS_diam // 2, AS_diam // 2, N_pix), + np.linspace(-AS_diam // 2, AS_diam // 2, N_pix), + ) + + # Calculate the Aperture stop and draw it ### + aperture_stop_mask = np.sqrt( + (W - AS_centre[0]) ** 2 + (H - AS_centre[1]) ** 2 + ) <= (AS_diam / 2) + pupil_plane[~aperture_stop_mask] = 0 + + # Calculate the M1/M2 obscurations and draw them ### + M1_mask = np.sqrt((W - M1_centre[0]) ** 2 + (H - M1_centre[1]) ** 2) <= ( + M1_diam / 2 + ) + pupil_plane[M1_mask] = 0 + + # Calculate the spiders and draw them + # Spider 1 + sp1_a = np.tan(sp1_angle * (np.pi / 180)) + sp1_b = sp1_y_pos - sp1_a * sp1_x_pos + + sp1_mask_1 = sp1_a * W + sp1_b - sp_width / 2 * np.sqrt(1 + sp1_a**2) < H + sp1_mask_2 = sp1_a * W + sp1_b + sp_width / 2 * np.sqrt(1 + sp1_a**2) > H + sp1_mask = np.logical_and(sp1_mask_1, sp1_mask_2) + + sp1_length_mask = np.sqrt((W - sp1_x_pos) ** 2 + (H - sp1_y_pos) ** 2) <= ( + sp_lenght / 2 + ) + sp1_mask = np.logical_and(sp1_mask, sp1_length_mask) + + # Spider 2 + sp2_a = np.tan(sp2_angle * (np.pi / 180)) + sp2_b = sp2_y_pos - sp2_a * sp2_x_pos + + sp2_mask_1 = sp2_a * W + sp2_b - sp_width / 2 * np.sqrt(1 + sp2_a**2) < H + sp2_mask_2 = sp2_a * W + sp2_b + sp_width / 2 * np.sqrt(1 + sp2_a**2) > H + sp2_mask = np.logical_and(sp2_mask_1, sp2_mask_2) + + sp2_length_mask = np.sqrt((W - sp2_x_pos) ** 2 + (H - sp2_y_pos) ** 2) <= ( + sp_lenght / 2 + ) + sp2_mask = np.logical_and(sp2_mask, sp2_length_mask) + + # Spider 3 + sp3_a = np.tan(sp3_angle * (np.pi / 180)) + sp3_b = sp3_y_pos - sp3_a * sp3_x_pos + + sp3_mask_1 = sp3_a * W + sp3_b - sp_width / 2 * np.sqrt(1 + sp3_a**2) < H + sp3_mask_2 = sp3_a * W + sp3_b + sp_width / 2 * np.sqrt(1 + sp3_a**2) > H + sp3_mask = np.logical_and(sp3_mask_1, sp3_mask_2) + + sp3_length_mask = np.sqrt((W - sp3_x_pos) ** 2 + (H - sp3_y_pos) ** 2) <= ( + sp_lenght / 2 + ) + sp3_mask = np.logical_and(sp3_mask, sp3_length_mask) + + # Draw the three spider arms + pupil_plane[sp1_mask] = 0 + pupil_plane[sp2_mask] = 0 + pupil_plane[sp3_mask] = 0 + + # Low-pass filter the image + if do_filter: + top_hat_filter = np.ones((N_filter, N_filter)) + + pupil_plane = convolve2d( + pupil_plane, + top_hat_filter, + boundary="fill", + mode="same", + fillvalue=0, + ) + pupil_plane /= np.sum(top_hat_filter) + + # Get pupil scale + pupil_scale = AS_diam / N_pix + + return pupil_plane, pupil_scale
    + + + +if __name__ == "__main__": + parser = ArgumentParser() + parser.add_argument( + "-o", + "--output", + dest="output_path", + help="Path where to save the pupil plane. Default to the euclidlike" + " data directory if it exist.", + type=str, + ) + parser.add_argument( + "-N", + "--N_pix", + dest="Npix", + help="N pixels used to save the pupil plane. [Default: 2048]", + type=int, + default=2048, + ) + parser.add_argument( + "-filter", + "--do_filter", + dest="DoFilter", + help="Wether to apply a Top-Hat filter. [Default: True]", + type=bool, + default=True, + ) + parser.add_argument( + "-Nf", + "--N_filter", + dest="Nfilter", + help="N pixels used for the Top-Hat filter. [Default: 3]", + type=int, + default=3, + ) + + args = parser.parse_args() + + # Deal with the output + if args.output_path is None: + if importlib.util.find_spec("euclidlike") is None: + raise ValueError( + "No output path provided and euclidlike not found." + " Please provide an output path." + ) + output_path = str( + files("euclidlike.data").joinpath("euclid_pupil_plane.fits.gz") + ) + else: + output_path = os.path.abspath(args.output_path) + + pupil_plane, pupil_scale = make_EuclidLike_pupil_plane( + args.Npix, + args.DoFilter, + args.Nfilter, + ) + + # Galsim need the pupil scale in m/pixel + pupil_img = galsim.Image(pupil_plane, scale=pupil_scale / 1000) + pupil_img.write(output_path) + print(f"Pupil plane saved at: {output_path}") +
    + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_sources/euclidlike.rst.txt b/docs/_build/html/_sources/euclidlike.rst.txt index c09a526..d4f2d47 100644 --- a/docs/_build/html/_sources/euclidlike.rst.txt +++ b/docs/_build/html/_sources/euclidlike.rst.txt @@ -1,53 +1,153 @@ -euclidlike package -================== +The Euclid-like Module +################################ -Submodules ----------- +The ``euclidlike`` module contains telescope information and functionality needed for image simulations. +The demo script end_to_end_demo.py shows how to use many of the atrributes and functions described here. -euclidlike.backgrounds module ------------------------------ -.. automodule:: euclidlike.backgrounds - :members: - :undoc-members: - :show-inheritance: +Module-level Attributes +======================= -euclidlike.bandpass module --------------------------- +There are several of attributes of the ``euclidlike`` module which define some numerical +parameters related to a Euclid-like geometry. Some of these parameters relate to the entire +wide-field imager. Others, especially the return values of the functions to get the +PSF and WCS, are specific to each CCD and therefore are indexed based on the detector number. +All detector-related arrays are 0-indexed, which might differ from the CCD indices for Euclid, +which run 1-1 to n_row-n_col. -.. automodule:: euclidlike.bandpass - :members: - :undoc-members: - :show-inheritance: +gain + The gain for all CCDs is expected to be the roughly the same. -euclidlike.euclidlike\_psf module ---------------------------------- +pixel_scale + The pixel scale in units of arcsec/pixel. -.. automodule:: euclidlike.euclidlike_psf - :members: - :undoc-members: - :show-inheritance: +diameter + The telescope diameter in meters. -euclidlike.euclidlike\_wcs module ---------------------------------- +obscuration + The linear obscuration of the telescope, expressed as a fraction of the diameter. -.. automodule:: euclidlike.euclidlike_wcs - :members: - :undoc-members: - :show-inheritance: +collecting_area + The actual collecting area after accounting for obscuration, struts, etc. in + units of cm^2. -euclidlike.instrument\_params module ------------------------------------- +long_exptime + The typical exposure time for the longer exposures used for VIS images, in units of seconds. + The number that is stored is for a single dither. -.. automodule:: euclidlike.instrument_params - :members: - :undoc-members: - :show-inheritance: +short_exptime_nisp + The typical exposure time for the shorter NISP imaging exposures used for VIS images, in units of seconds. + The number that is stored is for a single dither. -Module contents ---------------- +short_exptime_vis + The typical exposure time for the shorter exposures with VIS taken in parallel with NISP imaging, in units of seconds. + The number that is stored is for a single dither. -.. automodule:: euclidlike - :members: - :undoc-members: - :show-inheritance: +n_dithers + The number of dithers per filter. + +n_ccd + The number of CCDs in the focal plane. + +n_ccd_row + The number of CCDs in the each focal plane row. + +n_ccd_col + The number of CCDs in the each focal plane column. + +n_pix_row + Each CCD has n_pix_row total pixels in each row. +n_pix_col + Each CCD has n_pix_col total pixels in each column. + +pixel_scale_mm + The physical pixel size, in units of mm. + +plate_scale + The plate scale, in units of arcsec / mm + +read_noise + Total readout noise, in units of e-. + +saturation + Pixel saturation, in units of e-. + +det2ccd + Mapping from DETID to CCDID. + +ccd2det + Mapping from CCDID to DETID. + +min_sun_angle + Minimum allowed angle from the telescope solar panels to the sun, in degrees. + +max_sun_angle + Maximum allowed angle from the telescope solar panels to the sun, in degrees. + +vis_bands + List of available VIS bands +nisp_bands + List of available NISP bands + +vis_blue_limit + Bandpass blue limit needed for consistency with the wavelength range covered by ur tabulated + PSF images, in nm. + +vis_red_limit + Bandpass red limit needed for consistency with the wavelength range covered by ur tabulated + PSF images, in nm. + +For example, to get the gain value, use euclidlike.gain. + +#.. automodule:: euclidlike.instrument_params +# :members: +# :undoc-members: + + +Euclid-like Functions +=============== + +This module also contains the following routines: + +`euclidlike.getBandpasses` + A utility to get a dictionary containing galsim.Bandpass objects for each of + the Euclid-like imaging bandpasses, which by default have AB zeropoints given using + the GalSim zeropoint convention (see `getBandpasses` docstring for more details). + +`euclidlike.getSkyLevel` + A utility to find the expected sky level due to zodiacal light at a given + position, in a given band. + +`euclidlike.getZodiBackground` + This helper routine is enables the calculation of the zodiacal light, in photons/m^2/arcsec^2/sec + +`euclidlike.getPSF` + A routine to get a chromatic representation of the PSF in a single CCD. + PSFs are based on precomputed, oversampled (by 3x) PSF images on a grid in wavelength and + focal plane position. + +`euclidlike.getBrightPSF` + Get a fake optical PSF for very bright objects. + +`euclidlike.getWCS` + This routine returns a dict containing a WCS for each of the Euclid CCDs. + +`euclidlike.findCCD` + This is a helper routine to calculate the minimum and maximum pixel values that should be + considered within a CCD. + + + +.. autofunction:: euclidlike.getBandpasses + +.. autofunction:: euclidlike.getSkyLevel + +.. autofunction:: euclidlike.getZodiBackground + +.. autofunction:: euclidlike.getPSF + +.. autofunction:: euclidlike.getBrightPSF + +.. autofunction:: euclidlike.getWCS + +.. autofunction:: euclidlike.findCCD diff --git a/docs/_build/html/_sources/euclidlike_imsim.rst.txt b/docs/_build/html/_sources/euclidlike_imsim.rst.txt index bc6626f..244a9b5 100644 --- a/docs/_build/html/_sources/euclidlike_imsim.rst.txt +++ b/docs/_build/html/_sources/euclidlike_imsim.rst.txt @@ -1,109 +1,64 @@ -euclidlike\_imsim package -========================= +The Euclid-like ImSim Module +################################ -Submodules ----------- +This module contains configuration scripts to produce large-scale Euclid-like simulation runs based on the information in ``euclidlike``. +It is based heavily on `roman_imsim `_. -euclidlike\_imsim.bandpass module ---------------------------------- +Classes and Functions +===================== .. automodule:: euclidlike_imsim.bandpass :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.ccd module ----------------------------- .. automodule:: euclidlike_imsim.ccd :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.detector\_physics module ------------------------------------------- .. automodule:: euclidlike_imsim.detector_physics :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.noise module ------------------------------- .. automodule:: euclidlike_imsim.noise :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.obseq module ------------------------------- .. automodule:: euclidlike_imsim.obseq :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.photonOps module ----------------------------------- .. automodule:: euclidlike_imsim.photonOps :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.psf module ----------------------------- .. automodule:: euclidlike_imsim.psf :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.scafile module --------------------------------- .. automodule:: euclidlike_imsim.scafile :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.skycat module -------------------------------- .. automodule:: euclidlike_imsim.skycat :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.stamp module ------------------------------- .. automodule:: euclidlike_imsim.stamp :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.utils module ------------------------------- .. automodule:: euclidlike_imsim.utils :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.wcs module ----------------------------- .. automodule:: euclidlike_imsim.wcs :members: :undoc-members: - :show-inheritance: -Module contents ---------------- -.. automodule:: euclidlike_imsim - :members: - :undoc-members: - :show-inheritance: +Use +==== +Example files needed for large-scale Euclid-like simulation runs are included in ``GalSim-Euclid-Like/config``. + +.. include:: ../config/README.rst + diff --git a/docs/_build/html/_sources/examples.rst.txt b/docs/_build/html/_sources/examples.rst.txt new file mode 100644 index 0000000..07f898e --- /dev/null +++ b/docs/_build/html/_sources/examples.rst.txt @@ -0,0 +1,29 @@ +Examples +========= + +The ``GalSim-Euclid-Like/examples`` directory contains example files for how use the euclidlike module. + +End-to-end demo +--------------- + +`end_to_end_demo.py.py <../examples/end_to_end_demo.py>`_ + +This first demo is the euclidlike-equivalent of `demo 13 `_ in ``GalSim``. This demo uses the Euclid-like PSF, WCS, and background noise to produce a realistic scene of galaxies and stars as observed from a Euclid-like Telescope. + +** Features introduced in the Python file**: + +- euclidlike.getBandpasses(AB_zeropoint) +- euclidlike.getWCS(world_pos, CCDs_CCD, date) +- euclidlike.getPSF(use_CCD, filter_name, wcs) +- euclidlike.getSkyLevel(bandpass, world_pos) + +The output generated from this file can be visualized by running the script `end_to_end_demo.py.py <../examples/end_to_end_demo.py>`_ + + +Focal Plane Layout +------------------ + +`plot_VIS.py <../examples/plot_VIS.py>`_ + +This Jupyter Notebook shows the display of the focal plane used in the euclidlike package, along with the CCD centers and ID convention. + diff --git a/docs/_build/html/_sources/history.rst.txt b/docs/_build/html/_sources/history.rst.txt new file mode 100644 index 0000000..d35e38d --- /dev/null +++ b/docs/_build/html/_sources/history.rst.txt @@ -0,0 +1,11 @@ +Revision History +################ + +.. include:: ../CHANGELOG.rst + + +Older Versions +============== + +.. toctree:: + older \ No newline at end of file diff --git a/docs/_build/html/_sources/index.rst.txt b/docs/_build/html/_sources/index.rst.txt index 55d881e..3f160f3 100644 --- a/docs/_build/html/_sources/index.rst.txt +++ b/docs/_build/html/_sources/index.rst.txt @@ -1,63 +1,24 @@ -GalSim-Euclid-Like -================== - -Helper functions to generate simulations of Euclid-like images using GalSim. - -This repository contains information about the Euclid space telescope and survey that is needed to -produce simulations using `GalSim `_. Some of the -information provided is approximate, aimed towards fast simulations rather than full accuracy in -representation of Euclid images. Places where the information is only approximate are flagged and -described in the docstring, and we particularly highlight that the PSF is only approximate; -for details, see the docstring of the ``getPSF()`` method. This library should enable generation of -Euclid-like images of sufficient fidelity for preliminary exploration of object detection, -photometry, deblending, and joint analysis with ground-based observatories. For -applications requiring high precision such as weak lensing, the higher fidelity simulations -available within the Euclid Consortium should be used. - -This repository includes two distinct packages: - -* ``euclidlike``: has basic observatory, instrumentation, and survey information for Euclid. - This package can be used on its own along with GalSim to produce Euclid-like simulations. - -* ``euclidlike_imsim``: has configuration scripts to produce large-scale Euclid-like simulation runs - based on the information in ``euclidlike``. It is based heavily on `roman_imsim `_. - - -References -================== +.. GalSim-Euclid-Like documentation master file + -For more information about `GalSim `_, please see its README and documentation. +GalSim-Euclid-Like: Euclid-like images using GalSim +============================================== -For more information about Euclid, please see the `Euclid Consortium website `_ and papers linked from there. +.. toctree:: + :maxdepth: 2 -Attribution for software and data used by particular routines in this library is given in the docstring for the relevant routine. + overview + install + euclidlike + euclidlike_imsim + examples + history -Installation -================== - -Please view the `installation instructions `_ for details on how to install GalSim-Euclid-Like. - -Downloading relevant data -================== -The Euclid-like PSF is constructed from precomputed oversampled images on a grid in focal plane position and wavelength. To use the full FOV PSF within GalSim-Euclid-Like, the images must be downloaded by running:: - - $ euclidlike_download_psf - -in the terminal after installation of GalSim-Euclid-Like. To install in an alternative directory to the default, use the ``--dir`` argument. Refer to the ``getPSF`` documentation for further details about the PSF. -Getting started -================== -Please see the examples/ directory for demos illustrating the use of this code. - -Communicating with the developers +Indices and tables ================== -Feel free to `open a GitHub issue `_ to reach the developers with questions, comments, and bug reports. New contributors are also welcome and can indicate their interest in developing this code base through the Issues. - -Attribution -================== - -This software is open source and may be used according to the terms of its `license `_. - -When using this software, please provide the URL to the repository in the resulting paper or note. Once there is a Zenodo DOI or journal article, this README will be updated and we will ask those using the code in their research to cite the relevant journal article. +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/_build/html/_sources/install.rst.txt b/docs/_build/html/_sources/install.rst.txt new file mode 100644 index 0000000..63b62ca --- /dev/null +++ b/docs/_build/html/_sources/install.rst.txt @@ -0,0 +1,4 @@ +Installation +######## + +.. include:: ../INSTALL.rst \ No newline at end of file diff --git a/docs/_build/html/_sources/modules.rst.txt b/docs/_build/html/_sources/modules.rst.txt index 269fdea..dc909a1 100644 --- a/docs/_build/html/_sources/modules.rst.txt +++ b/docs/_build/html/_sources/modules.rst.txt @@ -1,9 +1,6 @@ -GalSim-Euclid-Like -================== - .. toctree:: :maxdepth: 4 euclidlike euclidlike_imsim - scripts + scripts \ No newline at end of file diff --git a/docs/_build/html/_sources/overview.rst.txt b/docs/_build/html/_sources/overview.rst.txt new file mode 100644 index 0000000..803a9ee --- /dev/null +++ b/docs/_build/html/_sources/overview.rst.txt @@ -0,0 +1,4 @@ +Overview +######## + +.. include:: ../README.rst \ No newline at end of file diff --git a/docs/_build/html/_sources/scripts.rst.txt b/docs/_build/html/_sources/scripts.rst.txt index 28a2437..11b271d 100644 --- a/docs/_build/html/_sources/scripts.rst.txt +++ b/docs/_build/html/_sources/scripts.rst.txt @@ -1,6 +1,11 @@ scripts package =============== +.. automodule:: scripts + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- @@ -19,11 +24,3 @@ scripts.make\_euclidlike\_pupil\_plane module :members: :undoc-members: :show-inheritance: - -Module contents ---------------- - -.. automodule:: scripts - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_build/html/euclidlike.html b/docs/_build/html/euclidlike.html index ae374c6..f539977 100644 --- a/docs/_build/html/euclidlike.html +++ b/docs/_build/html/euclidlike.html @@ -5,7 +5,7 @@ - euclidlike package — GalSim-Euclid-Like 0.0.1 documentation + The Euclid-like Module — GalSim-Euclid-Like 0.0.1 documentation @@ -14,6 +14,8 @@ + + @@ -31,17 +33,142 @@
    -
    -

    euclidlike package

    -
    -

    Submodules

    +
    +

    The Euclid-like Module

    +

    The euclidlike module contains telescope information and functionality needed for image simulations. +The demo script end_to_end_demo.py shows how to use many of the atrributes and functions described here.

    +
    +

    Module-level Attributes

    +

    There are several of attributes of the euclidlike module which define some numerical +parameters related to a Euclid-like geometry. Some of these parameters relate to the entire +wide-field imager. Others, especially the return values of the functions to get the +PSF and WCS, are specific to each CCD and therefore are indexed based on the detector number. +All detector-related arrays are 0-indexed, which might differ from the CCD indices for Euclid, +which run 1-1 to n_row-n_col.

    +
    +
    gain

    The gain for all CCDs is expected to be the roughly the same.

    +
    +
    pixel_scale

    The pixel scale in units of arcsec/pixel.

    +
    +
    diameter

    The telescope diameter in meters.

    +
    +
    obscuration

    The linear obscuration of the telescope, expressed as a fraction of the diameter.

    +
    +
    collecting_area
    +
    The actual collecting area after accounting for obscuration, struts, etc. in

    units of cm^2.

    +
    +
    +
    +
    long_exptime

    The typical exposure time for the longer exposures used for VIS images, in units of seconds. +The number that is stored is for a single dither.

    +
    +
    short_exptime_nisp

    The typical exposure time for the shorter NISP imaging exposures used for VIS images, in units of seconds. +The number that is stored is for a single dither.

    +
    +
    short_exptime_vis

    The typical exposure time for the shorter exposures with VIS taken in parallel with NISP imaging, in units of seconds. +The number that is stored is for a single dither.

    +
    +
    n_dithers

    The number of dithers per filter.

    +
    +
    n_ccd

    The number of CCDs in the focal plane.

    +
    +
    n_ccd_row

    The number of CCDs in the each focal plane row.

    +
    +
    n_ccd_col

    The number of CCDs in the each focal plane column.

    +
    +
    n_pix_row

    Each CCD has n_pix_row total pixels in each row.

    +
    +
    n_pix_col

    Each CCD has n_pix_col total pixels in each column.

    +
    +
    pixel_scale_mm

    The physical pixel size, in units of mm.

    +
    +
    plate_scale

    The plate scale, in units of arcsec / mm

    +
    +
    read_noise

    Total readout noise, in units of e-.

    +
    +
    saturation

    Pixel saturation, in units of e-.

    +
    +
    det2ccd

    Mapping from DETID to CCDID.

    +
    +
    ccd2det

    Mapping from CCDID to DETID.

    +
    +
    min_sun_angle

    Minimum allowed angle from the telescope solar panels to the sun, in degrees.

    +
    +
    max_sun_angle

    Maximum allowed angle from the telescope solar panels to the sun, in degrees.

    +
    +
    vis_bands

    List of available VIS bands

    +
    +
    nisp_bands

    List of available NISP bands

    +
    +
    vis_blue_limit

    Bandpass blue limit needed for consistency with the wavelength range covered by ur tabulated +PSF images, in nm.

    +
    +
    vis_red_limit

    Bandpass red limit needed for consistency with the wavelength range covered by ur tabulated +PSF images, in nm.

    +
    +
    +

    For example, to get the gain value, use euclidlike.gain.

    +

    #.. automodule:: euclidlike.instrument_params +# :members: +# :undoc-members:

    -
    -

    euclidlike.backgrounds module

    -

    This file includes any routines needed to define the background level, for which the main contribution (currently the only one implemented) is zodiacal light.

    +
    +

    Euclid-like Functions

    +

    This module also contains the following routines:

    +
    +
    euclidlike.getBandpasses

    A utility to get a dictionary containing galsim.Bandpass objects for each of +the Euclid-like imaging bandpasses, which by default have AB zeropoints given using +the GalSim zeropoint convention (see getBandpasses docstring for more details).

    +
    +
    euclidlike.getSkyLevel

    A utility to find the expected sky level due to zodiacal light at a given +position, in a given band.

    +
    +
    euclidlike.getZodiBackground

    This helper routine is enables the calculation of the zodiacal light, in photons/m^2/arcsec^2/sec

    +
    +
    euclidlike.getPSF

    A routine to get a chromatic representation of the PSF in a single CCD. +PSFs are based on precomputed, oversampled (by 3x) PSF images on a grid in wavelength and +focal plane position.

    +
    +
    euclidlike.getBrightPSF

    Get a fake optical PSF for very bright objects.

    +
    +
    euclidlike.getWCS

    This routine returns a dict containing a WCS for each of the Euclid CCDs.

    +
    +
    euclidlike.findCCD

    This is a helper routine to calculate the minimum and maximum pixel values that should be +considered within a CCD.

    +
    +
    +
    +
    +euclidlike.getBandpasses(AB_zeropoint=True, default_thin_trunc=True, full_bandpass=False, **kwargs)[source]
    +

    Function to get the bandpass information for the Euclid VIS band and the three Euclid NISP passbands.

    +

    This routine reads in files containing a list of wavelengths and +transmission values for the Euclid bands. The files are located in the +euclidlike.data directory. The routine then creates a Bandpass object +using the LookupTable class from the GalSim package, and returns a dict with bandpasses for the +keys.

    +

    The bandpasses are publicly available from IPAC: +http://svo2.cab.inta-csic.es/svo/theory/fps3/index.php?mode=browse&gname=Euclid&gname2=VIS&asttype=. +https://euclid.esac.esa.int/msp/refdata/nisp/NISP-PHOTO-PASSBANDS-V1

    +

    These are relatively old files that do not include the latest estimates of system response. +They correspond to end-of-life estimates, with some expected degradation of the QE and filter +transmission over time. This can lead to flux estimates that are suppressed by 5-10% from +beginning-of-life flux estimates.

    +

    The VIS bandpass red and blue limits are set not by the transmission curve but by the range of +wavelengths over which we have tabulated PSF images. The wavelength range is read in from the +instrument parameter file.

    +

    Args: +AB_zeropoint (bool) : If True, set the zeropoint of the bandpass to the AB magnitude system. [default: True] +default_thin_trunc (bool) : If True, use the default thinning and truncation parameters. [default: True] +full_bandpass (bool): if True, use the full bandpass without red/blue limits needed for PSF

    +
    +

    calculations. [default: False]

    +
    +

    kwargs : Additional keyword arguments to pass to either Bandpass.thin or Bandpass.truncate.

    +
    +
    -
    -euclidlike.backgrounds.getSkyLevel(bandpass, world_pos=None, exptime=None, epoch=2025, date=None)[source]
    +
    +euclidlike.getSkyLevel(bandpass, world_pos=None, exptime=None, epoch=2025, date=None)[source]

    Get the expected sky level for a Euclid observation due to zodiacal light for this bandpass and position.

    This routine can take an arbitray galsim.Bandpass() and calculate the zodiacal background @@ -82,123 +209,8 @@

    Submodules -
    -euclidlike.backgrounds.getZodiBackground(ecl_lat, ecl_dlon, lambda_min, lambda_max, Tlambda, T)[source]
    -

    This helper routine is used with permission from Chris Hirata’s Exposure Time Calculator and enables the -calculation of the zodiacal light in photons/m^2/arcsec^2/sec. The ETC may be found here:

    -

    http://www.tapir.caltech.edu/~chirata/web/software/space-etc/

    -

    The code was ported from C to python by Michael Troxel (matroxel on GitHub). The units are -exactly as in the original C code, and we convert to any other needed units outside of this -routine, in user-facing code.

    -
    -
    Parameters:
    -
      -
    • ecl_lat – Ecliptic latitude (degrees)

    • -
    • ecl_dlon – Ecliptic longitude (degrees)

    • -
    • lambda_min – Minimum wavelength for the bandpass (microns)

    • -
    • lambda_max – Maximum wavelength for the bandpass (microns)

    • -
    • Tlambda – Numpy array containing a grid of wavelength values for the bandpass (microns)

    • -
    • T – Numpy array containing the throughput (normalized to be between 0-1) for the -bandpass

    • -
    -
    -
    Returns:
    -

    A floating point value for the zodiacal light in photons/m^2/arcsec^2/sec

    -
    -
    -

    - -
    -
    -

    euclidlike.bandpass module

    -

    @file bandpass.py

    -

    This file includes any routines needed to define the Euclid bandpasses. -This module is heavily based on the roman bandpass.py file from the GalSim package. -https://github.com/GalSim-developers/GalSim/blob/releases/2.5/galsim/roman/roman_bandpass.py

    -

    The Euclid VIS bandpass is read in from the Euclid_VIS.vis.dat file which can be downloaded from -http://svo2.cab.inta-csic.es/svo/theory/fps3/index.php?mode=browse&gname=Euclid&gname2=VIS&asttype=.

    -

    The Euclid NISP bandpasses are read in from files downloaded from -https://euclid.esac.esa.int/msp/refdata/nisp/NISP-PHOTO-PASSBANDS-V1

    -
    -
    -euclidlike.bandpass.getBandpasses(AB_zeropoint=True, default_thin_trunc=True, full_bandpass=False, **kwargs)[source]
    -

    Function to get the bandpass information for the Euclid VIS band and the three Euclid NISP passbands.

    -

    This routine reads in files containing a list of wavelengths and -transmission values for the Euclid bands. The files are located in the -euclidlike.data directory. The routine then creates a Bandpass object -using the LookupTable class from the GalSim package, and returns a dict with bandpasses for the -keys.

    -

    The bandpasses are publicly available from IPAC: -http://svo2.cab.inta-csic.es/svo/theory/fps3/index.php?mode=browse&gname=Euclid&gname2=VIS&asttype=. -https://euclid.esac.esa.int/msp/refdata/nisp/NISP-PHOTO-PASSBANDS-V1

    -

    These are relatively old files that do not include the latest estimates of system response. -They correspond to end-of-life estimates, with some expected degradation of the QE and filter -transmission over time. This can lead to flux estimates that are suppressed by 5-10% from -beginning-of-life flux estimates.

    -

    The VIS bandpass red and blue limits are set not by the transmission curve but by the range of -wavelengths over which we have tabulated PSF images. The wavelength range is read in from the -instrument parameter file.

    -

    Args: -AB_zeropoint (bool) : If True, set the zeropoint of the bandpass to the AB magnitude system. [default: True] -default_thin_trunc (bool) : If True, use the default thinning and truncation parameters. [default: True] -full_bandpass (bool): if True, use the full bandpass without red/blue limits needed for PSF

    -
    -

    calculations. [default: False]

    -
    -

    kwargs : Additional keyword arguments to pass to either Bandpass.thin or Bandpass.truncate.

    -
    - -
    -
    -

    euclidlike.euclidlike_psf module

    -
    -
    -euclidlike.euclidlike_psf.getBrightPSF(ccd, bandpass, ccd_pos=None, pupil_bin=4, wcs=None, n_waves=None, wavelength=None, gsparams=None, logger=None)[source]
    -

    Get a fake optical PSF for very bright objects in Euclid-like simulations. -Depending on the inputs, this routine returns a chromatic or achromatic PSF using the -Euclid telescope diameter and Euclid-like aperture.

    -

    Args: -ccd (int): Single value specifying the CCD for which the PSF should be

    -
    -

    loaded.

    -
    -
    -
    bandpass (str): Single string specifying the bandpass to use when

    defining the pupil plane configuration and/or interpolation of -chromatic PSFs.

    -
    -
    ccd_pos: Single galsim.PositionD indicating the position within the CCD

    for which the PSF should be created. If None, the exact center of the -CCD is chosen. [default: None]

    -
    -
    wcs: The WCS to use to project the PSF into world coordinates. [default:

    galsim.PixelScale(euclidlike.pixel_scale)]

    -
    -
    n_waves (int): Number of wavelengths to use for setting up interpolation of the

    chromatic PSF objects, which can lead to much faster image -rendering. If None, then no interpolation is used. Note that -users who want to interpolate can always set up the interpolation -later on even if they do not do so when calling getPSF. -[default: None]

    -
    -
    wavelength (float): An option to get an achromatic PSF for a single

    wavelength, for users who do not care about chromaticity of the PSF. If -None, then the fully chromatic PSF is returned as an -InterpolatedChromaticObject. Alternatively the user should supply -either (a) a wavelength in nanometers, and they will get an -InterpolatedImage object for that wavelength, or (b) a bandpass object, -in which case they will get an InterpolatedImage objects defined at the -effective wavelength of that bandpass. [default: None]

    -
    -
    gsparams: An optional GSParams argument. See the docstring for GSParams

    for details. [default: None]

    -
    -
    -
    -
    Returns:
    -

    A single PSF object (either an InterpolatedChromaticObject or an -InterpolatedImage depending on the inputs).

    -
    -
    -
    - -
    -
    -euclidlike.euclidlike_psf.getPSF(ccd, bandpass, ccd_pos=None, wcs=None, wavelength=None, gsparams=None, logger=None, psf_dir=None)[source]
    +
    +euclidlike.getPSF(ccd, bandpass, ccd_pos=None, wcs=None, wavelength=None, gsparams=None, logger=None, psf_dir=None)[source]

    Get a single PSF for a Euclid-like simulation.

    These PSFs are based on precomputed, oversampled (by 3x) PSF images on a grid in wavelength and focal plane position. These images were provided by Lance Miller and Chris Duncan. They are @@ -276,152 +288,54 @@

    Submodules -

    euclidlike.euclidlike_wcs module

    -

    @file euclidlike_wcs.py

    -

    This file includes any routines needed to define and use the Euclid-like WCS. -Current version is based on the focal plane description detailed in -Scaramella et al. (Fig. 2 and Table 1). -The distortion coefficients were derived from the ERO release.

    -

    Scaramella et al.: https://arxiv.org/abs/2108.01201

    -
    -euclidlike.euclidlike_wcs.allowedPos(world_pos, date, SAA=None)[source]
    -

    This routine can be used to check whether Euclid would be allowed to look at a particular -position (world_pos) on a given date. This is determined by the angle of this position -relative to the Sun.

    -

    In general, Euclid can point at angles relative to the Sun in the range 90+20 & 90-3 degrees. -Obviously, pointing too close to the Sun would result in overly high sky backgrounds. It is -less obvious why Euclid cannot look at a spot directly opposite from the Sun (180 degrees on the -sky). The reason is that the observatory is aligned such that if the observer is looking at -some sky position, the solar panels are oriented at 90 degrees from that position. So it’s -always optimal for the observatory to be pointing at an angle of 90 degrees relative to the -Sun. It is also permitted to look within [-3, + 20] degrees of that optimal position.

    -
    -
    Parameters:
    -
      -
    • world_pos – A galsim.CelestialCoord indicating the position at which the observer -wishes to look.

    • -
    • date – A python datetime object indicating the desired date of observation.

    • -
    • SAA – A galsim.Angle representing the Solar Aspect Angle -of the telescope for the observation. If not provided, -it will be computed internally.

    • -
    +
    +euclidlike.getBrightPSF(ccd, bandpass, ccd_pos=None, pupil_bin=4, wcs=None, n_waves=None, wavelength=None, gsparams=None, logger=None)[source]
    +

    Get a fake optical PSF for very bright objects in Euclid-like simulations. +Depending on the inputs, this routine returns a chromatic or achromatic PSF using the +Euclid telescope diameter and Euclid-like aperture.

    +

    Args: +ccd (int): Single value specifying the CCD for which the PSF should be

    +
    +

    loaded.

    +
    +
    +
    bandpass (str): Single string specifying the bandpass to use when

    defining the pupil plane configuration and/or interpolation of +chromatic PSFs.

    -
    Returns:
    -

    True or False, indicating whether it is permitted to look at this position on this date.

    +
    ccd_pos: Single galsim.PositionD indicating the position within the CCD

    for which the PSF should be created. If None, the exact center of the +CCD is chosen. [default: None]

    -
    -
    - -
    -
    -euclidlike.euclidlike_wcs.bestPA(world_pos, date, SAA=None)[source]
    -

    This routine determines the best position angle for the observatory for a given observation date -and position on the sky.

    -

    The best/optimal position angle is determined by the fact that the solar panels are at 90 -degrees to the position being observed, and it is best to have those facing the Sun as directly -as possible. Note that if a given world_pos is not actually observable on the given -date, then this routine will return None.

    -
    -
    Parameters:
    -
      -
    • world_pos – A galsim.CelestialCoord indicating the position at which the observer -wishes to look.

    • -
    • date – A python datetime object indicating the desired date of observation.

    • -
    • SAA – A galsim.Angle representing the Solar Aspect Angle -of the telescope for the observation. If not provided, -it will be computed internally.

    • -
    +
    wcs: The WCS to use to project the PSF into world coordinates. [default:

    galsim.PixelScale(euclidlike.pixel_scale)]

    -
    Returns:
    -

    the best position angle for the observatory, as a galsim.Angle, or None if the position -is not observable.

    +
    n_waves (int): Number of wavelengths to use for setting up interpolation of the

    chromatic PSF objects, which can lead to much faster image +rendering. If None, then no interpolation is used. Note that +users who want to interpolate can always set up the interpolation +later on even if they do not do so when calling getPSF. +[default: None]

    -
    -
    - -
    -
    -euclidlike.euclidlike_wcs.convertCenter(world_pos, CCD, PA=None, date=None, SAA=None, PA_is_FPA=False, tol=coord.Angle(2.42406840554768e-06, coord.radians))[source]
    -

    This is a simple helper routine that takes an input position world_pos that is meant to -correspond to the position of the center of an CCD, and tells where the center of the focal -plane array should be. The goal is to provide a position that can be used as an input to -getWCS(), which wants the center of the focal plane array.

    -

    The results of the calculation are deterministic if given a fixed position angle (PA). If it’s -not given one, it will try to determine the best one for this location and date, like getWCS() -does.

    -

    Because of distortions varying across the focal plane, this routine has to iteratively correct -its initial result based on empirical tests. The tol kwarg can be used to adjust how -careful it will be, but it always does at least one iteration.

    -
    -
    Parameters:
    -
      -
    • world_pos – A galsim.CelestialCoord indicating the position to observe at the center of the -given CCD. Note that if the given position is not observable on -the given date, then the routine will raise an exception.

    • -
    • CCD – A single number giving the CCD for which the center should be located at -world_pos.

    • -
    • PA – galsim.Angle representing the position angle of the observatory +Y axis, unless -PA_is_FPA=True, in which case it’s the position angle of the FPA. For -users to do not care about this, then leaving this as None will result in the -routine using the supplied date and world_pos to select the optimal -orientation for the observatory. Note that if a user supplies a PA value, -the routine does not check whether this orientation is actually allowed. -[default: None]

    • -
    • SAA – A galsim.Angle representing the Solar Aspect Angle -of the telescope for the observation. If not provided, -it will be computed internally.

    • -
    • date – The date of the observation, as a python datetime object. If None, then the -vernal equinox in 2025 will be used. [default: None]

    • -
    • PA_is_FPA – If True, then the position angle that was provided was the PA of the focal -plane array, not the observatory. [default: False]

    • -
    • tol – Tolerance for errors due to distortions, as a galsim.Angle. -[default: 0.5*galsim.arcsec]

    • -
    +
    wavelength (float): An option to get an achromatic PSF for a single

    wavelength, for users who do not care about chromaticity of the PSF. If +None, then the fully chromatic PSF is returned as an +InterpolatedChromaticObject. Alternatively the user should supply +either (a) a wavelength in nanometers, and they will get an +InterpolatedImage object for that wavelength, or (b) a bandpass object, +in which case they will get an InterpolatedImage objects defined at the +effective wavelength of that bandpass. [default: None]

    -
    Returns:
    -

    A CelestialCoord object indicating the center of the focal plane array.

    +
    gsparams: An optional GSParams argument. See the docstring for GSParams

    for details. [default: None]

    -
    - -
    -
    -euclidlike.euclidlike_wcs.findCCD(wcs_dict, world_pos, include_border=False)[source]
    -

    This is a subroutine to take a dict of WCS (one per CCD) from euclidlike.getWCS() and query -which CCD a particular real-world coordinate would be located on. The position (world_pos) -should be specified as a galsim.CelestialCoord. If the position is not located on any of the -CCDs, the result will be None. Note that if wcs_dict does not include all CCDs in it, then -it’s possible the position might lie on one of the CCDs that was not included.

    -

    Depending on what the user wants to do with the results, they may wish to use the -include_border keyword. This keyword determines whether or not to include an additional -border corresponding to half of the gaps between CCDs. For example, if a user is drawing a -single image they may wish to only know whether a given position falls onto a CCD, and if so, -which one (ignoring everything in the gaps). In contrast, a user who plans to make a sequence -of dithered images might find it most useful to know whether the position is either on a CCD or -close enough that in a small dither sequence it might appear on the CCD at some point. Use of -include_border switches between these scenarios.

    -
    Parameters:
    -
      -
    • wcs_dict – The dict of WCS’s output from euclidlike.getWCS().

    • -
    • world_pos – A galsim.CelestialCoord indicating the sky position of interest.

    • -
    • include_border – If True, then include the half-border around CCD to cover the gap -between each sensor. [default: False]

    • -
    -
    -
    Returns:
    -

    an integer value of the CCD on which the position falls, or None if the position is not -on any CCD.

    +
    Returns:
    +

    A single PSF object (either an InterpolatedChromaticObject or an +InterpolatedImage depending on the inputs).

    -
    -euclidlike.euclidlike_wcs.getWCS(world_pos, PA=None, date=None, CCDs=None, PA_is_FPA=False, SAA=None)[source]
    +
    +euclidlike.getWCS(world_pos, PA=None, date=None, CCDs=None, PA_is_FPA=False, SAA=None)[source]

    This routine returns a dict containing a WCS for each of the Euclid CCDs. The Euclid CCDs are labeled 0-35, so these numbers are used as the keys in the dict. Alternatively the user can request a subset of the CCDs using @@ -475,14 +389,38 @@

    Submodules -

    euclidlike.instrument_params module

    -

    Basic information GalSim needs to produce Euclid-like simulations.

    -

    When editing this file, you should also modify the imports in __init__.py

    -

    -
    -

    Module contents

    +
    +
    +euclidlike.findCCD(wcs_dict, world_pos, include_border=False)[source]
    +

    This is a subroutine to take a dict of WCS (one per CCD) from euclidlike.getWCS() and query +which CCD a particular real-world coordinate would be located on. The position (world_pos) +should be specified as a galsim.CelestialCoord. If the position is not located on any of the +CCDs, the result will be None. Note that if wcs_dict does not include all CCDs in it, then +it’s possible the position might lie on one of the CCDs that was not included.

    +

    Depending on what the user wants to do with the results, they may wish to use the +include_border keyword. This keyword determines whether or not to include an additional +border corresponding to half of the gaps between CCDs. For example, if a user is drawing a +single image they may wish to only know whether a given position falls onto a CCD, and if so, +which one (ignoring everything in the gaps). In contrast, a user who plans to make a sequence +of dithered images might find it most useful to know whether the position is either on a CCD or +close enough that in a small dither sequence it might appear on the CCD at some point. Use of +include_border switches between these scenarios.

    +
    +
    Parameters:
    +
      +
    • wcs_dict – The dict of WCS’s output from euclidlike.getWCS().

    • +
    • world_pos – A galsim.CelestialCoord indicating the sky position of interest.

    • +
    • include_border – If True, then include the half-border around CCD to cover the gap +between each sensor. [default: False]

    • +
    +
    +
    Returns:
    +

    an integer value of the CCD on which the position falls, or None if the position is not +on any CCD.

    +
    +
    +
    +
    @@ -512,11 +450,25 @@

    GalSim-Euclid-Like

    Navigation

    + diff --git a/docs/_build/html/euclidlike_imsim.html b/docs/_build/html/euclidlike_imsim.html index b9034a0..e6d31e5 100644 --- a/docs/_build/html/euclidlike_imsim.html +++ b/docs/_build/html/euclidlike_imsim.html @@ -5,7 +5,7 @@ - euclidlike_imsim package — GalSim-Euclid-Like 0.0.1 documentation + The Euclid-like ImSim Module — GalSim-Euclid-Like 0.0.1 documentation @@ -14,6 +14,8 @@ + + @@ -31,49 +33,736 @@
    -
    -

    euclidlike_imsim package

    -
    -

    Submodules

    -
    -
    -

    euclidlike_imsim.bandpass module

    -
    -
    -

    euclidlike_imsim.ccd module

    -
    -
    -

    euclidlike_imsim.detector_physics module

    -
    -
    -

    euclidlike_imsim.noise module

    -
    -
    -

    euclidlike_imsim.obseq module

    -
    -
    -

    euclidlike_imsim.photonOps module

    -
    -
    -

    euclidlike_imsim.psf module

    -
    -
    -

    euclidlike_imsim.scafile module

    -
    -
    -

    euclidlike_imsim.skycat module

    -
    -
    -

    euclidlike_imsim.stamp module

    +
    +

    The Euclid-like ImSim Module

    +

    This module contains configuration scripts to produce large-scale Euclid-like simulation runs based on the information in euclidlike. +It is based heavily on roman_imsim.

    +
    +

    Classes and Functions

    +
    +
    +class euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder[source]
    +

    A class for loading a Bandpass from a file

    +

    FileBandpass expected the following parameter:

    +
    +

    name (str) The name of the Euclid filter to get. (required)

    +
    +
    +
    +buildBandpass(config, base, logger)[source]
    +

    Build the Bandpass based on the specifications in the config dict.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the bandpass type.

    • +
    • base – The base configuration dict.

    • +
    • logger – If provided, a logger for logging debug statements.

    • +
    +
    +
    Returns:
    +

    the constructed Bandpass object.

    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder[source]
    +
    +
    +addNoise(image, config, base, image_num, obj_num, current_var, logger)[source]
    +

    Add the final noise to a Scattered image

    +
    +
    Parameters:
    +
      +
    • image – The image onto which to add the noise.

    • +
    • config – The configuration dict for the image field.

    • +
    • base – The base configuration dict.

    • +
    • image_num – The current image number.

    • +
    • obj_num – The first object number in the image.

    • +
    • current_var – The current noise variance in each postage stamps.

    • +
    • logger – If given, a logger object to log progress.

    • +
    +
    +
    +
    + +
    +
    +buildImage(config, base, image_num, obj_num, logger)[source]
    +

    Build an Image containing multiple objects placed at arbitrary locations.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the image field.

    • +
    • base – The base configuration dict.

    • +
    • image_num – The current image number.

    • +
    • obj_num – The first object number in the image.

    • +
    • logger – If given, a logger object to log progress.

    • +
    +
    +
    Returns:
    +

    the final image and the current noise variance in the image as a tuple

    +
    +
    +
    + +
    +
    +setup(config, base, image_num, obj_num, ignore, logger)[source]
    +

    Do the initialization and setup for building the image.

    +

    This figures out the size that the image will be, but doesn’t actually build it yet.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the image field.

    • +
    • base – The base configuration dict.

    • +
    • image_num – The current image number.

    • +
    • obj_num – The first object number in the image.

    • +
    • ignore – A list of parameters that are allowed to be in config that we can +ignore here. i.e. it won’t be an error if these parameters are present.

    • +
    • logger – If given, a logger object to log progress.

    • +
    +
    +
    Returns:
    +

    xsize, ysize

    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.noise.NoiseImageBuilder[source]
    +
    +
    +initialize(data, scratch, config, base, logger)[source]
    +

    Do any initial setup for this builder at the start of a new output file.

    +

    The base class implementation saves two work space items into self.data and self.scratch +that can be used to safely communicate across multiple processes.

    +
    +
    Parameters:
    +
      +
    • data – An empty list of length nimages to use as work space.

    • +
    • scratch – An empty dict that can be used as work space.

    • +
    • config – The configuration field for this output object.

    • +
    • base – The base configuration dict.

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    +
    + +
    +
    +processImage(index, obj_nums, config, base, logger)[source]
    +

    Perform any necessary processing at the end of each image construction.

    +

    This function will be called after each full image is built.

    +

    Compute the noise for the current image and add it to the image. +It will also create an independent noise image. +The code optionally subtract the background if requested.

    +
    +
    Parameters:
    +
      +
    • index – The index in self.data to use for this image. This isn’t the image_num +(which can be accessed at base[‘image_num’] if needed), but rather +an index that starts at 0 for the first image being worked on and +goes up to nimages-1.

    • +
    • obj_nums – The object numbers that were used for this image.

    • +
    • config – The configuration field for this output object.

    • +
    • base – The base configuration dict.

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.noise.SkyImageBuilder[source]
    +
    +
    +processImage(index, obj_nums, config, base, logger)[source]
    +

    Perform any necessary processing at the end of each image construction.

    +

    This function will be called after each full image is built.

    +

    Compute the sky background and return it in an image.

    +
    +
    Parameters:
    +
      +
    • index – The index in self.data to use for this image. This isn’t the image_num +(which can be accessed at base[‘image_num’] if needed), but rather +an index that starts at 0 for the first image being worked on and +goes up to nimages-1.

    • +
    • obj_nums – The object numbers that were used for this image.

    • +
    • config – The configuration field for this output object.

    • +
    • base – The base configuration dict.

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.noise.WeightImageBuilder[source]
    +
    +
    +processImage(index, obj_nums, config, base, logger)[source]
    +

    Perform any necessary processing at the end of each image construction.

    +

    This function will be called after each full image is built.

    +

    Compute the weight map from the noise image and return it in an image.

    +
    +
    Parameters:
    +
      +
    • index – The index in self.data to use for this image. This isn’t the image_num +(which can be accessed at base[‘image_num’] if needed), but rather +an index that starts at 0 for the first image being worked on and +goes up to nimages-1.

    • +
    • obj_nums – The object numbers that were used for this image.

    • +
    • config – The configuration field for this output object.

    • +
    • base – The base configuration dict.

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    +
    + +
    + +
    +
    +euclidlike_imsim.noise.get_noise(cfg_noise, cfg_image, base, logger)[source]
    +
    + +
    +
    +euclidlike_imsim.noise.parse_noise_config(params)[source]
    +
    + +
    +
    +euclidlike_imsim.obseq.ObSeqData(config, base, value_type)[source]
    +

    Returns the obseq data for a pointing.

    +
    + +
    +
    +class euclidlike_imsim.obseq.ObSeqDataLoader(file_name, visit, obs_kind, CCD, logger=None)[source]
    +

    Read the exposure information from the observation sequence.

    +
    +
    +get(field, default=None, obs_kind=None)[source]
    +
    + +
    +
    +read_obseq()[source]
    +

    Read visit info from the obseq file.

    +
    + +
    + +
    +
    +class euclidlike_imsim.photonOps.ChargeDiff(rng=None, **kwargs)[source]
    +

    A photon operator that applies the effect of charge diffusion via a probablistic model limit.

    +
    +
    +applyTo(photon_array, local_wcs=None, rng=None)[source]
    +

    Apply the charge diffusion effect to the photons

    +
    +
    Parameters:
    +
      +
    • photon_array – A PhotonArray to apply the operator to.

    • +
    • local_wcs – A LocalWCS instance defining the local WCS for the current photon +bundle in case the operator needs this information. [default: None]

    • +
    • rng – A random number generator to use if needed. [default: None]

    • +
    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.photonOps.ChargeDiffBuilder[source]
    +

    Build ChargeDiff photonOp

    +
    +
    +buildPhotonOp(config, base, logger)[source]
    +

    Build the PhotonOp based on the specifications in the config dict.

    +

    Note: Sub-classes must override this function with a real implementation.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the PhotonOp

    • +
    • base – The base configuration dict.

    • +
    • logger – If provided, a logger for logging debug statements.

    • +
    +
    +
    Returns:
    +

    the constructed PhotonOp object.

    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.psf.EuclidlikePSF(CCD=None, WCS=None, n_waves=None, bpass=None, extra_aberrations=None, logger=None)[source]
    +

    Class building needed Euclidlike PSFs.

    +
    +
    +getPSF(pupil_bin, pos)[source]
    +

    Return a PSF to be convolved with sources. +PSF is sampled at 4 quadrants for each CCD. Returned PSF +corresponds to that of the quadrant of the CCD position.

    +

    @param [in] what pupil binning to request.

    +
    + +
    + +
    +
    +class euclidlike_imsim.psf.PSFLoader[source]
    +

    PSF loader.

    +
    +
    +getKwargs(config, base, logger)[source]
    +

    Parse the config dict and return the kwargs needed to build the input object.

    +

    The default implementation looks for special class attributes called:

    +
    +
    _req_params

    A dict of required parameters and their types.

    +
    +
    _opt_params

    A dict of optional parameters and their types.

    +
    +
    _single_params

    A list of dicts of parameters such that one and only one of +parameter in each dict is required.

    +
    +
    _takes_rng

    A bool value saying whether an rng object is required.

    +
    +
    +

    See galsim.Catalog for an example of a class that sets these attributes.

    +

    In addition to the kwargs, we also return a bool value, safe, that indicates whether +the constructed object will be safe to keep around for multiple files (True) of if +it will need to be rebuilt for each output file (False).

    +
    +
    Parameters:
    +
      +
    • config – The config dict for this input item

    • +
    • base – The base config dict

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    Returns:
    +

    kwargs, safe

    +
    +
    +
    + +
    + +

    Interface to obtain objects from skyCatalogs.

    +
    +
    +euclidlike_imsim.skycat.SkyCatObj(config, base, ignore, gsparams, logger)[source]
    +

    Build an object according to info in the sky catalog.

    +
    + +
    +
    +euclidlike_imsim.skycat.SkyCatValue(config, base, value_type)[source]
    +

    Return a value from the object part of the skyCatalog

    +
    + +
    +
    +euclidlike_imsim.skycat.SkyCatWorldPos(config, base, value_type)[source]
    +

    Return a value from the object part of the skyCatalog

    +
    + +
    +
    +class euclidlike_imsim.skycat.SkyCatalogInterface(file_name, exptime, wcs=None, mjd=None, bandpass=None, xsize=None, ysize=None, obj_types=None, edge_pix=100, max_flux=None, logger=None)[source]
    +

    Interface to skyCatalogs package.

    +
    +
    +getApproxNObjects()[source]
    +

    Return the approximate number of GSObjects to render, as set in +the class initializer.

    +
    + +
    +
    +getFlux(index, filter=None, mjd=None, exptime=None)[source]
    +

    Return the flux associated to an object.

    +
    +
    Parameters:
    +
      +
    • index (int) – Index of the object in the self.objects catalog.

    • +
    • filter (str, optional) – Name of the filter for which the flux is computed. If None, use the +filter provided during initialization. [Default: None]

    • +
    • mjd (float, optional) – Date of the observation in MJD format. If None, use the +mjd provided during initialization. [Default: None]

    • +
    • exptime (int or float, optional) – Exposure time of the observation. If None, use the +exptime provided during initialization. [Default: None]

    • +
    +
    +
    Returns:
    +

    Computer flux at the given date for the requested exposure time and +filter.

    +
    +
    Return type:
    +

    flux

    +
    +
    +
    + +
    +
    +getNObjects()[source]
    +

    Return the number of GSObjects to render

    +
    + +
    +
    +getObj(index, gsparams=None, rng=None, exptime=30)[source]
    +

    Return the galsim object for the skyCatalog object +corresponding to the specified index. If the skyCatalog +object is a galaxy, the returned galsim object will be +a galsim.Sum.

    +
    +
    Parameters:
    +

    index (int) – Index of the object in the self.objects catalog.

    +
    +
    Return type:
    +

    galsim.GSObject

    +
    +
    +
    + +
    +
    +getValue(index, field)[source]
    +

    Return a skyCatalog value for the an object.

    +
    +
    Parameters:
    +
      +
    • index (int) – Index of the object in the self.objects catalog.

    • +
    • field (str) – Name of the field for which you want the value.

    • +
    +
    +
    Returns:
    +

    The value associated to the field or None if the field do not exist.

    +
    +
    Return type:
    +

    int or float or str or None

    +
    +
    +
    + +
    +
    +getWorldPos(index)[source]
    +

    Return the sky coordinates of the skyCatalog object +corresponding to the specified index.

    +
    +
    Parameters:
    +

    index (int) – Index of the (object_index, subcomponent) combination.

    +
    +
    Return type:
    +

    galsim.CelestialCoord

    +
    +
    +
    + +
    +
    +get_ccd_center()[source]
    +

    Return the CCD center.

    +
    + +
    +
    +property objects
    +
    + +
    + +
    +
    +class euclidlike_imsim.skycat.SkyCatalogLoader(init_func, has_nobj=False, file_scope=False, takes_logger=False, use_proxy=True, worker_init=None, worker_initargs=None)[source]
    +

    Class to load SkyCatalogInterface object.

    +
    +
    +getKwargs(config, base, logger)[source]
    +

    Parse the config dict and return the kwargs needed to build the input object.

    +

    The default implementation looks for special class attributes called:

    +
    +
    _req_params

    A dict of required parameters and their types.

    +
    +
    _opt_params

    A dict of optional parameters and their types.

    +
    +
    _single_params

    A list of dicts of parameters such that one and only one of +parameter in each dict is required.

    +
    +
    _takes_rng

    A bool value saying whether an rng object is required.

    +
    +
    +

    See galsim.Catalog for an example of a class that sets these attributes.

    +

    In addition to the kwargs, we also return a bool value, safe, that indicates whether +the constructed object will be safe to keep around for multiple files (True) of if +it will need to be rebuilt for each output file (False).

    +
    +
    Parameters:
    +
      +
    • config – The config dict for this input item

    • +
    • base – The base config dict

    • +
    • logger – If given, a logger object to log progress. [default: None]

    • +
    +
    +
    Returns:
    +

    kwargs, safe

    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.stamp.Euclidlike_stamp[source]
    +

    This performs the tasks necessary for building the stamp for a single object.

    +

    It uses the regular Basic functions for most things. +It specializes the quickSkip, buildProfile, and draw methods.

    +
    +
    +buildPSF(config, base, gsparams, logger)[source]
    +

    Build the PSF object.

    +

    For the Basic stamp type, this builds a PSF from the base[‘psf’] dict, if present, +else returns None.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the stamp field.

    • +
    • base – The base configuration dict.

    • +
    • gsparams – A dict of kwargs to use for a GSParams. More may be added to this +list by the galaxy object.

    • +
    • logger – A logger object to log progress.

    • +
    +
    +
    Returns:
    +

    the PSF

    +
    +
    +
    + +
    +
    +draw(prof, image, method, offset, config, base, logger)[source]
    +

    Draw the profile on the postage stamp image.

    +
    +
    Parameters:
    +
      +
    • prof – The profile to draw.

    • +
    • image – The image onto which to draw the profile (which may be None).

    • +
    • method – The method to use in drawImage.

    • +
    • offset – The offset to apply when drawing.

    • +
    • config – The configuration dict for the stamp field.

    • +
    • base – The base configuration dict.

    • +
    • logger – A logger object to log progress.

    • +
    +
    +
    Returns:
    +

    the resulting image

    +
    +
    +
    + +
    +
    +classmethod fix_seds(prof, bandpass)[source]
    +
    + +
    +
    +getDrawMethod(config, base, logger)[source]
    +

    Determine the draw method to use.

    +

    @param config The configuration dict for the stamp field. +@param base The base configuration dict. +@param logger A logger object to log progress.

    +

    @returns method

    +
    + +
    +
    +setup(config, base, xsize, ysize, ignore, logger)[source]
    +

    Do the initialization and setup for building a postage stamp.

    +

    In the base class, we check for and parse the appropriate size and position values in +config (aka base[‘stamp’] or base[‘image’].

    +

    Values given in base[‘stamp’] take precedence if these are given in both places (which +would be confusing, so probably shouldn’t do that, but there might be a use case where it +would make sense).

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the stamp field.

    • +
    • base – The base configuration dict.

    • +
    • xsize – The xsize of the image to build (if known).

    • +
    • ysize – The ysize of the image to build (if known).

    • +
    • ignore – A list of parameters that are allowed to be in config that we can +ignore here. i.e. it won’t be an error if these parameters are present.

    • +
    • logger – A logger object to log progress.

    • +
    +
    +
    Returns:
    +

    xsize, ysize, image_pos, world_pos

    +
    +
    +
    + +
    + +
    +
    +class euclidlike_imsim.utils.roman_utils(config_file, visit=None, sca=None, image_name=None, setup_skycat=False)[source]
    +

    Class to contain a variety of helper routines to work with the simulation data.

    +
    +
    +check_input(visit, sca, image_name)[source]
    +
    + +
    +
    +getBandpass()[source]
    +

    Return Roman bandpass for image

    +
    + +
    +
    +getLocalWCS(x, y)[source]
    +

    Return Roman WCS for image

    +
    + +
    +
    +getPSF(x=None, y=None, pupil_bin=8)[source]
    +

    Return Roman PSF for some image position. +:param x: x-position in SCA +:param y: y-position in SCA +:param pupil_bin: pupil image binning factor

    +
    +
    Returns:
    +

    the chromatic GalSim PSF model object (does not include additional effects like charge diffusion!)

    +
    +
    +
    + +
    +
    +getPSF_Image(stamp_size, x=None, y=None, pupil_bin=8, sed=None, oversampling_factor=1, include_photonOps=False, n_phot=1000000.0)[source]
    +

    Return a Roman PSF image for some image position +:param stamp_size: size of output PSF model stamp in native roman pixel_scale (oversampling_factor=1) +:param x: x-position in SCA +:param y: y-position in SCA +:param pupil_bin: pupil image binning factor +:param sed: SED to be used to draw the PSF - default is a flat SED. +:param oversampling_factor: factor by which to oversample native roman pixel_scale +:param include_photonOps: include additional contributions from other photon operators in effective psf image

    +
    +
    Returns:
    +

    the PSF GalSim image object (use image.array to get a numpy array representation)

    +
    +
    +
    + +
    +
    +getWCS()[source]
    +

    Return Roman WCS for image

    +
    + +
    + +
    +
    +class euclidlike_imsim.wcs.EuclidlikeWCS[source]
    +
    +
    +buildWCS(config, base, logger)[source]
    +

    Build the WCS based on the specifications in the config dict.

    +

    Note: Sub-classes must override this function with a real implementation.

    +
    +
    Parameters:
    +
      +
    • config – The configuration dict for the wcs type.

    • +
    • base – The base configuration dict.

    • +
    • logger – If provided, a logger for logging debug statements.

    • +
    +
    +
    Returns:
    +

    the constructed WCS object.

    +
    +
    +
    + +
    +
    -
    -

    euclidlike_imsim.utils module

    +
    +

    Use

    +

    Example files needed for large-scale Euclid-like simulation runs are included in GalSim-Euclid-Like/config.

    -
    -

    euclidlike_imsim.wcs module

    +
    +

    Config imsim

    +

    was.yaml: euclidlike_imsim example config file. +You will want to update the following entries:

    +
      +
    • input.obseq_data.file_name: path to the observing sequence. Link to euclidlike/data/euclid_obseq.fits

    • +
    • input.sky_catalog.file_name: path to the skyCatalog to use

    • +
    • output.dir: path to the output directory for the simulated images

    • +
    • output.truth.dir: path to the output directory for the true catalogs

    • +
    +

    To run the code:

    +
    galsim was.yaml
    +
    +
    +

    You might want to specify some config entries on the command line, like:

    +
    galsim was.yaml input.obseq_data.visit=33690 image.CCD=1
    +
    +
    -
    -

    Module contents

    +
    +

    Config SLURM

    +

    slurm_runner.sh contains the SLURM configuration to run “large scale” simulations. +You will want to update the following lines:

    +
      +
    • #!/bin/zsh: depending on the shell you are using, you might want to change it to: #!/bin/bash

    • +
    • #SBATCH --output=/path/to/slurm-%A-%a.out: SLURM stdout file

    • +
    • #SBATCH --error=/path/to/slurm-%A-%a.err: SLURM stderr file

    • +
    • source activate [env_name]: conda environment to use

    • +
    • file_list='/path/to/run_list.txt': file containing the pointings to simulate (see note below)

    • +
    +

    The run_list.txt is a 2-column file with the pointing and the CCD_ID to simulate. It should look like:

    +
    33688 0
    +33688 1
    +33688 2
    +[...]
    +33688 35
    +33689 0
    +33689 1
    +[...]
    +
    +
    @@ -103,11 +792,27 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/examples.html b/docs/_build/html/examples.html new file mode 100644 index 0000000..4fd9454 --- /dev/null +++ b/docs/_build/html/examples.html @@ -0,0 +1,135 @@ + + + + + + + + Examples — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Examples

    +

    The GalSim-Euclid-Like/examples directory contains example files for how use the euclidlike module.

    +
    +

    End-to-end demo

    +

    end_to_end_demo.py.py

    +

    This first demo is the euclidlike-equivalent of demo 13 in GalSim. This demo uses the Euclid-like PSF, WCS, and background noise to produce a realistic scene of galaxies and stars as observed from a Euclid-like Telescope.

    +

    ** Features introduced in the Python file**:

    +
      +
    • euclidlike.getBandpasses(AB_zeropoint)

    • +
    • euclidlike.getWCS(world_pos, CCDs_CCD, date)

    • +
    • euclidlike.getPSF(use_CCD, filter_name, wcs)

    • +
    • euclidlike.getSkyLevel(bandpass, world_pos)

    • +
    +

    The output generated from this file can be visualized by running the script end_to_end_demo.py.py

    +
    +
    +

    Focal Plane Layout

    +

    plot_VIS.py

    +

    This Jupyter Notebook shows the display of the focal plane used in the euclidlike package, along with the CCD centers and ID convention.

    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 9c9d874..5f05424 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -37,16 +37,30 @@

    Index

    A | B | C + | D | E | F | G + | I | M + | N + | O + | P + | Q + | R + | S + | U + | W

    A

    +
    @@ -54,7 +68,17 @@

    A

    B

    +
    @@ -62,7 +86,33 @@

    B

    C

    + +
    + +

    D

    + + +
    @@ -71,56 +121,98 @@

    E

    F

    +
    @@ -128,19 +220,73 @@

    F

    G

    +
    + +

    I

    + +
    @@ -148,23 +294,174 @@

    G

    M

    +
    + +

    N

    + + +
    + +

    O

    + + + +
    + +

    P

    + + + +
    + +

    Q

    + + +
    + +

    R

    + + + +
    + +

    S

    + + + +
    + +

    U

    + + +
    + +

    W

    + +
    @@ -195,6 +492,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/history.html b/docs/_build/html/history.html new file mode 100644 index 0000000..9f69abb --- /dev/null +++ b/docs/_build/html/history.html @@ -0,0 +1,123 @@ + + + + + + + + Revision History — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Revision History

    +
    +

    Changes from v0.0.0 to v0.0.1

    +

    Made repo public.

    +
    +
    +

    Older Versions

    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index 5cb8389..73125c7 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -5,7 +5,7 @@ - GalSim-Euclid-Like — GalSim-Euclid-Like 0.0.1 documentation + GalSim-Euclid-Like: Euclid-like images using GalSim — GalSim-Euclid-Like 0.0.1 documentation @@ -14,6 +14,7 @@ + @@ -31,57 +32,56 @@
    -
    -

    GalSim-Euclid-Like

    -

    Helper functions to generate simulations of Euclid-like images using GalSim.

    -

    This repository contains information about the Euclid space telescope and survey that is needed to -produce simulations using GalSim. Some of the -information provided is approximate, aimed towards fast simulations rather than full accuracy in -representation of Euclid images. Places where the information is only approximate are flagged and -described in the docstring, and we particularly highlight that the PSF is only approximate; -for details, see the docstring of the getPSF() method. This library should enable generation of -Euclid-like images of sufficient fidelity for preliminary exploration of object detection, -photometry, deblending, and joint analysis with ground-based observatories. For -applications requiring high precision such as weak lensing, the higher fidelity simulations -available within the Euclid Consortium should be used.

    -

    This repository includes two distinct packages:

    -

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/install.html b/docs/_build/html/install.html new file mode 100644 index 0000000..11726e8 --- /dev/null +++ b/docs/_build/html/install.html @@ -0,0 +1,150 @@ + + + + + + + + Installation — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Installation

    +
    +

    Installation Instructions

    +

    The GalSim-Euclid-Like repository contains two python libraries and currently supports Python versions 3.10 and above.

    +

    System requirements: Given the heavy dependance on GalSim, GalSim-Euclid-Like currently only supports Linux and Mac OSX. For +further details on system requirements for GalSim see GalSim Installation.

    +
    +

    Dependencies

    +

    GalSim-Euclid-Like requires python>=3.10 and the following dependencies:

    +
    numpy>=1.17,
    +galsim>=2.6,
    +astropy>=2.0
    +
    +
    +
    +
    +

    Installation

    +

    The source code for GalSim-Euclid-Like has not been published to pypi. To install from source code:

    +
    git clone git@github.com:GalSim-developers/GalSim-Euclid-Like.git
    +
    +
    +

    and install by running:

    +
    conda create -n euclidlike python=3.10
    +cd GalSim-Euclid-Like
    +conda activate euclidlike
    +pip install .
    +
    +
    +

    To make sure the installation is successful, do the following:

    +
    $ python
    +>>> import euclidlike
    +>>> euclidlike.getBandpasses()
    +
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/modules.html b/docs/_build/html/modules.html index 71109a5..b8967d7 100644 --- a/docs/_build/html/modules.html +++ b/docs/_build/html/modules.html @@ -5,7 +5,7 @@ - GalSim-Euclid-Like — GalSim-Euclid-Like 0.0.1 documentation + <no title> — GalSim-Euclid-Like 0.0.1 documentation @@ -31,65 +31,144 @@
    -
    -

    GalSim-Euclid-Like

    -
    +
    -
    @@ -117,6 +196,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 5e4256b..24e0d91 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/overview.html b/docs/_build/html/overview.html new file mode 100644 index 0000000..47dd1b5 --- /dev/null +++ b/docs/_build/html/overview.html @@ -0,0 +1,173 @@ + + + + + + + + Overview — GalSim-Euclid-Like 0.0.1 documentation + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    + +
    +

    Overview

    +
    +

    GalSim-Euclid-Like

    +

    Helper functions to generate simulations of Euclid-like images using GalSim.

    +

    This repository contains information about the Euclid space telescope and survey that is needed to +produce simulations using GalSim. Some of the +information provided is approximate, aimed towards fast simulations rather than full accuracy in +representation of Euclid images. Places where the information is only approximate are flagged and +described in the docstring, and we particularly highlight that the PSF is only approximate; +for details, see the docstring of the getPSF() method. This library should enable generation of +Euclid-like images of sufficient fidelity for preliminary exploration of object detection, +photometry, deblending, and joint analysis with ground-based observatories. For +applications requiring high precision such as weak lensing, the higher fidelity simulations +available within the Euclid Consortium should be used.

    +

    This repository includes two distinct packages:

    +
      +
    • euclidlike: has basic observatory, instrumentation, and survey information for Euclid. +This package can be used on its own along with GalSim to produce Euclid-like simulations.

    • +
    • euclidlike_imsim: has configuration scripts to produce large-scale Euclid-like simulation runs +based on the information in euclidlike. It is based heavily on roman_imsim.

    • +
    +
    +
    +

    References

    +

    For more information about GalSim, please see its README and documentation.

    +

    For more information about Euclid, please see the Euclid Consortium website and papers linked from there.

    +

    Attribution for software and data used by particular routines in this library is given in the docstring for the relevant routine.

    +
    +
    +

    Installation

    +

    Please view the installation instructions for details on how to install GalSim-Euclid-Like.

    +
    +
    +

    Downloading relevant data

    +

    The Euclid-like PSF is constructed from precomputed oversampled images on a grid in focal plane position and wavelength. To use the full FOV PSF within GalSim-Euclid-Like, the images must be downloaded by running:

    +
    $ euclidlike_download_psf
    +
    +
    +

    in the terminal after installation of GalSim-Euclid-Like. To install in an alternative directory to the default, use the --dir argument. Refer to the getPSF documentation for further details about the PSF.

    +
    +
    +

    Getting started

    +

    Please see the examples/ directory for demos illustrating the use of this code.

    +
    +
    +

    Communicating with the developers

    +

    Feel free to open a GitHub issue to reach the developers with questions, comments, and bug reports. New contributors are also welcome and can indicate their interest in developing this code base through the Issues.

    +
    +
    +

    Attribution

    +

    This software is open source and may be used according to the terms of its license.

    +

    When using this software, please provide the URL to the repository in the resulting paper or note. Once there is a Zenodo DOI or journal article, this README will be updated and we will ask those using the code in their research to cite the relevant journal article.

    +
    +
    + + +
    + +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html index f0b916e..9330300 100644 --- a/docs/_build/html/py-modindex.html +++ b/docs/_build/html/py-modindex.html @@ -37,7 +37,8 @@

    Python Module Index

    - e + e | + s
    @@ -48,32 +49,76 @@

    Python Module Index

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    - euclidlike + euclidlike_imsim
        - euclidlike.backgrounds + euclidlike_imsim.bandpass
        - euclidlike.bandpass + euclidlike_imsim.ccd
        - euclidlike.euclidlike_psf + euclidlike_imsim.noise
        - euclidlike.euclidlike_wcs + euclidlike_imsim.obseq
        - euclidlike.instrument_params + euclidlike_imsim.photonOps +
        + euclidlike_imsim.psf +
        + euclidlike_imsim.skycat +
        + euclidlike_imsim.stamp +
        + euclidlike_imsim.utils +
        + euclidlike_imsim.wcs +
     
    + s
    + scripts +
        + scripts.download_psf +
        + scripts.make_euclidlike_pupil_plane
    @@ -103,6 +148,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/scripts.html b/docs/_build/html/scripts.html index bd95c86..87be1ee 100644 --- a/docs/_build/html/scripts.html +++ b/docs/_build/html/scripts.html @@ -31,19 +31,115 @@
    -
    -

    scripts package

    +
    +

    scripts package

    Submodules

    -
    -

    scripts.download_psf module

    -
    -
    -

    scripts.make_euclidlike_pupil_plane module

    +
    +

    scripts.download_psf module

    +

    A program to download the Euclid-like PSF sampled across the focal plane for discrete wavelengths. +The code below was adapted from: https://github.com/GalSim-developers/GalSim/blob/releases/2.5/galsim/download_cosmos.py

    +
    +
    +scripts.download_psf.check_existing(target, unpack_dir, meta, args, logger)[source]
    +
    + +
    +
    +scripts.download_psf.check_remove(do_unpack, target, args)[source]
    +
    + +
    +
    +scripts.download_psf.check_unpack(do_download, unpack_dir, target, args)[source]
    +
    + +
    +
    +scripts.download_psf.download(do_download, url, target, meta, args, logger)[source]
    +
    + +
    +
    +scripts.download_psf.download_psf(args, logger)[source]
    +

    The main script given the ArgParsed args and a logger

    +
    + +
    +
    +scripts.download_psf.get_input()[source]
    +
    + +
    +
    +scripts.download_psf.get_meta(url, args, logger)[source]
    +
    + +
    +
    +scripts.download_psf.get_names(args, logger)[source]
    +
    + +
    +
    +scripts.download_psf.main(command_args)[source]
    +

    The whole process given command-line parameters in their native (non-ArgParse) form.

    +
    + +
    + +
    + +
    +
    +scripts.download_psf.parse_args(command_args)[source]
    +

    Handle the command line arguments using either argparse (if available) or optparse.

    +
    + +
    +
    +scripts.download_psf.query_yes_no(question, default='yes')[source]
    +

    Ask a yes/no question via input() and return their answer.

    +

    “question” is a string that is presented to the user. +“default” is the presumed answer if the user just hits <Enter>.

    +
    +

    It must be “yes” (the default), “no” or None (meaning +an answer is required of the user).

    +
    +

    The “answer” return value is one of “yes” or “no”.

    +
    + +
    +
    +scripts.download_psf.remove_tarball(do_remove, target, logger)[source]
    +
    + +
    +
    +scripts.download_psf.run_main()[source]
    +

    Kick off the process grabbing the command-line parameters from sys.argv

    +
    + +
    +
    +scripts.download_psf.unpack(do_unpack, target, target_dir, unpack_dir, meta, args, logger)[source]
    +
    +
    -
    -

    Module contents

    +
    +

    scripts.make_euclidlike_pupil_plane module

    +

    This code has been taken from https://github.com/CosmoStat/wf-psf Liaudat et al.

    +

    This is an implementation of the function generate_pupil_obscurations https://github.com/CosmoStat/wf-psf/blob/87e0c8e9770199cd276f5f0551054cb4902d53bb/src/wf_psf/sims/SimPSFToolkit.py#L233

    +

    NOTE from Tobias Liaudat: +“Simple procedure considering only the 2D plane. +No 3D projections wrt the angle of the FoV is done.”

    +
    +
    +scripts.make_euclidlike_pupil_plane.make_EuclidLike_pupil_plane(N_pix=2048, do_filter=True, N_filter=3)[source]
    +
    +
    @@ -73,6 +169,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index 8a6504c..e5c04c5 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -81,6 +81,14 @@

    GalSim-Euclid-Like

    Navigation

    +

    Related Topics

    diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index bd0afe7..ea6848e 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"Attribution": [[2, "attribution"]], "Communicating with the developers": [[2, "communicating-with-the-developers"]], "Downloading relevant data": [[2, "downloading-relevant-data"]], "GalSim-Euclid-Like": [[2, null], [3, null]], "Getting started": [[2, "getting-started"]], "Installation": [[2, "installation"]], "Module contents": [[0, "module-euclidlike"], [1, "module-contents"], [4, "module-contents"]], "References": [[2, "references"]], "Submodules": [[0, "submodules"], [1, "submodules"], [4, "submodules"]], "euclidlike package": [[0, null]], "euclidlike.backgrounds module": [[0, "module-euclidlike.backgrounds"]], "euclidlike.bandpass module": [[0, "module-euclidlike.bandpass"]], "euclidlike.euclidlike_psf module": [[0, "module-euclidlike.euclidlike_psf"]], "euclidlike.euclidlike_wcs module": [[0, "module-euclidlike.euclidlike_wcs"]], "euclidlike.instrument_params module": [[0, "module-euclidlike.instrument_params"]], "euclidlike_imsim package": [[1, null]], "euclidlike_imsim.bandpass module": [[1, "euclidlike-imsim-bandpass-module"]], "euclidlike_imsim.ccd module": [[1, "euclidlike-imsim-ccd-module"]], "euclidlike_imsim.detector_physics module": [[1, "euclidlike-imsim-detector-physics-module"]], "euclidlike_imsim.noise module": [[1, "euclidlike-imsim-noise-module"]], "euclidlike_imsim.obseq module": [[1, "euclidlike-imsim-obseq-module"]], "euclidlike_imsim.photonOps module": [[1, "euclidlike-imsim-photonops-module"]], "euclidlike_imsim.psf module": [[1, "euclidlike-imsim-psf-module"]], "euclidlike_imsim.scafile module": [[1, "euclidlike-imsim-scafile-module"]], "euclidlike_imsim.skycat module": [[1, "euclidlike-imsim-skycat-module"]], "euclidlike_imsim.stamp module": [[1, "euclidlike-imsim-stamp-module"]], "euclidlike_imsim.utils module": [[1, "euclidlike-imsim-utils-module"]], "euclidlike_imsim.wcs module": [[1, "euclidlike-imsim-wcs-module"]], "scripts package": [[4, null]], "scripts.download_psf module": [[4, "scripts-download-psf-module"]], "scripts.make_euclidlike_pupil_plane module": [[4, "scripts-make-euclidlike-pupil-plane-module"]]}, "docnames": ["euclidlike", "euclidlike_imsim", "index", "modules", "scripts"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["euclidlike.rst", "euclidlike_imsim.rst", "index.rst", "modules.rst", "scripts.rst"], "indexentries": {"allowedpos() (in module euclidlike.euclidlike_wcs)": [[0, "euclidlike.euclidlike_wcs.allowedPos", false]], "bestpa() (in module euclidlike.euclidlike_wcs)": [[0, "euclidlike.euclidlike_wcs.bestPA", false]], "convertcenter() (in module euclidlike.euclidlike_wcs)": [[0, "euclidlike.euclidlike_wcs.convertCenter", false]], "euclidlike": [[0, "module-euclidlike", false]], "euclidlike.backgrounds": [[0, "module-euclidlike.backgrounds", false]], "euclidlike.bandpass": [[0, "module-euclidlike.bandpass", false]], "euclidlike.euclidlike_psf": [[0, "module-euclidlike.euclidlike_psf", false]], "euclidlike.euclidlike_wcs": [[0, "module-euclidlike.euclidlike_wcs", false]], "euclidlike.instrument_params": [[0, "module-euclidlike.instrument_params", false]], "findccd() (in module euclidlike.euclidlike_wcs)": [[0, "euclidlike.euclidlike_wcs.findCCD", false]], "getbandpasses() (in module euclidlike.bandpass)": [[0, "euclidlike.bandpass.getBandpasses", false]], "getbrightpsf() (in module euclidlike.euclidlike_psf)": [[0, "euclidlike.euclidlike_psf.getBrightPSF", false]], "getpsf() (in module euclidlike.euclidlike_psf)": [[0, "euclidlike.euclidlike_psf.getPSF", false]], "getskylevel() (in module euclidlike.backgrounds)": [[0, "euclidlike.backgrounds.getSkyLevel", false]], "getwcs() (in module euclidlike.euclidlike_wcs)": [[0, "euclidlike.euclidlike_wcs.getWCS", false]], "getzodibackground() (in module euclidlike.backgrounds)": [[0, "euclidlike.backgrounds.getZodiBackground", false]], "module": [[0, "module-euclidlike", false], [0, "module-euclidlike.backgrounds", false], [0, "module-euclidlike.bandpass", false], [0, "module-euclidlike.euclidlike_psf", false], [0, "module-euclidlike.euclidlike_wcs", false], [0, "module-euclidlike.instrument_params", false]]}, "objects": {"": [[0, 0, 0, "-", "euclidlike"]], "euclidlike": [[0, 0, 0, "-", "backgrounds"], [0, 0, 0, "-", "bandpass"], [0, 0, 0, "-", "euclidlike_psf"], [0, 0, 0, "-", "euclidlike_wcs"], [0, 0, 0, "-", "instrument_params"]], "euclidlike.backgrounds": [[0, 1, 1, "", "getSkyLevel"], [0, 1, 1, "", "getZodiBackground"]], "euclidlike.bandpass": [[0, 1, 1, "", "getBandpasses"]], "euclidlike.euclidlike_psf": [[0, 1, 1, "", "getBrightPSF"], [0, 1, 1, "", "getPSF"]], "euclidlike.euclidlike_wcs": [[0, 1, 1, "", "allowedPos"], [0, 1, 1, "", "bestPA"], [0, 1, 1, "", "convertCenter"], [0, 1, 1, "", "findCCD"], [0, 1, 1, "", "getWCS"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:function"}, "terms": {"": 0, "0": 0, "01201": 0, "06": 0, "1": 0, "10": 0, "17": 0, "180": 0, "2": 0, "20": 0, "2023": 0, "2025": 0, "2108": 0, "3": 0, "30": 0, "35": 0, "3x": 0, "4": 0, "42406840554768e": 0, "5": 0, "90": 0, "A": 0, "As": 0, "But": 0, "For": [0, 2], "If": 0, "In": 0, "It": [0, 2], "The": [0, 2], "These": 0, "To": 2, "__init__": 0, "ab": 0, "ab_zeropoint": 0, "aberr": 0, "about": [0, 2], "access": 0, "accord": 2, "account": 0, "accross": 0, "accuraci": [0, 2], "achromat": 0, "across": 0, "actual": 0, "addit": 0, "adjust": 0, "adopt": 0, "after": 2, "aim": 2, "al": 0, "alias": 0, "align": 0, "all": 0, "allow": 0, "allowedpo": [0, 3], "along": 2, "also": [0, 2], "altern": [0, 2], "alwai": 0, "an": [0, 2], "analysi": 2, "angl": 0, "ani": 0, "apertur": 0, "appear": 0, "applic": [0, 2], "appropi": 0, "approxim": [0, 2], "ar": [0, 2], "arbitrai": 0, "arcsec": 0, "area": 0, "arg": 0, "argument": [0, 2], "around": 0, "arrai": 0, "articl": 2, "arxiv": 0, "ask": 2, "aspect": 0, "assum": 0, "asttyp": 0, "avail": [0, 2], "awai": 0, "axi": 0, "b": 0, "background": 3, "baffl": 0, "band": 0, "bandpass": 3, "base": [0, 2], "basic": [0, 2], "becaus": 0, "befor": 0, "begin": 0, "being": 0, "best": 0, "bestpa": [0, 3], "between": 0, "blob": 0, "blue": 0, "bool": 0, "border": 0, "boxi": 0, "bright": 0, "brighter": 0, "brows": 0, "bug": 2, "c": 0, "cab": 0, "calcul": 0, "call": 0, "caltech": 0, "can": [0, 2], "cannot": 0, "care": 0, "carri": 0, "case": 0, "ccd": [0, 3], "ccd_po": 0, "celestialcoord": 0, "center": 0, "certain": 0, "chang": 0, "charg": 0, "check": 0, "chirata": 0, "choos": 0, "chosen": 0, "chri": 0, "chromat": 0, "cite": 2, "class": 0, "close": 0, "code": [0, 2], "coeffici": 0, "collecting_area": 0, "column": 0, "com": 0, "combin": 0, "command": 0, "comment": 2, "compromis": 0, "comput": 0, "configur": [0, 2], "consortium": 2, "construct": [0, 2], "contain": [0, 2], "content": 3, "contrast": 0, "contribut": 0, "contributor": 2, "convers": 0, "convert": 0, "convertcent": [0, 3], "coord": 0, "coordin": 0, "correct": 0, "correspond": 0, "cover": 0, "creat": 0, "csic": 0, "current": 0, "curv": 0, "dat": 0, "data": 0, "date": 0, "datetim": 0, "deblend": 2, "decent": 0, "decontamin": 0, "default": [0, 2], "default_thin_trunc": 0, "defin": 0, "degrad": 0, "degre": 0, "demo": 2, "depend": 0, "deriv": 0, "describ": 2, "descript": 0, "desir": 0, "detail": [0, 2], "detect": 2, "detector": 0, "detector_phys": 3, "determin": 0, "determinist": 0, "develop": 0, "diamet": 0, "dichroic": 0, "dict": 0, "diffus": 0, "dir": 2, "directli": 0, "directori": [0, 2], "discret": 0, "distinct": 2, "distort": 0, "dither": 0, "divid": 0, "do": 0, "docstr": [0, 2], "document": 2, "doe": 0, "doi": 2, "done": 0, "download": 0, "download_psf": 3, "draw": 0, "due": 0, "duncan": 0, "e": 0, "each": 0, "earli": 0, "earth": 0, "ecl_dlon": 0, "ecl_lat": 0, "eclipt": 0, "edit": 0, "edu": 0, "effect": 0, "either": 0, "empir": 0, "enabl": [0, 2], "end": 0, "enough": 0, "epoch": 0, "equinox": 0, "ero": 0, "error": 0, "esa": 0, "esac": 0, "estim": 0, "et": 0, "etc": 0, "euclid": 0, "euclid_lik": 0, "euclid_vi": 0, "euclidlik": [2, 3], "euclidlike_download_psf": [0, 2], "euclidlike_imsim": [2, 3], "euclidlike_psf": 3, "euclidlike_wc": 3, "even": 0, "everyth": 0, "exact": 0, "exactli": 0, "exampl": [0, 2], "except": 0, "expect": 0, "explor": 2, "exposur": 0, "exptim": 0, "face": 0, "fact": 0, "fair": 0, "fake": 0, "fall": 0, "fals": 0, "fast": 2, "faster": 0, "fatter": 0, "feel": 2, "fidel": 2, "fig": 0, "figur": 0, "file": 0, "filter": 0, "find": 0, "findccd": [0, 3], "fix": 0, "flag": 2, "float": 0, "flux": 0, "focal": [0, 2], "focu": 0, "folding_threshold": 0, "follow": 0, "format": 0, "found": 0, "fov": 2, "fpa": 0, "fps3": 0, "free": 2, "from": [0, 2], "full": [0, 2], "full_bandpass": 0, "fulli": 0, "function": [0, 2], "further": 2, "futur": 0, "galsim": 0, "gap": 0, "gener": [0, 2], "get": 0, "getbandpass": [0, 3], "getbrightpsf": [0, 3], "getpsf": [0, 2, 3], "getskylevel": [0, 3], "getwc": [0, 3], "getzodibackground": [0, 3], "github": [0, 2], "give": 0, "given": [0, 2], "gname": 0, "gname2": 0, "goal": 0, "good": 0, "grid": [0, 2], "ground": 2, "gsparam": 0, "guid": 0, "ha": [0, 2], "half": 0, "handl": 0, "have": 0, "heavili": [0, 2], "helper": [0, 2], "here": 0, "high": [0, 2], "higher": 2, "highlight": 2, "hirata": 0, "how": [0, 2], "howev": 0, "http": 0, "i": [0, 2], "ic": 0, "id": 0, "ignor": 0, "illustr": 2, "imag": [0, 2], "implement": 0, "import": 0, "includ": [0, 2], "include_bord": 0, "incorpor": 0, "index": 0, "indic": [0, 2], "ineffici": 0, "infer": 0, "inform": [0, 2], "initi": 0, "input": 0, "instruct": 2, "instrument": [0, 2], "instrument_param": 3, "int": 0, "inta": 0, "integ": 0, "interest": [0, 2], "intern": 0, "interpol": 0, "interpolatedchromaticobject": 0, "interpolatedimag": 0, "ipac": 0, "isr": 0, "issu": 2, "iter": 0, "its": [0, 2], "joint": 2, "journal": 2, "kei": 0, "keyword": 0, "know": 0, "knowledg": 0, "kwarg": 0, "label": 0, "lack": 0, "lambda_max": 0, "lambda_min": 0, "lanc": 0, "larg": 2, "later": 0, "latest": 0, "latitud": 0, "lead": 0, "least": 0, "leav": 0, "lens": [0, 2], "less": 0, "level": 0, "librari": 2, "licens": 2, "lie": 0, "life": 0, "light": 0, "like": 0, "limit": 0, "linear": 0, "link": 2, "list": 0, "load": 0, "locat": 0, "logger": 0, "longer": 0, "longitud": 0, "look": 0, "lookup": 0, "lookupt": 0, "lower": 0, "m": 0, "magnitud": 0, "mai": [0, 2], "main": 0, "make": 0, "make_euclidlike_pupil_plan": 3, "makeskyimag": 0, "matroxel": 0, "maximum": 0, "mean": 0, "meant": 0, "measur": 0, "method": 2, "michael": 0, "micron": 0, "might": 0, "miller": 0, "minimum": 0, "mode": 0, "model": 0, "modifi": 0, "modul": 3, "more": 2, "most": 0, "msp": 0, "much": 0, "multipli": 0, "must": [0, 2], "n_wave": 0, "nanomet": 0, "need": [0, 2], "new": 2, "nisp": 0, "nois": 3, "non": 0, "none": 0, "nonlinear": 0, "normal": 0, "note": [0, 2], "np": 0, "number": 0, "numpi": 0, "object": [0, 2], "obliqu": 0, "obscur": 0, "obseq": 3, "observ": 0, "observatori": [0, 2], "obtain": 0, "obviou": 0, "obvious": 0, "old": 0, "omit": 0, "onc": 2, "one": 0, "onli": [0, 2], "onto": 0, "open": 2, "opposit": 0, "optic": 0, "optim": 0, "option": 0, "orbit": 0, "order": 0, "org": 0, "orient": 0, "origin": 0, "other": 0, "otherwis": 0, "out": 0, "output": 0, "outsid": 0, "outskirt": 0, "over": 0, "overli": 0, "oversampl": [0, 2], "own": 2, "pa": 0, "pa_is_fpa": 0, "packag": [2, 3], "panel": 0, "paper": 2, "paramet": 0, "part": 0, "particular": [0, 2], "particularli": 2, "pass": 0, "passband": 0, "pattern": 0, "per": 0, "perfectli": 0, "permiss": 0, "permit": 0, "photo": 0, "photometri": 2, "photon": 0, "photonop": 3, "php": 0, "pi": 0, "pix": 0, "pixel": 0, "pixel_scal": 0, "pixelscal": 0, "place": 2, "plan": 0, "plane": [0, 2], "pleas": 2, "point": 0, "polar": 0, "port": 0, "posit": [0, 2], "positiond": 0, "possibl": 0, "possibli": 0, "post": 0, "precis": [0, 2], "precomput": [0, 2], "preliminari": 2, "process": 0, "produc": [0, 2], "project": 0, "properli": 0, "provid": [0, 2], "psf": [0, 2, 3], "psf_dir": 0, "publicli": 0, "pupil": 0, "pupil_bin": 0, "py": 0, "python": 0, "qe": 0, "quadrant": 0, "queri": 0, "question": 2, "radian": 0, "rais": 0, "rang": 0, "rather": 2, "reach": 2, "read": 0, "readm": 2, "readout": 0, "real": 0, "realist": 0, "reason": 0, "red": 0, "refdata": 0, "refer": 0, "reflect": 0, "rel": 0, "releas": 0, "remov": 0, "render": 0, "renorm": 0, "report": 2, "repositori": 2, "repres": 0, "represent": 2, "request": 0, "requir": [0, 2], "research": 2, "respect": 0, "respons": 0, "result": [0, 2], "return": 0, "roman": 0, "roman_bandpass": 0, "roman_imsim": 2, "routin": [0, 2], "row": 0, "run": 2, "saa": 0, "sampl": 0, "scafil": 3, "scale": 2, "scaramella": 0, "scenario": 0, "script": [2, 3], "sec": 0, "second": 0, "sed": 0, "see": [0, 2], "select": 0, "sensibli": 0, "sensor": 0, "septemb": 0, "sequenc": 0, "set": 0, "sever": 0, "shape": 0, "shear": 0, "should": [0, 2], "show": 0, "signatur": 0, "simpl": 0, "simpli": 0, "simplifi": 0, "simul": [0, 2], "singl": 0, "size": 0, "sky": 0, "skycat": 3, "slower": 0, "small": 0, "so": 0, "softwar": [0, 2], "solar": 0, "some": [0, 2], "sourc": [0, 2], "space": [0, 2], "spatial": 0, "specifi": 0, "spider": 0, "spot": 0, "stamp": 3, "star": 0, "store": 0, "str": 0, "string": 0, "submodul": 3, "subroutin": 0, "subset": 0, "suffici": 2, "sum": 0, "sun": 0, "suppli": 0, "suppress": 0, "surfac": 0, "survei": 2, "svo": 0, "svo2": 0, "switch": 0, "system": 0, "t": 0, "tabl": 0, "tabul": 0, "take": 0, "tapir": 0, "telescop": [0, 2], "tell": 0, "term": 2, "termin": [0, 2], "test": 0, "than": [0, 2], "thei": 0, "theori": 0, "therefor": 0, "thi": [0, 2], "thin": 0, "those": [0, 2], "thought": 0, "three": 0, "through": 2, "throughput": 0, "time": 0, "tlambda": 0, "tol": 0, "toler": 0, "too": 0, "toward": [0, 2], "transfer": 0, "transmiss": 0, "troxel": 0, "true": 0, "truncat": 0, "try": 0, "two": 2, "uncertain": 0, "unit": 0, "unless": 0, "up": 0, "updat": 2, "url": 2, "us": [0, 2], "user": 0, "util": 3, "v1": 0, "valu": 0, "vari": 0, "variat": 0, "veri": 0, "vernal": 0, "version": 0, "vi": 0, "view": 2, "vignet": 0, "wa": 0, "wai": 0, "want": 0, "wavefront": 0, "wavelength": [0, 2], "wc": [0, 3], "wcs_dict": 0, "we": [0, 2], "weak": [0, 2], "web": 0, "websit": 2, "welcom": 2, "were": 0, "what": 0, "when": [0, 2], "where": [0, 2], "whether": 0, "which": 0, "who": 0, "why": 0, "wish": 0, "within": [0, 2], "without": 0, "world": 0, "world_po": 0, "would": 0, "www": 0, "y": 0, "you": 0, "zenodo": 2, "zeropoint": 0, "zodiac": 0}, "titles": ["euclidlike package", "euclidlike_imsim package", "GalSim-Euclid-Like", "GalSim-Euclid-Like", "scripts package"], "titleterms": {"attribut": 2, "background": 0, "bandpass": [0, 1], "ccd": 1, "commun": 2, "content": [0, 1, 4], "data": 2, "detector_phys": 1, "develop": 2, "download": 2, "download_psf": 4, "euclid": [2, 3], "euclidlik": 0, "euclidlike_imsim": 1, "euclidlike_psf": 0, "euclidlike_wc": 0, "galsim": [2, 3], "get": 2, "instal": 2, "instrument_param": 0, "like": [2, 3], "make_euclidlike_pupil_plan": 4, "modul": [0, 1, 4], "nois": 1, "obseq": 1, "packag": [0, 1, 4], "photonop": 1, "psf": 1, "refer": 2, "relev": 2, "scafil": 1, "script": 4, "skycat": 1, "stamp": 1, "start": 2, "submodul": [0, 1, 4], "util": 1, "wc": 1}}) \ No newline at end of file +Search.setIndex({"alltitles": {"Attribution": [[15, "attribution"]], "Changes from v0.0.0 to v0.0.1": [[11, "changes-from-v0-0-0-to-v0-0-1"]], "Classes and Functions": [[1, "module-euclidlike_imsim.bandpass"], [9, "module-euclidlike_imsim.bandpass"]], "Communicating with the developers": [[15, "communicating-with-the-developers"]], "Config SLURM": [[9, "config-slurm"]], "Config imsim": [[9, "config-imsim"]], "Dependencies": [[13, "dependencies"]], "Downloading relevant data": [[15, "downloading-relevant-data"]], "End-to-end demo": [[2, "end-to-end-demo"], [10, "end-to-end-demo"]], "Euclid-like Functions": [[0, "euclid-like-functions"], [8, "euclid-like-functions"]], "Examples": [[2, null], [10, null]], "Focal Plane Layout": [[2, "focal-plane-layout"], [10, "focal-plane-layout"]], "GalSim-Euclid-Like": [[15, "galsim-euclid-like"]], "GalSim-Euclid-Like: Euclid-like images using GalSim": [[4, null], [12, null]], "Getting started": [[15, "getting-started"]], "Indices and tables": [[4, "indices-and-tables"], [12, "indices-and-tables"]], "Installation": [[5, null], [13, null], [13, "id1"], [15, "installation"]], "Installation Instructions": [[13, "installation-instructions"]], "Module-level Attributes": [[0, "module-level-attributes"], [8, "module-level-attributes"]], "Older Versions": [[11, "older-versions"]], "Overview": [[7, null], [15, null]], "References": [[15, "references"]], "Revision History": [[11, null]], "Submodules": [[16, "submodules"]], "The Euclid-like ImSim Module": [[1, null], [9, null]], "The Euclid-like Module": [[0, null], [8, null]], "Use": [[1, "use"], [9, "use"]], "scripts package": [[16, null]], "scripts.download_psf module": [[16, "module-scripts.download_psf"]], "scripts.make_euclidlike_pupil_plane module": [[16, "module-scripts.make_euclidlike_pupil_plane"]]}, "docnames": [".ipynb_checkpoints/euclidlike-checkpoint", ".ipynb_checkpoints/euclidlike_imsim-checkpoint", ".ipynb_checkpoints/examples-checkpoint", ".ipynb_checkpoints/history-checkpoint", ".ipynb_checkpoints/index-checkpoint", ".ipynb_checkpoints/install-checkpoint", ".ipynb_checkpoints/modules-checkpoint", ".ipynb_checkpoints/overview-checkpoint", "euclidlike", "euclidlike_imsim", "examples", "history", "index", "install", "modules", "overview", "scripts"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": [".ipynb_checkpoints/euclidlike-checkpoint.rst", ".ipynb_checkpoints/euclidlike_imsim-checkpoint.rst", ".ipynb_checkpoints/examples-checkpoint.rst", ".ipynb_checkpoints/history-checkpoint.rst", ".ipynb_checkpoints/index-checkpoint.rst", ".ipynb_checkpoints/install-checkpoint.rst", ".ipynb_checkpoints/modules-checkpoint.rst", ".ipynb_checkpoints/overview-checkpoint.rst", "euclidlike.rst", "euclidlike_imsim.rst", "examples.rst", "history.rst", "index.rst", "install.rst", "modules.rst", "overview.rst", "scripts.rst"], "indexentries": {"addnoise() (euclidlike_imsim.ccd.euclidlikeccdimagebuilder method)": [[1, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.addNoise", false], [9, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.addNoise", false]], "applyto() (euclidlike_imsim.photonops.chargediff method)": [[1, "euclidlike_imsim.photonOps.ChargeDiff.applyTo", false], [9, "euclidlike_imsim.photonOps.ChargeDiff.applyTo", false]], "buildbandpass() (euclidlike_imsim.bandpass.euclidlikebandpassbuilder method)": [[1, "euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder.buildBandpass", false], [9, "euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder.buildBandpass", false]], "buildimage() (euclidlike_imsim.ccd.euclidlikeccdimagebuilder method)": [[1, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.buildImage", false], [9, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.buildImage", false]], "buildphotonop() (euclidlike_imsim.photonops.chargediffbuilder method)": [[1, "euclidlike_imsim.photonOps.ChargeDiffBuilder.buildPhotonOp", false], [9, "euclidlike_imsim.photonOps.ChargeDiffBuilder.buildPhotonOp", false]], "buildpsf() (euclidlike_imsim.stamp.euclidlike_stamp method)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp.buildPSF", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp.buildPSF", false]], "buildwcs() (euclidlike_imsim.wcs.euclidlikewcs method)": [[1, "euclidlike_imsim.wcs.EuclidlikeWCS.buildWCS", false], [9, "euclidlike_imsim.wcs.EuclidlikeWCS.buildWCS", false]], "chargediff (class in euclidlike_imsim.photonops)": [[1, "euclidlike_imsim.photonOps.ChargeDiff", false], [9, "euclidlike_imsim.photonOps.ChargeDiff", false]], "chargediffbuilder (class in euclidlike_imsim.photonops)": [[1, "euclidlike_imsim.photonOps.ChargeDiffBuilder", false], [9, "euclidlike_imsim.photonOps.ChargeDiffBuilder", false]], "check_existing() (in module scripts.download_psf)": [[16, "scripts.download_psf.check_existing", false]], "check_input() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.check_input", false], [9, "euclidlike_imsim.utils.roman_utils.check_input", false]], "check_remove() (in module scripts.download_psf)": [[16, "scripts.download_psf.check_remove", false]], "check_unpack() (in module scripts.download_psf)": [[16, "scripts.download_psf.check_unpack", false]], "download() (in module scripts.download_psf)": [[16, "scripts.download_psf.download", false]], "download_psf() (in module scripts.download_psf)": [[16, "scripts.download_psf.download_psf", false]], "draw() (euclidlike_imsim.stamp.euclidlike_stamp method)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp.draw", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp.draw", false]], "euclidlike_imsim.bandpass": [[1, "module-euclidlike_imsim.bandpass", false], [9, "module-euclidlike_imsim.bandpass", false]], "euclidlike_imsim.ccd": [[1, "module-euclidlike_imsim.ccd", false], [9, "module-euclidlike_imsim.ccd", false]], "euclidlike_imsim.noise": [[1, "module-euclidlike_imsim.noise", false], [9, "module-euclidlike_imsim.noise", false]], "euclidlike_imsim.obseq": [[1, "module-euclidlike_imsim.obseq", false], [9, "module-euclidlike_imsim.obseq", false]], "euclidlike_imsim.photonops": [[1, "module-euclidlike_imsim.photonOps", false], [9, "module-euclidlike_imsim.photonOps", false]], "euclidlike_imsim.psf": [[1, "module-euclidlike_imsim.psf", false], [9, "module-euclidlike_imsim.psf", false]], "euclidlike_imsim.skycat": [[1, "module-euclidlike_imsim.skycat", false], [9, "module-euclidlike_imsim.skycat", false]], "euclidlike_imsim.stamp": [[1, "module-euclidlike_imsim.stamp", false], [9, "module-euclidlike_imsim.stamp", false]], "euclidlike_imsim.utils": [[1, "module-euclidlike_imsim.utils", false], [9, "module-euclidlike_imsim.utils", false]], "euclidlike_imsim.wcs": [[1, "module-euclidlike_imsim.wcs", false], [9, "module-euclidlike_imsim.wcs", false]], "euclidlike_stamp (class in euclidlike_imsim.stamp)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp", false]], "euclidlikebandpassbuilder (class in euclidlike_imsim.bandpass)": [[1, "euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder", false], [9, "euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder", false]], "euclidlikeccdimagebuilder (class in euclidlike_imsim.ccd)": [[1, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder", false], [9, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder", false]], "euclidlikepsf (class in euclidlike_imsim.psf)": [[1, "euclidlike_imsim.psf.EuclidlikePSF", false], [9, "euclidlike_imsim.psf.EuclidlikePSF", false]], "euclidlikewcs (class in euclidlike_imsim.wcs)": [[1, "euclidlike_imsim.wcs.EuclidlikeWCS", false], [9, "euclidlike_imsim.wcs.EuclidlikeWCS", false]], "findccd() (in module euclidlike)": [[0, "euclidlike.findCCD", false], [8, "euclidlike.findCCD", false]], "fix_seds() (euclidlike_imsim.stamp.euclidlike_stamp class method)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp.fix_seds", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp.fix_seds", false]], "get() (euclidlike_imsim.obseq.obseqdataloader method)": [[1, "euclidlike_imsim.obseq.ObSeqDataLoader.get", false], [9, "euclidlike_imsim.obseq.ObSeqDataLoader.get", false]], "get_ccd_center() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.get_ccd_center", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.get_ccd_center", false]], "get_input() (in module scripts.download_psf)": [[16, "scripts.download_psf.get_input", false]], "get_meta() (in module scripts.download_psf)": [[16, "scripts.download_psf.get_meta", false]], "get_names() (in module scripts.download_psf)": [[16, "scripts.download_psf.get_names", false]], "get_noise() (in module euclidlike_imsim.noise)": [[1, "euclidlike_imsim.noise.get_noise", false], [9, "euclidlike_imsim.noise.get_noise", false]], "getapproxnobjects() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getApproxNObjects", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getApproxNObjects", false]], "getbandpass() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.getBandpass", false], [9, "euclidlike_imsim.utils.roman_utils.getBandpass", false]], "getbandpasses() (in module euclidlike)": [[0, "euclidlike.getBandpasses", false], [8, "euclidlike.getBandpasses", false]], "getbrightpsf() (in module euclidlike)": [[0, "euclidlike.getBrightPSF", false], [8, "euclidlike.getBrightPSF", false]], "getdrawmethod() (euclidlike_imsim.stamp.euclidlike_stamp method)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp.getDrawMethod", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp.getDrawMethod", false]], "getflux() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getFlux", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getFlux", false]], "getkwargs() (euclidlike_imsim.psf.psfloader method)": [[1, "euclidlike_imsim.psf.PSFLoader.getKwargs", false], [9, "euclidlike_imsim.psf.PSFLoader.getKwargs", false]], "getkwargs() (euclidlike_imsim.skycat.skycatalogloader method)": [[1, "euclidlike_imsim.skycat.SkyCatalogLoader.getKwargs", false], [9, "euclidlike_imsim.skycat.SkyCatalogLoader.getKwargs", false]], "getlocalwcs() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.getLocalWCS", false], [9, "euclidlike_imsim.utils.roman_utils.getLocalWCS", false]], "getnobjects() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getNObjects", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getNObjects", false]], "getobj() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getObj", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getObj", false]], "getpsf() (euclidlike_imsim.psf.euclidlikepsf method)": [[1, "euclidlike_imsim.psf.EuclidlikePSF.getPSF", false], [9, "euclidlike_imsim.psf.EuclidlikePSF.getPSF", false]], "getpsf() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.getPSF", false], [9, "euclidlike_imsim.utils.roman_utils.getPSF", false]], "getpsf() (in module euclidlike)": [[0, "euclidlike.getPSF", false], [8, "euclidlike.getPSF", false]], "getpsf_image() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.getPSF_Image", false], [9, "euclidlike_imsim.utils.roman_utils.getPSF_Image", false]], "getskylevel() (in module euclidlike)": [[0, "euclidlike.getSkyLevel", false], [8, "euclidlike.getSkyLevel", false]], "getvalue() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getValue", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getValue", false]], "getwcs() (euclidlike_imsim.utils.roman_utils method)": [[1, "euclidlike_imsim.utils.roman_utils.getWCS", false], [9, "euclidlike_imsim.utils.roman_utils.getWCS", false]], "getwcs() (in module euclidlike)": [[0, "euclidlike.getWCS", false], [8, "euclidlike.getWCS", false]], "getworldpos() (euclidlike_imsim.skycat.skycataloginterface method)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.getWorldPos", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.getWorldPos", false]], "initialize() (euclidlike_imsim.noise.noiseimagebuilder method)": [[1, "euclidlike_imsim.noise.NoiseImageBuilder.initialize", false], [9, "euclidlike_imsim.noise.NoiseImageBuilder.initialize", false]], "main() (in module scripts.download_psf)": [[16, "scripts.download_psf.main", false]], "make_euclidlike_pupil_plane() (in module scripts.make_euclidlike_pupil_plane)": [[16, "scripts.make_euclidlike_pupil_plane.make_EuclidLike_pupil_plane", false]], "make_link() (in module scripts.download_psf)": [[16, "scripts.download_psf.make_link", false]], "module": [[1, "module-euclidlike_imsim.bandpass", false], [1, "module-euclidlike_imsim.ccd", false], [1, "module-euclidlike_imsim.noise", false], [1, "module-euclidlike_imsim.obseq", false], [1, "module-euclidlike_imsim.photonOps", false], [1, "module-euclidlike_imsim.psf", false], [1, "module-euclidlike_imsim.skycat", false], [1, "module-euclidlike_imsim.stamp", false], [1, "module-euclidlike_imsim.utils", false], [1, "module-euclidlike_imsim.wcs", false], [9, "module-euclidlike_imsim.bandpass", false], [9, "module-euclidlike_imsim.ccd", false], [9, "module-euclidlike_imsim.noise", false], [9, "module-euclidlike_imsim.obseq", false], [9, "module-euclidlike_imsim.photonOps", false], [9, "module-euclidlike_imsim.psf", false], [9, "module-euclidlike_imsim.skycat", false], [9, "module-euclidlike_imsim.stamp", false], [9, "module-euclidlike_imsim.utils", false], [9, "module-euclidlike_imsim.wcs", false], [16, "module-scripts", false], [16, "module-scripts.download_psf", false], [16, "module-scripts.make_euclidlike_pupil_plane", false]], "noiseimagebuilder (class in euclidlike_imsim.noise)": [[1, "euclidlike_imsim.noise.NoiseImageBuilder", false], [9, "euclidlike_imsim.noise.NoiseImageBuilder", false]], "objects (euclidlike_imsim.skycat.skycataloginterface property)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface.objects", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface.objects", false]], "obseqdata() (in module euclidlike_imsim.obseq)": [[1, "euclidlike_imsim.obseq.ObSeqData", false], [9, "euclidlike_imsim.obseq.ObSeqData", false]], "obseqdataloader (class in euclidlike_imsim.obseq)": [[1, "euclidlike_imsim.obseq.ObSeqDataLoader", false], [9, "euclidlike_imsim.obseq.ObSeqDataLoader", false]], "parse_args() (in module scripts.download_psf)": [[16, "scripts.download_psf.parse_args", false]], "parse_noise_config() (in module euclidlike_imsim.noise)": [[1, "euclidlike_imsim.noise.parse_noise_config", false], [9, "euclidlike_imsim.noise.parse_noise_config", false]], "processimage() (euclidlike_imsim.noise.noiseimagebuilder method)": [[1, "euclidlike_imsim.noise.NoiseImageBuilder.processImage", false], [9, "euclidlike_imsim.noise.NoiseImageBuilder.processImage", false]], "processimage() (euclidlike_imsim.noise.skyimagebuilder method)": [[1, "euclidlike_imsim.noise.SkyImageBuilder.processImage", false], [9, "euclidlike_imsim.noise.SkyImageBuilder.processImage", false]], "processimage() (euclidlike_imsim.noise.weightimagebuilder method)": [[1, "euclidlike_imsim.noise.WeightImageBuilder.processImage", false], [9, "euclidlike_imsim.noise.WeightImageBuilder.processImage", false]], "psfloader (class in euclidlike_imsim.psf)": [[1, "euclidlike_imsim.psf.PSFLoader", false], [9, "euclidlike_imsim.psf.PSFLoader", false]], "query_yes_no() (in module scripts.download_psf)": [[16, "scripts.download_psf.query_yes_no", false]], "read_obseq() (euclidlike_imsim.obseq.obseqdataloader method)": [[1, "euclidlike_imsim.obseq.ObSeqDataLoader.read_obseq", false], [9, "euclidlike_imsim.obseq.ObSeqDataLoader.read_obseq", false]], "remove_tarball() (in module scripts.download_psf)": [[16, "scripts.download_psf.remove_tarball", false]], "roman_utils (class in euclidlike_imsim.utils)": [[1, "euclidlike_imsim.utils.roman_utils", false], [9, "euclidlike_imsim.utils.roman_utils", false]], "run_main() (in module scripts.download_psf)": [[16, "scripts.download_psf.run_main", false]], "scripts": [[16, "module-scripts", false]], "scripts.download_psf": [[16, "module-scripts.download_psf", false]], "scripts.make_euclidlike_pupil_plane": [[16, "module-scripts.make_euclidlike_pupil_plane", false]], "setup() (euclidlike_imsim.ccd.euclidlikeccdimagebuilder method)": [[1, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.setup", false], [9, "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder.setup", false]], "setup() (euclidlike_imsim.stamp.euclidlike_stamp method)": [[1, "euclidlike_imsim.stamp.Euclidlike_stamp.setup", false], [9, "euclidlike_imsim.stamp.Euclidlike_stamp.setup", false]], "skycataloginterface (class in euclidlike_imsim.skycat)": [[1, "euclidlike_imsim.skycat.SkyCatalogInterface", false], [9, "euclidlike_imsim.skycat.SkyCatalogInterface", false]], "skycatalogloader (class in euclidlike_imsim.skycat)": [[1, "euclidlike_imsim.skycat.SkyCatalogLoader", false], [9, "euclidlike_imsim.skycat.SkyCatalogLoader", false]], "skycatobj() (in module euclidlike_imsim.skycat)": [[1, "euclidlike_imsim.skycat.SkyCatObj", false], [9, "euclidlike_imsim.skycat.SkyCatObj", false]], "skycatvalue() (in module euclidlike_imsim.skycat)": [[1, "euclidlike_imsim.skycat.SkyCatValue", false], [9, "euclidlike_imsim.skycat.SkyCatValue", false]], "skycatworldpos() (in module euclidlike_imsim.skycat)": [[1, "euclidlike_imsim.skycat.SkyCatWorldPos", false], [9, "euclidlike_imsim.skycat.SkyCatWorldPos", false]], "skyimagebuilder (class in euclidlike_imsim.noise)": [[1, "euclidlike_imsim.noise.SkyImageBuilder", false], [9, "euclidlike_imsim.noise.SkyImageBuilder", false]], "unpack() (in module scripts.download_psf)": [[16, "scripts.download_psf.unpack", false]], "weightimagebuilder (class in euclidlike_imsim.noise)": [[1, "euclidlike_imsim.noise.WeightImageBuilder", false], [9, "euclidlike_imsim.noise.WeightImageBuilder", false]]}, "objects": {"": [[16, 1, 0, "-", "scripts"]], "euclidlike": [[8, 0, 1, "", "findCCD"], [8, 0, 1, "", "getBandpasses"], [8, 0, 1, "", "getBrightPSF"], [8, 0, 1, "", "getPSF"], [8, 0, 1, "", "getSkyLevel"], [8, 0, 1, "", "getWCS"]], "euclidlike_imsim": [[9, 1, 0, "-", "bandpass"], [9, 1, 0, "-", "ccd"], [9, 1, 0, "-", "noise"], [9, 1, 0, "-", "obseq"], [9, 1, 0, "-", "photonOps"], [9, 1, 0, "-", "psf"], [9, 1, 0, "-", "skycat"], [9, 1, 0, "-", "stamp"], [9, 1, 0, "-", "utils"], [9, 1, 0, "-", "wcs"]], "euclidlike_imsim.bandpass": [[9, 2, 1, "", "EuclidlikeBandpassBuilder"]], "euclidlike_imsim.bandpass.EuclidlikeBandpassBuilder": [[9, 3, 1, "", "buildBandpass"]], "euclidlike_imsim.ccd": [[9, 2, 1, "", "EuclidlikeCCDImageBuilder"]], "euclidlike_imsim.ccd.EuclidlikeCCDImageBuilder": [[9, 3, 1, "", "addNoise"], [9, 3, 1, "", "buildImage"], [9, 3, 1, "", "setup"]], "euclidlike_imsim.noise": [[9, 2, 1, "", "NoiseImageBuilder"], [9, 2, 1, "", "SkyImageBuilder"], [9, 2, 1, "", "WeightImageBuilder"], [9, 0, 1, "", "get_noise"], [9, 0, 1, "", "parse_noise_config"]], "euclidlike_imsim.noise.NoiseImageBuilder": [[9, 3, 1, "", "initialize"], [9, 3, 1, "", "processImage"]], "euclidlike_imsim.noise.SkyImageBuilder": [[9, 3, 1, "", "processImage"]], "euclidlike_imsim.noise.WeightImageBuilder": [[9, 3, 1, "", "processImage"]], "euclidlike_imsim.obseq": [[9, 0, 1, "", "ObSeqData"], [9, 2, 1, "", "ObSeqDataLoader"]], "euclidlike_imsim.obseq.ObSeqDataLoader": [[9, 3, 1, "", "get"], [9, 3, 1, "", "read_obseq"]], "euclidlike_imsim.photonOps": [[9, 2, 1, "", "ChargeDiff"], [9, 2, 1, "", "ChargeDiffBuilder"]], "euclidlike_imsim.photonOps.ChargeDiff": [[9, 3, 1, "", "applyTo"]], "euclidlike_imsim.photonOps.ChargeDiffBuilder": [[9, 3, 1, "", "buildPhotonOp"]], "euclidlike_imsim.psf": [[9, 2, 1, "", "EuclidlikePSF"], [9, 2, 1, "", "PSFLoader"]], "euclidlike_imsim.psf.EuclidlikePSF": [[9, 3, 1, "", "getPSF"]], "euclidlike_imsim.psf.PSFLoader": [[9, 3, 1, "", "getKwargs"]], "euclidlike_imsim.skycat": [[9, 0, 1, "", "SkyCatObj"], [9, 0, 1, "", "SkyCatValue"], [9, 0, 1, "", "SkyCatWorldPos"], [9, 2, 1, "", "SkyCatalogInterface"], [9, 2, 1, "", "SkyCatalogLoader"]], "euclidlike_imsim.skycat.SkyCatalogInterface": [[9, 3, 1, "", "getApproxNObjects"], [9, 3, 1, "", "getFlux"], [9, 3, 1, "", "getNObjects"], [9, 3, 1, "", "getObj"], [9, 3, 1, "", "getValue"], [9, 3, 1, "", "getWorldPos"], [9, 3, 1, "", "get_ccd_center"], [9, 4, 1, "", "objects"]], "euclidlike_imsim.skycat.SkyCatalogLoader": [[9, 3, 1, "", "getKwargs"]], "euclidlike_imsim.stamp": [[9, 2, 1, "", "Euclidlike_stamp"]], "euclidlike_imsim.stamp.Euclidlike_stamp": [[9, 3, 1, "", "buildPSF"], [9, 3, 1, "", "draw"], [9, 3, 1, "", "fix_seds"], [9, 3, 1, "", "getDrawMethod"], [9, 3, 1, "", "setup"]], "euclidlike_imsim.utils": [[9, 2, 1, "", "roman_utils"]], "euclidlike_imsim.utils.roman_utils": [[9, 3, 1, "", "check_input"], [9, 3, 1, "", "getBandpass"], [9, 3, 1, "", "getLocalWCS"], [9, 3, 1, "", "getPSF"], [9, 3, 1, "", "getPSF_Image"], [9, 3, 1, "", "getWCS"]], "euclidlike_imsim.wcs": [[9, 2, 1, "", "EuclidlikeWCS"]], "euclidlike_imsim.wcs.EuclidlikeWCS": [[9, 3, 1, "", "buildWCS"]], "scripts": [[16, 1, 0, "-", "download_psf"], [16, 1, 0, "-", "make_euclidlike_pupil_plane"]], "scripts.download_psf": [[16, 0, 1, "", "check_existing"], [16, 0, 1, "", "check_remove"], [16, 0, 1, "", "check_unpack"], [16, 0, 1, "", "download"], [16, 0, 1, "", "download_psf"], [16, 0, 1, "", "get_input"], [16, 0, 1, "", "get_meta"], [16, 0, 1, "", "get_names"], [16, 0, 1, "", "main"], [16, 0, 1, "", "make_link"], [16, 0, 1, "", "parse_args"], [16, 0, 1, "", "query_yes_no"], [16, 0, 1, "", "remove_tarball"], [16, 0, 1, "", "run_main"], [16, 0, 1, "", "unpack"]], "scripts.make_euclidlike_pupil_plane": [[16, 0, 1, "", "make_EuclidLike_pupil_plane"]]}, "objnames": {"0": ["py", "function", "Python function"], "1": ["py", "module", "Python module"], "2": ["py", "class", "Python class"], "3": ["py", "method", "Python method"], "4": ["py", "property", "Python property"]}, "objtypes": {"0": "py:function", "1": "py:module", "2": "py:class", "3": "py:method", "4": "py:property"}, "terms": {"": [0, 8], "0": [0, 1, 8, 9, 12, 13], "1": [0, 1, 8, 9, 12, 13], "10": [0, 8, 13], "100": [1, 9], "1000000": [1, 9], "13": [2, 10], "17": [0, 8, 13], "180": [0, 8], "2": [0, 8, 9, 13, 16], "2023": [0, 8], "2025": [0, 8], "2048": 16, "2d": 16, "3": [13, 16], "30": [0, 1, 8, 9], "33688": 9, "33689": 9, "33690": 9, "35": [0, 8, 9], "3d": 16, "3x": [0, 8], "4": [0, 1, 8, 9], "5": [0, 8, 16], "6": 13, "8": [1, 9], "87e0c8e9770199cd276f5f0551054cb4902d53bb": 16, "90": [0, 8], "A": [0, 1, 8, 9, 16], "As": [0, 8], "But": [0, 8], "For": [0, 1, 8, 9, 13, 15], "If": [0, 1, 8, 9], "In": [0, 1, 8, 9], "It": [1, 9, 15, 16], "No": 16, "The": [2, 10, 12, 13, 14, 15, 16], "There": [0, 8], "These": [0, 8], "To": [9, 13, 15], "_opt_param": [1, 9], "_req_param": [1, 9], "_single_param": [1, 9], "_takes_rng": [1, 9], "ab": [0, 8], "ab_zeropoint": [0, 2, 8, 10], "aberr": [0, 8], "about": [0, 8, 15], "abov": 13, "access": [0, 1, 8, 9], "accord": [1, 9, 15], "account": [0, 8], "accross": [0, 8], "accuraci": [0, 8, 15], "achromat": [0, 8], "across": [1, 9, 16], "activ": [9, 13], "actual": [0, 1, 8, 9], "ad": [1, 9], "adapt": 16, "add": [1, 9], "addit": [0, 1, 8, 9], "addnois": [1, 9, 14], "adopt": [0, 8], "after": [0, 1, 8, 9, 15], "aim": 15, "aka": [1, 9], "al": 16, "alias": [0, 8], "all": [0, 8], "allow": [0, 1, 8, 9], "along": [2, 10, 15], "also": [0, 1, 8, 9, 15], "altern": [0, 8, 15], "alwai": [0, 8], "an": [0, 1, 8, 9, 15, 16], "analysi": 15, "angl": [0, 8, 16], "ani": [0, 1, 8, 9], "answer": 16, "apertur": [0, 8], "appear": [0, 8], "appli": [1, 9], "applic": [0, 8, 15], "applyto": [1, 9, 14], "appropi": [0, 8], "appropri": [1, 9], "approxim": [0, 1, 8, 9, 15], "ar": [0, 1, 8, 9, 15], "arbitrai": [0, 8], "arbitrari": [1, 9], "arcsec": [0, 8], "area": [0, 8], "arg": [0, 8, 16], "argpars": 16, "argument": [0, 8, 15, 16], "argv": 16, "around": [0, 1, 8, 9], "arrai": [0, 1, 8, 9], "articl": 15, "ask": [15, 16], "aspect": [0, 8], "associ": [1, 9], "assum": [0, 8], "astropi": 13, "asttyp": [0, 8], "atrribut": [0, 8], "attribut": [1, 9, 12, 14], "automodul": [0, 8], "avail": [0, 8, 15, 16], "awai": [0, 8], "axi": [0, 8], "b": [0, 8], "background": [0, 1, 2, 8, 9, 10], "baffl": [0, 8], "band": [0, 8], "bandpass": [0, 1, 2, 8, 9, 10], "base": [0, 1, 8, 9, 15], "bash": 9, "basic": [0, 1, 8, 9, 15], "been": [13, 16], "befor": [0, 8], "begin": [0, 8], "being": [1, 9], "below": [9, 16], "between": [0, 8], "bin": [1, 9], "blob": 16, "blue": [0, 8], "bool": [0, 1, 8, 9], "border": [0, 8], "both": [1, 9], "boxi": [0, 8], "bpass": [1, 9], "bright": [0, 8], "brighter": [0, 8], "brows": [0, 8], "bug": 15, "build": [1, 9], "buildbandpass": [1, 9, 14], "builder": [1, 9], "buildimag": [1, 9, 14], "buildphotonop": [1, 9, 14], "buildprofil": [1, 9], "buildpsf": [1, 9, 14], "buildwc": [1, 9, 14], "built": [1, 9], "bundl": [1, 9], "cab": [0, 8], "calcul": [0, 8], "call": [0, 1, 8, 9], "can": [0, 1, 2, 8, 9, 10, 15], "care": [0, 8], "carri": [0, 8], "case": [0, 1, 8, 9], "catalog": [1, 9], "ccd": [0, 1, 2, 8, 9, 10], "ccd2det": [0, 8], "ccd_id": 9, "ccd_po": [0, 8], "ccdid": [0, 8], "ccds_ccd": [2, 10], "cd": 13, "celestialcoord": [0, 1, 8, 9], "center": [0, 1, 2, 8, 9, 10], "certain": [0, 8], "cfg_imag": [1, 9], "cfg_nois": [1, 9], "chang": [0, 8, 9, 12], "charg": [0, 1, 8, 9], "chargediff": [1, 9, 14], "chargediffbuild": [1, 9, 14], "check": [0, 1, 8, 9], "check_exist": [14, 16], "check_input": [1, 9, 14], "check_remov": [14, 16], "check_unpack": [14, 16], "choos": [0, 8], "chosen": [0, 8], "chri": [0, 8], "chromat": [0, 1, 8, 9], "cite": 15, "class": [0, 8, 12, 14], "classmethod": [1, 9], "clone": 13, "close": [0, 8], "cm": [0, 8], "code": [1, 9, 13, 15, 16], "collect": [0, 8], "collecting_area": [0, 8], "column": [0, 8, 9], "com": [13, 16], "combin": [0, 1, 8, 9], "command": [0, 8, 9, 16], "command_arg": 16, "comment": 15, "commun": [1, 9, 12], "compromis": [0, 8], "comput": [0, 1, 8, 9], "conda": [9, 13], "config": [1, 12, 14], "config_fil": [1, 9], "configur": [0, 1, 8, 9, 15], "confus": [1, 9], "consid": [0, 8, 16], "consist": [0, 8], "consortium": 15, "construct": [0, 1, 8, 9, 15], "contain": [0, 1, 2, 8, 9, 10, 13, 15], "contrast": [0, 8], "contribut": [1, 9], "contributor": 15, "convent": [0, 2, 8, 10], "convers": [0, 8], "convert": [0, 8], "convolv": [1, 9], "coordin": [0, 1, 8, 9], "correct": [0, 8], "correspond": [0, 1, 8, 9], "cosmostat": 16, "cover": [0, 8], "creat": [0, 1, 8, 9, 13], "csic": [0, 8], "current": [1, 9, 13], "current_var": [1, 9], "curv": [0, 8], "data": [0, 1, 8, 9, 12], "date": [0, 1, 2, 8, 9, 10], "datetim": [0, 8], "deblend": 15, "debug": [1, 9], "decent": [0, 8], "decontamin": [0, 8], "default": [0, 1, 8, 9, 15, 16], "default_thin_trunc": [0, 8], "defin": [0, 1, 8, 9], "degrad": [0, 8], "degre": [0, 8], "demo": [0, 8, 12, 15], "depend": [0, 8, 9], "describ": [0, 8, 15], "descript": [0, 8], "det2ccd": [0, 8], "detail": [0, 8, 13, 15], "detect": 15, "detector": [0, 8], "determin": [0, 1, 8, 9], "detid": [0, 8], "develop": [12, 13, 16], "diamet": [0, 8], "dichroic": [0, 8], "dict": [0, 1, 8, 9], "dictionari": [0, 8], "differ": [0, 8], "diffus": [0, 1, 8, 9], "dir": [9, 15], "directli": [0, 8], "directori": [0, 2, 8, 9, 10, 15], "discret": [0, 8, 16], "displai": [2, 10], "distinct": 15, "dither": [0, 8], "divid": [0, 8], "do": [0, 1, 8, 9, 13], "do_download": 16, "do_filt": 16, "do_link": 16, "do_remov": 16, "do_unpack": 16, "docstr": [0, 8, 15], "document": 15, "doe": [0, 1, 8, 9], "doesn": [1, 9], "doi": 15, "done": [0, 8, 16], "download": [0, 8, 12, 14, 16], "download_cosmo": 16, "download_psf": 14, "draw": [0, 1, 8, 9, 14], "drawimag": [1, 9], "due": [0, 8], "duncan": [0, 8], "dure": [1, 9], "e": [0, 1, 8, 9], "each": [0, 1, 8, 9], "earli": [0, 8], "earth": [0, 8], "eclipt": [0, 8], "edge_pix": [1, 9], "effect": [0, 1, 8, 9], "either": [0, 8, 16], "els": [1, 9], "empti": [1, 9], "enabl": [0, 8, 15], "end": [0, 1, 8, 9, 12], "end_to_end_demo": [0, 2, 8, 10], "enough": [0, 8], "enter": 16, "entir": [0, 8], "entri": 9, "env_nam": 9, "environ": 9, "epoch": [0, 8], "equinox": [0, 8], "equival": [2, 10], "ero": [0, 8], "err": 9, "error": [0, 1, 8, 9], "esa": [0, 8], "esac": [0, 8], "especi": [0, 8], "estim": [0, 8], "et": 16, "etc": [0, 8], "euclid": [2, 10, 13, 14, 16], "euclid_lik": [0, 8], "euclid_obseq": 9, "euclidlik": [0, 1, 2, 8, 9, 10, 13, 15], "euclidlike_download_psf": [0, 8, 15], "euclidlike_imsim": [1, 9, 15], "euclidlike_stamp": [1, 9, 14], "euclidlikebandpassbuild": [1, 9, 14], "euclidlikeccdimagebuild": [1, 9, 14], "euclidlikepsf": [1, 9, 14], "euclidlikewc": [1, 9, 14], "even": [0, 8], "everyth": [0, 8], "exact": [0, 8], "exampl": [0, 1, 8, 9, 12, 15], "except": [0, 8], "exist": [1, 9], "expect": [0, 1, 8, 9], "explor": 15, "exposur": [0, 1, 8, 9], "express": [0, 8], "exptim": [0, 1, 8, 9], "extra_aberr": [1, 9], "factor": [1, 9], "fair": [0, 8], "fake": [0, 8], "fall": [0, 8], "fals": [0, 1, 8, 9], "fast": 15, "faster": [0, 8], "fatter": [0, 8], "featur": [2, 10], "feel": 15, "fidel": 15, "field": [0, 1, 8, 9], "figur": [0, 1, 8, 9], "file": [0, 1, 2, 8, 9, 10], "file_list": 9, "file_nam": [1, 9], "file_scop": [1, 9], "filebandpass": [1, 9], "filter": [0, 1, 8, 9], "filter_nam": [2, 10], "final": [1, 9], "find": [0, 8], "findccd": [0, 8, 14], "first": [1, 2, 9, 10], "fit": 9, "fix_s": [1, 9, 14], "flag": 15, "flat": [1, 9], "float": [0, 1, 8, 9], "flux": [0, 1, 8, 9], "focal": [0, 8, 12, 15, 16], "focu": [0, 8], "folding_threshold": [0, 8], "follow": [0, 1, 8, 9, 13], "form": 16, "format": [0, 1, 8, 9], "fov": [15, 16], "fpa": [0, 8], "fps3": [0, 8], "fraction": [0, 8], "free": 15, "from": [0, 1, 2, 8, 9, 10, 12, 13, 15, 16], "full": [0, 1, 8, 9, 15], "full_bandpass": [0, 8], "fulli": [0, 8], "function": [12, 14, 15, 16], "further": [13, 15], "futur": [0, 8], "gain": [0, 8], "galaxi": [1, 2, 9, 10], "galsim": [0, 1, 2, 8, 9, 10, 13, 16], "gap": [0, 8], "gener": [0, 1, 2, 8, 9, 10, 15], "generate_pupil_obscur": 16, "geometri": [0, 8], "get": [0, 1, 8, 9, 12, 14], "get_ccd_cent": [1, 9, 14], "get_input": [14, 16], "get_meta": [14, 16], "get_nam": [14, 16], "get_nois": [1, 9, 14], "getapproxnobject": [1, 9, 14], "getbandpass": [0, 1, 2, 8, 9, 10, 13, 14], "getbrightpsf": [0, 8, 14], "getdrawmethod": [1, 9, 14], "getflux": [1, 9, 14], "getkwarg": [1, 9, 14], "getlocalwc": [1, 9, 14], "getnobject": [1, 9, 14], "getobj": [1, 9, 14], "getpsf": [0, 1, 2, 8, 9, 10, 14, 15], "getpsf_imag": [1, 9, 14], "getskylevel": [0, 2, 8, 10, 14], "getvalu": [1, 9, 14], "getwc": [0, 1, 2, 8, 9, 10, 14], "getworldpo": [1, 9, 14], "getzodibackground": [0, 8], "git": 13, "github": [13, 15, 16], "give": [0, 8], "given": [0, 1, 8, 9, 13, 15, 16], "gname": [0, 8], "gname2": [0, 8], "goe": [1, 9], "good": [0, 8], "grab": 16, "grid": [0, 8, 15], "ground": 15, "gsobject": [1, 9], "gsparam": [0, 1, 8, 9], "guid": [0, 8], "ha": [0, 8, 13, 15, 16], "half": [0, 8], "handl": [0, 8, 16], "has_nobj": [1, 9], "have": [0, 8], "heavi": 13, "heavili": [1, 9, 15], "helper": [0, 1, 8, 9, 15], "here": [0, 1, 8, 9], "high": [0, 8, 15], "higher": 15, "highlight": 15, "histori": 12, "hit": 16, "how": [0, 2, 8, 10, 15], "howev": [0, 8], "http": [0, 8, 16], "i": [0, 1, 2, 8, 9, 10, 13, 15, 16], "ic": [0, 8], "id": [0, 2, 8, 10], "ignor": [0, 1, 8, 9], "illustr": 15, "imag": [0, 1, 8, 9, 15], "image_nam": [1, 9], "image_num": [1, 9], "image_po": [1, 9], "implement": [1, 9, 16], "import": [0, 8, 13], "imsim": [12, 14], "includ": [0, 1, 8, 9, 15], "include_bord": [0, 8], "include_photonop": [1, 9], "incorpor": [0, 8], "independ": [1, 9], "index": [0, 1, 4, 8, 9, 12], "indic": [0, 1, 8, 9, 15], "ineffici": [0, 8], "infer": [0, 8], "info": [1, 9], "inform": [0, 1, 8, 9, 15], "init_func": [1, 9], "initi": [1, 9, 14], "input": [0, 1, 8, 9, 16], "instal": 12, "instanc": [1, 9], "instruct": [12, 15], "instrument": [0, 8, 15], "instrument_param": [0, 8], "int": [0, 1, 8, 9], "inta": [0, 8], "integ": [0, 8], "interest": [0, 8, 15], "interfac": [1, 9], "intern": [0, 8], "interpol": [0, 8], "interpolatedchromaticobject": [0, 8], "interpolatedimag": [0, 8], "introduc": [2, 10], "ipac": [0, 8], "isn": [1, 9], "isr": [0, 8], "issu": 15, "item": [1, 9], "iter": [0, 8], "its": 15, "joint": 15, "journal": 15, "jupyt": [2, 10], "just": 16, "keep": [1, 9], "kei": [0, 8], "keyword": [0, 8], "kick": 16, "know": [0, 8], "knowledg": [0, 8], "known": [1, 9], "kwarg": [0, 1, 8, 9], "l233": 16, "label": [0, 8], "lack": [0, 8], "lanc": [0, 8], "larg": [1, 9, 15], "later": [0, 8], "latest": [0, 8], "latitud": [0, 8], "layout": 12, "lead": [0, 8], "leav": [0, 8], "length": [1, 9], "lens": [0, 8, 15], "level": [12, 14], "liaudat": 16, "librari": [13, 15], "licens": 15, "lie": [0, 8], "life": [0, 8], "light": [0, 8], "like": [2, 10, 13, 14, 16], "limit": [0, 1, 8, 9], "line": [9, 16], "linear": [0, 8], "link": [9, 15], "link_dir": 16, "linux": 13, "list": [0, 1, 8, 9], "load": [0, 1, 8, 9], "loader": [1, 9], "local": [1, 9], "local_wc": [1, 9], "localwc": [1, 9], "locat": [0, 1, 8, 9], "log": [1, 9], "logger": [0, 1, 8, 9, 16], "long_exptim": [0, 8], "longer": [0, 8], "longitud": [0, 8], "look": [0, 1, 8, 9], "lookup": [0, 8], "lookupt": [0, 8], "lower": [0, 8], "m": [0, 8], "mac": 13, "made": 11, "magnitud": [0, 8], "mai": [0, 1, 8, 9, 15], "main": [14, 16], "make": [0, 1, 8, 9, 13], "make_euclidlike_pupil_plan": 14, "make_link": [14, 16], "makeskyimag": [0, 8], "mani": [0, 8], "map": [0, 1, 8, 9], "max_flux": [1, 9], "max_sun_angl": [0, 8], "maximum": [0, 8], "mean": [0, 8, 16], "meant": [0, 8], "measur": [0, 8], "member": [0, 8], "meta": 16, "meter": [0, 8], "method": [1, 9, 15], "might": [0, 1, 8, 9], "miller": [0, 8], "min_sun_angl": [0, 8], "minimum": [0, 8], "mjd": [1, 9], "mm": [0, 8], "mode": [0, 8], "model": [0, 1, 8, 9], "modul": [2, 4, 10, 12, 14], "more": [0, 1, 8, 9, 15], "most": [0, 1, 8, 9], "msp": [0, 8], "much": [0, 8], "multipl": [1, 9], "multipli": [0, 8], "must": [0, 1, 8, 9, 15, 16], "n": 13, "n_ccd": [0, 8], "n_ccd_col": [0, 8], "n_ccd_row": [0, 8], "n_col": [0, 8], "n_dither": [0, 8], "n_filter": 16, "n_phot": [1, 9], "n_pix": 16, "n_pix_col": [0, 8], "n_pix_row": [0, 8], "n_row": [0, 8], "n_wave": [0, 1, 8, 9], "name": [1, 9], "nanomet": [0, 8], "nativ": [1, 9, 16], "necessari": [1, 9], "need": [0, 1, 8, 9, 15], "new": [1, 9, 15], "nimag": [1, 9], "nisp": [0, 8], "nisp_band": [0, 8], "nm": [0, 8], "nois": [0, 1, 2, 8, 9, 10], "noiseimagebuild": [1, 9, 14], "non": [0, 8, 16], "none": [0, 1, 8, 9, 16], "nonlinear": [0, 8], "normal": [0, 8], "note": [0, 1, 8, 9, 15, 16], "notebook": [2, 10], "np": [0, 8], "number": [0, 1, 8, 9], "numer": [0, 8], "numpi": [1, 9, 13], "obj_num": [1, 9], "obj_typ": [1, 9], "object": [0, 1, 8, 9, 14, 15], "object_index": [1, 9], "obliqu": [0, 8], "obs_kind": [1, 9], "obscur": [0, 8], "obseq": [1, 9], "obseq_data": 9, "obseqdata": [1, 9, 14], "obseqdataload": [1, 9, 14], "observ": [0, 1, 2, 8, 9, 10], "observatori": [0, 8, 15], "obtain": [0, 1, 8, 9], "off": 16, "offset": [1, 9], "old": [0, 8], "older": 12, "omit": [0, 8], "onc": 15, "one": [0, 1, 8, 9, 16], "onli": [0, 1, 8, 9, 13, 15, 16], "onto": [0, 1, 8, 9], "open": 15, "oper": [1, 9], "optic": [0, 8], "optim": [0, 8], "option": [0, 1, 8, 9], "optpars": 16, "orbit": [0, 8], "order": [0, 8], "orient": [0, 8], "osx": 13, "other": [0, 1, 8, 9], "otherwis": [0, 8], "out": [0, 1, 8, 9], "output": [0, 1, 2, 8, 9, 10], "outskirt": [0, 8], "over": [0, 8], "overrid": [1, 9], "oversampl": [0, 1, 8, 9, 15], "oversampling_factor": [1, 9], "overview": 12, "own": 15, "pa": [0, 8], "pa_is_fpa": [0, 8], "packag": [0, 1, 2, 8, 9, 10, 14, 15], "page": [4, 12], "panel": [0, 8], "paper": 15, "parallel": [0, 8], "param": [1, 9], "paramet": [0, 1, 8, 9, 16], "pars": [1, 9], "parse_arg": [14, 16], "parse_noise_config": [1, 9, 14], "part": [0, 1, 8, 9], "particular": [0, 8, 15], "particularli": 15, "pass": [0, 8], "passband": [0, 8], "path": 9, "pattern": [0, 8], "per": [0, 8], "perfectli": [0, 8], "perform": [1, 9], "photo": [0, 8], "photometri": 15, "photon": [0, 1, 8, 9], "photon_arrai": [1, 9], "photonarrai": [1, 9], "photonop": [1, 9], "php": [0, 8], "physic": [0, 8], "pi": [0, 8], "pip": 13, "pix": [0, 8], "pixel": [0, 8], "pixel_scal": [0, 1, 8, 9], "pixel_scale_mm": [0, 8], "pixelscal": [0, 8], "place": [1, 9, 15], "plan": [0, 8], "plane": [0, 8, 12, 15, 16], "plate": [0, 8], "plate_scal": [0, 8], "pleas": 15, "plot_vi": [2, 10], "po": [1, 9], "point": [0, 1, 8, 9], "polar": [0, 8], "posit": [0, 1, 8, 9, 15], "positiond": [0, 8], "possibl": [0, 8], "possibli": [0, 8], "post": [0, 8], "postag": [1, 9], "preced": [1, 9], "precis": [0, 8, 15], "precomput": [0, 8, 15], "preliminari": 15, "present": [1, 9, 16], "presum": 16, "probabl": [1, 9], "probablist": [1, 9], "procedur": 16, "process": [0, 1, 8, 9, 16], "processimag": [1, 9, 14], "produc": [0, 1, 2, 8, 9, 10, 15], "prof": [1, 9], "profil": [1, 9], "program": 16, "progress": [1, 9], "project": [0, 8, 16], "properli": [0, 8], "properti": [1, 9], "provid": [0, 1, 8, 9, 15], "psf": [0, 1, 2, 8, 9, 10, 15, 16], "psf_dir": [0, 8], "psfloader": [1, 9, 14], "public": 11, "publicli": [0, 8], "publish": 13, "pupil": [0, 1, 8, 9], "pupil_bin": [0, 1, 8, 9], "py": [0, 2, 8, 10, 16], "pypi": 13, "python": [0, 2, 8, 10, 13], "qe": [0, 8], "quadrant": [0, 1, 8, 9], "queri": [0, 8], "query_yes_no": [14, 16], "question": [15, 16], "quickskip": [1, 9], "rais": [0, 8], "random": [1, 9], "rang": [0, 8], "rather": [1, 9, 15], "reach": 15, "read": [0, 1, 8, 9], "read_nois": [0, 8], "read_obseq": [1, 9, 14], "readm": 15, "readout": [0, 8], "real": [0, 1, 8, 9], "realist": [0, 2, 8, 10], "rebuilt": [1, 9], "red": [0, 8], "refdata": [0, 8], "refer": [0, 8, 12], "reflect": [0, 8], "regular": [1, 9], "rel": [0, 8], "relat": [0, 8], "releas": [0, 8, 16], "relev": 12, "remov": [0, 8], "remove_tarbal": [14, 16], "render": [0, 1, 8, 9], "renorm": [0, 8], "repo": 11, "report": 15, "repositori": [13, 15], "repres": [0, 8], "represent": [0, 1, 8, 9, 15], "request": [0, 1, 8, 9], "requir": [0, 1, 8, 9, 13, 15, 16], "research": 15, "respect": [0, 8], "respons": [0, 8], "result": [0, 1, 8, 9, 15], "return": [0, 1, 8, 9, 16], "revis": 12, "rng": [1, 9], "roman": [0, 1, 8, 9], "roman_imsim": [1, 9, 15], "roman_util": [1, 9, 14], "roughli": [0, 8], "routin": [0, 1, 8, 9, 15], "row": [0, 8], "run": [0, 1, 2, 8, 9, 10, 13, 15], "run_list": 9, "run_main": [14, 16], "saa": [0, 8], "safe": [1, 9], "sai": [1, 9], "same": [0, 8], "sampl": [0, 1, 8, 9, 16], "satur": [0, 8], "save": [1, 9], "sbatch": 9, "sca": [1, 9], "scale": [0, 1, 8, 9, 15], "scatter": [1, 9], "scenario": [0, 8], "scene": [2, 10], "scratch": [1, 9], "script": [0, 1, 2, 8, 9, 10, 14, 15], "search": [4, 12], "sec": [0, 8], "second": [0, 8], "sed": [0, 1, 8, 9], "see": [0, 1, 8, 9, 13, 15], "select": [0, 8], "self": [1, 9], "sens": [1, 9], "sensibli": [0, 8], "sensor": [0, 8], "septemb": [0, 8], "sequenc": [0, 1, 8, 9], "set": [0, 1, 8, 9], "setup": [1, 9, 14], "setup_skycat": [1, 9], "sever": [0, 8], "sh": 9, "shape": [0, 8], "shear": [0, 8], "shell": 9, "short_exptime_nisp": [0, 8], "short_exptime_vi": [0, 8], "shorter": [0, 8], "should": [0, 8, 9, 15], "shouldn": [1, 9], "show": [0, 2, 8, 10], "signatur": [0, 8], "sim": 16, "simpl": 16, "simpli": [0, 8], "simplifi": [0, 8], "simpsftoolkit": 16, "simul": [0, 1, 8, 9, 15], "singl": [0, 1, 8, 9], "size": [0, 1, 8, 9], "sky": [0, 1, 8, 9], "sky_catalog": 9, "skycat": [1, 9], "skycatalog": [1, 9], "skycataloginterfac": [1, 9, 14], "skycatalogload": [1, 9, 14], "skycatobj": [1, 9, 14], "skycatvalu": [1, 9, 14], "skycatworldpo": [1, 9, 14], "skyimagebuild": [1, 9, 14], "slower": [0, 8], "slurm": [12, 14], "slurm_runn": 9, "small": [0, 8], "so": [0, 1, 8, 9], "softwar": 15, "solar": [0, 8], "some": [0, 1, 8, 9, 15], "sourc": [0, 1, 8, 9, 13, 15, 16], "space": [1, 9, 15], "spatial": [0, 8], "special": [1, 9], "specif": [0, 1, 8, 9], "specifi": [0, 1, 8, 9], "spider": [0, 8], "src": 16, "stamp": [1, 9], "stamp_siz": [1, 9], "star": [0, 2, 8, 10], "start": [1, 9, 12], "statement": [1, 9], "stderr": 9, "stdout": 9, "store": [0, 8], "str": [0, 1, 8, 9], "string": [0, 8, 16], "strut": [0, 8], "sub": [1, 9], "subcompon": [1, 9], "submodul": 14, "subroutin": [0, 8], "subset": [0, 8], "subtract": [1, 9], "success": 13, "suffici": 15, "sum": [0, 1, 8, 9], "sun": [0, 8], "suppli": [0, 8], "support": 13, "suppress": [0, 8], "sure": 13, "surfac": [0, 8], "survei": 15, "svo": [0, 8], "svo2": [0, 8], "switch": [0, 8], "sy": 16, "system": [0, 8, 13], "t": [1, 9], "tabl": [0, 8], "tabul": [0, 8], "take": [0, 1, 8, 9], "taken": [0, 8, 16], "takes_logg": [1, 9], "target": 16, "target_dir": 16, "task": [1, 9], "telescop": [0, 2, 8, 10, 15], "term": 15, "termin": [0, 8, 15], "test": [0, 8], "than": [0, 8, 15], "thei": [0, 8], "theori": [0, 8], "therefor": [0, 8], "thi": [0, 1, 2, 8, 9, 10, 15, 16], "thin": [0, 8], "thing": [1, 9], "those": [0, 8, 15], "thought": [0, 8], "three": [0, 8], "through": 15, "time": [0, 1, 8, 9], "tobia": 16, "total": [0, 8], "toward": [0, 8, 15], "transfer": [0, 8], "transmiss": [0, 8], "true": [0, 1, 8, 9, 16], "truncat": [0, 8], "truth": 9, "tupl": [1, 9], "two": [1, 9, 13, 15], "txt": 9, "type": [1, 9], "typic": [0, 8], "uncertain": [0, 8], "undoc": [0, 8], "unit": [0, 8], "unless": [0, 8], "unpack": [14, 16], "unpack_dir": 16, "up": [0, 1, 8, 9], "updat": [9, 15], "ur": [0, 8], "url": [15, 16], "us": [0, 2, 8, 10, 14, 15, 16], "use_ccd": [2, 10], "use_proxi": [1, 9], "user": [0, 8, 16], "util": [0, 1, 8, 9], "v0": 12, "v1": [0, 8], "valu": [0, 1, 8, 9, 16], "value_typ": [1, 9], "vari": [0, 8], "varianc": [1, 9], "variat": [0, 8], "varieti": [1, 9], "veri": [0, 8], "vernal": [0, 8], "version": [12, 13], "vi": [0, 8], "via": [1, 9, 16], "view": 15, "vignet": [0, 8], "vis_band": [0, 8], "vis_blue_limit": [0, 8], "vis_red_limit": [0, 8], "visit": [1, 9], "visual": [2, 10], "wa": [0, 8, 9, 16], "wai": [0, 8], "want": [0, 1, 8, 9], "wavefront": [0, 8], "wavelength": [0, 8, 15, 16], "wc": [0, 1, 2, 8, 9, 10], "wcs_dict": [0, 8], "we": [0, 1, 8, 9, 15], "weak": [0, 8, 15], "websit": 15, "weight": [1, 9], "weightimagebuild": [1, 9, 14], "welcom": 15, "were": [0, 1, 8, 9], "wf": 16, "wf_psf": 16, "what": [0, 1, 8, 9], "when": [0, 1, 8, 9, 15], "where": [0, 1, 8, 9, 15], "whether": [0, 1, 8, 9], "which": [0, 1, 8, 9], "who": [0, 8], "whole": 16, "wide": [0, 8], "wish": [0, 8], "within": [0, 8, 15], "without": [0, 8], "won": [1, 9], "work": [1, 9], "worker_init": [1, 9], "worker_initarg": [1, 9], "world": [0, 8], "world_po": [0, 1, 2, 8, 9, 10], "would": [0, 1, 8, 9], "wrt": 16, "x": [1, 9], "xsize": [1, 9], "y": [0, 1, 8, 9], "yaml": 9, "ye": 16, "yet": [1, 9], "you": [0, 1, 8, 9], "ysize": [1, 9], "zenodo": 15, "zeropoint": [0, 8], "zodiac": [0, 8], "zsh": 9}, "titles": ["The Euclid-like Module", "The Euclid-like ImSim Module", "Examples", "<no title>", "GalSim-Euclid-Like: Euclid-like images using GalSim", "Installation", "<no title>", "Overview", "The Euclid-like Module", "The Euclid-like ImSim Module", "Examples", "Revision History", "GalSim-Euclid-Like: Euclid-like images using GalSim", "Installation", "<no title>", "Overview", "scripts package"], "titleterms": {"0": 11, "1": 11, "The": [0, 1, 8, 9], "attribut": [0, 8, 15], "chang": 11, "class": [1, 9], "commun": 15, "config": 9, "data": 15, "demo": [2, 10], "depend": 13, "develop": 15, "download": 15, "download_psf": 16, "end": [2, 10], "euclid": [0, 1, 4, 8, 9, 12, 15], "exampl": [2, 10], "focal": [2, 10], "from": 11, "function": [0, 1, 8, 9], "galsim": [4, 12, 15], "get": 15, "histori": 11, "imag": [4, 12], "imsim": [1, 9], "indic": [4, 12], "instal": [5, 13, 15], "instruct": 13, "layout": [2, 10], "level": [0, 8], "like": [0, 1, 4, 8, 9, 12, 15], "make_euclidlike_pupil_plan": 16, "modul": [0, 1, 8, 9, 16], "older": 11, "overview": [7, 15], "packag": 16, "plane": [2, 10], "refer": 15, "relev": 15, "revis": 11, "script": 16, "slurm": 9, "start": 15, "submodul": 16, "tabl": [4, 12], "us": [1, 4, 9, 12], "v0": 11, "version": 11}}) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index d38c79e..3220f77 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,6 +10,9 @@ import sys sys.path.insert(0,os.path.abspath('.')) +import euclidlike +import euclidlike_imsim + project = 'GalSim-Euclid-Like' copyright = '2024, Rachel Mandelbaum, Axel Guinot, Federico Berlfein, Andy Park, Xiangchong Li, Michael Troxel, Tianqing Zhang' author = 'Rachel Mandelbaum, Axel Guinot, Federico Berlfein, Andy Park, Xiangchong Li, Michael Troxel, Tianqing Zhang' @@ -21,7 +24,7 @@ extensions = [] templates_path = ['_templates'] -exclude_patterns = [] +exclude_patterns = ['**/.ipynb_checkpoints'] diff --git a/docs/euclidlike.rst b/docs/euclidlike.rst index c09a526..d4f2d47 100644 --- a/docs/euclidlike.rst +++ b/docs/euclidlike.rst @@ -1,53 +1,153 @@ -euclidlike package -================== +The Euclid-like Module +################################ -Submodules ----------- +The ``euclidlike`` module contains telescope information and functionality needed for image simulations. +The demo script end_to_end_demo.py shows how to use many of the atrributes and functions described here. -euclidlike.backgrounds module ------------------------------ -.. automodule:: euclidlike.backgrounds - :members: - :undoc-members: - :show-inheritance: +Module-level Attributes +======================= -euclidlike.bandpass module --------------------------- +There are several of attributes of the ``euclidlike`` module which define some numerical +parameters related to a Euclid-like geometry. Some of these parameters relate to the entire +wide-field imager. Others, especially the return values of the functions to get the +PSF and WCS, are specific to each CCD and therefore are indexed based on the detector number. +All detector-related arrays are 0-indexed, which might differ from the CCD indices for Euclid, +which run 1-1 to n_row-n_col. -.. automodule:: euclidlike.bandpass - :members: - :undoc-members: - :show-inheritance: +gain + The gain for all CCDs is expected to be the roughly the same. -euclidlike.euclidlike\_psf module ---------------------------------- +pixel_scale + The pixel scale in units of arcsec/pixel. -.. automodule:: euclidlike.euclidlike_psf - :members: - :undoc-members: - :show-inheritance: +diameter + The telescope diameter in meters. -euclidlike.euclidlike\_wcs module ---------------------------------- +obscuration + The linear obscuration of the telescope, expressed as a fraction of the diameter. -.. automodule:: euclidlike.euclidlike_wcs - :members: - :undoc-members: - :show-inheritance: +collecting_area + The actual collecting area after accounting for obscuration, struts, etc. in + units of cm^2. -euclidlike.instrument\_params module ------------------------------------- +long_exptime + The typical exposure time for the longer exposures used for VIS images, in units of seconds. + The number that is stored is for a single dither. -.. automodule:: euclidlike.instrument_params - :members: - :undoc-members: - :show-inheritance: +short_exptime_nisp + The typical exposure time for the shorter NISP imaging exposures used for VIS images, in units of seconds. + The number that is stored is for a single dither. -Module contents ---------------- +short_exptime_vis + The typical exposure time for the shorter exposures with VIS taken in parallel with NISP imaging, in units of seconds. + The number that is stored is for a single dither. -.. automodule:: euclidlike - :members: - :undoc-members: - :show-inheritance: +n_dithers + The number of dithers per filter. + +n_ccd + The number of CCDs in the focal plane. + +n_ccd_row + The number of CCDs in the each focal plane row. + +n_ccd_col + The number of CCDs in the each focal plane column. + +n_pix_row + Each CCD has n_pix_row total pixels in each row. +n_pix_col + Each CCD has n_pix_col total pixels in each column. + +pixel_scale_mm + The physical pixel size, in units of mm. + +plate_scale + The plate scale, in units of arcsec / mm + +read_noise + Total readout noise, in units of e-. + +saturation + Pixel saturation, in units of e-. + +det2ccd + Mapping from DETID to CCDID. + +ccd2det + Mapping from CCDID to DETID. + +min_sun_angle + Minimum allowed angle from the telescope solar panels to the sun, in degrees. + +max_sun_angle + Maximum allowed angle from the telescope solar panels to the sun, in degrees. + +vis_bands + List of available VIS bands +nisp_bands + List of available NISP bands + +vis_blue_limit + Bandpass blue limit needed for consistency with the wavelength range covered by ur tabulated + PSF images, in nm. + +vis_red_limit + Bandpass red limit needed for consistency with the wavelength range covered by ur tabulated + PSF images, in nm. + +For example, to get the gain value, use euclidlike.gain. + +#.. automodule:: euclidlike.instrument_params +# :members: +# :undoc-members: + + +Euclid-like Functions +=============== + +This module also contains the following routines: + +`euclidlike.getBandpasses` + A utility to get a dictionary containing galsim.Bandpass objects for each of + the Euclid-like imaging bandpasses, which by default have AB zeropoints given using + the GalSim zeropoint convention (see `getBandpasses` docstring for more details). + +`euclidlike.getSkyLevel` + A utility to find the expected sky level due to zodiacal light at a given + position, in a given band. + +`euclidlike.getZodiBackground` + This helper routine is enables the calculation of the zodiacal light, in photons/m^2/arcsec^2/sec + +`euclidlike.getPSF` + A routine to get a chromatic representation of the PSF in a single CCD. + PSFs are based on precomputed, oversampled (by 3x) PSF images on a grid in wavelength and + focal plane position. + +`euclidlike.getBrightPSF` + Get a fake optical PSF for very bright objects. + +`euclidlike.getWCS` + This routine returns a dict containing a WCS for each of the Euclid CCDs. + +`euclidlike.findCCD` + This is a helper routine to calculate the minimum and maximum pixel values that should be + considered within a CCD. + + + +.. autofunction:: euclidlike.getBandpasses + +.. autofunction:: euclidlike.getSkyLevel + +.. autofunction:: euclidlike.getZodiBackground + +.. autofunction:: euclidlike.getPSF + +.. autofunction:: euclidlike.getBrightPSF + +.. autofunction:: euclidlike.getWCS + +.. autofunction:: euclidlike.findCCD diff --git a/docs/euclidlike_imsim.rst b/docs/euclidlike_imsim.rst index bc6626f..244a9b5 100644 --- a/docs/euclidlike_imsim.rst +++ b/docs/euclidlike_imsim.rst @@ -1,109 +1,64 @@ -euclidlike\_imsim package -========================= +The Euclid-like ImSim Module +################################ -Submodules ----------- +This module contains configuration scripts to produce large-scale Euclid-like simulation runs based on the information in ``euclidlike``. +It is based heavily on `roman_imsim `_. -euclidlike\_imsim.bandpass module ---------------------------------- +Classes and Functions +===================== .. automodule:: euclidlike_imsim.bandpass :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.ccd module ----------------------------- .. automodule:: euclidlike_imsim.ccd :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.detector\_physics module ------------------------------------------- .. automodule:: euclidlike_imsim.detector_physics :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.noise module ------------------------------- .. automodule:: euclidlike_imsim.noise :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.obseq module ------------------------------- .. automodule:: euclidlike_imsim.obseq :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.photonOps module ----------------------------------- .. automodule:: euclidlike_imsim.photonOps :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.psf module ----------------------------- .. automodule:: euclidlike_imsim.psf :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.scafile module --------------------------------- .. automodule:: euclidlike_imsim.scafile :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.skycat module -------------------------------- .. automodule:: euclidlike_imsim.skycat :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.stamp module ------------------------------- .. automodule:: euclidlike_imsim.stamp :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.utils module ------------------------------- .. automodule:: euclidlike_imsim.utils :members: :undoc-members: - :show-inheritance: - -euclidlike\_imsim.wcs module ----------------------------- .. automodule:: euclidlike_imsim.wcs :members: :undoc-members: - :show-inheritance: -Module contents ---------------- -.. automodule:: euclidlike_imsim - :members: - :undoc-members: - :show-inheritance: +Use +==== +Example files needed for large-scale Euclid-like simulation runs are included in ``GalSim-Euclid-Like/config``. + +.. include:: ../config/README.rst + diff --git a/docs/examples.rst b/docs/examples.rst new file mode 100644 index 0000000..07f898e --- /dev/null +++ b/docs/examples.rst @@ -0,0 +1,29 @@ +Examples +========= + +The ``GalSim-Euclid-Like/examples`` directory contains example files for how use the euclidlike module. + +End-to-end demo +--------------- + +`end_to_end_demo.py.py <../examples/end_to_end_demo.py>`_ + +This first demo is the euclidlike-equivalent of `demo 13 `_ in ``GalSim``. This demo uses the Euclid-like PSF, WCS, and background noise to produce a realistic scene of galaxies and stars as observed from a Euclid-like Telescope. + +** Features introduced in the Python file**: + +- euclidlike.getBandpasses(AB_zeropoint) +- euclidlike.getWCS(world_pos, CCDs_CCD, date) +- euclidlike.getPSF(use_CCD, filter_name, wcs) +- euclidlike.getSkyLevel(bandpass, world_pos) + +The output generated from this file can be visualized by running the script `end_to_end_demo.py.py <../examples/end_to_end_demo.py>`_ + + +Focal Plane Layout +------------------ + +`plot_VIS.py <../examples/plot_VIS.py>`_ + +This Jupyter Notebook shows the display of the focal plane used in the euclidlike package, along with the CCD centers and ID convention. + diff --git a/docs/history.rst b/docs/history.rst new file mode 100644 index 0000000..d35e38d --- /dev/null +++ b/docs/history.rst @@ -0,0 +1,11 @@ +Revision History +################ + +.. include:: ../CHANGELOG.rst + + +Older Versions +============== + +.. toctree:: + older \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 55d881e..3f160f3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,63 +1,24 @@ -GalSim-Euclid-Like -================== - -Helper functions to generate simulations of Euclid-like images using GalSim. - -This repository contains information about the Euclid space telescope and survey that is needed to -produce simulations using `GalSim `_. Some of the -information provided is approximate, aimed towards fast simulations rather than full accuracy in -representation of Euclid images. Places where the information is only approximate are flagged and -described in the docstring, and we particularly highlight that the PSF is only approximate; -for details, see the docstring of the ``getPSF()`` method. This library should enable generation of -Euclid-like images of sufficient fidelity for preliminary exploration of object detection, -photometry, deblending, and joint analysis with ground-based observatories. For -applications requiring high precision such as weak lensing, the higher fidelity simulations -available within the Euclid Consortium should be used. - -This repository includes two distinct packages: - -* ``euclidlike``: has basic observatory, instrumentation, and survey information for Euclid. - This package can be used on its own along with GalSim to produce Euclid-like simulations. - -* ``euclidlike_imsim``: has configuration scripts to produce large-scale Euclid-like simulation runs - based on the information in ``euclidlike``. It is based heavily on `roman_imsim `_. - - -References -================== +.. GalSim-Euclid-Like documentation master file + -For more information about `GalSim `_, please see its README and documentation. +GalSim-Euclid-Like: Euclid-like images using GalSim +============================================== -For more information about Euclid, please see the `Euclid Consortium website `_ and papers linked from there. +.. toctree:: + :maxdepth: 2 -Attribution for software and data used by particular routines in this library is given in the docstring for the relevant routine. + overview + install + euclidlike + euclidlike_imsim + examples + history -Installation -================== - -Please view the `installation instructions `_ for details on how to install GalSim-Euclid-Like. - -Downloading relevant data -================== -The Euclid-like PSF is constructed from precomputed oversampled images on a grid in focal plane position and wavelength. To use the full FOV PSF within GalSim-Euclid-Like, the images must be downloaded by running:: - - $ euclidlike_download_psf - -in the terminal after installation of GalSim-Euclid-Like. To install in an alternative directory to the default, use the ``--dir`` argument. Refer to the ``getPSF`` documentation for further details about the PSF. -Getting started -================== -Please see the examples/ directory for demos illustrating the use of this code. - -Communicating with the developers +Indices and tables ================== -Feel free to `open a GitHub issue `_ to reach the developers with questions, comments, and bug reports. New contributors are also welcome and can indicate their interest in developing this code base through the Issues. - -Attribution -================== - -This software is open source and may be used according to the terms of its `license `_. - -When using this software, please provide the URL to the repository in the resulting paper or note. Once there is a Zenodo DOI or journal article, this README will be updated and we will ask those using the code in their research to cite the relevant journal article. +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/install.rst b/docs/install.rst new file mode 100644 index 0000000..63b62ca --- /dev/null +++ b/docs/install.rst @@ -0,0 +1,4 @@ +Installation +######## + +.. include:: ../INSTALL.rst \ No newline at end of file diff --git a/docs/modules.rst b/docs/modules.rst index 269fdea..dc909a1 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -1,9 +1,6 @@ -GalSim-Euclid-Like -================== - .. toctree:: :maxdepth: 4 euclidlike euclidlike_imsim - scripts + scripts \ No newline at end of file diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 0000000..803a9ee --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1,4 @@ +Overview +######## + +.. include:: ../README.rst \ No newline at end of file diff --git a/docs/scripts.rst b/docs/scripts.rst index 28a2437..11b271d 100644 --- a/docs/scripts.rst +++ b/docs/scripts.rst @@ -1,6 +1,11 @@ scripts package =============== +.. automodule:: scripts + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- @@ -19,11 +24,3 @@ scripts.make\_euclidlike\_pupil\_plane module :members: :undoc-members: :show-inheritance: - -Module contents ---------------- - -.. automodule:: scripts - :members: - :undoc-members: - :show-inheritance: diff --git a/euclidlike/instrument_params.py b/euclidlike/instrument_params.py index a3fc12a..8371047 100644 --- a/euclidlike/instrument_params.py +++ b/euclidlike/instrument_params.py @@ -136,4 +136,4 @@ # this module. However, pointing errors / jitter are quantified in the VIS paper. # # The impact of the dichroic and of charge transfer inefficiency are not included. Same for -# saturation (200000 e-). +# saturation (200000 e-). \ No newline at end of file