Skip to content

Commit

Permalink
Ensure logging is done and log call to database service. (#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlpstsci authored Sep 27, 2023
1 parent a4d75d5 commit be1d2b4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drizzlepac/haputils/astrometric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def create_astrometric_catalog(inputs, catalog="GAIAedr3", output="ref_cat.ecsv"
gaia_only=False, table_format="ascii.ecsv",
existing_wcs=None, num_sources=None,
use_footprint=False, full_catalog=False,
user_epoch='match', log_level=logutil.logging.NOTSET):
user_epoch='match', log_level=logutil.logging.INFO):
"""Create an astrometric catalog that covers the inputs' field-of-view.
This function will return a table containing sources derived from the
Expand Down Expand Up @@ -452,7 +452,7 @@ def get_catalog(ra, dec, sr=0.1, epoch=None, catalog='GSC241'):
spec = base_spec + epoch_str.format(epoch) if epoch else base_spec

serviceUrl = '{}/{}?{}'.format(SERVICELOCATION, serviceType, spec)
log.debug("Getting catalog using: \n {}".format(serviceUrl))
log.info(f"Getting catalog using: \n {serviceUrl}")
rawcat = requests.get(serviceUrl, headers=headers)
r_contents = rawcat.content.decode() # convert from bytes to a String
rstr = r_contents.split('\r\n')
Expand All @@ -461,7 +461,7 @@ def get_catalog(ra, dec, sr=0.1, epoch=None, catalog='GSC241'):
if rstr[0].startswith('Error'):
# Try again without EPOCH
serviceUrl = '{}/{}?{}'.format(SERVICELOCATION, serviceType, base_spec)
log.debug("Getting catalog using: \n {}".format(serviceUrl))
log.warning(f"Problem accessing catalog service - getting catalog using: \n {serviceUrl}")
rawcat = requests.get(serviceUrl, headers=headers)
r_contents = rawcat.content.decode() # convert from bytes to a String
rstr = r_contents.split('\r\n')
Expand Down Expand Up @@ -523,7 +523,7 @@ def get_catalog_from_footprint(footprint, epoch=None, catalog='GSC241'):
spec = base_spec + epoch_str.format(epoch) if epoch else base_spec

serviceUrl = '{}/{}?{}'.format(SERVICELOCATION, serviceType, spec)
log.debug("Getting catalog using: \n {}".format(serviceUrl))
log.info(f"Getting catalog from footprint using: \n {serviceUrl}")

rawcat = requests.get(serviceUrl, headers=headers)
r_contents = rawcat.content.decode() # convert from bytes to a String
Expand All @@ -533,7 +533,7 @@ def get_catalog_from_footprint(footprint, epoch=None, catalog='GSC241'):
if rstr[0].startswith('Error'):
# Try again without EPOCH
serviceUrl = '{}/{}?{}'.format(SERVICELOCATION, serviceType, base_spec)
log.debug("Getting catalog using: \n {}".format(serviceUrl))
log.warning(f"Problem accessing catalog service - getting catalog from footprint using: \n {serviceUrl}")
rawcat = requests.get(serviceUrl, headers=headers)
r_contents = rawcat.content.decode() # convert from bytes to a String
rstr = r_contents.split('\r\n')
Expand Down Expand Up @@ -720,7 +720,7 @@ def compute_2d_background(imgarr, box_size, win_size,

def build_auto_kernel(imgarr, whtarr, fwhm=3.0, threshold=None, source_box=7,
good_fwhm=[1.0, 4.0], num_fwhm=30,
isolation_size=11, saturation_limit=70000., log_level=logutil.logging.NOTSET):
isolation_size=11, saturation_limit=70000., log_level=logutil.logging.INFO):
"""Build kernel for use in source detection based on image PSF
This algorithm looks for an isolated point-source that is non-saturated to use as a template
for the source detection kernel. Failing to find any suitable sources, it will return a
Expand Down Expand Up @@ -899,7 +899,7 @@ def find_fwhm(psf, default_fwhm):

def extract_point_sources(img, dqmask=None, fwhm=3.0, kernel=None,
nbright=1000,
threshold=200.0, sigma=3.0, source_box=7, log_level=logutil.logging.NOTSET):
threshold=200.0, sigma=3.0, source_box=7, log_level=logutil.logging.INFO):
"""Use photutils to replicate the IRAF point-source catalogs"""
# Initialize logging for this user-callable function
log.setLevel(log_level)
Expand Down Expand Up @@ -962,7 +962,7 @@ def extract_sources(img, dqmask=None, fwhm=3.0, kernel=None, photmode=None,
dao_nsigma=3.0, source_box=7,
classify=True, centering_mode="starfind", nlargest=None,
outroot=None, plot=False, vmax=None, deblend=False,
log_level=logutil.logging.NOTSET):
log_level=logutil.logging.INFO):
"""Use photutils to find sources in image based on segmentation.
Parameters
Expand Down

0 comments on commit be1d2b4

Please sign in to comment.