astro-otter 0.3.5__py3-none-any.whl → 0.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of astro-otter might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astro-otter
3
- Version: 0.3.5
3
+ Version: 0.4.1
4
4
  Author-email: Noah Franz <nfranz@arizona.edu>
5
5
  License: MIT License
6
6
 
@@ -1,18 +1,18 @@
1
- astro_otter-0.3.5.dist-info/licenses/LICENSE,sha256=s9IPE8A3CAMEaZpDhj4eaorpmfLYGB0mIGphq301PUY,1067
1
+ astro_otter-0.4.1.dist-info/licenses/LICENSE,sha256=s9IPE8A3CAMEaZpDhj4eaorpmfLYGB0mIGphq301PUY,1067
2
2
  otter/__init__.py,sha256=pvX-TN7nLVmvKpkDi89Zxe-jMfHNiVMD3zsd_bPEK9Y,535
3
- otter/_version.py,sha256=5LVB9FiBWDmYEmn6fLO_jW-OA3WAt_uN2xs5Dc4KpNY,76
3
+ otter/_version.py,sha256=Af91-Q-wYZrx1oE0zsbFccgT2zWIHBDaWCDo8UsrNHg,76
4
4
  otter/exceptions.py,sha256=3lQF4AXVTfs9VRsVePQoIrXnramsPZbUL5crvf1s9Ng,1702
5
5
  otter/schema.py,sha256=J-iI_kEEd0aHN_Hr49HFEa8W07enh1FSDbU99NwIz3Y,11240
6
6
  otter/util.py,sha256=G5M2PdtPGKpRXCqkItyXMLj6h5F3EboBBDKWMViw04k,23333
7
7
  otter/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  otter/io/data_finder.py,sha256=M6kzqMyy-yhwQfxbOs2E7i_8bCcZFW4Zyf8z-6LCxNQ,38425
9
9
  otter/io/host.py,sha256=xv_SznZuvMoMVsZLqlcmlOyaqKCMZqlTQ_gkN4VBSTw,7139
10
- otter/io/otter.py,sha256=qTKTfGkBdmsWjLF1cxjiX-SvOaKOPK-nd0aK7TtPQO8,61076
11
- otter/io/transient.py,sha256=1yVy-9NEo9ozM4B-sqEcGlJW_1abD0sWSXYG0Ex-3Jc,58020
10
+ otter/io/otter.py,sha256=22Wfe8Z6X3-R9XhZRCPqHp53oITXu-qfVvHX6hTpF9I,61161
11
+ otter/io/transient.py,sha256=uWxLARaHkGgGDqmjKgDNNKDR_Mq6Tj0y9OSPCgBPLvY,58397
12
12
  otter/plotter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  otter/plotter/otter_plotter.py,sha256=yUjGHR0FcbndwC1yLQekJWqX2KBMAJXtjFKbbASG_Cc,2144
14
14
  otter/plotter/plotter.py,sha256=ni4WV63wIjhMHStDmuccltaMHSaFbwwfztYpuMdYAz8,9340
15
- astro_otter-0.3.5.dist-info/METADATA,sha256=CTru7txtl0-m5zmGInfuJ_qd0upiUjF1eGTU6Eo-ZEk,7046
16
- astro_otter-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- astro_otter-0.3.5.dist-info/top_level.txt,sha256=Wth72sCwBRUk3KZGknSKvLQDMFuJk6qiaAavMDOdG5k,6
18
- astro_otter-0.3.5.dist-info/RECORD,,
15
+ astro_otter-0.4.1.dist-info/METADATA,sha256=1O7pvLIGNtfkM8WcnMDaBeMPb92vYNOuCcjJaxYn4PU,7046
16
+ astro_otter-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ astro_otter-0.4.1.dist-info/top_level.txt,sha256=Wth72sCwBRUk3KZGknSKvLQDMFuJk6qiaAavMDOdG5k,6
18
+ astro_otter-0.4.1.dist-info/RECORD,,
otter/_version.py CHANGED
@@ -2,4 +2,4 @@
2
2
  Just define the package version in one place
