bmorris3 / arcesetc Goto Github PK
View Code? Open in Web Editor NEWExposure time calculator for the ARC Echelle Spectrograph (ARCES) on the Apache Point Observatory 3.5 m Telescope
Home Page: https://arcesetc.readthedocs.io
License: MIT License
Exposure time calculator for the ARC Echelle Spectrograph (ARCES) on the Apache Point Observatory 3.5 m Telescope
Home Page: https://arcesetc.readthedocs.io
License: MIT License
In the Getting Started guide there is a note on the first example that G4V
-> G5V
because there is no exact match but in the example notebook it points out that it will try to guess the type if something is close and give a ValueError
warning.
I can see in closest_sptype
that there is some special handling of xxV
types. Some clarification of when it is corrected would be helpful.
Might be nice to have a basic install instruction in the main README. Could be exactly the same as what's in the installation docs
pytest-astropy
isn't pulled in as a dependency and therefore python setup.py test
doesn't work out of the box in a clean environment.
The contributing pages is currently RST and should probably be renamed to CONTRIBUTING.
It could also use a statement about how one could possible contribute to the adding of new spectra as it's not obvious.
To whom it may concern,
If you are using https://github.com/astropy/ci-helpers in your appveyor.yml , please know that the Astropy project has dropped active development/support for Appveyor CI. If it still works, good for you, because we did not remove the relevant files (yet). But if it ever stops working, we have no plans to fix anything for Appveyor CI. Please consider using native Windows support other CI, e.g., Travis CI (see https://docs.travis-ci.com/user/reference/windows/). We apologize for any inconvenience caused.
If this issue is opened in error or irrelevant to you, feel free to close. Thank you.
I get the below error message when trying out the example code. I'm working on a fix and will submit a pull request if I find one.
In [18]: sptype = 'B3V'
...: wavelength = 3990 * u.Angstrom
...: signal_to_noise = 100
...: V = 5
...:
...: fig, ax, exp_time = plot_order_sn(sptype, wavelength, V, signal_to_noise=signal_to_noise)
---------------------------------------------------------------------------
UnitConversionError Traceback (most recent call last)
<ipython-input-18-6ef2779d36e5> in <module>
4 V = 5
5
----> 6 fig, ax, exp_time = plot_order_sn(sptype, wavelength, V, signal_to_noise=signal_to_noise)
~/anaconda3/lib/python3.7/site-packages/astropy/units/decorators.py in wrapper(*func_args, **func_kwargs)
232 # Call the original function with any equivalencies in force.
233 with add_enabled_equivalencies(self.equivalencies):
--> 234 return_ = wrapped_function(*func_args, **func_kwargs)
235 if wrapped_signature.return_annotation not in (inspect.Signature.empty, None):
236 return return_.to(wrapped_signature.return_annotation)
~/anaconda3/lib/python3.7/site-packages/arcesetc/plots.py in plot_order_sn(sptype, wavelength, V, exp_time, signal_to_noise, **kwargs)
175 V,
176 exp_time=exp_time,
--> 177 signal_to_noise=signal_to_noise)
178 sn = flux / np.sqrt(flux)
179 ax.set_title('Sp. Type: {0}, Exposure time: {1:.1f}'
~/anaconda3/lib/python3.7/site-packages/astropy/units/decorators.py in wrapper(*func_args, **func_kwargs)
232 # Call the original function with any equivalencies in force.
233 with add_enabled_equivalencies(self.equivalencies):
--> 234 return_ = wrapped_function(*func_args, **func_kwargs)
235 if wrapped_signature.return_annotation not in (inspect.Signature.empty, None):
236 return return_.to(wrapped_signature.return_annotation)
~/anaconda3/lib/python3.7/site-packages/arcesetc/util.py in reconstruct_order(sptype, wavelength, V, exp_time, signal_to_noise)
213
214 closest_order = get_closest_order(matrix, wavelength)
--> 215 wave, flux = matrix_row_to_spectrum(matrix, closest_order)
216 flux *= scale_flux(archive[target], V)
217
~/anaconda3/lib/python3.7/site-packages/arcesetc/util.py in matrix_row_to_spectrum(matrix, closest_order)
119 wave = np.arange(lam_0 - n_lam*delta_lam/2, lam_0 + n_lam*delta_lam/2,
120 delta_lam) * u.Angstrom
--> 121 flux = np.polyval(polynomial_coeffs, wave-lam_0 * u.Angstrom)
122 return wave, flux
123
<__array_function__ internals> in polyval(*args, **kwargs)
~/anaconda3/lib/python3.7/site-packages/numpy/lib/polynomial.py in polyval(p, x)
734 y = NX.zeros_like(x)
735 for i in range(len(p)):
--> 736 y = y * x + p[i]
737 return y
738
~/anaconda3/lib/python3.7/site-packages/astropy/units/quantity.py in __array_ufunc__(self, function, method, *inputs, **kwargs)
455 # consistent units between two inputs (e.g., in np.add) --
456 # and the unit of the result (or tuple of units for nout > 1).
--> 457 converters, unit = converters_and_unit(function, method, *inputs)
458
459 out = kwargs.get('out', None)
~/anaconda3/lib/python3.7/site-packages/astropy/units/quantity_helper/converters.py in converters_and_unit(function, method, *args)
187 "argument is not a quantity (unless the "
188 "latter is all zero/infinity/nan)"
--> 189 .format(function.__name__))
190 except TypeError:
191 # _can_have_arbitrary_unit failed: arg could not be compared
UnitConversionError: Can only apply 'add' function to dimensionless quantities when other argument is not a quantity (unless the latter is all zero/infinity/nan)
The JOSS paper and the main README could benefit from a simple 1-2 sentence statement about who you are expecting to use this and what for (even though it's sort of obvious it's not stated).
Trailing documentation for the sptype
param in all functions:
https://github.com/bmorris3/arcesetc/blob/master/arcesetc/plots.py#L117
https://github.com/bmorris3/arcesetc/blob/master/arcesetc/plots.py#L26
https://github.com/bmorris3/arcesetc/blob/master/arcesetc/util.py#L243
https://github.com/bmorris3/arcesetc/blob/master/arcesetc/util.py#L186
There's an "If" that either shouldn't be there or a missing sentence.
FWIW, one of our volunteers has been very adamant about us clearly having periods to end all sentences. Many of the params are missing these (e.g. for V
in the functions) while many of them have it (e.g. for wavelength
). For missing periods one could make an argument that it could look like a trailing sentence and that's sort of apparent with this trailing sentence.
Anyway, for consistency it would be nice if all param doc sentences had periods.
Hey @bmorris3, just starting to look things over. The notebooks folder could probably use a little clean up in order to clarify things. Some of them either look like actual notebooks (:smile:) or things that maybe shouldn't have been committed (e.g. the targets_path.txt file.)
A statement in the README pointing to any appropriate notebooks would also be nice although that could just be left for the docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.