Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Jan 30, 2019
2 parents bb87e2b + a4704d7 commit a203dd7
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 122 deletions.
2 changes: 1 addition & 1 deletion diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from skimage.transform import resize
except ImportError:
print('Module skimage not found. Please install with: pip install '
'skimage')
'scikit-kimage')
sys.exit()

# pipeline-specific modules
Expand Down
2 changes: 1 addition & 1 deletion pp_calibrate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_CALIBRATE - match image databases against photometry catalogs
and derive magnitude zeropoint
Expand Down
2 changes: 1 addition & 1 deletion pp_combine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_COMBINE - combine frames based on wcs
v1.0: 2017-10-03, mommermiscience@gmail.com
Expand Down
4 changes: 2 additions & 2 deletions pp_distill.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_DISTILL - distill calibrated image databases into one database
of select moving or fixed sources
Expand Down Expand Up @@ -330,7 +330,7 @@ def serendipitous_variablestars(catalogs, display=True):
+ 'a %.2f deg radius') %
(ra_deg, dec_deg, rad_deg))

field = coord.SkyCoord(ra=ra_deg, dec=dec_deg, unit=(u.dec, u.dec),
field = coord.SkyCoord(ra=ra_deg, dec=dec_deg, unit=(u.deg, u.deg),
frame='icrs')

vquery = Vizier(columns=['Name', 'RAJ2000', 'DEJ2000'])
Expand Down
2 changes: 1 addition & 1 deletion pp_extract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_EXTRACT - identify field sources using Source Extractor with
multi-threading capabilities
Expand Down
2 changes: 1 addition & 1 deletion pp_manident.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" MANIDENT - manual target identification tool for the Photometry Pipeline
Expand Down
2 changes: 1 addition & 1 deletion pp_photometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_PHOTOMETRY - run curve-of-growth analysis on image files,
identify optimum aperture radius, and redo photometry
Expand Down
32 changes: 17 additions & 15 deletions pp_prepare.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_PREPARE - prepare fits images for photometry pipeline
v1.0: 2016-02-27, mommermiscience@gmail.com
Expand Down Expand Up @@ -220,20 +220,22 @@ def prepare(filenames, obsparam, header_update, keep_wcs=False,
header.remove(key)
elif 'PV' in key and '_' in key:
header.remove(key)
elif key in ['CTYPE1', 'CRPIX1', 'CRVAL1', 'CROTA1',
'CROTA2', 'CFINT1', 'CTYPE2', 'CRPIX2',
'CRVAL2', 'CFINT2', 'LTM1_1', 'LTM2_2',
'WAT0_001', 'LTV1', 'LTV2', 'PIXXMIT',
'PIXOFFST', 'PC1_1', 'PC1_2', 'PC2_1', 'PC2_2',
#'CUNIT1', 'CUNIT2',
'A_ORDER', 'A_0_0',
'A_0_1', 'A_0_2', 'A_1_0', 'A_1_1', 'A_2_0',
'B_ORDER', 'B_0_0', 'B_0_1', 'B_0_2', 'B_1_0',
'B_1_1', 'B_2_0', 'AP_ORDER', 'AP_0_0',
'AP_0_1', 'AP_0_2', 'AP_1_0', 'AP_1_1',
'AP_2_0', 'BP_ORDER', 'BP_0_0', 'BP_0_1',
'BP_0_2', 'BP_1_0', 'BP_1_1', 'BP_2_0',
'CDELT1', 'CDELT2', 'CRDELT1', 'CRDELT2']:
elif key in (['CTYPE1', 'CRPIX1', 'CRVAL1', 'CROTA1',
'CROTA2', 'CFINT1', 'CTYPE2', 'CRPIX2',
'CRVAL2', 'CFINT2', 'LTM1_1', 'LTM2_2',
'WAT0_001', 'LTV1', 'LTV2', 'PIXXMIT',
'PIXOFFST', 'PC1_1', 'PC1_2', 'PC2_1', 'PC2_2',
'A_ORDER', 'A_0_0',
'A_0_1', 'A_0_2', 'A_1_0', 'A_1_1', 'A_2_0',
'B_ORDER', 'B_0_0', 'B_0_1', 'B_0_2', 'B_1_0',
'B_1_1', 'B_2_0', 'AP_ORDER', 'AP_0_0',
'AP_0_1', 'AP_0_2', 'AP_1_0', 'AP_1_1',
'AP_2_0', 'BP_ORDER', 'BP_0_0', 'BP_0_1',
'BP_0_2', 'BP_1_0', 'BP_1_1', 'BP_2_0',
'CDELT1', 'CDELT2', 'CRDELT1', 'CRDELT2'] +
['TR{}_{}'.format(i, j)
for i in range(1, 3)
for j in range(15)]):
if not toolbox.if_val_in_dict(key, obsparam):
header.remove(key)

Expand Down
2 changes: 1 addition & 1 deletion pp_register.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_REGISTER - wcs register frames
v1.0: 2015-12-30, mommermiscience@gmail.com
Expand Down
2 changes: 1 addition & 1 deletion pp_stackedphotometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PP_STACKEDPHOTOMETRY - wrapper to perform photometry on stacked images
v1.0: 2017-10-19, mommermiscience@gmail.com
Expand Down
2 changes: 1 addition & 1 deletion pptool_mpcreport.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PPTOOL_MPCREPORT - produce a file for submission of asteroid astrometry
to the Minor Planet center
Expand Down
2 changes: 1 addition & 1 deletion pptool_psfsub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

""" PPTOOL_PSFSUB - PSF subtraction tool
v1.0: 2017-12-10, mommermiscience@gmail.com
Expand Down
88 changes: 0 additions & 88 deletions setup/mytelescopes.py

This file was deleted.

17 changes: 10 additions & 7 deletions toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
sys.exit()

import math
import numpy
import numpy as np

# only import if Python3 is used
if sys.version_info > (3, 0):
Expand Down Expand Up @@ -128,7 +128,7 @@ def read_scamp_output():
this_data = []
# flush data line
if read_this and raw[idx].find('</TR>') > -1:
data.append(numpy.hstack(this_data))
data.append(np.hstack(this_data))
# actually read data line
if read_this and raw[idx].find('<TD>') > -1:
line = raw[idx].replace('/', '').split('<TD>')
Expand Down Expand Up @@ -199,16 +199,19 @@ def skycenter(catalogs, ra_key='ra_deg', dec_key='dec_deg'):

# using percentiles instead of min/max to get better handle
# on outliers
min_ra = min([numpy.percentile(cat[ra_key], 1)
min_ra = min([np.percentile(cat[ra_key], 1)
for cat in catalogs])
max_ra = max([numpy.percentile(cat[ra_key], 99)
max_ra = max([np.percentile(cat[ra_key], 99)
for cat in catalogs])
min_dec = min([numpy.percentile(cat[dec_key], 1)
min_dec = min([np.percentile(cat[dec_key], 1)
for cat in catalogs])
max_dec = max([numpy.percentile(cat[dec_key], 99)
max_dec = max([np.percentile(cat[dec_key], 99)
for cat in catalogs])

ra, dec = (max_ra+min_ra)/2, (max_dec+min_dec)/2
ra, dec = (np.rad2deg(np.angle(np.exp(1j*np.deg2rad(min_ra)) +
np.exp(1j*np.deg2rad(max_ra)))),
np.rad2deg(np.angle(np.exp(1j*np.deg2rad(min_dec)) +
np.exp(1j*np.deg2rad(max_dec)))))

lower_left = SkyCoord(ra=min_ra, dec=min_dec, frame='icrs', unit='deg')
upper_right = SkyCoord(ra=max_ra, dec=max_dec, frame='icrs', unit='deg')
Expand Down

0 comments on commit a203dd7

Please sign in to comment.