question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can one slice a GWCS?

See, e.g., https://github.com/astropy/astropy/issues/4669

Specifically, how do you create a new GWCS for a cutout image? This is needed for visualization (cc @pllim, referencing the above post).

Does nddata already do this? I hope this is a documentation issue, not a feature request.

Example use case:

hdu = fits.open('filename.fits')[('SCI', 1)]
ww = WCS(hdu.header)
slcs = slice(50, 100), slice(100, 150)
data = hdu.data[slcs]
ax = pl.subplot(projection=ww[slcs])
ax.imshow(data)

How can I do that with GWCS?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
pllimcommented, Sep 19, 2022

Stuart’s brain is probably serializable to TOML or something. 😝

1reaction
keflavichcommented, Sep 19, 2022

I think we’ve worked out everything except serializing the SlicedLowLevelWCS, which should be its own issuse.

Aside: I thought at first unpick was shorthand for unpickle and that your brain now just works in numpy-object space full time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An IFU Example - managing a discontiguous WCS
In general each slice has a unique WCS transform. There are two ways to represent this kind of transforms in GWCS depending on...
Read more >
Issues · spacetelescope/gwcs - GitHub
Issues list ; Multi-Issues with to_fits_sip : Detection of achieved accuracy, docs, fixing c0_0 · #425 opened 8 days ago ; GWCS slicing....
Read more >
Food Menu - Green Woods Charter School
Apple Slices Milk, 8. Lunch: Cheese Lasagna w/ Marinara Steamed Broccoli Fruit Dinner Roll Milk, 9. Lunch: French Bread Pizza Garden Salad Fresh...
Read more >
Shared Python Interface for World Coordinate Systems - Astropy
... such as the gwcs package being developed for the James Webb Space Telescope ... This slicing infrastructure is able to deal with...
Read more >
Loading and Working with Level One Data
Slicing ND Objects ... The wcs property is a gwcs.wcs. ... as the ASDF file they will be opened automatically when their slice...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found