Skip to content

Commit

Permalink
Tag1.3.1 (#459)
Browse files Browse the repository at this point in the history
* edits for tag1.3.1

* edit mwm_more_ob.py

* postv1: mwm_wd.py: mwm_wd_pwd_boss_single, mwm_wd_gaia_boss_single

* postv1: mwm_rv.py

* edit mwm_snc_further_ext.py

* edit mwm_snc_further_ext.py

* edit mwm_snc_further_ext.py

* edit mwm_halo_gaia_dr3.py

* edit mwm_more_ob.py

* edits for tag1.3.1

* edits for tag1.3.1
  • Loading branch information
astronomygupta authored Jul 12, 2024
1 parent ac77aae commit 7246c28
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 80 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Changelog

## 1.3.1 - July 12, 2024

### ✨Improved

* Add cartons to target_selection plan 1.2.2


## 1.3.0 - July 10, 2024

### ✨ Improved

* Add cartons to target_selection plan 1.2.1

* [#455](https://github.com/sdss/target_selection/pull/455) Significant rewrite of the `FileCarton` code to deal with instances of duplicate rows for a single input identifier.

### ⚙️ Engineering
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 = "sdss-target-selection"
version = "1.3.1.a0"
version = "1.3.1"
description = "Code to perform target selection for BHM/MWM using catalogdb"
authors = ["José Sánchez-Gallego <[email protected]>"]
license = "BSD 3-Clause"
Expand Down
56 changes: 0 additions & 56 deletions python/target_selection/cartons/mwm_halo_gaia_dr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ class MWM_halo_distant_rrl_boss_triple_Carton(MWM_halo_distant_rrl_boss_single_C
priority = 3051
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_distant_rrl_boss_Carton(BaseCarton):
"""5.1.34. mwm_halo_distant_rrl_boss
Expand Down Expand Up @@ -395,10 +391,6 @@ class MWM_halo_vmp_xp_boss_triple_Carton(MWM_halo_vmp_xp_boss_single_Carton):
priority = 1851
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_mp_xp_boss_single_Carton(MWM_halo_mp_xp_Base_Carton):
"""
Expand Down Expand Up @@ -448,10 +440,6 @@ class MWM_halo_mp_xp_boss_triple_Carton(MWM_halo_mp_xp_boss_single_Carton):
priority = 2971
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_nmp_xp_boss_single_Carton(MWM_halo_mp_xp_Base_Carton):
"""
Expand Down Expand Up @@ -501,10 +489,6 @@ class MWM_halo_nmp_xp_boss_triple_Carton(MWM_halo_nmp_xp_boss_single_Carton):
priority = 6501
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_vmp_xp_apogee_single_Carton(MWM_halo_mp_xp_Base_Carton):
"""
Expand Down Expand Up @@ -550,10 +534,6 @@ class MWM_halo_vmp_xp_apogee_triple_Carton(MWM_halo_vmp_xp_apogee_single_Carton)
priority = 1851
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_mp_xp_apogee_single_Carton(MWM_halo_mp_xp_Base_Carton):
"""
Expand Down Expand Up @@ -603,10 +583,6 @@ class MWM_halo_mp_xp_apogee_triple_Carton(MWM_halo_mp_xp_apogee_single_Carton):
priority = 2971
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_nmp_xp_apogee_single_Carton(MWM_halo_mp_xp_Base_Carton):
"""
Expand Down Expand Up @@ -656,10 +632,6 @@ class MWM_halo_nmp_xp_apogee_triple_Carton(MWM_halo_nmp_xp_apogee_single_Carton)
priority = 6501
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query


class MWM_halo_mp_xp_dark_Base_Carton(BaseCarton):
"""5.1.36. mwm_halo_mp_xp_dark
Expand Down Expand Up @@ -1257,13 +1229,6 @@ class MWM_halo_local_high_apogee_triple_Carton(MWM_halo_local_high_apogee_single
priority = 2981
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query

def post_process(self, model):
super().post_process(model)


class MWM_halo_local_high_boss_single_Carton(MWM_halo_local_Base_Carton):
"""
Expand Down Expand Up @@ -1359,13 +1324,6 @@ class MWM_halo_local_high_boss_triple_Carton(MWM_halo_local_high_boss_single_Car
priority = 2981
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query

def post_process(self, model):
super().post_process(model)


class MWM_halo_local_low_apogee_single_Carton(MWM_halo_local_Base_Carton):
"""
Expand Down Expand Up @@ -1457,13 +1415,6 @@ class MWM_halo_local_low_apogee_triple_Carton(MWM_halo_local_low_apogee_single_C
priority = 6501
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query

def post_process(self, model):
super().post_process(model)


class MWM_halo_local_low_boss_single_Carton(MWM_halo_local_Base_Carton):
"""
Expand Down Expand Up @@ -1555,13 +1506,6 @@ class MWM_halo_local_low_boss_triple_Carton(MWM_halo_local_low_boss_single_Carto
priority = 6501
can_offset = True

def build_query(self, version_id, query_region=None):
query = super().build_query(version_id, query_region)
return query

def post_process(self, model):
super().post_process(model)


class MWM_halo_local_high_apogee_Carton(MWM_halo_local_Base_Carton):
"""
Expand Down
39 changes: 18 additions & 21 deletions python/target_selection/cartons/mwm_more_ob.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ class Openfibertargets_mwm_more_ob_boss_Carton(BaseCarton):
INNER JOIN gaiadr1.tmass_original_valid AS tm
ON tm.tmass_oid = xmatch.tmass_oid
WHERE parallax < power (10, ((10. - tm.ks_m + 0.) / 5.))
WHERE parallax < power (10, ((10. - tm.k_m + 0.) / 5.))
AND parallax > power(10, ((10. - tm.ks_m - 0.61) / 5.))
AND parallax > power(10, ((10. - tm.k_m - 0.61) / 5.))
AND g.phot_g_mean_mag < 16.
AND tm.j_m - tm.ks_m - 0.25 * (g.phot_g_mean_mag - tm.ks_m) < 0.10
AND tm.j_m - tm.ks_m - 0.25 * (g.phot_g_mean_mag - tm.ks_m) > -0.30
AND tm.j_m - tm.h_m < 0.15 * (g.phot_g_mean_mag - tm.ks_m) + 0.05
AND tm.j_m - tm.h_m > 0.15 * (g.phot_g_mean_mag - tm.ks_m) - 0.15
AND g.phot_g_mean_mag > 2 * (g.phot_g_mean_mag - tm.ks_m) + 3.0
AND tm.j_m - tm.k_m - 0.25 * (g.phot_g_mean_mag - tm.k_m) < 0.10
AND tm.j_m - tm.k_m - 0.25 * (g.phot_g_mean_mag - tm.k_m) > -0.30
AND tm.j_m - tm.h_m < 0.15 * (g.phot_g_mean_mag - tm.k_m) + 0.05
AND tm.j_m - tm.h_m > 0.15 * (g.phot_g_mean_mag - tm.k_m) - 0.15
AND g.phot_g_mean_mag > 2 * (g.phot_g_mean_mag - tm.k_m) + 3.0
Return columns: Gaia DR3: source_id, ra, dec, parallax, pmra, pmdec,
phot_g_mean_mag, phot_bp_mean_mag, phot_rp_mean_mag; 2MASS: j_m, h_m, ks_m
phot_g_mean_mag, phot_bp_mean_mag, phot_rp_mean_mag; 2MASS: j_m, h_m, k_m
Metadata: can_offset=True
Priority: 6085
Expand Down Expand Up @@ -92,7 +92,6 @@ def build_query(self, version_id, query_region=None):
TwoMassPSC.j_m,
TwoMassPSC.h_m,
TwoMassPSC.k_m,
TwoMassPSC.ks_m,
)
.join(Gaia_DR3, on=(CatalogToGaia_DR3.target_id == Gaia_DR3.source_id))
.switch(CatalogToGaia_DR3)
Expand All @@ -104,34 +103,32 @@ def build_query(self, version_id, query_region=None):
.where(
CatalogToGaia_DR3.version_id == version_id,
CatalogToGaia_DR3.best >> True,
CatalogToTwoMassPSC.version_id == version_id,
CatalogToTwoMassPSC.best >> True,
(Gaia_DR3.parallax < peewee.fn.power(10, ((10.0 - TwoMassPSC.ks_m + 0.0) / 5.0))),
(Gaia_DR3.parallax > peewee.fn.power(10, ((10.0 - TwoMassPSC.ks_m - 0.61) / 5.0))),
(Gaia_DR3.parallax < peewee.fn.power(10, ((10.0 - TwoMassPSC.k_m + 0.0) / 5.0))),
(Gaia_DR3.parallax > peewee.fn.power(10, ((10.0 - TwoMassPSC.k_m - 0.61) / 5.0))),
Gaia_DR3.phot_g_mean_mag < 16,
(
TwoMassPSC.j_m
- TwoMassPSC.ks_m
- 0.25 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.ks_m)
- TwoMassPSC.k_m
- 0.25 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.k_m)
< 0.10
),
(
TwoMassPSC.j_m
- TwoMassPSC.ks_m
- 0.25 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.ks_m)
- TwoMassPSC.k_m
- 0.25 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.k_m)
> -0.30
),
(
TwoMassPSC.j_m - TwoMassPSC.h_m
< 0.15 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.ks_m) + 0.05
< 0.15 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.k_m) + 0.05
),
(
TwoMassPSC.j_m - TwoMassPSC.h_m
> 0.15 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.ks_m) - 0.15
),
(
Gaia_DR3.phot_g_mean_mag
> 2 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.ks_m) + 3.0
> 0.15 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.k_m) - 0.15
),
(Gaia_DR3.phot_g_mean_mag > 2 * (Gaia_DR3.phot_g_mean_mag - TwoMassPSC.k_m) + 3.0),
)
)

Expand Down
64 changes: 64 additions & 0 deletions python/target_selection/cartons/mwm_rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,3 +687,67 @@ def build_query(self, version_id, query_region=None):
*mwm_rv_short_condition,
)
return query


class MWM_bin_rv_short_rgb_apogee_08epoch_Carton(MWM_bin_rv_short_rgb_apogee_Carton):
"""mwm_bin_rv_short_rgb_apogee_08epoch -
same as mwm_bin_rv_short_rgb_apogee but
with cadence=bright_8x1 and adding “2” to each priority
"""

name = "mwm_bin_rv_short_rgb_apogee_08epoch"
category = "science"
instrument = "APOGEE"
cadence = "bright_8x1"
program = "mwm_bin"
mapper = "MWM"
priority = 2537
can_offset = False


class MWM_bin_rv_short_rgb_apogee_12epoch_Carton(MWM_bin_rv_short_rgb_apogee_Carton):
"""mwm_bin_rv_short_rgb_apogee_12epoch -
same as mwm_bin_rv_short_rgb_apogee but
with cadence=bright_12x1 and adding “1” to each priority
"""

name = "mwm_bin_rv_short_rgb_apogee_12epoch"
category = "science"
instrument = "APOGEE"
cadence = "bright_12x1"
program = "mwm_bin"
mapper = "MWM"
priority = 2536
can_offset = False


class MWM_bin_rv_short_subgiant_apogee_08epoch_Carton(MWM_bin_rv_short_subgiant_apogee_Carton):
"""mwm_bin_rv_short_subgiant_apogee_08epoch -
same as mwm_bin_rv_short_subgiant_apogee but
with cadence=bright_8x1 and adding “2” to each priority
"""

name = "mwm_bin_rv_short_subgiant_apogee_8epoch"
category = "science"
instrument = "APOGEE"
cadence = "bright_8x1"
program = "mwm_bin"
mapper = "MWM"
priority = 2527
can_offset = False


class MWM_bin_rv_short_subgiant_apogee_12epoch_Carton(MWM_bin_rv_short_subgiant_apogee_Carton):
"""mwm_bin_rv_short_subgiant_apogee_12epoch -
same as mwm_bin_rv_short_subgiant_apogee but
with cadence=bright_12x1 and adding “1” to each priority
"""

name = "mwm_bin_rv_short_subgiant_apogee_12epoch"
category = "science"
instrument = "APOGEE"
cadence = "bright_12x1"
program = "mwm_bin"
mapper = "MWM"
priority = 2526
can_offset = False
5 changes: 3 additions & 2 deletions python/target_selection/cartons/mwm_snc_further_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def build_query(self, version_id, query_region=None):

query = (
Gaia_DR3.select(
CatalogToGaia_DR3.catalogid,
Gaia_DR3.source_id,
Gaia_DR3.l,
Gaia_DR3.b,
Expand Down Expand Up @@ -216,7 +217,7 @@ def post_process(self, model):

cursor = self.database.execute_sql(
"select catalogid, gaia_dr3_phot_g_mean_mag from "
+ " sandbox.openfibertargets_mwm_snc_further_ext_boss ;"
+ " sandbox.temp_openfibertargets_mwm_snc_further_ext_boss ;"
)

output = cursor.fetchall()
Expand All @@ -232,7 +233,7 @@ def post_process(self, model):

if current_cadence is not None:
self.database.execute_sql(
" update sandbox.openfibertargets_mwm_snc_further_ext_boss "
" update sandbox.temp_openfibertargets_mwm_snc_further_ext_boss "
+ " set cadence = '"
+ current_cadence
+ "'"
Expand Down
32 changes: 32 additions & 0 deletions python/target_selection/cartons/mwm_wd.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,35 @@ def build_query(self, version_id, query_region=None):
)

return query


class MWM_WD_PWD_boss_single_Carton(MWM_WD_PWD_boss_Carton):
"""mwm_wd_pwd_boss_single -
same as mwm_wd_pwd_boss but
with cadence=dark_1x3 and adding "2" to each priority.
"""

name = "mwm_wd_pwd_boss_single"
mapper = "MWM"
category = "science"
program = "mwm_wd"
instrument = "BOSS"
cadence = "dark_1x3"
priority = 1402
can_offset = True


class MWM_WD_Gaia_boss_single_Carton(MWM_WD_Gaia_boss_Carton):
"""mwm_wd_gaia_boss_single -
same as mwm_wd_gaia_boss but
with cadence=dark_1x3 and adding "2" to each priority.
"""

name = "mwm_wd_gaia_boss_single"
mapper = "MWM"
category = "science"
program = "mwm_wd"
instrument = "BOSS"
cadence = "dark_1x3"
priority = 1403
can_offset = True
19 changes: 19 additions & 0 deletions python/target_selection/config/target_selection.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
'1.2.2':
xmatch_plan: 1.0.0
cartons:
- openfibertargets_mwm_hypervelocity_stars_boss
- openfibertargets_mwm_snc_further_ext_apogee_bright
- openfibertargets_mwm_snc_further_ext_apogee_dark
- openfibertargets_mwm_snc_further_ext_boss
open_fiber_path: /uufs/chpc.utah.edu/common/home/sdss50/sdsswork/target/open_fiber/postv1/draft2/
schema: sandbox
magnitudes:
h: [catalog_to_twomass_psc, twomass_psc, twomass_psc.h_m]
j: [catalog_to_twomass_psc, twomass_psc, twomass_psc.j_m]
k: [catalog_to_twomass_psc, twomass_psc, twomass_psc.k_m]
bp: [catalog_to_gaia_dr3_source, gaia_dr3_source, gaia_dr3_source.phot_bp_mean_mag]
rp: [catalog_to_gaia_dr3_source, gaia_dr3_source, gaia_dr3_source.phot_rp_mean_mag]
gaia_g: [catalog_to_gaia_dr3_source, gaia_dr3_source, gaia_dr3_source.phot_g_mean_mag]
database_options:
work_mem: '5GB'

'1.2.1':
xmatch_plan: 1.0.0
cartons:
Expand Down

0 comments on commit 7246c28

Please sign in to comment.