Giter VIP home page Giter VIP logo

pandeia-coronagraphy's People

Contributors

kvangorkom avatar mperrin avatar

Watchers

 avatar  avatar  avatar

pandeia-coronagraphy's Issues

on-the-fly PSFs have a subpixel offset relative to precomputed library PSFs

When the Pandeia library PSFs are generated, the requested offsets for the PSFs are forced to nearest integer upsampled pixel, and then recentered by a simple pixel remapping after the call to WebbPSF (so the convolution kernel created from the PSF is centered). For on-the-fly PSFs, I've intentionally avoided forcing the offset to an integer multiple of the upsampled pixel, since we care (particularly for MIRI) about small changes to these spatially-dependent PSFs. However, the pixel remapping approach then has the side effect of producing a slightly off-center convolution kernel.

Possible mitigation strategies: interpolate the PSF for the centering step (I really don't want to do this), or adopt a higher upsampling value.

refactor scene and engine

Several functions are currently living in scene (load_calculation, save_calcation, calculate_batch) that more properly belong under engine. This will require updating notebooks.

nircam and miri SGD notebook error due to NANs

Hello,

I have been testing the MIRI SGD notebook and running into issues when generating the KLIP reference. This is related to uncorrected nan's in the SGD reference images, possibly due to saturation artifacts, that cause the code to crash.

Here's what is in the original code -

slope = r['2d']['detector'] 
reg = analysis.register_to_target(slope,target_slope,rescale_reference=True)
sgd_reg.append(reg)
sgd_reg = np.array(sgd_reg)

I modified it in the following manner (also zero'd mean for references) -

slope = r['2d']['detector']
slope_mean_sub = slope - np.nanmean(slope)
slope_mean_sub[np.isnan(slope_mean_sub)] = 0
reg = analysis.register_to_target(slope_mean_sub,target_slope,rescale_reference=True)
sgd_reg.append(reg)

This does result in the central PSF artifact not getting completely removed in the target-reference but that could be corrected by drawing a mask on the central 0.1-0.2 arcsec.

which repo to use for future development?

Hi @kjbrooks @kvangorkom - since @kvangorkom's no longer here at ST, do we have a transition plan for which repository to use for future development on this? I was just reminded by @abhijithrajan that I never made a PR for my version of this that re-enables the LRU caching for faster calculations.

Should I submit that PR here, to @kjbrooks's fork of this repo, or somewhere else? Should we make a new fork of this inside the spacetelescope organization and declare that is the new primary master? I'm happy with whatever, just want to make sure that we all agree on the right path.

LRU cache is incompatible with multiprocessing

The functools32.lru_cache decorator (currently decorating engine.get_psf_on_the_fly) does not update the function cache when called on a separate process (as in when performing calculations with engine.calculate_batch).

There are other caching implementations that appear to play nicely with multiprocessing, but that'd require adding a 3rd-party dependency, which I'd rather avoid. (Alternatively, I could roll my own, but that adds a failure mode I'd rather not deal with.)

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.