benmontet / nutella Goto Github PK
View Code? Open in Web Editor NEWGreat (point) spreads for beautiful Kepler/K2 inference
License: MIT License
Great (point) spreads for beautiful Kepler/K2 inference
License: MIT License
Am I accidentally shifting twice somewhere
So it can minimize faster.
We were missing the dumb (right) way to calculate the total expected flux from a star in each cadence:
pred_flux = [np.sum(np.exp(model(*results[i], gds))) for i in range(len(tpf)]
Duh. Just calculate the model explicitly and sum over all pixels.
Anyway, when we do this (see the old notebook) we still get too much noise. I think this might be in part because the model region is smaller than the entire PSF and so the movement carries it out of the model region. The residuals look like noise (which is good!) but there is too much of it.
The good news is that we can see the sinusoidal pattern in the data. The residuals aren't quite centered around 0, but I believe this is a background issue and will be fixed when we fix #1.
I propose we fit for [Nstar x Ncadence] fluxes, [Nstar x2] positions (x and y), and [(Nstar-1) x2] offsets between stars. As the detector moves around the relative positions of stars will be fixed, so any apparent changes in the centroids of each is actually telling us something about the flat field.
Using the powell
method I can directly optimize a matrix of parameters (although looks like that's not intended scipy/scipy#8262), but I think we can give it a shot.
Any pixel that might have a negative value is a pixel that by definition is not receiving any flux from the star, so perhaps it shouldn't contribute to our models at all. I propose we consider NaNning these pixels.
GD is slow (as currently implemented)
@mirca please check my math here. Since we're multiplying the terms together now they were definitely wrong as written previously! I'm still not convinced they're right.
Let's make sure we don't get sued for the name of this code. (A cease and desist is okay---perhaps encouraged)
In a simulated test with a simple PSF and no noise and no motion, it works perfectly and we get the ideal PSF back.
As soon as we build in even simple motion, everything goes to hell. Why? Positions are not inferred correctly, need to explore to see what's going on (did we miss a minus sign somewhere?)
I'm using a PSF which is a simple square of height one in the central 9 pixels, and motion that carries this only directly up and down. The norm_super_tpf must have sharp vertical edges in this case, as the columns outside the central 3 never receive any flux.
This is what we're getting with RectBivariateSpline which clearly is an issue.
What are our errors anyway, really? Perhaps a Poisson likelihood function is relevant. Does that ruin everything in some subtle way?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.