Table Of Contents

Previous topic

Exposure Time Calculator

Next topic

Simulation tools

Generating Object Catalogue

These simple functions can be used to generate different types of object catalogues that can then be used as an input for the VIS simulator.

Please note that the script requires files from the data folder. Thus, you should place the script to an empty directory and either copy or link to the data directory.

requires:NumPy
requires:SciPy
requires:matplotlib
author:Sami-Matias Niemi
contact:s.niemi@ucl.ac.uk
CatalogueBachallSoneira(magnitudeLimit=28, b=25, l=0, sqdeg=0.496, xmax=26000, ymax=29000, types=array([ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
95, 96, 97, 98, 99, 100, 101, 102]), output='catalogue.dat')

Generate an object catalogue with random positions using the Bachall and Soneira stellar model. Includes also galaxies.

Parameters:
  • magnitudeLimit (int) – limiting magnitude in V-band
  • b (int) – galactic longitude
  • l (int) – galactic latitude
  • sqdeg (float) – number of square degrees to cover
  • xmax (int) – highest pixel value to use for the random positions in x
  • ymax (int) – highest pixel value to use for the random positions in y
  • types (list) – a list of galaxy types corresponding to the postage stamp images
  • output (str) – name of the output file
Returns:

None

sources.createObjectCatalogue.drawFromCumulativeDistributionFunction(cpdf, x, number)

Draw a number of random x values from a cumulative distribution function.

Parameters:
  • cpdf (numpy array) – cumulative distribution function
  • x (numpy array) – values of the abscissa
  • number (int) – number of draws
Returns:

randomly drawn x value

Return type:

ndarray

sources.createObjectCatalogue.generateCatalog(**kwargs)

Generate a catalogue of stars and galaxies that follow realistic number density functions.

Parameters:deg – galactic latitude, either 30, 60, 90
sources.createObjectCatalogue.plotCatalog(catalog)

Plot the number of objects in the generated catalog. Will generate both cumulative and normal distributions for galaxies and stars separately.

Parameters:catalog (str) – name of the catalogue file
Returns:None
sources.createObjectCatalogue.plotDistributionFunction(datax, datay, fitx, fity, output)

Generates a simple plot showing the observed data points and the fit that was generated based on these data.

sources.createObjectCatalogue.starCatalog(stars=400, xmax=2048, ymax=2066, magmin=23, magmax=26)

Generate a catalog with stars at random positions.

sources.createObjectCatalogue.starCatalogFixedMagnitude(stars=400, xmax=2048, ymax=2066, mag=18, random=True, pergrid=51, out='starsSameMag.dat')

Generate a catalog with stars of a given magnitude either at random positions or in a rectangular grid.

sources.createObjectCatalogue.starCatalogueBachallSoneira(magnitudeLimit=28, b=30, l=0, sqdeg=0.496, xmax=26000, ymax=29000, output='starsOnly.dat')

Generate an object catalogue with random positions using the Bachall and Soneira stellar model.

For a full focal plane the default values should be fine. A full focal plane covers about 0.496 square degrees and in x and y pixels: 5*(4096 + (1.643*1000/12.)) + 4096 and 5*(4132 + (8.116*1000/12.)) + 4132, respectively.

Parameters:
  • magnitudeLimit (int) – limiting magnitude in V-band
  • b (int) – galactic longitude
  • l (int) – galactic latitude
  • sqdeg (float) – number of square degrees to cover
  • xmax (int) – highest pixel value to use for the random positions in x
  • ymax (int) – highest pixel value to use for the random positions in y
Returns:

None

Generating Postage Stamp Images

This simple script can be used to generate postage stamp images from a larger mosaic. These images can then be used in the VIS simulator.

requires:NumPy
requires:PyFITS
requires:VIS-PP
author:Sami-Matias Niemi
contact:s.niemi@ucl.ac.uk
version:0.1
sources.generatePostageStamps.generaPostageStamps(filename, catalog, maglimit=22.0, output='galaxy')

Generates postage stamp images from an input file given the input catalog position. The output files are saved to FITS files.

Parameters:
  • filename (str) – name of the FITS file from which the postage stamps are extracted
  • catalog (str) – name of the catalogue with x and y positions and magnitudes
  • maglimit (float) – brighter galaxies than the given magnitude limit are extracted
  • output (str) – name of the postage stamp prefix (will add a running number to this)
Returns:

None

This file provides simple functions to calculate the integrated stellar number counts as a function of limiting magnitude and galactic coordinates.

requires:NumPy
requires:matplotlib
version:0.1
author:Sami-Matias Niemi
contact:s.niemi@ucl.ac.uk
sources.stellarNumberCounts.bahcallSoneira(magnitude, longitude, latitude, constants)

Implemented Equation B1 from Bahcall and Soneira 1980 (1980ApJS...44...73B).

Note that the values return do not necessarily agree with the Table 6 of the paper values. Mostly the integrated number of stars agree within 15%, which is the error quoted in the paper.

Parameters:magnitude – limiting magnitude

:type magnitude:float :param longitude: galactic longitude in degrees :type longitude: float :param latitude: galactic latitude in degrees :type latitude: float

Returns:Number of stars per square degree
sources.stellarNumberCounts.integratedCountsVband()

Returns constant values for the integrated number counts in the V-band.

Returns:constants to be used when calculating the integrated number counts.
Return type:dict
sources.stellarNumberCounts.skyNumbers(maglimit=20, blow=20.0, bhigh=90.0, llow=0.0, lhigh=360.0, bnum=71, lnum=361, plot=True)

Calculate the integrated stellar number counts in a grid of galactic coordinates. Plot the results in two projections.

Parameters:
  • maglimit (int or float) – magnitude limit
  • blow (float) – lower limit for the galactic latitude
  • bhigh (float) – upper limit for the galactic latitude
  • llow (float) – lower limit for the galactic longitude
  • lhigh (float) – upper limit of the galacti longitude:
  • bnum (int) – number of galactic latitude grid points
  • lnum (int) – number of galactic longitude grid points
  • plot (bool) – whether or not to generate sky coverage plots
Returns:

grid of galactic coordinates and the number of stars in the grid