Giter Club home page Giter Club logo

Comments (5)

brechmos-stsci avatar brechmos-stsci commented on July 18, 2024

@nden and I talked about the ticket and this is my understanding (which might need to be modified).

Problem Definition
All the transforms in assign_wcs, for NIRSPEC, expect the wavelength data to be in meters, which it is currently. The output wavelength dataset is expected to be in microns, which it isn't (hence the ticket). So, I need to come up with a way to convert the wavelength units from meters to microns.

Possible Solutions

@nden and I discussed two possible methods:

  1. Add a transform using Identity and Constant so it would be something like:
(ra, dec, lambda) | Mapping(0,1,2,2) & Identity(2) * ( Identity(1) * Constant(10^6))

The problem is the inverse transform may take some work given the number of inputs is different.

  1. Extend the Affine() Transform to move from 2D to 3D (or add a 3D)

We could put it in jwst.transforms for now and it could be built primarily for this purpose. In this case we would need to create an Affine3D in which the diagonal would be (1, 1, 10^6). I would also have to look at the inverse transform and we would have to be careful as the inverse transform would still do rotate-translate which is not the inverse of rotate-translate.

Solution Direction

@nden and I talked and 2. might be the better option as it would be cleaner.

In either case the change should be incorporated into the v2v3 frame as opposed to adding a new frame only for the wavelength unit conversion.

Testing

To confirm this works I can take any NIRSPEC file, run it through the assign_wcs before and after the changes. The resulting wavelength values should be 10^6 larger once the change is done.

from jwst.

nden avatar nden commented on July 18, 2024

👍

from jwst.

brechmos-stsci avatar brechmos-stsci commented on July 18, 2024

@nden as an aside, given the values have units attached to them is there not a "built-in" unit conversion utility? Would something like that make more sense to pursue as it would be more generally applicable?

I am about 50% done for this ticket either way.

from jwst.

nden avatar nden commented on July 18, 2024

astropy.units is generally used for unit conversion but models don't work with units yet although they will in the future when one would be able to pass astropy.Quantity to models. Currently gwcs.coordinate_frame has a method for attaching units to the output values. In the pipeline for now we need to return results in microns by default.

from jwst.

nden avatar nden commented on July 18, 2024

Fixed in #243. Thanks @brechmos-stsci !

from jwst.

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.