Giter VIP home page Giter VIP logo

astronify's People

Contributors

ceb8 avatar dhuppenkothen avatar outdatedpine906 avatar pllim avatar scfleming avatar theresadower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

astronify's Issues

Pitch mapping function

utils.pitch_mapping.data_to_pitch

Needs:

  • Stretching functions are not working - fix (they are from Astrocut and worked fine there, not sure what changed)
  • Allow for pitch limits in Hz
  • Allow for value limits (clipping) as minmax percent
  • Allow for value limits (clipping) as values in same units as original data
  • center_point -> zero_point should be able to take Hz, "median" or "mean"

Add pitch range parameter

Allow users to select the pitch range they are most comfortable listening to for Astronify snapshot functionality (and for the main functionality), for more accessibility.

Metronome

Create function to easily add a regular beat behind sonification that acts as tics on the time axis. (default to data time, ie: 4 days)

User should be able to define the frequency of the beat.

Create .wav duration warning message

Write up a condition to catch for when n_spacing creates a .wav file that takes too long (>10 seconds?). Given the n_spacing + the num. of individual data points that will be sonified, calculate the length of time it will take to sonify the entire data table. If it takes too long, warn the user and let them know their n_spacing is too large.

Possible error if given a series of fluxes that are exactly identical.

While not expected in real data, when I tried to sonify a simulated light curve that was perfectly constant (all fluxes were exactly the same value) I got "divide by zero" errors and no sound. I suspect the problem is in calculating one or more ranges for setting some parameters. The expectation is that if the array is exactly all the same value, one should get a constant tone out.

Can not call write() in Python notebooks.

I am unable to make a call to write() on a sonified object. I haven't debugged it a ton yet, but it seems there is an order-of-operations problem in the _write() pyo statement (at least for me) where it again causes an error about the server being booted.

It complains around this set of code:

` self.server.reinit(audio="offline")
self.server.boot()
self.server.recordOptions(dur=delays[-1]+duration, filename=filepath)

    env = pyo.Linseg(list=[(0, 0), (0.1, 1), (duration - 0.1, 1),
                           (duration - 0.05, 0.5), (duration - 0.005, 0)],
                     mul=[self.gain for i in range(len(pitches))]).play(
                         delay=list(delays), dur=duration)
    sine = pyo.Sine(list(pitches), 0, env).out(delay=list(delays),
                                               dur=duration)
    self.server.start()`

where it is unhappy with the .play() command inside the 'env' line. I tried moving the server.start() above the env line, but no avail.

Test edge cases for transit injection.

Haven't done a ton of testing for edge cases, especially for transit signals that end right near / on / right after the end of the light curve array to make sure the code doesn't miss the final bin, or add an extra, etc.

Fix Documentation Navigation Links

Add links to easily move between docs sections and a link back to the home page within each section.
Read the Docs side bar currently only shows links within that section, but not for the entire project.

Allow doctests to use lightkurve

Several examples in the main docs require lightkurve, it should be possible to add lightkurve as a required package just for the doctests.

No sound output when running through command line.

While I am able to hear sound as expected for a single .play() command in a Python notebook, if running as part of a script from the command line I do not hear any sound at all, just a very brief "click" from my speakers.

Polyphonic Functionality

Add ability to sonify multiple objects in different channels allowing more than one dataset to play at the same time

IO improvement

Allow for more flexibility in input formats

  • Allow time column to be float or AstropyDate
  • Check that other tabular forms are accepted (pandas dataframes? numpy ndtables?) not just Astropy Tables
  • Replace hard coded values with actual arguments

Fix issues that come from negative values

We have issues with calculating the total area and standard deviation error when data points go into the negative y-axis. The current possible solution for this would be to offset all the data by some value to shift it up and out of the negatives, but this would be creating false flux and therefore auditory comparison between spectra would not be possible in the future.

Remove example files

The Astropy template come with a number of example files. These need to be removed from the repository.

User control

Add more user controls:

  • Time range
  • Speed (time between notes really)

Hearing Test

Create a way for a user to test their hearing so they can learn optimal pitch outputs to use when sonifying data they want to study

Similar to how fancy earbuds do this when you first configure them

Unable to play more than one sound in a single notebook.

Within a Python notebook, I am unable to run a .play() on more than one sonified object. The error I get is one where it states "the server must be botted before...", the first call to .play() works as expected, but a second call to another sonified object fails.

Animation Function

Write Python function that generates mp4 animation by combining the .gif graph images and .wav sonification sound.

@ceb8 has notebook with code to get started with this

ANN: Please migrate away from pytest-openfiles

Hello. The Astropy Project has decided to retire pytest-openfiles, a plugin to detect open files in pytest runs. We see that you are using it in this repo. While you may continue to use it, please be advised that it will no longer be maintained going forward. See https://github.com/astropy/pytest-openfiles#important-retirement-roadmap for more information. We apologize for any inconvenienced cause.

If this issue was opened in error and is irrelevant, feel free to close.

Thank you for your patience.

xref astropy/pytest-openfiles#47

Handle presence of NaN's correctly.

