Git Product home page Git Product logo

Comments (7)

rmjarvis avatar rmjarvis commented on July 22, 2024

I'm pretty sure makeStars does choose the stamps so that the given position (from x_col, y_col) is as close as possible to the center of the stamp. I suspect the confusion is that these positions are assumed to be FITS-style positions, not numpy. That is, the center of the lower left pixel of the full image is considered to be (x,y) = (1,1), not (0,0).

These are the positions that show up if you open the image in, say, ds9 or some other standard astronomical image viewing software. And notably, (1,1) offset from what you get from things like matplotlib's imshow.

from piff.

MickaelRigault avatar MickaelRigault commented on July 22, 2024

It definitely could be that.

Should I change my code such that the conversions are RA,DEc-> x_col, y_pos in FITS-style or is there a way to tell PIFF that the values I am giving are numpy ?

I would prefer the latter as I think numpy formating is more standard (and matchs with matplotlib). But I could make the trick inside my code.
Thanks

from piff.

MickaelRigault avatar MickaelRigault commented on July 22, 2024

I am now shifting the x_cos, y_col by -1 to follow the fortran/fits format when creating the catalog that enters PIFF.

It solves the issue.

image

from piff.

rmjarvis avatar rmjarvis commented on July 22, 2024

Good. I'd much rather keep the convention of matching other astronomy software than some particular plotting package, so I think we should leave it as is. Especially since most input catalogs (e.g. any from SExtractor or the LSST stack) will be using this convention, not the numpy one. (I.e. your convention is very much not more standard.)

However, we could consider adding optional parameters xoffset and yoffset, which you can set to 1 as a way to apply an offset to the input positions. This way, you wouldn't need to rewrite new catalogs if you for whatever reason made catalogs with the numpy convention.

from piff.

MickaelRigault avatar MickaelRigault commented on July 22, 2024

That could be an idea, and indeed, numpy convention might actually not be the standard in astronomy.

from piff.

RobertLuptonTheGood avatar RobertLuptonTheGood commented on July 22, 2024

The Rubin code sets the centre of the bottom-left-hand pixel to be (0.0, 0.0), which is off-by-one from FITS (but consistent with 0-indexing in C and python)

from piff.

rmjarvis avatar rmjarvis commented on July 22, 2024

Ah, good to know. Thanks.

from piff.

Related Issues (20)

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.