pz-rail-astro-tools 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.
Potentially problematic release.
This version of pz-rail-astro-tools might be problematic. Click here for more details.
- {pz_rail_astro_tools-1.0.0.dist-info → pz_rail_astro_tools-1.0.1.dist-info}/METADATA +1 -1
- {pz_rail_astro_tools-1.0.0.dist-info → pz_rail_astro_tools-1.0.1.dist-info}/RECORD +8 -7
- rail/astro_tools/_version.py +2 -2
- rail/examples_data/testdata/rubin_dm_dc2_example2.pq +0 -0
- rail/tools/photometry_tools.py +33 -11
- {pz_rail_astro_tools-1.0.0.dist-info → pz_rail_astro_tools-1.0.1.dist-info}/LICENSE +0 -0
- {pz_rail_astro_tools-1.0.0.dist-info → pz_rail_astro_tools-1.0.1.dist-info}/WHEEL +0 -0
- {pz_rail_astro_tools-1.0.0.dist-info → pz_rail_astro_tools-1.0.1.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
rail/astro_tools/__init__.py,sha256=c0yzN5jMhByii01h_mjOWipeProO8vludBsO09dJkmc,377
|
|
2
|
-
rail/astro_tools/_version.py,sha256=
|
|
2
|
+
rail/astro_tools/_version.py,sha256=IIj5MPQqf7H30zvHF3gsfSLSw1SsdlKYR9SngW-9GC8,411
|
|
3
3
|
rail/creation/degraders/grid_selection.py,sha256=QCs7ZpLJ_GdJnIIt0WF09mBLeqsrzQ2CiDo0h0Hd3dQ,12438
|
|
4
4
|
rail/creation/degraders/lsst_error_model.py,sha256=WWQxPO3w1S6sALQxl7x7_mUI1f3o1eOGpBk3Yzi-1Q0,1969
|
|
5
5
|
rail/creation/degraders/observing_condition_degrader.py,sha256=jelIfFHzrgmRmRARm5uC36ZohepfMHq5djWT5wGEaZI,19987
|
|
@@ -13,9 +13,10 @@ rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i2
|
|
|
13
13
|
rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits,sha256=79Kg4xRP4WHlOCcS-3SKqf9aP_LZRAq-izIM0DFL6bw,1581120
|
|
14
14
|
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits,sha256=twvyce70G3h1MQnGGFQJG9wZc8UbuNqXc6mjtiuaL1s,1581120
|
|
15
15
|
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits,sha256=RbMMFSVJQxGhZnL4BnISE9VTNljfTZwV6Bax6NxverY,1581120
|
|
16
|
-
rail/
|
|
17
|
-
|
|
18
|
-
pz_rail_astro_tools-1.0.
|
|
19
|
-
pz_rail_astro_tools-1.0.
|
|
20
|
-
pz_rail_astro_tools-1.0.
|
|
21
|
-
pz_rail_astro_tools-1.0.
|
|
16
|
+
rail/examples_data/testdata/rubin_dm_dc2_example2.pq,sha256=_Iihbbcz1A332QAkaMiFacT4QAbBQBMTOwpfrS7AclE,25884
|
|
17
|
+
rail/tools/photometry_tools.py,sha256=Di3gGP_SZUY5diFb84iWsR1aeHZzNlTzg7p7PYKjQIo,19053
|
|
18
|
+
pz_rail_astro_tools-1.0.1.dist-info/LICENSE,sha256=tLMEN21HbzvT-7umOVVvPjaJZbQxCa-2bAeYLwG5Q04,1102
|
|
19
|
+
pz_rail_astro_tools-1.0.1.dist-info/METADATA,sha256=VFGd40v0OQmnknbkhgpGBpNRBWXG13sNv_frQKzyqeE,3947
|
|
20
|
+
pz_rail_astro_tools-1.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
21
|
+
pz_rail_astro_tools-1.0.1.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
|
|
22
|
+
pz_rail_astro_tools-1.0.1.dist-info/RECORD,,
|
rail/astro_tools/_version.py
CHANGED
|
Binary file
|
rail/tools/photometry_tools.py
CHANGED
|
@@ -20,8 +20,6 @@ dustmaps_config = tables_io.lazy_modules.lazyImport('dustmaps.config')
|
|
|
20
20
|
dustmaps_sfd = tables_io.lazy_modules.lazyImport('dustmaps.sfd')
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
23
|
# default column names in DC2
|
|
26
24
|
LSST_BANDS = 'ugrizy'
|
|
27
25
|
DEFAULT_MAG_COLS = [f"mag_{band}_lsst" for band in LSST_BANDS]
|
|
@@ -412,13 +410,13 @@ class LSSTFluxToMagConverter(RailStage):
|
|
|
412
410
|
return self.get_handle('output')
|
|
413
411
|
|
|
414
412
|
|
|
415
|
-
class
|
|
413
|
+
class DustMapBase(RailStage):
|
|
416
414
|
"""Utility stage that does dereddening
|
|
417
415
|
|
|
418
416
|
Note: set copy_all_cols=True to copy all
|
|
419
417
|
columns in data, copy_cols will be ignored
|
|
420
418
|
"""
|
|
421
|
-
name = '
|
|
419
|
+
name = 'DustMapBase'
|
|
422
420
|
|
|
423
421
|
config_options = RailStage.config_options.copy()
|
|
424
422
|
config_options.update(bands='ugrizy')
|
|
@@ -429,8 +427,8 @@ class Dereddener(RailStage):
|
|
|
429
427
|
config_options.update(copy_cols=[])
|
|
430
428
|
config_options.update(copy_all_cols=False)
|
|
431
429
|
|
|
432
|
-
inputs = [('input',
|
|
433
|
-
outputs = [('output',
|
|
430
|
+
inputs = [('input', PqHandle)]
|
|
431
|
+
outputs = [('output', PqHandle)]
|
|
434
432
|
|
|
435
433
|
def fetch_map(self):
|
|
436
434
|
dust_map_dict = dict(sfd=dustmaps_sfd)
|
|
@@ -439,12 +437,15 @@ class Dereddener(RailStage):
|
|
|
439
437
|
except KeyError as msg: # pragma: no cover
|
|
440
438
|
raise KeyError(f"Unknown dustmap {self.config.dustmap_name}, options are {list(dust_map_dict.keys())}") from msg
|
|
441
439
|
|
|
442
|
-
|
|
440
|
+
dustmap_dir = os.path.expandvars(self.config.dustmap_dir)
|
|
441
|
+
dustmap_path = os.path.join(dustmap_dir, self.config.dustmap_name)
|
|
442
|
+
if os.path.exists(dustmap_path): # pragma: no cover
|
|
443
443
|
# already downloaded, return
|
|
444
444
|
return
|
|
445
445
|
|
|
446
446
|
dust_map_config = dustmaps_config.config
|
|
447
|
-
dust_map_config['data_dir'] = self.config.dustmap_dir
|
|
447
|
+
# dust_map_config['data_dir'] = self.config.dustmap_dir
|
|
448
|
+
dust_map_config['data_dir'] = dustmap_dir
|
|
448
449
|
fetch_func = dust_map_submod.fetch
|
|
449
450
|
fetch_func()
|
|
450
451
|
|
|
@@ -455,7 +456,7 @@ class Dereddener(RailStage):
|
|
|
455
456
|
def run(self):
|
|
456
457
|
data = self.get_data('input', allow_missing=True)
|
|
457
458
|
out_data = {}
|
|
458
|
-
coords = SkyCoord(data['ra'], data['
|
|
459
|
+
coords = SkyCoord(data['ra'], data['dec'], unit = 'deg',frame='fk5')
|
|
459
460
|
dust_map_dict = dict(sfd=dustmaps_sfd.SFDQuery)
|
|
460
461
|
try:
|
|
461
462
|
dust_map_class = dust_map_dict[self.config.dustmap_name]
|
|
@@ -469,7 +470,7 @@ class Dereddener(RailStage):
|
|
|
469
470
|
for i, band_ in enumerate(self.config.bands):
|
|
470
471
|
band_mag_name = self.config.mag_name.format(band=band_)
|
|
471
472
|
mag_vals = data[band_mag_name]
|
|
472
|
-
out_data[band_mag_name] = mag_vals
|
|
473
|
+
out_data[band_mag_name] = self._calc_values(mag_vals, ebvvec, self.config.band_a_env[i])
|
|
473
474
|
band_mag_name_list.append(band_mag_name)
|
|
474
475
|
|
|
475
476
|
# check if copy_all_cols set to true:
|
|
@@ -482,7 +483,8 @@ class Dereddener(RailStage):
|
|
|
482
483
|
if col_ not in band_mag_name_list:
|
|
483
484
|
out_data[col_] = data[col_]
|
|
484
485
|
|
|
485
|
-
|
|
486
|
+
out_data_pd = pd.DataFrame(out_data)
|
|
487
|
+
self.add_data('output', out_data_pd)
|
|
486
488
|
|
|
487
489
|
def __call__(self, data):
|
|
488
490
|
"""Return a converted table
|
|
@@ -500,3 +502,23 @@ class Dereddener(RailStage):
|
|
|
500
502
|
self.set_data('input', data)
|
|
501
503
|
self.run()
|
|
502
504
|
return self.get_handle('output')
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
class Dereddener(DustMapBase):
|
|
508
|
+
"""Utility stage that does dereddening
|
|
509
|
+
|
|
510
|
+
"""
|
|
511
|
+
name = 'Dereddener'
|
|
512
|
+
|
|
513
|
+
def _calc_values(self, mag_vals, ebvvec, band_a_env):
|
|
514
|
+
return mag_vals - ebvvec*band_a_env
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
class Reddener(DustMapBase):
|
|
518
|
+
"""Utility stage that does reddening
|
|
519
|
+
|
|
520
|
+
"""
|
|
521
|
+
name = 'Reddener'
|
|
522
|
+
|
|
523
|
+
def _calc_values(self, mag_vals, ebvvec, band_a_env):
|
|
524
|
+
return mag_vals + ebvvec*band_a_env
|
|
File without changes
|
|
File without changes
|
|
File without changes
|