hyper-py-photometry 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyper_py/data_output.py +1 -1
- hyper_py/detection.py +2 -1
- hyper_py/map_io.py +4 -2
- hyper_py/single_map.py +45 -18
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/METADATA +1 -1
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/RECORD +10 -10
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/WHEEL +1 -1
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/entry_points.txt +0 -0
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/licenses/LICENSE +0 -0
- {hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/top_level.txt +0 -0
hyper_py/data_output.py
CHANGED
|
@@ -23,7 +23,7 @@ def write_tables(data_dict, output_dir, config, sigma_thres, real_rms, base_file
|
|
|
23
23
|
flux_units_beam = 'mJy/beam'
|
|
24
24
|
else:
|
|
25
25
|
flux_units_beam = 'Jy/beam'
|
|
26
|
-
flux_units = 'Jy
|
|
26
|
+
flux_units = 'Jy'
|
|
27
27
|
|
|
28
28
|
units = {
|
|
29
29
|
'MAP_ID': '', 'HYPER_ID': '', 'BAND': 'GHz',
|
hyper_py/detection.py
CHANGED
|
@@ -50,7 +50,8 @@ def estimate_rms(image, sigma_clip=3.0):
|
|
|
50
50
|
return sigma
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
def detect_peaks(filtered_image, threshold, fwhm_pix, roundlim=(-1.0, 1.0), sharplim=(-1.0, 2.0)):
|
|
53
|
+
def detect_peaks(filtered_image, threshold, fwhm_pix, roundlim=(-1.0, 1.0), sharplim=(-1.0, 2.0)):
|
|
54
|
+
|
|
54
55
|
finder = DAOStarFinder(
|
|
55
56
|
threshold=threshold,
|
|
56
57
|
fwhm=fwhm_pix,
|
hyper_py/map_io.py
CHANGED
|
@@ -50,8 +50,10 @@ def read_and_prepare_map(filepath, beam, beam_area_arcsec2, beam_area_sr, conver
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
# --- Unit conversions ---
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
header_for_units = hdul[0].header
|
|
54
|
+
bunit = header_for_units.cards['BUNIT'].value
|
|
55
|
+
|
|
56
|
+
if bunit == 'MJy/sr' or bunit == 'MJy / sr':
|
|
55
57
|
arcsec_to_rad = np.pi / (180.0 * 3600.0)
|
|
56
58
|
pix_area_sr = (pix_dim * arcsec_to_rad)**2
|
|
57
59
|
image_data *= 1e6 * pix_area_sr # MJy/sr to Jy/pixel
|
hyper_py/single_map.py
CHANGED
|
@@ -95,7 +95,7 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
95
95
|
flux_err = []
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
fit_status_val = []
|
|
99
99
|
deblend_val = []
|
|
100
100
|
cluster_val = []
|
|
101
101
|
|
|
@@ -143,14 +143,16 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
# --- map rms used to define real sources in the map - accounting for non-zero background --- #
|
|
146
|
+
map_zero_mean_detect = real_map - np.nanmean(real_map)
|
|
147
|
+
|
|
146
148
|
use_maual_rms = cfg.get("detection", "use_manual_rms", False)
|
|
147
149
|
if use_maual_rms == True:
|
|
148
150
|
real_rms = cfg.get("detection", "rms_value", False)
|
|
149
151
|
else:
|
|
150
152
|
sigma_clip = SigmaClip(sigma=3.0, maxiters=10)
|
|
151
|
-
map_zero_mean_detect = real_map - np.nanmean(real_map)
|
|
152
153
|
clipped = sigma_clip(map_zero_mean_detect)
|
|
153
154
|
real_rms = np.sqrt(np.nanmean(clipped**2))
|
|
155
|
+
|
|
154
156
|
|
|
155
157
|
|
|
156
158
|
# --- run sources identification --- #
|
|
@@ -234,12 +236,24 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
234
236
|
# Convert to sky coordinates
|
|
235
237
|
x_pixels = np.array(xcen, dtype=np.float64)
|
|
236
238
|
y_pixels = np.array(ycen, dtype=np.float64)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
|
|
240
|
+
ctype1 = header.get('CTYPE1', '').upper()
|
|
241
|
+
ctype2 = header.get('CTYPE2', '').upper()
|
|
242
|
+
|
|
243
|
+
if 'GLON' in ctype1 and 'GLAT' in ctype2:
|
|
244
|
+
# Input coordinates are Galactic
|
|
245
|
+
glon, glat = wcs.wcs_pix2world(x_pixels, y_pixels, 0)
|
|
246
|
+
skycoords = SkyCoord(l=glon, b=glat, unit='deg', frame='galactic')
|
|
247
|
+
ra = skycoords.fk5.ra.deg
|
|
248
|
+
dec = skycoords.fk5.dec.deg
|
|
249
|
+
ra_save = np.where(ra < 0., ra + 360., ra)
|
|
250
|
+
else:
|
|
251
|
+
# Assume input coordinates are Equatorial (FK5/ICRS)
|
|
252
|
+
ra, dec = wcs.wcs_pix2world(x_pixels, y_pixels, 0)
|
|
253
|
+
ra_save = np.where(ra < 0., ra + 360., ra)
|
|
254
|
+
skycoords = SkyCoord(ra=ra, dec=dec, unit='deg', frame='fk5')
|
|
255
|
+
glon = skycoords.galactic.l.deg
|
|
256
|
+
glat = skycoords.galactic.b.deg
|
|
243
257
|
|
|
244
258
|
# Prepare zeroed output table
|
|
245
259
|
N = len(xcen)
|
|
@@ -386,7 +400,7 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
386
400
|
redchi_val.append(final_redchi)
|
|
387
401
|
bic_val.append(final_bic)
|
|
388
402
|
|
|
389
|
-
|
|
403
|
+
fit_status_val.append(fit_status)
|
|
390
404
|
deblend_val.append(0) # not deblended
|
|
391
405
|
cluster_val.append(1) # only one source
|
|
392
406
|
|
|
@@ -568,7 +582,7 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
568
582
|
redchi_val.append(final_redchi)
|
|
569
583
|
bic_val.append(final_bic)
|
|
570
584
|
|
|
571
|
-
|
|
585
|
+
fit_status_val.append(fit_status)
|
|
572
586
|
deblend_val.append(1) # multi-Gaussian fit
|
|
573
587
|
cluster_val.append(len(group_indices)) # number of sources in the group
|
|
574
588
|
|
|
@@ -586,18 +600,31 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
586
600
|
|
|
587
601
|
# Assuming you have your WCS object (usually from your FITS header)
|
|
588
602
|
header = map_struct["header"]
|
|
589
|
-
# Convert pixel coordinates to sky coordinates (RA, Dec)
|
|
590
603
|
x_pixels = np.array(updated_xcen, dtype=np.float64)
|
|
591
604
|
y_pixels = np.array(updated_ycen, dtype=np.float64)
|
|
592
605
|
|
|
593
606
|
# Initialize WCS from header
|
|
594
607
|
wcs = WCS(header)
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
608
|
+
|
|
609
|
+
# Detect coordinate type from header
|
|
610
|
+
ctype1 = header.get('CTYPE1', '').upper()
|
|
611
|
+
ctype2 = header.get('CTYPE2', '').upper()
|
|
612
|
+
|
|
613
|
+
if 'GLON' in ctype1 and 'GLAT' in ctype2:
|
|
614
|
+
# Input coordinates are Galactic
|
|
615
|
+
glon, glat = wcs.wcs_pix2world(x_pixels, y_pixels, 0)
|
|
616
|
+
# Convert to FK5 (RA/Dec)
|
|
617
|
+
skycoords = SkyCoord(l=glon, b=glat, unit='deg', frame='galactic')
|
|
618
|
+
ra = skycoords.fk5.ra.deg
|
|
619
|
+
dec = skycoords.fk5.dec.deg
|
|
620
|
+
ra_save = np.where(ra < 0., ra + 360., ra)
|
|
621
|
+
else:
|
|
622
|
+
# Assume input coordinates are Equatorial (FK5/ICRS)
|
|
623
|
+
ra, dec = wcs.wcs_pix2world(x_pixels, y_pixels, 0)
|
|
624
|
+
ra_save = np.where(ra < 0., ra + 360., ra)
|
|
625
|
+
skycoords = SkyCoord(ra=ra, dec=dec, unit='deg', frame='fk5')
|
|
626
|
+
glon = skycoords.galactic.l.deg
|
|
627
|
+
glat = skycoords.galactic.b.deg
|
|
601
628
|
|
|
602
629
|
|
|
603
630
|
######################## Write Table after photometry ########################
|
|
@@ -639,7 +666,7 @@ def main(map_name=None, cfg=None, dir_root=None, logger=None, logger_file_only=N
|
|
|
639
666
|
"FWHM_1": list(radius_val_1),
|
|
640
667
|
"FWHM_2": list(radius_val_2),
|
|
641
668
|
"PA": list(PA_val),
|
|
642
|
-
"STATUS": list(
|
|
669
|
+
"STATUS": list(fit_status_val),
|
|
643
670
|
"GLON": list(glon),
|
|
644
671
|
"GLAT": list(glat),
|
|
645
672
|
"RA": list(ra_save),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyper-py-photometry
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: HYPER: Hybrid Photometry Photometry and Extraction Routine
|
|
5
5
|
Author-email: Alessio Traficante <alessio.traficante@inaf.it>
|
|
6
6
|
Project-URL: Homepage, https://github.com/alessio-traficante/hyper-py
|
|
@@ -4,25 +4,25 @@ hyper_py/bkg_multigauss.py,sha256=SuVlEMkPOccqOuATCaoEBU_WpQARAlHJa2qwAkglHII,22
|
|
|
4
4
|
hyper_py/bkg_single.py,sha256=stGiZIAFabOW3QHxakA2pJ0__HjgyvcPD2TnB3ARbZc,20269
|
|
5
5
|
hyper_py/config.py,sha256=evafwkxft8YK4vbAjOlBdB796gYd4zNnHt8wJbOabPs,1473
|
|
6
6
|
hyper_py/create_background_slices.py,sha256=VjR_cwRYWFFmEkpcJ8fXcnc6oSAbtY2DPjGWvbs5ecc,6090
|
|
7
|
-
hyper_py/data_output.py,sha256=
|
|
8
|
-
hyper_py/detection.py,sha256=
|
|
7
|
+
hyper_py/data_output.py,sha256=ae2pVAfcX3NlIGL-OhLyJz3aEg_w7y5HnGy4QMFfbZY,5527
|
|
8
|
+
hyper_py/detection.py,sha256=Bbcz5FsQnfWPRqxmT8vieGGL7cxmaebPsJ4yj6vXQaE,4716
|
|
9
9
|
hyper_py/extract_cubes.py,sha256=hmfp5MoA5HKOwEduXqmV8uahfBbL479Qr5cC84zT7z0,1643
|
|
10
10
|
hyper_py/fitting.py,sha256=MTw9Yt4LYAybVXM5uI_IgQiT5Maiz_W9EyWqHLEXVkY,26010
|
|
11
11
|
hyper_py/gaussfit.py,sha256=t_LlKd5hJZB1K2fGnZsd6v-q2h-M5XCW214FYjDCFOU,22833
|
|
12
12
|
hyper_py/groups.py,sha256=Q2xQ4MqYR-sRpRhNtayMqTVPMi2rm0ie34mmCDwTbNY,2303
|
|
13
13
|
hyper_py/hyper.py,sha256=574EnlwCXTesCkOK_L3dMMnIo8uU4G1RWj_Tgaz2F7c,6018
|
|
14
14
|
hyper_py/logger.py,sha256=He18tjVOvG7_OVGY6262wj30HExoEa7vCFO6WziHSFk,2864
|
|
15
|
-
hyper_py/map_io.py,sha256=
|
|
15
|
+
hyper_py/map_io.py,sha256=4i0G_Hs4IR0GeYTHzPJsu-NAPt-Dd4nNA_mJRNIanwM,2442
|
|
16
16
|
hyper_py/paths_io.py,sha256=fUl0GjwUZLEDXZAUlLK88DB6mBQ_il7fIa-vvKVUxRI,3770
|
|
17
17
|
hyper_py/photometry.py,sha256=4oCRZy8FVjV9BZL5f85LlcNnXuNq0wgtGAm8_cL5f9w,3869
|
|
18
18
|
hyper_py/run_hyper.py,sha256=ed2n7yf8mLATWXtjPxOAs1odiBcUsDsEU4bwDiXd24w,5388
|
|
19
|
-
hyper_py/single_map.py,sha256=
|
|
19
|
+
hyper_py/single_map.py,sha256=C6bn1sljPMVmzOqpn2QdTdE_BdwH-KYCAlhaXSl0K40,29931
|
|
20
20
|
hyper_py/survey.py,sha256=ymOJk-H4Bf515OwSNFkmODKk7x3MteT6l51ylaYy9Cg,2807
|
|
21
21
|
hyper_py/visualization.py,sha256=AJRuR_Y-_AaZ2NwX1w07lRABV0C2-w8QP1tSqs9_kvk,5662
|
|
22
22
|
hyper_py/assets/default_config.yaml,sha256=64DJtYhwHX6XkbOyuGMmn51WwjK0uJpNafRe8CwkkO4,10616
|
|
23
|
-
hyper_py_photometry-1.0.
|
|
24
|
-
hyper_py_photometry-1.0.
|
|
25
|
-
hyper_py_photometry-1.0.
|
|
26
|
-
hyper_py_photometry-1.0.
|
|
27
|
-
hyper_py_photometry-1.0.
|
|
28
|
-
hyper_py_photometry-1.0.
|
|
23
|
+
hyper_py_photometry-1.0.1.dist-info/licenses/LICENSE,sha256=aB7cqE2-X_8mxy-EmQuVMkKmP8DQA2BnQaqD5k5C5nE,584
|
|
24
|
+
hyper_py_photometry-1.0.1.dist-info/METADATA,sha256=5H0bNqXRu52VbLK4odAAx6qTo-jK0AZmF3A7XjpSpig,37007
|
|
25
|
+
hyper_py_photometry-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
26
|
+
hyper_py_photometry-1.0.1.dist-info/entry_points.txt,sha256=0AVwuatL0ri5juy_Ccgt_9Bd4V0McpOrWSSnNX8cCzs,120
|
|
27
|
+
hyper_py_photometry-1.0.1.dist-info/top_level.txt,sha256=Pw-Iuf0SQwcibLdOwx4RkmEas3I6s0Ym_D0_oUnXEr4,9
|
|
28
|
+
hyper_py_photometry-1.0.1.dist-info/RECORD,,
|
{hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{hyper_py_photometry-1.0.0.dist-info → hyper_py_photometry-1.0.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|