comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to create synthetic images of stars with gaussian psf in IDL.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to create synthetic images of stars with gaussian psf in IDL. [message #92989 is a reply to message #92987] Tue, 05 April 2016 07:24 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Tuesday, April 5, 2016 at 10:18:17 AM UTC-4, Jeremy Bailin wrote:
> On Monday, April 4, 2016 at 10:59:09 AM UTC-4, Sonu Tabitha wrote:
>> On Monday, April 4, 2016 at 1:13:27 PM UTC+5:30, Sonu Tabitha wrote:
>>> I want to create a synthetic image to resemble a stellar field (say covering an area of 255 by 255 pixels, with a total of about 4 stars having Gaussian PSF). The rest of the image has to be filled with constant background and noise, as present in the entire image, but devoid of stars. I want to create this to test a source extraction algorithm that I have developed. I am a beginner in IDL. Can you please help me out in coding?
>>
>> Thanks Jeremy! But I am very new to IDL and I am not so familiar with its functions. Can you please give me a sample code?
>
> 1) RANDOMU takes as its first argument a random seed, and then the dimensions of the output array. So, for example, if you wanted to get a 256 x 512 random array, you could do:
>
> seed = 1L ; set it to something so your results are repeatable
> noise_image = RANDOMU(seed, 256, 512)
>
> By default RANDOMU gives you a uniform random deviate, but you probably want a Poisson distribution, which requires giving the POISSON keyword with the mean expected value. For example, if your noise level is 2.5 electrons, you might say:
>
> RANDOMU(seed, 256, 512, POISSON=2.5)
>
>
> 2) PSF_GAUSSIAN takes a few options. The ones you care about are:
> NPIXEL: The dimensions of the output array. So you could use [256, 512] to make an array the same size as above.
> CENTROID: The position on the iamge of the center of the PSF. For example [10.5, 186] for a center at x=10.5, y=186 (note they don't have to be at pixel centers).
> FWHM or ST_DEV: Width of the Gaussian -- you can specify it either using the FWHM or Gaussian sigma. For an isotropic PSF, just give one value (e.g. ST_DEV=3.0 for a 3-pixel standard deviation), or for an anisotropic PSF you can give a separate x- and y-width (e.g. FWHM=[4.0, 5.5] for a PSF that is slightly elongated in the y-direction).
>
> e.g. psf1 = PSF_GAUSSIAN(NPIXEL=[256,512], CENTROID=[10.5,186], ST_DEV=3.0)
>
> 3) Add them.
>
> image = noise_image + psf1
>
>
> -Jeremy.

Oh, one obvious bit that I missed -- PSF_GAUSSIAN will give you a peak value of 1 (or, if /NORMALIZE is set, a total integral of 1). To get a different number, just multiply the output of PSF_GAUSSIAN by the actual amplitude you want.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: filtering data data in .txt
Next Topic: Can you please explain me the meaning of the following IDL code?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:31:31 PDT 2025

Total time taken to generate the page: 0.00467 seconds