Giter Club home page Giter Club logo

Comments (3)

exowanderer avatar exowanderer commented on July 1, 2024

By using the try/except bypass, I can say that this error occurs about 25 times in 60k images.

from least_asymmetry.

natelust avatar natelust commented on July 1, 2024

This issue occurs when there is no minimum in the asymmetry space. Basically the routine is following the gradient in asymmetry space trying to get the minimum value to be at the center of a square array. If in the course of following the gradient, the array which is used to calculate an asymmetry value extends beyond the data array it is attempting to measure this error will be thrown. In other words, it is trying to calculate a radial profile around a certain x,y position but there is no data in the input array from which to generate the profile. The code used a pre-calculated square array do do this calculation (it is important it always be symmetric so a rectangle would not work) for the sake of efficiency. The routine is checking the pre-computed array matches the dimensions of a view into the data array and throws an error if they do not match.

There are a few quick options you can go with.

  1. give more area (a larger array) to the routine and hope that this will be enough such that the gradient in asym space flows down hill to a minimum.

  2. decrease the asym_rad to something like 2 or 3 pixels. If the gradient in asym space is such that you would find a minimim near an edge this may give you enough pixels to work with. Remember you need enough data to correspond to the asym transformation radius plus the asym image radius. in other words if you want to transform a 5x5 area of an image using a 5 pixel asym radius you will need a data array of at least 10x10 (assuming the center is already in the center of the data image) if is not, you will need additional pixels in the dimensions the routine needs to walk to find the center. If it must go up one pixel and right one pixel, you will need a data array of at least 11x11. You may be able to just decrease the asym_rad for the images that fail the try block (decreasing the rad will also decrease the accuracy.

  3. Investigate the failing images. It may be possible that something weird is going on (bluring large noise spikes, etc.) and the images are bad anyway. At least this may give you an idea of what the algorithm is seeing.

Does this help? I think I probably can put in a more helpful error message to give a hint to this for future uses.

from least_asymmetry.

exowanderer avatar exowanderer commented on July 1, 2024

Yes. That definitely helped. All 27 images had a cosmic ray hit (strong single-pixel spike) nearby the PSF. So the algorithm was definitely being led astray.

I think that it would be fruitful for the algorithm to print an error message that flags the frames and says "Frame ##### FAILED; examine more closely; assigning pathological value for centering". Then I would have looked at those frames and said "yep. these are cosmic ray hits". Instead, I spent about 2 hours digging through the python and cpp code looking for the size of the arrays.

The error message "Array must be square" implied to me that the input array (my images) were not square, which made no sense to me.

Thank you for the help!

from least_asymmetry.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.