Currently the Jupyter kernel will die if sonify() is given a set of fluxes with NaN values in it. These should be filtered out, or the algorithm should be made NaN-safe, depending on our decision for a mitigation strategy. Kepler/K2 data can sometimes have NaN values in the time array to, so the solution should be applied to both the time and flux axes.

Get rid of 6th bin for some data files

Sometimes we end up with a 6th bin (filled with zeros, so does not affect the actual output) probably due to the num. of data points not being divisible by 5. Low priority, but still needs to be addressed.

Improve long data series handling

Above a certain number of data points (somewhere between the number in a Kepler long cadence light curve and the number in a Kepler short cadence light curve) playing or writing a sonification starts to hang and kill the kernal. Ideally we would fix Astronofy so that any length is fine. But if that is not possible at the least there should be a hard limit and error thrown so that unsuspecting users do not repeatedly kill their kernel not knowing what the problem is.

Basic documentation

Readthedocs documentation to the level where we can show it to users

  • Fix logo
  • Add installation instructions
  • Example that shows:
  • Getting Kepler light curve
  • Setting up a SoniSeries object
  • Sonifying data
  • Playing sonification
  • Adjusting parameter(s)
  • Writing sonification to wav file
  • Embedded sound file
  • Show plot as well for sighted users
  • Downloadable pyfile with all the code from the example(s)
  • Docstring documentation

Handle clipping

It's possible and in fact too easy to overwhelm the speaker and get unpleasant sounds, we need to implement automatic clipping so this can't happen.

Save multiple sonified data from 'soni_obj.play()'

Hi,
I heard the other day about Astronify, what a great project!

As I started exploring and creating sound objects. In Jupyter Notebook I can play simultaneously several files just by having multiple soni_obj.play() one after the other, however, I can .wirte() only individual files, so I was wondering is it possible to write all into a file - as it is played?
I'm using it to sonify galaxy groups - therefore, trying to test how clear would be to hear an entire group of galaxies played/saved at the same time.

Installing astronify at the Rubin Science Platform in `data.lsst.cloud`

I'm trying to install astronify at the Rubin Science Platform (RSP) in data.lsst.cloud to create a short Jupyter Notebook demonstration on how to use astronify with LSST-like data.

At first, pip install --user astronify would run into problems with portaudio (the details are in this public forum question: https://community.lsst.org/t/installing-astronify-via-homebrew-on-rsp-notebooks/8066). A colleague from Rubin suggested doing a minimal installation of pyo to exclude portaudio since portaudio is used when you want to play audio on the same computer that you’re running the code on, but on the RSP the code runs in a data center somewhere, so instead you need to use IPython to interface with the browser to play the audio. This solution worked fine as of November of 2023, but now the following error message appears when trying to import astronify in a notebook:

ImportError: libsndfile.so.1: cannot open shared object file: No such file or directory

A colleague from Rubin suggested that astronify might be out of date with respect to the astropy built into rubin-env, which has astropy 6.0.0..

Handling uncertainty?

Seeing as uncertainty is vital to communicating scientific results properly, I was wondering if there are ways to use astronify to embed uncertainty information in outputs? I noticed that SoniSeries doesn't explicitly support this, but workarounds and hacks for doing this would be useful.

R/D: Explore pyo streams

Currently we're doing one stream per note, this seems unnecessary and spawns way too many streams. Figure out a better way to do this.

Basic tests and CI

Add basic testing framework

  • Write basic unit tests
  • Hook up github actions CI
  • Hook up codecov
  • Hook up astropybot for pep8/changelog/milestone checking

Why does sonification not work if only two values present?

For transit simulator or case of top of square (e.g., square wave) the output sound isn't as expected. One would expect two distinct sounds at roughly 1/3 and 2/3 the allowed tone range, but instead it is basically monotone. This could be a bug, or could be result of algorithm being used, will investigate.

Store Sonification Configurations

Create a way for a user to name and store a group of configs for things like pitch, speed, timing, point spacing, etc.

This can also be used to name and store default configs for different types of data
 (ie: flares vs transit).

Enhance readme

Add additional information to the readme

  • Information on how to run tests locally
  • Information on how to build docs locally
  • Better description of the project

Error while imporrting.

Hi, I'm having the following traceback while importing astronify.
I'm under Win11, Python 3.11.8, iPython 8.22:
In [1]: import astronify

ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import astronify
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\astronify_init_.py:7
1 # Licensed under a 3-clause BSD style license - see LICENSE.rst
2
3
4 # Packages may add whatever they like to this file, but
5 # should keep this content at the top.
6 # ----------------------------------------------------------------------------
----> 7 from ._astropy_init import * # noqa
8 # ----------------------------------------------------------------------------
11 from . import series # noqa
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\astronify_astropy_init.py:21
19 import os
20 from warnings import warn
---> 21 from astropy.config.configuration import (
22 update_default_config,
23 ConfigurationDefaultMissingError,
24 ConfigurationDefaultMissingWarning)
26 # Create the test function for self test
27 from astropy.tests.runner import TestRunner
ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' (C:\Users\Utente\AppData\Local\Programs\Python\Python311\Lib\site-packages\astropy\config\configuration.py)

Thanks for any help on how to fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.