Skip to content

Commit

Permalink
comment out local catalog for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
virajkaram committed Jul 3, 2023
1 parent d048072 commit 335f795
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions mirar/pipelines/winter/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
from mirar.processors.sqldatabase.base_model import BaseDB
from mirar.references.local import RefFromPath
from mirar.references.ukirt import UKIRTRef
# from mirar.catalog.base_catalog import CatalogFromFile

logger = logging.getLogger(__name__)
winter_dir = os.path.dirname(__file__)
astromatic_config_dir = os.path.join(winter_dir, "config/")
swarp_config_path = os.path.join(astromatic_config_dir, "config.swarp")
winter_mask_path = os.path.join(winter_dir, "winter_mask.fits")
scamp_config_path = os.path.join(winter_dir, "scamp.conf")
scamp_config_path = os.path.join(winter_dir, "config/files/scamp.conf")


def winter_reference_generator(image: Image, db_table: Type[BaseDB] = RefStacks):
Expand Down Expand Up @@ -98,9 +99,16 @@ def winter_photometric_catalog_generator(image: Image) -> Gaia2Mass:
:return: catalogue
"""
filter_name = image["FILTER"]
search_radius_arcmin = (
np.max([image["NAXIS1"], image["NAXIS2"]]) * np.abs(image["CD1_1"]) * 60
) / 2.0
search_radius_arcmin = (np.max([image["NAXIS1"], image["NAXIS2"]]) * np.abs(
image["CD1_1"]) * 60
) / 2.0

# #TODO Remove this make more generic if needed
# catalog_path = '/Users/viraj/winter_data/winter/20230629/phot/' \
# 'WINTERcamera_20230630-060524-235_mef_4.tmass.cat'
# if os.path.exists(catalog_path):
# return CatalogFromFile(catalog_path=catalog_path)

return Gaia2Mass(
min_mag=10,
max_mag=20,
Expand All @@ -122,12 +130,12 @@ def winter_ref_photometric_img_catalog_purifier(catalog: Table, image: Image) ->
y_upper_limit = image.get_data().shape[0] - edge_width_pixels

clean_mask = (
(catalog["FLAGS"] == 0)
& (catalog["FWHM_WORLD"] < fwhm_threshold_arcsec / 3600.0)
& (catalog["X_IMAGE"] > x_lower_limit)
& (catalog["X_IMAGE"] < x_upper_limit)
& (catalog["Y_IMAGE"] > y_lower_limit)
& (catalog["Y_IMAGE"] < y_upper_limit)
(catalog["FLAGS"] == 0)
& (catalog["FWHM_WORLD"] < fwhm_threshold_arcsec / 3600.0)
& (catalog["X_IMAGE"] > x_lower_limit)
& (catalog["X_IMAGE"] < x_upper_limit)
& (catalog["Y_IMAGE"] > y_lower_limit)
& (catalog["Y_IMAGE"] < y_upper_limit)
)

return catalog[clean_mask]
Expand Down

0 comments on commit 335f795

Please sign in to comment.