Skip to content

Commit

Permalink
Support WISE AllSky release (#132)
Browse files Browse the repository at this point in the history
* add allsky_4band_p3as_psd table

* add test of wise allsky interface

* bump version
  • Loading branch information
JannisNe authored Nov 6, 2023
1 parent c0b437b commit 313250a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'Jannis Necker'

# The full version, including alpha/beta/rc tags
release = 'v0.4.8'
release = 'v0.4.9'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "timewise"
version = "0.4.8"
version = "0.4.9"
description = "A small package to download infrared data from the WISE satellite"
authors = ["Jannis Necker <[email protected]>"]
license = "MIT"
Expand Down
18 changes: 18 additions & 0 deletions tests/test_1_test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ def test_a_wise_data(self):

wise_data.plot_diagnostic_binning(service="gator", ind=int(plot_id))

def test_b_test_match_to_wise_allsky(self):
logger.info('\n\n Testing WISE AllSky interface \n')
wise_data = WISEDataTestVersion(
base_name=WISEDataTestVersion.base_name + '_match_to_allsky'
)
in_filename = os.path.join(wise_data.cache_dir, "test_allsky_match_in.xml")
out_filename = os.path.join(wise_data.cache_dir, "test_allsky_match_out.tbl")
mask = [True] * len(wise_data.parent_sample.df)
res = wise_data._match_to_wise(
table_name=wise_data.get_db_name("WISE All-Sky Source Catalog"),
in_filename=in_filename,
out_filename=out_filename,
mask=mask,
one_to_one=True,
)
logger.info(f"matched {len(res)} objects")
self.assertEqual(len(res), len(wise_data.parent_sample.df))

def test_b_test_photometry_download_by_allwise_id(self):
logger.info('\n\n Testing WISE Data \n')
wise_data = WISEDataTestVersion(
Expand Down
2 changes: 1 addition & 1 deletion timewise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from timewise.wise_bigdata_desy_cluster import WISEDataDESYCluster
from timewise.parent_sample_base import ParentSampleBase

__version__ = "0.4.8"
__version__ = "0.4.9"
7 changes: 6 additions & 1 deletion timewise/wise_data_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class WISEDataBase(abc.ABC):
('AllWISE Source Catalog', 'allwise_p3as_psd'),
('WISE 3-Band Cryo Single Exposure (L1b) Source Table', 'allsky_3band_p1bs_psd'),
('NEOWISE-R Single Exposure (L1b) Source Table', 'neowiser_p1bs_psd'),

('WISE All-Sky Source Catalog', 'allsky_4band_p3as_psd')
], columns=['nice_table_name', 'table_name'])

bands = ['W1', 'W2']
Expand Down Expand Up @@ -453,6 +453,11 @@ def _run_gator_match(self, in_file, out_file, table_name,
if _db_name == "allwise_p3as_mep":
_sigpos = _source_id = _des = ""
_id_key = "cntr_mf,cntr"
elif _db_name == "allsky_4band_p3as_psd":
_sigpos = 'sigra,sigdec,'
_source_id = "source_id,"
_des = 'designation,'
_id_key = 'cntr'
else:
_sigpos = 'sigra,sigdec,'
_source_id = "source_id,"
Expand Down

0 comments on commit 313250a

Please sign in to comment.