Git Product home page Git Product logo

s4's Introduction

Hi there πŸ‘‹

I'm Gustavo BraganΓ§a, based in Rio de Janeiro πŸ‡§πŸ‡·, and I like Python, Data, Biking and Pilates.

visitors

GitHub Stats

πŸ“« How to contact me

You can find and get touch with me on these accounts!

Linkedin Badge
Twitter Badge
Medium Badge

s4's People

Contributors

bitdeli-chef avatar gabraganca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kgullikson88

s4's Issues

Refactor entire code

This package has so many code that is not used. Some of it can be discarded.

Time to go hunting!

Fortran compilation

The setup.py is not finding ifort on my pc at ON, and so is not compiling Synspec and Rotin3.

Travis is not building

Travis is not building the environment prior to running the tests. It is throwing the following error:

The command "wget $securityBaseURL/c/cups/libcups2_1.7.2-0ubuntu1.7_amd64.deb -O libcups2.deb" failed and exited with 8 during .

Missing files in first run

After install, when I run the program calling "sagui" in terminal, the program returns this error message:

ERROR: IOError: [Errno 2] No such file or directory: '/home/julio/.s4/synthesis/synplot/fort.11' [numpy.lib.npyio]
Traceback (most recent call last):
  File "/usr/local/bin/sagui", line 553, in <module>
    main()
  File "/usr/local/bin/sagui", line 546, in main
    mw = MainWindow()
  File "/usr/local/bin/sagui", line 44, in __init__
    self.wdg = Widget()
  File "/usr/local/bin/sagui", line 123, in __init__
    self.set_default()
  File "/usr/local/bin/sagui", line 432, in set_default
    self.synplot()
  File "/usr/local/bin/sagui", line 159, in synplot
    self.syn.run()
  File "/usr/local/lib/python2.7/dist-packages/s4/synthesis/synplotwrapper.py", line 99, in run
    self.spectrum = np.loadtxt(self.path + 'fort.11')
  File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 715, in loadtxt
    fh = iter(open(fname, 'U'))
IOError: [Errno 2] No such file or directory: '/home/julio/.s4/synthesis/synplot/fort.11'

The program tries to call .s4/synthesis/synplot/fort.11 but the file is missing.

New problems with new install

I installed the S4 again and the first run of sagui returns:

[julio@bd2093ea ~]$ sagui
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:122: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
ERROR: IOError: Calculated spectrum is not available. Check if syn(spec|plot) ran correctly. [s4.synthesis.synplotwrapper]
Traceback (most recent call last):
  File "/usr/bin/sagui", line 513, in <module>
    main()
  File "/usr/bin/sagui", line 508, in main
    mw = MainWindow()
  File "/usr/bin/sagui", line 41, in __init__
    self.wdg = Widget()
  File "/usr/bin/sagui", line 139, in __init__
    self.synplot()
  File "/usr/bin/sagui", line 172, in synplot
    self.syn.run()
  File "/usr/lib/python2.7/site-packages/s4/synthesis/synplotwrapper.py", line 97, in run
    'syn(spec|plot) ran correctly.')
IOError: Calculated spectrum is not available. Check if syn(spec|plot) ran correctly.

IDL and Intel Fortran are installed and working.

Boxcar smooth

Try adding a boxcar smooting to the spectra.line_position function to improve detection of the line position on spectra of los S/N.

Spectral plotting

The synthetic spectrum is plotted underneath the observed spectrum. This makes very difficult to check if the fit is good or not.

I guess would it be better to do the opposite: synthetic spectra over the observed one.

Create tests.

Now that GDL can run Synplot (#31), we can start writing some tests.

Make GDL default.

The latest version of GDL is able to run Synplot. So, this should be made the default option instead of IDL.

Write a method to load FITS file.

I should probably write a method to load FITS spectrum as a ndarray.

The flux can be loaded easily with astropy.io.fits. For the wavelength I will have to calculate the values using the CRPIX1, CRVAL1 and CDELT1 entries on the header. The header can also be easily loaded also with the astropy.io.fits.

Use Ubuntu 18.04 on Travis via Docker

Travis CI runs their VMs on Ubuntu 14.04 images, which is an issue for us because it does not contain GDL on its repository, forcing us to download and install all dependencies one by one.

The repository where the dependency is located eventually get updated which breaks the Travis buildings (see #39 ).

One solution would be running an updated version of Ubuntu inside a Docker container, as it is suggested in travis-ci/travis-ci#5821

This docs can shed some light on how to do it.

Load spectrum outside folder

The S4 can only open a spectrum if the spectrum is on the folder or if the entire path is given.

Please, add os.path.realpath to obtain the entire path of the spectrum before loading it.

Equivalent Width

@juliotux asked me to write a function to calculate the equivalent width of a line.

Actually the function is already implemented (s4.spectools.get_equiv_width()) but lacks a correction in the case that the user is using a scale factor.

I probably should add this to SAGUI as well.

Line identifcation

Make that the line identification argument (line_id) to be an argumento fo the plot function and not from the object.

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.