GithubHelp home page GithubHelp logo

Comments (3)

timj avatar timj commented on July 24, 2024

If any of the package was in python it would have been easier to have a norm=True keyword argument for tran(). Since it's all in C that would probably be tricky. It's a bit silly to add that to Atl. It is a problem that the arrangement of the numpy arrays returned from tran() are different to the numpy arrangement accepted by norm().

The reason tran() doesn't do that by default is that AST doesn't want to waste time normalising the coordinates when those coordinates may well be transformed again anyhow.

from starlink-pyast.

parejkoj avatar parejkoj commented on July 24, 2024

It's fine that tran() doesn't default to that: no disagreement there. But it is very awkward to actually normalize the output of tran. Having some method that can be directly applied to the tran() output is the idea here.

from starlink-pyast.

dsberry avatar dsberry commented on July 24, 2024

I suppose we could provided an overloaded implementation of the norm method within pyast that check the type of its arguments to see if it is provided with a single array of floating point values, or an array of arrays and does the appropriate thing. But in addition you can also use the existing NormMap class to normalise the output from tran:

(a,b) = wcsinfo.tran( [[100.0,150.0],[200.0,250.0]] )
(c,d) = Ast.NormMap( wcsinfo ).tran( [a,b] )

The reason for not performing normalisation by default within tran is partly, as Tim says, to avoid unnecessary work. But it is also because there are some occasions when you do not want to perform the normalisation - e.g. when dealing with cylindrical projections such as CAR when you need to know if a transformed point has gone out of the domain of the projection.

from starlink-pyast.

Related Issues (10)

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.