Skip to content

Commit a9b6104

Browse files
committed
ruff
1 parent 8454218 commit a9b6104

File tree

1 file changed

+21
-30
lines changed

1 file changed

+21
-30
lines changed

phrosty/utils.py

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ def get_roman_bands():
124124

125125

126126
def read_truth_txt(path=None, band=None, pointing=None, sca=None):
127-
"""Reads in the txt versions of the OpenUniverse
128-
truth files as convenient astropy tables.
127+
"""Reads in the txt versions of the OpenUniverse truth files as convenient astropy tables.
129128
130129
Parameters
131130
----------
@@ -240,8 +239,7 @@ def _read_parquet( file ):
240239

241240

242241
def get_transient_radec(oid):
243-
"""Retrieve RA, dec of a transient based on its object ID
244-
in the OpenUniverse sims.
242+
"""Retrieve RA, dec of a transient based on its object ID in the OpenUniverse sims.
245243
246244
Parameters
247245
----------
@@ -254,7 +252,7 @@ def get_transient_radec(oid):
254252
RA in degrees of target transient.
255253
dec : float
256254
Dec in degrees of target transient.
257-
255+
258256
"""
259257

260258
oid = int(oid)
@@ -270,8 +268,7 @@ def get_transient_radec(oid):
270268

271269

272270
def get_transient_mjd(oid):
273-
"""Retrieve start and end dates of a transient
274-
in the OpenUniverse sims based on its object ID.
271+
"""Retrieve start and end dates of a transient in the OpenUniverse sims based on its object ID.
275272
276273
Parameters
277274
----------
@@ -284,7 +281,7 @@ def get_transient_mjd(oid):
284281
Simulated start MJD of target transient.
285282
286283
end : float
287-
Simulated end MJD of target transient.
284+
Simulated end MJD of target transient.
288285
289286
"""
290287
oid = int(oid)
@@ -302,8 +299,7 @@ def get_transient_mjd(oid):
302299

303300
def get_transient_zcmb(oid):
304301

305-
"""Retrieve z_CMB of a transient in the OpenUniverse
306-
sims based on its object ID.
302+
"""Retrieve z_CMB of a transient in the OpenUniverse sims based on its object ID.
307303
308304
Parameters
309305
----------
@@ -315,8 +311,8 @@ def get_transient_zcmb(oid):
315311
z : float
316312
z_CMB of target transient.
317313
318-
"""
319-
314+
"""
315+
320316
oid = int(oid)
321317
snana_pq_path = os.path.join( Config.get().value('ou24.sn_truth_dir'), 'snana_*.parquet' )
322318
file_list = glob(snana_pq_path)
@@ -331,8 +327,7 @@ def get_transient_zcmb(oid):
331327

332328
def get_transient_peakmjd(oid):
333329

334-
"""Retrieve MJD of peak brightness for a transient
335-
object in the OpenUniverse sims.
330+
"""Retrieve MJD of peak brightness for a transient object in the OpenUniverse sims.
336331
337332
Parameters
338333
----------
@@ -359,11 +354,9 @@ def get_transient_peakmjd(oid):
359354

360355

361356
def get_transient_info(oid):
362-
"""Retrieve RA, Dec, start MJD, and end MJD for a
363-
specified object in the OpenUnvierse sims.
357+
"""Retrieve RA, Dec, start MJD, and end MJD for a specified object in the OpenUnvierse sims.
364358
365-
This function calls get_transient_radec() and
366-
get_transient_mjd().
359+
This function calls get_transient_radec() and get_transient_mjd().
367360
368361
Parameters
369362
----------
@@ -382,7 +375,7 @@ def get_transient_info(oid):
382375
Simulated start MJD of target transient.
383376
384377
end : float
385-
Simulated end MJD of target transient.
378+
Simulated end MJD of target transient.
386379
387380
"""
388381

@@ -419,8 +412,7 @@ def transient_in_or_out(oid, start, end, band):
419412

420413

421414
def get_mjd_limits(obseq_path=None):
422-
"""Retrive the earliest and latest MJD in the
423-
OpenUniverse TDS simulations.
415+
"""Retrive the earliest and latest MJD in the OpenUniverse TDS simulations.
424416
425417
Parameters
426418
----------
@@ -447,8 +439,7 @@ def get_mjd_limits(obseq_path=None):
447439

448440

449441
def get_radec_limits(obseq_path=None):
450-
"""Retrieve the RA, dec limits of the boresight coordinates
451-
of the simulated TDS OpenUniverse survey in degrees.
442+
"""Retrieve the RA, dec limits of the boresight coordinates of the simulated TDS OpenUniverse survey in degrees.
452443
453444
Parameters
454445
----------
@@ -461,7 +452,7 @@ def get_radec_limits(obseq_path=None):
461452
with [minimum RA, maximum RA] and [minimum Dec, maximum Dec],
462453
respectively.
463454
464-
"""
455+
"""
465456
with fits.open(ou2024_obseq_path(obseq_path)) as obs:
466457
obseq = Table(obs[1].data)
467458

@@ -565,20 +556,21 @@ def get_mjd_info(mjd_start=0, mjd_end=np.inf, return_inverse=False, obseq_path=N
565556
def get_exptime(band=None):
566557

567558
"""Retrieves exposure times from the TDS OpenUniverse sims.
559+
568560
https://arxiv.org/abs/2501.05632
569561
570562
Parameters
571563
----------
572564
band : str, default None
573-
Band for which to retrieve exposure time.
565+
Band for which to retrieve exposure time.
574566
575567
Returns
576568
-------
577569
exptime : dict or float
578570
If a band is specified, a float with the exposure time in seconds is
579-
returned. If no band is specified, a dictionary with the exposure time
580-
for all bands is returned.
581-
"""
571+
returned. If no band is specified, a dictionary with the exposure time
572+
for all bands is returned.
573+
"""
582574

583575
exptime = {'F184': 901.175,
584576
'J129': 302.275,
@@ -595,8 +587,7 @@ def get_exptime(band=None):
595587

596588

597589
def make_object_table(oid):
598-
"""Retrieves a table with all images that contain the RA, Dec
599-
coordinates of a specified transient.
590+
"""Retrieves a table with all images that contain the RA, Dec coordinates of a specified transient.
600591
601592
Parameters
602593
----------

0 commit comments

Comments
 (0)