-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week12 #26
Week12 #26
Conversation
astroalign is sometimes returning false matches so we remove it for now until we can fix this. Also some changes to the wcs_checking loop to catch whether references left the frame or got near the edge after the new wcs.
This reverts commit 3e435ad.
@todo: this dependency can be removed with smarter numpy or astropy table usage.
Let's get this merged if we can. Any additions can come in future PRs. This is large enough.. |
This will cause us to have to drop support for Python 3.6. This will cause problems for some of the systems currently running the automatic parts of the code, until we can get them upgraded. What is the reason for the strict "astropy >= 4.2" requirement? |
Please install all dependencies (pip install -r requirements.txt) and run "flake8" and fix any errors it finds. |
Why is it needed to have the API URL in the config file... This sounds to me like a way to open a security hole... I change that config to point to something nasty and bad things happen... And it will break existing setups if it is not defined |
Please the following lines in the beginning of all files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rename the "localweb" or "web" to something more describing? Like "local target plotting interface" or whatever...
I think my nearest neighbor WCS correction code needs Astropy 4.2, and we intend to have it as a backup. So we should upgrade all dependencies to python >3.6 and astropy >=4.2, but let's do that later. Possibly, we change my code to not need astropy 4.2. It's just that they added a nice WCS solver in 4.2 that works well for matched pairs. |
import photutils.psf | ||
|
||
|
||
class EPSFBuilder(photutils.psf.EPSFBuilder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing as for the "WCS" object... Lets give it a new name so there is no confusion with the original EPSFBuilder
... FlowsEPSFBuilder
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're just copying and extending it, I think we should keep the same name. Then in the future if we move back to photutils EPSFBuilder, we don't have to refactor the code.
flows/load_image.py
Outdated
@@ -84,6 +85,9 @@ def load_image(FILENAME): | |||
image.image = np.asarray(hdul[0].data, dtype='float64') | |||
image.shape = image.image.shape | |||
|
|||
image.head = hdr | |||
image.exthdu = [hdu.copy() for hdu in hdul[1:]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere? It is an expensive operation if not used for anything and we might as well just use the HDUList
from the original FITS file if it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
flows/load_image.py
Outdated
@@ -84,6 +85,9 @@ def load_image(FILENAME): | |||
image.image = np.asarray(hdul[0].data, dtype='float64') | |||
image.shape = image.image.shape | |||
|
|||
image.head = hdr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this to "header" instead of "head"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
from astropy.table import Table, vstack | ||
from astropy.nddata import NDData | ||
from astropy.modeling import models, fitting | ||
from astropy.wcs.utils import proj_plane_pixel_area | ||
from astropy.wcs.utils import proj_plane_pixel_area, fit_wcs_from_points | ||
from astropy.time import Time | ||
|
||
warnings.simplefilter('ignore', category=AstropyDeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this warnings.simplefilter needed twice? (properly not)
The reason it was here originally was that photutils would throw warnings when importing... Is that still the case with the newer version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this for now yes, especially with our version fixing of Astropy/Photutils
flows/coordinatematch/__init__.py
Outdated
@@ -0,0 +1,2 @@ | |||
from .coordinatematch import CoordinateMatch # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be specific on which warnings you are disabling. Never use the "disable all warnings" unless there is a REALLY good reason for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are error F401 but we should ignore F401 by default on all init.py files.
Rasmus Comments, flake8 things. Correct Branch
Codecov Report
@@ Coverage Diff @@
## devel #26 +/- ##
==========================================
+ Coverage 16.81% 17.33% +0.51%
==========================================
Files 22 28 +6
Lines 1564 1979 +415
==========================================
+ Hits 263 343 +80
- Misses 1301 1636 +335
Continue to review full report at Codecov.
|
Fix PEP8 and missing )
missing operator flake8
Ok it’s ready to pull in |
Okay, I will merge this, but I will be doing some cosmetic changes afterwards |
I had to add two keys to the config.ini under [api],
to enable the custom api.
And @emirkmo is to blame for the switch to spaces :p