From d0304173c031b9ae002bef0f0161fea765407e5b Mon Sep 17 00:00:00 2001 From: Joanne Bogart Date: Wed, 4 Oct 2023 12:40:26 -0700 Subject: [PATCH 1/2] Correct calculation for star extinction --- skycatalogs/catalog_creator.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/skycatalogs/catalog_creator.py b/skycatalogs/catalog_creator.py index 94fe9576..35685cd9 100644 --- a/skycatalogs/catalog_creator.py +++ b/skycatalogs/catalog_creator.py @@ -34,9 +34,8 @@ __all__ = ['CatalogCreator'] _MW_rv_constant = 3.1 - - _Av_adjustment = 2.742 + def _make_MW_extinction(ra, dec): ''' Given arrays of ra & dec, create a MW Av column corresponding to V-band @@ -56,7 +55,6 @@ def _make_MW_extinction(ra, dec): sfd = SFDQuery() ebv_raw = np.array(sfd.query_equ(ra, dec)) - return _Av_adjustment * ebv_raw def _generate_sed_path(ids, subdir, cmp): @@ -811,7 +809,7 @@ def create_pointsource_pixel(self, pixel, arrow_schema, star_cat=None, cols = ','.join(['format("%s",simobjid) as id', 'ra', 'decl as dec', 'magNorm as magnorm', 'mura', 'mudecl as mudec', 'radialVelocity as radial_velocity', 'parallax', - 'sedFilename as sed_filepath']) + 'sedFilename as sed_filepath', 'ebv']) q = f'select {cols} from stars where hpid={pixel} ' with sqlite3.connect(star_cat) as conn: star_df = pd.read_sql_query(q, conn) @@ -825,8 +823,8 @@ def create_pointsource_pixel(self, pixel, arrow_schema, star_cat=None, star_df['MW_rv'] = np.full((nobj,), _MW_rv_constant, np.float32()) - star_df['MW_av'] = _make_MW_extinction(np.array(star_df['ra']), - np.array(star_df['dec'])) + # NOTE MW_av calculation for stars does not use SFD dust map + star_df['MW_av'] = star_df['ebv'] * _MW_rv_constant star_df['variability_model'] = np.full((nobj,), '') star_df['salt2_params'] = np.full((nobj,), None) out_table = pa.Table.from_pandas(star_df, schema=arrow_schema) From c638f3fa6bc0c4c6a0c8ae263fd2c962172ba8e4 Mon Sep 17 00:00:00 2001 From: Joanne Bogart Date: Wed, 4 Oct 2023 12:59:23 -0700 Subject: [PATCH 2/2] several changes since last version change --- skycatalogs/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skycatalogs/_version.py b/skycatalogs/_version.py index 3bdbde7c..2b7c5e4d 100644 --- a/skycatalogs/_version.py +++ b/skycatalogs/_version.py @@ -1 +1 @@ -__version__ = "1.6.0-rc2" +__version__ = "1.7.0-rc1"