Skip to main content

Intensity modelling for multiply-imaged objects

Project description

Mimical (Modelling the Intensity of Multiply-Imaged Celestial Ancient Light)

Mimical is an intensity modelling code for multiply-imaged objects, performing simultaenous Bayseian inference of model parameters via the nested sampling algorithm. Mimical supports any astropy 2D model, and supports user defined parameter polynomial depenency with image wavelength.

Installation

Mimical can be installed with pip:

pip install mimical
docs/median_model_example.png

Required input

  1. images - An image array or list of image arrays with elements for each filter.

  2. filt_list - A path string or list of path strings to the filter transmission curve files.

  3. psfs - A PSF image array or list of PSF image arrays with elements for each filter.

  4. mimical_prior - The Mimical prior

Mimical prior

Below is an example mimical_prior for a run using the default astropy sersic model. The first set of element keys must match the astropy model parameter names. Following this, the next element, named psf_pa, traces the rotation of the PSF. The final two elements must be named rms and counts_per_flux.

mimical_prior = {}

mimical_prior['amplitude'] = ((0, 1), 'Individual')
mimical_prior['r_eff'] = ((0, 50), 'Polynomial', 1)
mimical_prior['n'] = ((0.1, 10), 'Polynomial', 1)
mimical_prior['x_0'] = ((48, 52), 'Polynomial', 0)
mimical_prior['y_0'] = ((48, 52), 'Polynomial', 0)
mimical_prior['ellip'] = ((0,0.75), 'Polynomial', 0)
mimical_prior['theta'] = ((0, np.pi), 'Polynomial', 0)

mimical_prior['psf_pa'] = ((-180, 180), 'Polynomial', 0)

mimical_prior['rms'] = ('Infer',)``
mimical_prior['counts_per_flux'] = (cpf_list, 'Individual')

The rms parameter traces the RMS noise in the image; this can be fit with Mimical but it is highly recommended to fix it in order to reduce dimensionality (see Fixing parameters), either by passing it in as a float / list of floats / list of arrays of the same shape as images, or by selecting the special Mimical prior type 'Infer'. This automatically calculates the RMS of the image background as identified by Source Extractor.

Similarly for counts_per_flux, which helps Mimical calculate the poisson uncertainty associated with the generated model, it is recommended to fix it to a provided quantity (float / list of floats / list of arrays of the same shape as images). This can be easily provided by the user with information on the gain and exposure time etc.

Optional input and parameters

  • astropy_model = Sersic2D() - Any astropy 2D model

  • pool = None - Number of cores to parallelise likelihood calculations to

  • sampler = 'Nautilus' - The nested sampler to use, other options include Dynesty

  • oversample_boxlength = 15 - Length of box in the centre of the image to perform oversampling in

  • oversample_factor = 10 - Factor by which to oversample inside the above box

  • sextractor_clean = False - Whether or not to let Sextractor clean the images of other objects

  • sextractor_target_maxdistancepix='default' - Radius from the image centre at which Sextractor discards the closest object as contamination. Needed for when the target object is undetected.

Fixing parameters

You can fix any of the parameters in the Mimical prior by setting the first element in the parameter tuple equal to either a float / int / list. For instance, to keep x_0 constant across all images, one would pass a float/int and choose the options (float/int, 'Polynomial', 0). Or, to supply the RMS for each image separately, one would pass a list of length Nfilters and choose the options (list, 'Individual'). If the user supplies arrays for RMS and counts-per-flux in the same shape as the images, the corner plot samples will show the mean of these images for generality, but the full arrays will be parsed in the likelihood function.

Parallelisation

Mimical can be parallelised to different cores in one of two ways:

  • The likelihood calculations can be parallelised to different cores by using the pool keyword argument. This is ideal for single object fits.

  • When using fit_catalogue, the mpi_serial keyword arguement can be set to True for individual object fits to be parallelised to separate cores. With this option enabled, mimical must be run using mpirun/mpiexec -n [ncores] python [filename].py. This is ideal for large catalogue fits.

Running Mimical with both of these options enabled is untested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mimical-0.3.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file mimical-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mimical-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for mimical-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19e02c27965adf4bebeb3440909e88b01a8fdccab31e09f0e80fd02d27bb65fc
MD5 0ab06d6215597ed52568bd2fd12b2828
BLAKE2b-256 78ac09c4184fd4e7204ef836ed9fa66dfee975cfa10ac65938dab601ed2e9bd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page