Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 16, 2023
1 parent 52d0373 commit 3267d3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions app/host/cutouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def panstarrs_cutout(position, image_size=None, filter=None):
f"{service}ra={position.ra.degree}&dec={position.dec.degree}"
f"&size={image_size}&format=fits&red={filename}"
)
fits_image = fits.open(fits_url,cache=None)
fits_image = fits.open(fits_url, cache=None)
else:
fits_image = None

Expand Down Expand Up @@ -241,7 +241,7 @@ def galex_cutout(position, image_size=None, filter=None):
.replace("-rr.fits.gz", "-int.fits.gz")
.replace("-cnt.fits.gz", "-int.fits.gz")
.replace("-xd-mcat.fits.gz", f"-{filter[0].lower()}d-int.fits.gz"),
cache=None
cache=None,
)

wcs = WCS(fits_image[0].header)
Expand Down Expand Up @@ -302,7 +302,7 @@ def WISE_cutout(position, image_size=None, filter=None):
exptime = data["t_exptime"][0]

if url is not None:
fits_image = fits.open(url,cache=None)
fits_image = fits.open(url, cache=None)

wcs = WCS(fits_image[0].header)
cutout = Cutout2D(fits_image[0].data, position, image_size, wcs=wcs)
Expand Down Expand Up @@ -349,15 +349,17 @@ def DES_cutout(position, image_size=None, filter=None):
# we need both the depth and the image
time.sleep(1)
try:
fits_image = fits.open(valid_urls[0].replace("-depth-", "-image-"),cache=None)
fits_image = fits.open(
valid_urls[0].replace("-depth-", "-image-"), cache=None
)
except:
### found some bad links...
return None
if np.shape(fits_image[0].data)[0] == 1 or np.shape(fits_image[0].data)[1] == 1:
# no idea what's happening here but this is a mess
return None

depth_image = fits.open(valid_urls[0],cache=None)
depth_image = fits.open(valid_urls[0], cache=None)
wcs_depth = WCS(depth_image[0].header)
xc, yc = wcs_depth.wcs_world2pix(position.ra.deg, position.dec.deg, 0)

Expand Down Expand Up @@ -404,7 +406,7 @@ def TWOMASS_cutout(position, image_size=None, filter=None):
if re.match(f"https://irsa.*{filter.lower()}i.*fits", line.split("]]>")[0]):
fitsurl = line.split("]]")[0]

fits_image = fits.open(fitsurl,cache=None)
fits_image = fits.open(fitsurl, cache=None)
wcs = WCS(fits_image[0].header)

if position.contained_by(wcs):
Expand Down Expand Up @@ -483,7 +485,7 @@ def SDSS_cutout(position, image_size=None, filter=None):
band=filter,
)

fits_image = fits.open(link,cache=None)
fits_image = fits.open(link, cache=None)

wcs = WCS(fits_image[0].header)
cutout = Cutout2D(fits_image[0].data, position, image_size, wcs=wcs)
Expand Down
4 changes: 2 additions & 2 deletions app/host/postprocess_prosp.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ def run_all(
modphots_all.append(modmags) # model photometry
modspecs_all.append(modspec) # model spectrum
_mass = res["chain"][int(_subidx)][mass_idx]
stellarmass.append(np.log10(10**_mass)) # * sm))
stellarmass.append(np.log10(10**_mass)) # * sm))
ssfr.append(
chains["sfr"][i] / 10**_mass #* sm
chains["sfr"][i] / 10**_mass # * sm
) # sfr chains are already sub-sampled

stellarmass = np.array(stellarmass)
Expand Down

0 comments on commit 3267d3c

Please sign in to comment.