Skip to main content
1-Visitor
January 18, 2016
Solved

Help with creating locations of a regular pattern

  • January 18, 2016
  • 11 replies
  • 3922 views

I have create a set of random locations and then at each location I place an object to simualte an image.

im57.png

The delta just makes sure no objects are within 3 pixels of the image edge.

I know want to be able to change the locations now to represent the following regular pattern. I believe horizontallt there is a pitch of 8 pixels, and vertically a pitch of 9 pixels with a horiztonal shift of 4 pixels.

im58.png

Thnaks for any help

Jason

Best answer by RichardJ

Use the built-in convol2d function and the edge effect goes away (i could probably get it to go away using FTs as well, but the built-in function is a lot easier!).

11 replies

19-Tanzanite
January 18, 2016

Something like this?

Jbryant611-VisitorAuthor
1-Visitor
January 19, 2016

Thanks Richard - its a while since we last spoke on this forum!!

Please see the attached, you  helped me before a couple of years ago place a point spread function of random amplitude at each of these locations.  I have tried to combine your previous work with this patterned location array and nearly have it, there's 3 issues that have arisen though and I'm not sure how to do them.


In particular:

1: How to count the number of objects, I tried the following but its not right.

im62.png

2: How to apply random amplitudes to the objects  using

                        

    amp=runif(n,0.1,1)         - but how to then apply it to the objects in M?

3: How to get rid of the strange edge effect ont he right hand side

im63.png

and lastly, how to allow for a random 0.5 pixel shift so that each psf is not necessarily centred exactly on a pixel.

Thanks

Jason

Jbryant611-VisitorAuthor
1-Visitor
January 20, 2016

I've managed to answer my own questions, not sure if its the most elegant way.  I included the randomw amplitude and object count in Richards original function.image01.png

Im still getting a strange edge effects on the RHS once its convolved with the psf.

Jason