astro-otter 0.2.0__py3-none-any.whl → 0.3.0__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.2.0
3
+ Version: 0.3.0
4
4
  Author-email: Noah Franz <nfranz@arizona.edu>
5
5
  License: MIT License
6
6
 
@@ -36,7 +36,7 @@ Classifier: Programming Language :: Python :: 3
36
36
  Classifier: Programming Language :: Python :: 3.10
37
37
  Classifier: Programming Language :: Python :: 3.11
38
38
  Classifier: Development Status :: 2 - Pre-Alpha
39
- Requires-Python: <3.12,>=3.10
39
+ Requires-Python: >=3.9
40
40
  Description-Content-Type: text/markdown
41
41
  License-File: LICENSE
42
42
  Requires-Dist: numpy<2,>=1.20
@@ -1,18 +1,18 @@
1
- astro_otter-0.2.0.dist-info/licenses/LICENSE,sha256=s9IPE8A3CAMEaZpDhj4eaorpmfLYGB0mIGphq301PUY,1067
1
+ astro_otter-0.3.0.dist-info/licenses/LICENSE,sha256=s9IPE8A3CAMEaZpDhj4eaorpmfLYGB0mIGphq301PUY,1067
2
2
  otter/__init__.py,sha256=pvX-TN7nLVmvKpkDi89Zxe-jMfHNiVMD3zsd_bPEK9Y,535
3
- otter/_version.py,sha256=Hwps5WC9_lYJO5SVIdnlMYP1MbeluDR9sJvlFgSiQjg,76
3
+ otter/_version.py,sha256=XDCAY_avI84JEWPKHKBF9kXkCGBGi2CjNGEItozNsk4,76
4
4
  otter/exceptions.py,sha256=3lQF4AXVTfs9VRsVePQoIrXnramsPZbUL5crvf1s9Ng,1702
5
5
  otter/schema.py,sha256=eOxlrtp9TTbiENy38ueE2HcYlI-M56g0Ohg7zQeTxjk,10631
6
6
  otter/util.py,sha256=xKsNkkxGajML1rZZnR9d5rJV1_z1KeAlIdAs8t0814M,22440
7
7
  otter/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  otter/io/data_finder.py,sha256=v3jZCOhvysHUQG1FOwHdeJ-psTT-MsdO_GZalBpMBGc,38218
9
9
  otter/io/host.py,sha256=xv_SznZuvMoMVsZLqlcmlOyaqKCMZqlTQ_gkN4VBSTw,7139
10
- otter/io/otter.py,sha256=75YHnYN6NznFi8O9YzMAM8AJQNXqByUSDkmzEOaFro4,46766
11
- otter/io/transient.py,sha256=0Z2G9uvv0xl4sJSj43cwFfOj6qkhlmRfBIh4XCYUHVU,41416
10
+ otter/io/otter.py,sha256=HiYQ5hgAvPYSHmU6taF6NumpElYzFgjjA0oIgLEo9_4,47471
11
+ otter/io/transient.py,sha256=b_gOQxjk8z3VylZ9ZrAv-Dhqp_d2iXPICL65Hq3kYGg,41846
12
12
  otter/plotter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  otter/plotter/otter_plotter.py,sha256=OQhuLgnMSzgtAjJF8SYBuQOyYcu7Pr0uia5P0G_7z5Q,2144
14
14
  otter/plotter/plotter.py,sha256=z09NwQVJS2tuwH3sv95DZv8xogjvf-7Gvj6iWCEx-gQ,9635