3
3
  """
4
4
 
5
- __version__ = "0.3.5"
5
+ __version__ = "0.4.1"
otter/io/otter.py CHANGED
@@ -63,15 +63,15 @@ class Otter(Database):
63
63
 
64
64
  def __init__(
65
65
  self,
66
- url: str = "http://127.0.0.1:8529",
66
+ url: str = "https://otter.idies.jhu.edu/api",
67
67
  username: str = os.environ.get("ARANGO_USER_USERNAME", "user-guest"),
68
- password: str = os.environ.get("ARANGO_USER_PASSWORD", ""),
68
+ password: str = os.environ.get("ARANGO_USER_PASSWORD", "test"),
69
69
  gen_summary: bool = False,
70
70
  datadir: str = None,
71
71
  debug: bool = False,
72
72
  **kwargs,
73
73
  ) -> None:
74
- print("Attempting to login with the following credentials:")
74
+ print(f"Attempting to login to {url} with the following credentials:")
75
75
  print(f"username: {username}")
76
76
  print(f"password: {password}")
77
77
 
@@ -85,9 +85,6 @@ class Otter(Database):
85
85
 
86
86
  self.debug = debug
87
87
 
88
- if gen_summary:
89
- self.generate_summary_table(save=True)
90
-
91
88
  # make sure the data directory exists
92
89
  if not os.path.exists(self.DATADIR):
93
90
  try:
@@ -99,6 +96,9 @@ class Otter(Database):
99
96
  )
100
97
  pass
101
98
 
99
+ if gen_summary:
100
+ self.generate_summary_table(save=True)
101
+
102
102
  connection = Connection(username=username, password=password, arangoURL=url)
103
103
  super().__init__(connection, "otter", **kwargs)
104
104
 
@@ -943,7 +943,7 @@ class Otter(Database):
943
943
 
944
944
  # merge the meta and phot data
945
945
  if phot is not None:
946
- data = pd.merge(phot, meta, on="name", how="inner")
946
+ data = pd.merge(phot, meta, on="name", how="outer")
947
947
  else:
948
948
  data = meta
949
949
 
@@ -951,11 +951,11 @@ class Otter(Database):
951
951
  assert (
952
952
  len(data[pd.isna(data.ra)].name.unique()) == 0
953
953
  ), "Missing some RA and Decs, please check the input files!"
954
- if phot is not None:
955
- for name in meta.name:
956
- assert len(data[data.name == name]) == len(
957
- phot[phot.name == name]
958
- ), f"failed on {name}"
954
+ # if phot is not None:
955
+ # for name in meta.name:
956
+ # assert len(data[data.name == name]) == len(
957
+ # phot[phot.name == name]
958
+ # ), f"failed on {name}"
959
959
 
960
960
  # actually do the data conversion to OTTER
961
961
  all_jsons = []
@@ -1084,7 +1084,7 @@ class Otter(Database):
1084
1084
  # skip the photometry code if there is no photometry file
1085
1085
  # if there is a photometry file then we want to convert it below
1086
1086
  phot_sources = []
1087
- if phot is not None:
1087
+ if phot is not None and not np.all(pd.isna(tde["flux"])):
1088
1088
  tde["obs_type"] = [
1089
1089
  freq_to_obstype(vv * u.Unit(uu))
1090
1090
  for vv, uu in zip(
@@ -1531,7 +1531,7 @@ class Otter(Database):
1531
1531
  all_jsons.append(Transient(json))
1532
1532
 
1533
1533
  if db is None:
1534
- db = Otter(datadir=local_outpath)
1534
+ db = Otter(datadir=local_outpath, gen_summary=True)
1535
1535
  else:
1536
1536
  db.DATADIR = local_outpath
1537
1537
 
otter/io/transient.py CHANGED
@@ -432,6 +432,16 @@ class Transient(MutableMapping):
432
432
  if "host" in self:
433
433
  max_hosts = min([max_hosts, len(self["host"])])
434
434
  for h in self["host"][:max_hosts]:
435
+ # only return hosts with their ra and dec stored
436
+ if (
437
+ "host_ra" not in h
438
+ or "host_dec" not in h
439
+ or "host_ra_units" not in h
440
+ or "host_dec_units" not in h
441
+ ):
442
+ continue
443
+
444
+ # now we can construct a host object from this
435
445
  host.append(Host(transient_name=self.default_name, **dict(h)))
436
446
 
437
447
  # then try BLAST