15
- astro_otter-0.2.0.dist-info/METADATA,sha256=uyREDToWRYbZ0hYeQAz3PZKLqdz4pmLQYQVhZWAN36w,7134
16
- astro_otter-0.2.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
17
- astro_otter-0.2.0.dist-info/top_level.txt,sha256=Wth72sCwBRUk3KZGknSKvLQDMFuJk6qiaAavMDOdG5k,6
18
- astro_otter-0.2.0.dist-info/RECORD,,
15
+ astro_otter-0.3.0.dist-info/METADATA,sha256=7qokfMceKHN1Ai0FNKqY95LYiil9jf3BzAX_7_A5KVI,7127
16
+ astro_otter-0.3.0.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
17
+ astro_otter-0.3.0.dist-info/top_level.txt,sha256=Wth72sCwBRUk3KZGknSKvLQDMFuJk6qiaAavMDOdG5k,6
18
+ astro_otter-0.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
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.2.0"
5
+ __version__ = "0.3.0"
otter/io/otter.py CHANGED
@@ -280,7 +280,7 @@ class Otter(Database):
280
280
 
281
281
  WARNING! This does not do any conversions for you!
282
282
  This is how it differs from the `get_meta` method. Users should prefer to use
283
- `get_meta`, `getPhot`, and `getSpec` independently because it is a better
283
+ `get_meta`, and `get_phot` independently because it is a better
284
284
  workflow and can return the data in an astropy table with everything in the
285
285
  same units.
286
286
 
@@ -816,8 +816,32 @@ class Otter(Database):
816
816
  # read in the metadata and photometry file
817
817
  meta = pd.read_csv(metafile)
818
818
  phot = None
819
+
820
+ required_phot_cols = [
821
+ "name",
822
+ "date",
823
+ "date_format",
824
+ "filter",
825
+ "filter_eff",
826
+ "filter_eff_units",
827
+ "flux",
828
+ "flux_err",
829
+ "flux_unit",
830
+ ]
831
+
819
832
  if photfile is not None:
820
- phot = pd.read_csv(photfile)
833
+ phot_unclean = pd.read_csv(photfile)
834
+
835
+ phot = phot_unclean.dropna(subset=required_phot_cols)
836
+ if len(phot) != len(phot_unclean):
837
+ warn("""
838
+ Filtered out rows with nan in the photometry file! Make sure you
839
+ expect this behaviour!
840
+ """)
841
+
842
+ if "bibcode" not in phot:
843
+ phot["bibcode"] = "private"
844
+ warn("Setting the bibcode column to the special keyword 'private'!")
821
845
 
822
846
  # we need to generate columns of wave_eff and freq_eff
823
847
  wave_eff = []
otter/io/transient.py CHANGED
@@ -662,6 +662,12 @@ class Transient(MutableMapping):
662
662
  try:
663
663
  if isvegamag:
664
664
  astropy_units = VEGAMAG
665
+ elif unit == "AB":
666
+ # In astropy "AB" is a magnitude SYSTEM not unit and while
667
+ # u.Unit("AB") will succeed without error, it will not produce
668
+ # the expected result!
669
+ # We can assume here that this unit really means astropy's "mag(AB)"
670
+ astropy_units = u.Unit("mag(AB)")
665
671
  else:
666
672
  astropy_units = u.Unit(unit)
667
673
 
@@ -806,20 +812,19 @@ class Transient(MutableMapping):
806
812
  # magnitude upperlimits are independent of the actual measurement!)
807
813
  # sigma_m > (1/3) * (ln(10)/2.5)
808
814
  def is_upperlimit(row):
809
- if pd.isna(row.upperlimit):
815
+ if "upperlimit" in row and pd.isna(row.upperlimit):
810
816
  return row.converted_flux_err > np.log(10) / (3 * 2.5)
811
817
  else:
812
818
  return row.upperlimit
813
819
  else:
814
820
 
815
821
  def is_upperlimit(row):
816
- if pd.isna(row.upperlimit):
822
+ if "upperlimit" in row and pd.isna(row.upperlimit):
817
823
  return row.converted_flux < 3 * row.converted_flux_err
818
824
  else:
819
825
  return row.upperlimit
820
826
 
821
827
  outdata["upperlimit"] = outdata.apply(is_upperlimit, axis=1)
822
-
823
828
  return outdata
824
829
 
825
830
  def _merge_names(t1, t2, out): # noqa: N805