repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
pyterpol
pyterpol-master/pyterpol_examples/observed_spectra_fitting/v746cas_2/ondrejov/mask_tell.py
import sys import numpy as np tellbase = [ [6522., 6525.5], [6530., 6538.5], [6541.8, 6550.37], [6551.75, 6554.9], [6557., 6560], [6563.6, 6564.8], [6568.38, 6576.3], [6580.2, 6588.2], [6594.2, 6596.], [6598.8, 6603.4] ] def remove_telluric(f): """ Removes intervals def...
770
15.404255
56
py
pyterpol
pyterpol-master/pyterpol_examples/ObservedList/example.py
""" This example demonstrates how to prepare observations. """ import pyterpol ################################## BARE MINIMUM ######################################### # create a blank list ol = pyterpol.ObservedList() # now we are ready to attach some data - lets have a look at the data first # the spectrum is not...
2,934
34.361446
104
py
pyterpol
pyterpol-master/pyterpol_examples/StarList/example.py
""" This script demonstrates capabilities of the StarList class. """ import pyterpol ################################## BARE MINIMUM ######################################### # create an empty class sl = pyterpol.StarList() # pyterpol knows a set of parameters, which are given to a component # these parameters are t...
2,079
31
107
py
pyterpol
pyterpol-master/pyterpol_examples/disentangled_spectra_fitting/hd81357/hd81357_plot.py
""" This shows how to evaluate the outcome of the fitting We were fitting the disentangled spectra of the secondary. """ import pyterpol # 1) Load the last session - create an empty Interface itf = pyterpol.Interface() # fill it with teh last session itf.load('hd81357.sav') # 2) Have a look at the comparisons itf.pl...
627
20.655172
58
py
pyterpol
pyterpol-master/pyterpol_examples/disentangled_spectra_fitting/hd81357/hd81357.py
""" Real life demonstration. HD81357 is an interacting binary. Its secondary is a Roche-lobe filling star, which is probably losing its mass. We obtained disentangled spectra of the secondary in two spectral regions. Here is an estimate of its radiative properties. """ # import numpy as np import pyterpol ## 1) Creat...
5,610
39.366906
154
py
pyterpol
pyterpol-master/pyterpol_examples/Fitter/example.py
""" This function demonstrates usage of the class Fitter. """ import pyterpol import numpy as np import matplotlib.pyplot as plt import time ################################## BARE MINIMUM ######################################### # define a function that will be minimized def func(x): """ Polynomial of order...
2,764
28.105263
89
py
pyterpol
pyterpol-master/pyterpol_examples/RegionList/example.py
""" This script demonstrates capabilities of the RegionList class. """ import pyterpol ################################## BARE MINIMUM ######################################### # create an empty class rl = pyterpol.RegionList() # add a region - the simplest way rl.add_region(wmin=4300, wmax=4500) # add a region, de...
1,879
35.153846
89
py
pyterpol
pyterpol-master/docs/conf.py
import os # -*- coding: utf-8 -*- # # Pyterpol documentation build configuration file, created by # sphinx-quickstart on Fri Aug 26 12:34:08 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated ...
10,169
27.647887
80
py
pyterpol
pyterpol-master/grids_ABS/ready_phoenix.py
#!/usr/bin/env python """ ready_phoenix.py Convert Phoenix synthetic spectra from FITS to DAT. """ __author__ = "Miroslav Broz (miroslav.broz@email.cz)" __version__ = "Jun 23rd 2016" import sys import numpy as np from scipy.interpolate import splrep, splev from astropy.io import fits from pyterpol.synthetic.auxili...
2,065
20.747368
97
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticSpectrum/compare_c_p.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') from pyterpol.synthetic.makespectrum import SyntheticSpectrum gridSpec = 'grid.dat' # basic gridspectrum used by interpol c0_wave, c0_int = np.loadtxt(gridSpec, unpack=True, usecols=[0,1]) # shifted and rotated gridspectrum crs_...
992
27.371429
71
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticSpectrum/test01.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') from pyterpol.synthetic.makespectrum import SyntheticSpectrum syspe = SyntheticSpectrum(f='temp.dat', teff=10000, logg=4.2) # check normal output print syspe.get_spectrum() # choose a wave region # this one should raise warning w...
913
28.483871
79
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/test02/test02.py
""" Try to do some comparisons with various systems. """ import pyterpol import matplotlib.pyplot as plt # ================================= Binary ================================= debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [ dict(filename='o.asc', error=0.01), ...
939
25.857143
95
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/test02/test01.py
""" Try to do some comparisons with various systems. """ import pyterpol import matplotlib.pyplot as plt # ============================== Single star =============================== debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [ dict(filename='o.asc', error=0.01), ...
1,567
26.034483
95
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/testkorel/testkorel.py
""" Make a comparison with some data created with the old version. KOREL format of the ouput data is used. """ import pyterpol # 1) setup the model sl = pyterpol.StarList() sl.add_component('primary', teff=11257., logg=4.43, vrot=28.8, lr=0.744, rv=-17.94, z=1.000) sl.add_component('secondary', teff=7714., logg=4.25,...
765
25.413793
94
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/testnormal/testnormal.py
""" Make a comparison with some data created with the old version. KOREL format of the ouput data is used. """ import pyterpol # 1) setup the model sl = pyterpol.StarList() sl.add_component('primary', teff=32554., logg=3.77, vrot=64.5, lr=0.449, rv=6.685, z=1.003) sl.add_component('secondary', teff=31205., logg=3.36,...
818
22.4
94
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/test03/test03.py
""" Try to do some comparisons with various systems. """ import pyterpol import matplotlib.pyplot as plt # ======================== Binary wih KOREL file =========================== debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [ dict(filename='o.asc', error=0.01, ko...
1,096
27.868421
94
py
pyterpol
pyterpol-master/pyterpol_test/test_comparison/test01/test01.py
""" Try to do some comparisons with various systems. """ import pyterpol import matplotlib.pyplot as plt # ============================== Single star =============================== debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [ dict(filename='o.asc', error=0.01), ...
832
24.242424
95
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test04.py
""" Test computation of chi2 - fitting of 6 RVs on three spectra. This also shows that simplex wont get out of the local minimum easily, so more powerful fitting environments are needed if we want to get over big obstacles. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6325, wmax=6375) rl.add_regio...
2,697
32.725
100
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test05.py
""" Test computation of chi2 - fitting of 6 RVs on three spectra. This also shows that simplex wont get out of the local minimum easily, so more powerful fitting environments are needed if we want to get over big obstacles. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6325, wmax=6375) rl.add_regio...
2,739
32.82716
100
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test02.py
""" Test computation of chi2 - fitting of 6 RVs on three spectra. This also shows that simplex wont get out of the local minimum easily, so more powerful fitting environments are needed if we want to get over big obstacles. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6320, wmax=6380) rl.add_regio...
2,036
26.527027
97
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test01.py
""" Test computation of chi2 - fitting of one RV on one spectrum """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6320, wmax=6380) rl.add_region(wmin=6500, wmax=6600) sl = pyterpol.StarList() sl.add_component(component='primary', teff=18000., logg=4.5, rv=10., z=1.0, vrot=50.0, lr=0.3) sl.add_compone...
1,555
23.698413
97
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test03.py
""" Test computation of chi2 - fitting of 6 RVs on three spectra. This also shows that simplex wont get out of the local minimum easily, so more powerful fitting environments are needed if we want to get over big obstacles. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6325, wmax=6375, groups={'lr'...
2,551
31.717949
100
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_fitting/test06.py
""" Test computation of chi2 - fitting of 6 RVs on three spectra. This also shows that simplex wont get out of the local minimum easily, so more powerful fitting environments are needed if we want to get over big obstacles. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6325, wmax=6375) rl.add_regio...
2,805
33.219512
100
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_setup/test01.py
""" Test of setting up the class to start fitting. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=5300, wmax=5500) rl.add_region(wmin=6500, wmax=6600) sl = pyterpol.StarList() sl.add_component(teff=10000., logg=4.5, rv=10., z=1.0, vrot=20.0) itf = pyterpol.Interface(sl=sl, rl=rl, debug=True) print...
775
23.25
86
py
pyterpol
pyterpol-master/pyterpol_test/test_fitting/test_chi2/test01.py
""" Test computation of chi2 """ import pyterpol rl = pyterpol.RegionList() rl.add_region(wmin=6320, wmax=6380) rl.add_region(wmin=6500, wmax=6600) sl = pyterpol.StarList() sl.add_component(component='primary', teff=18000., logg=4.5, rv=10., z=1.0, vrot=50.0, lr=0.3) sl.add_component(component='secondary', teff=25000...
1,191
22.84
97
py
pyterpol
pyterpol-master/pyterpol_test/test_hjd/test.hjd.py
import numpy as np import pyterpol def load_observations(f): """ :param f: file :return: """ # load the observations flist = np.loadtxt(f, usecols=[0], unpack=True, dtype=str) hjd = np.loadtxt(f, usecols=[1], unpack=True).tolist() hjd[0] = None # create list of observations ob...
1,829
24.068493
87
py
pyterpol
pyterpol-master/pyterpol_test/test_fitter/test_save.py
import pyterpol fitter = pyterpol.Fitter() fitter.choose_fitter('nlopt_nelder_mead', xtol=1e-5, ftol=1e-5) fitter.save('fitter_save.txt') print fitter fitter.clear_all() print fitter fitter.load('fitter_save.txt') print fitter
226
24.222222
63
py
pyterpol
pyterpol-master/pyterpol_test/test_Parameter/test01.py
""" Test of basic properties of the Parameter class. """ from pyterpol.fitting.parameter import Parameter from pyterpol.fitting.parameter import parameter_definitions as pd # test that all parameter defined in parameter_definitions result into # Parameter - passed for key in pd.keys(): p = Parameter(**pd[key]) #...
532
18.035714
70
py
pyterpol
pyterpol-master/pyterpol_test/test_absolute_spectra/test.py
import pyterpol import matplotlib.pyplot as plt wmin = 3600 wmax = 4100 sygri = pyterpol.SyntheticGrid(flux_type='absolute') params = dict(teff=9950, logg=3.7, z=1.0) spec1 = sygri.get_synthetic_spectrum(params, [wmin, wmax], order=4, step=0.1) params = dict(teff=10000, logg=3.5, z=1.0) spec2 = sygri.get_synthetic_spe...
575
31
77
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticGrid/test_grid_listing.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid sygri = pyterpol.SyntheticGrid() # read properties sygri.read_list_from_file('gridlist', columns=['FILENAME', 'TEFF', 'LOGG'], family='BSTAR') # test narrowing down the synthetic spectra list for...
751
24.066667
91
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticGrid/test_grid_creation.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid sygri = pyterpol.SyntheticGrid() # this one works - checked sygri.read_list_from_file('gridlist', columns=['FILENAME', 'TEFF', 'LOGG'], family='BSTAR') print sygri print sygri.get_available_values...
1,351
32.8
91
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticGrid/test_grid_selection.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid sygri = pyterpol.SyntheticGrid() # read properties sygri.read_list_from_file('b1.dat', columns=['FILENAME', 'TEFF', 'LOGG', 'Z'], family='BSTAR') sygri.read_list_from_file('p1.dat', columns=['FILE...
864
27.833333
95
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticGrid/test_grid_selection_2.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid sygri = pyterpol.SyntheticGrid(debug=True, mode='default') parlis = sygri.select_parameters(order=4, **{'logg':3.9999999999999982, 'z':1.0, 'teff':16000.}) print parlis parlis = sygri.deselect_exac...
399
29.769231
96
py
pyterpol
pyterpol-master/pyterpol_test/test_SyntheticGrid/test_grid_interpolation.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid sygri = pyterpol.SyntheticGrid() # read properties sygri.read_list_from_file('b1.dat', columns=['FILENAME', 'TEFF', 'LOGG', 'Z'], family='BSTAR') sygri.read_list_from_file('p1.dat', columns=['FILE...
1,262
30.575
95
py
pyterpol
pyterpol-master/pyterpol_test/old_vs_new/pollux_barycentric_interpolator/compare.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,12), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) old = np.loadtxt(spec[:-3]+'old') ind = np.where((old[:,0] >= new[:,0].min()) & (old[:,0] <= new[:,...
799
26.586207
82
py
pyterpol
pyterpol-master/pyterpol_test/old_vs_new/pollux_hermite_interpolator/compare.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,12), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) old = np.loadtxt(spec[:-3]+'old') ind = np.where((old[:,0] >= new[:,0].min()) & (old[:,0] <= new[:,...
799
26.586207
82
py
pyterpol
pyterpol-master/pyterpol_test/old_vs_new/pollux_univariate_spline/compare.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,12), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) old = np.loadtxt(spec[:-3]+'old') ind = np.where((old[:,0] >= new[:,0].min()) & (old[:,0] <= new[:,...
799
26.586207
82
py
pyterpol
pyterpol-master/pyterpol_test/old_vs_new/pollux_adaptive_spline_order/compare.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,12), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) old = np.loadtxt(spec[:-3]+'old') ind = np.where((old[:,0] >= new[:,0].min()) & (old[:,0] <= new[:,...
799
26.586207
82
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_bstar/test_spectra_interpolation_wrapper.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('BSTAR', debug=True) # interpolate at wmin = 6500 wmax = 6650 keys = ['Z', 'LOGG', 'TEFF'] values = [1.5, 3.8, 18400] params = {k:v...
600
20.464286
60
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_bstar/test_spectra_interpolation_order.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('BSTAR', debug=True) # interpolate at wmin = 6500 wmax = 6650 keys = ['Z', 'LOGG', 'TEFF'] values = [1.0, 3.8, 18400] params = {k:v...
871
22.567568
93
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_bstar/compare_orders_z_1.0/compare_orders.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(15,15), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) xlim = (new[:,0].min(),new[:,0].max()) xlim = (6520,6600) if i == 0: fst = new.copy() o...
1,015
25.051282
79
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_bstar/compare_orders_z_1.5/compare_orders.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(15,15), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) xlim = (new[:,0].min(),new[:,0].max()) xlim = (6520,6600) if i == 0: fst = new.copy() o...
1,015
25.051282
79
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/test_spectra_interpolation_wrapper.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('POLLUX', debug=True) # interpolate at wmin = 6500 wmax = 6650 keys = ['Z', 'LOGG', 'TEFF'] values = [1.0, 4.0, 12000] params = {k:...
601
20.5
60
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/compare.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,12), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) old = np.loadtxt(spec[:-3]+'old') ind = np.where((old[:,0] >= new[:,0].min()) & (old[:,0] <= new[:,...
799
26.586207
82
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/test_spectra_interpolation.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('POLLUX', debug=True) # interpolate at keys_0 = ['Z', 'LOGG', 'TEFF'] values = [[1.0, 4.0, 12000],[1.0, 4.0, 12200],[1.0, 3.8, 1220...
1,322
26.5625
86
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/test_spectra_interpolation_order.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('POLLUX', debug=True) # interpolate at wmin = 6500 wmax = 6650 keys = ['Z', 'LOGG', 'TEFF'] values = [1.0, 3.8, 12200] params = {k:...
871
22.567568
93
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/test_spectra_loading.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('POLLUX') # try to load a spectrum keys = ['Z', 'LOGG', 'TEFF'] vals = [1.0, 4.0, 13000] wmin = 6400 wmax = 6600 # create a dictio...
810
20.342105
77
py
pyterpol
pyterpol-master/pyterpol_test/test_interpolation_pollux/compare_orders/compare_orders.py
import sys import numpy as np import matplotlib.pyplot as plt speclist = np.loadtxt(sys.argv[1], dtype=str) plt.figure(figsize=(10,15), dpi=100) for i,spec in enumerate(speclist): new = np.loadtxt(spec) if i == 0: fst = new.copy() old = np.loadtxt('LOGG_3.8_Z_1.0_TEFF_12200.old') ind = np.where((old[:...
983
26.333333
79
py
pyterpol
pyterpol-master/pyterpol_test/test_ObservedSpectra/test_osc.py
import sys sys.path.append('/home/jana/work/') import pyterpol import numpy as np obsfile = 'ua170034.asc' w, i = np.loadtxt(obsfile, unpack=True, usecols=[0, 1]) e = np.random.random(len(w)) * 0.01 # No spectrum is passes - only some warnings are issues -checked #os = pyterpol.ObservedSpectrum() # spectrum is passe...
1,997
29.738462
90
py
pyterpol
pyterpol-master/pyterpol_test/hd81357/hd81357.py
import numpy as np import pyterpol # 1) Generate region rl = pyterpol.RegionList() rl.add_region(wmin=6450, wmax=6650) # 2) Generate components sl = pyterpol.StarList() # compute rotational velocity prot = 33.77409 r_point = 14.68 i = np.radians(62.7) vsini = 50.57877*r_point*np.sin(i)/prot print vsini # add compo...
962
20.4
82
py
pyterpol
pyterpol-master/pyterpol_test/hd81357/fitting/eval_res.py
import numpy as np import matplotlib.pyplot as plt import pyterpol itf = pyterpol.Interface() itf.load('hd81357.sav') itf.populate_comparisons() # print itf.get_degrees_of_freedom() # print itf.compute_chi2_treshold() # try to load the data data = pyterpol.read_fitlog('fit.log') # try to plot the convergence itf.plo...
447
18.478261
64
py
pyterpol
pyterpol-master/pyterpol_test/hd81357/fitting/hd81357.py
import numpy as np import pyterpol # 1) Generate region rl = pyterpol.RegionList() rl.add_region(wmin=6324, wmax=6424) rl.add_region(wmin=4380, wmax=4497) # 2) Generate observed data ol = pyterpol.ObservedList() obs = [ dict(filename='DE_blue02_n.dat', component='secondary', korel=True, error=0.01), dict(file...
1,557
28.961538
109
py
pyterpol
pyterpol-master/pyterpol_test/test_ObservedList/test02.py
""" Test of the submodule ObservedList in fitting. Testing querying of spectra. """ import numpy as np from pyterpol.fitting.interface import ObservedList # define the type ol = ObservedList() # build a list of observations obs = [ dict(filename='o.asc', group=dict(rv=0, teff=0)), dict(filename='o.asc', group...
1,782
32.018519
86
py
pyterpol
pyterpol-master/pyterpol_test/test_ObservedList/test01.py
""" Test of the submodule ObservedList in fitting. """ import numpy as np from pyterpol.fitting.interface import ObservedList # define the type ol = ObservedList(debug=True) # add some observations ol.add_one_observation(filename='o.asc', group=dict(rv=0, teff=0)) ol.add_one_observation(filename='o.asc', group=dict(r...
832
21.513514
66
py
pyterpol
pyterpol-master/pyterpol_test/test_ObservedList/test_save.py
""" Test of the observedlist save/load """ import numpy as np from pyterpol.fitting.interface import ObservedList # define the type ol = ObservedList() # build a list of observations obs = [ dict(filename='o.asc', group=dict(rv=[0, 1], teff=0), error=0.01), dict(filename='o.asc', group=dict(rv=0, teff=1)), ...
603
19.133333
79
py
pyterpol
pyterpol-master/pyterpol_test/test_RegionList/test02.py
""" Tryout communication ObservedList -> RegionList -> StarList """ import pyterpol debug = True # 1) Observations ol = pyterpol.ObservedList(debug=debug) obslist = [ dict(filename='o.asc', component='secondary', error=0.01), dict(filename='o.asc', component='primary', error=0.01), dict(filename='o.asc',...
1,212
21.886792
104
py
pyterpol
pyterpol-master/pyterpol_test/test_RegionList/test01.py
""" Basic testing (creation and attachement of regions) of the RegionList class """ import pyterpol # type rl = pyterpol.RegionList(debug=True) # add regions # the simplest case rl.add_region(identification='myfirst', wmin=0., wmax=1.) #- correct # rl.add_region() #- correctly incorrect # try to add the same region...
1,258
36.029412
120
py
pyterpol
pyterpol-master/pyterpol_test/test_RegionList/test_save.py
""" Test saving of the class. """ import pyterpol rl = pyterpol.RegionList() rl.add_region(component='primary', identification='r1', wmin=4500., wmax=4600.) rl.add_region(component='primary', identification='r2', wmin=4500., wmax=4700.) rl.add_region(component='primary', identification='r3', wmin=4500., wmax=4800.) rl...
590
18.7
81
py
pyterpol
pyterpol-master/pyterpol_test/test_StarList/test02.py
""" Test of group assignment, """ import pyterpol # build the class and add some components sl = pyterpol.StarList() sl.add_component(component='primary', teff=15000., logg=4.5, vrot=0.0, rv=-20.) sl.add_component(component='secondary', teff=15000., logg=4.5, vrot=0.0, rv=-20.) # print sl # add two groups for rv - c...
550
26.55
81
py
pyterpol
pyterpol-master/pyterpol_test/test_StarList/test01.py
""" Test of initialization of the class StarList """ import pyterpol sl = pyterpol.StarList() sl.add_component(component='primary', teff=15000., logg=4.5, vrot=0.0, rv=-20.) sl.add_component(component='secondary', teff=15000., logg=4.5, vrot=0.0, rv=-20.) print sl sl.clear() # Try not to import one parameter sl.add...
517
21.521739
81
py
pyterpol
pyterpol-master/pyterpol_test/test_StarList/test03.py
""" Test of communication between StarList and ObservedList """ import pyterpol # build the class and add some components sl = pyterpol.StarList() sl.add_component(component='primary', teff=15000., logg=4.5, vrot=0.0, rv=-20., groups=dict(z=1)) sl.add_component(component='secondary', teff=15000., logg=4.5, vrot=0.0, ...
907
26.515152
99
py
pyterpol
pyterpol-master/pyterpol_test/test_StarList/test_save.py
import pyterpol sl = pyterpol.StarList() sl.add_component(component='primary', teff=17000., logg=4.0, rv=-100.0, z=1.0, vrot=40.0, lr=0.35) sl.add_component(component='secondary', teff=26000., logg=4.0, rv=100.0, z=1.0, vrot=140.0, lr=0.65) sl.set_parameter(component='primary', group=0, name='rv', value=-123123., vmi...
439
30.428571
107
py
pyterpol
pyterpol-master/pyterpol_test/test_fwhm/test.py
import pyterpol def main(): """ :return: """ ## 1) Generate region rl = pyterpol.RegionList() rl.add_region(wmin=6337., wmax=6410.0, groups=dict(lr=0)) rl.add_region(wmin=6530., wmax=6600.0, groups=dict(lr=0)) rl.add_region(wmin=6660., wmax=6690.0, groups=dict(lr=0)) ## 2) Load ob...
2,126
32.761905
108
py
pyterpol
pyterpol-master/pyterpol_test/junk/test.py
import numpy as np from scipy.interpolate import splrep, splev, interp1d import matplotlib.pyplot as plt x = np.linspace(0, 2*np.pi, 10) y = np.sin(x) xnew = np.linspace(0, 2*np.pi, 100) prec = np.sin(xnew) tck = splrep(x, y, k=3) int_splev = splev(xnew, tck) f = interp1d(x, y, kind='cubic') int_interp1d = f(xnew) ...
685
23.5
57
py
pyterpol
pyterpol-master/pyterpol_test/test_defaults/test_grid_defaults.py
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid() print sygri ## create the grid - BSTAR does nothing sygri = pyterpol.SyntheticGrid('BSTAR') print sygri ## create the grid - OSTAR does no...
664
19.78125
41
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test04.py
""" Testing of RV group """ import pyterpol import matplotlib.pyplot as plt debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) # obs = [ # dict(filename='o.asc', error=0.01, group=dict(rv=10)), # dict(filename='o2.asc', error=0.01, group=dict(rv=10)) # ] obs = [ ...
1,398
23.982143
95
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test05.py
""" Testing the comparison of synthetic and observed spectra. """ import pyterpol import matplotlib.pyplot as plt debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) # obs = [ # dict(filename='o.asc', error=0.01, group=dict(rv=10)), # dict(filename='o2.asc', error=0.01, gr...
1,336
23.309091
95
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test02.py
""" Testing of creation of combination list. """ import pyterpol debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [dict(filename='o.asc', error=0.01), dict(filename='o2.asc', error=0.01)] ol.add_observations(obs) # 2) define fitted regions rl = pyterpol.RegionList(debug...
732
19.361111
93
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test01.py
import pyterpol debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [dict(filename='o.asc', error=0.01), dict(filename='o2.asc', error=0.01)] ol.add_observations(obs) # 2) define fitted regions rl = pyterpol.RegionList(debug=debug) rl.add_region(wmin=4300, wmax=4380) rl.add...
619
22.846154
93
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test03.py
""" Testing creation of the class and settings of groups. """ import pyterpol debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [ dict(filename='o.asc', error=0.01, group=dict(rv=10)), dict(filename='o2.asc', error=0.01, group=dict(rv=11)) ] # obs = [ # ...
1,364
28.042553
95
py
pyterpol
pyterpol-master/pyterpol_test/test_interface/test_save.py
""" Testing the comparison of synthetic and observed spectra. """ import pyterpol import matplotlib.pyplot as plt debug=False # 1) define some observations ol = pyterpol.ObservedList(debug=debug) obs = [dict(filename='o.asc', error=0.01, component='primary', korel=True), dict(filename='o2.asc', error=0.01, co...
1,166
26.139535
95
py
pyterpol
pyterpol-master/observed/observations.py
import warnings import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import splrep from scipy.interpolate import splev # repeat userwarnings warnings.simplefilter('always', UserWarning) class ObservedSpectrum: """ A wrapper class for the observed spectra. """ def __init__(self, w...
15,903
33.498915
118
py
pyterpol
pyterpol-master/observed/__init__.py
2
0
0
py
davis2017-evaluation
davis2017-evaluation-master/setup.py
from setuptools import setup import sys if sys.version_info < (3, 6): sys.exit('Sorry, only Python >= 3.6 is supported') setup( python_requires='>=3.6, <4', install_requires=[ 'Pillow>=4.1.1', 'networkx>=2.0', 'numpy>=1.12.1', 'opencv-python>=4.0.0.21', 'pandas>=0.2...
506
23.142857
54
py
davis2017-evaluation
davis2017-evaluation-master/evaluation_method.py
#!/usr/bin/env python import os import sys from time import time import argparse import numpy as np import pandas as pd from davis2017.evaluation import DAVISEvaluation default_davis_path = '/path/to/the/folder/DAVIS' time_start = time() parser = argparse.ArgumentParser() parser.add_argument('--davis_path', type=str...
3,492
49.623188
118
py
davis2017-evaluation
davis2017-evaluation-master/evaluation_codalab.py
#!/usr/bin/env python import sys import os.path from time import time import numpy as np import pandas from davis2017.evaluation import DAVISEvaluation task = 'semi-supervised' gt_set = 'test-dev' time_start = time() # as per the metadata file, input and output directories are the arguments if len(sys.argv) < 3: ...
4,122
42.861702
140
py
davis2017-evaluation
davis2017-evaluation-master/pytest/test_evaluation.py
import os import sys import numpy as np import pandas from time import time from collections import defaultdict from davis2017.evaluation import DAVISEvaluation from davis2017 import utils from davis2017.metrics import db_eval_boundary, db_eval_iou davis_root = 'input_dir/ref' methods_root = 'examples' def test_ta...
6,518
38.271084
140
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/utils.py
import os import errno import numpy as np from PIL import Image import warnings from davis2017.davis import DAVIS def _pascal_color_map(N=256, normalized=False): """ Python implementation of the color map function for the PASCAL VOC data set. Official Matlab version can be found in the PASCAL VOC devkit ...
6,009
33.342857
110
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/results.py
import os import numpy as np from PIL import Image import sys class Results(object): def __init__(self, root_dir): self.root_dir = root_dir def _read_mask(self, sequence, frame_id): try: mask_path = os.path.join(self.root_dir, sequence, f'{frame_id}.png') return np.arr...
1,236
37.65625
111
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/metrics.py
import math import numpy as np import cv2 def db_eval_iou(annotation, segmentation, void_pixels=None): """ Compute region similarity as the Jaccard Index. Arguments: annotation (ndarray): binary annotation map. segmentation (ndarray): binary segmentation map. void_pixels (ndarray)...
6,823
33.464646
137
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/__init__.py
from __future__ import absolute_import __version__ = '0.1.0'
62
14.75
38
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/evaluation.py
import sys from tqdm import tqdm import warnings warnings.filterwarnings("ignore", category=RuntimeWarning) import numpy as np from davis2017.davis import DAVIS from davis2017.metrics import db_eval_boundary, db_eval_iou from davis2017 import utils from davis2017.results import Results from scipy.optimize import linea...
6,143
54.351351
143
py
davis2017-evaluation
davis2017-evaluation-master/davis2017/davis.py
import os from glob import glob from collections import defaultdict import numpy as np from PIL import Image class DAVIS(object): SUBSET_OPTIONS = ['train', 'val', 'test-dev', 'test-challenge'] TASKS = ['semi-supervised', 'unsupervised'] DATASET_WEB = 'https://davischallenge.org/davis2017/code.html' V...
5,514
43.837398
130
py
mapalignment
mapalignment-master/projects/mapalign/evaluate_funcs/evaluate_utils.py
import sys import numpy as np sys.path.append("../../utils") import polygon_utils def compute_batch_polygon_distances(gt_polygons_batch, aligned_disp_polygons_batch): # Compute distances distances = np.sqrt(np.sum(np.square(aligned_disp_polygons_batch - gt_polygons_batch), axis=-1)) min = np.nanmin(dis...
2,799
36.333333
100
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/preprocess_bradbury_buildings_multires.py
import sys import os import json import math import skimage.transform import skimage.draw import numpy as np # from PIL import Image, ImageDraw # Image.MAX_IMAGE_PIXELS = 200000000 import tensorflow as tf import config_bradbury_buildings_multires as config sys.path.append("../../../data/bradbury_buildings_roads_he...
17,281
47.68169
163
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/config_bradbury_buildings_multires.py
import os def choose_first_existing_dir(dir_list): for dir in dir_list: if os.path.exists(dir): return dir return None ROOT_DIR = choose_first_existing_dir([ "/local/shared/epitome-polygon-deep-learning", # Inria cluster node nefgpu23 "/home/nigirard/epitome-polygon-deep-learnin...
6,538
23.582707
143
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/preprocess_aerial_image_multires.py
import sys import os import math import json import random import skimage.transform import numpy as np import tensorflow as tf import config_aerial_image_multires as config sys.path.append("../../../data/AerialImageDataset") import read # sys.path.append("../utils") # import visualization sys.path.append("../../u...
16,812
46.360563
182
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/config_mapping_challenge_multires.py
import os def choose_first_existing_dir(dir_list): for dir in dir_list: if os.path.exists(dir): return dir return None ROOT_DIR = choose_first_existing_dir([ "/local/shared/epitome-polygon-deep-learning", # Inria cluster node nefgpu23 "/home/nigirard/epitome-polygon-deep-learnin...
1,817
41.27907
143
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/config_aerial_image_multires.py
import os def choose_first_existing_dir(dir_list): for dir in dir_list: if os.path.exists(dir): return dir return None ROOT_DIR = choose_first_existing_dir([ "/local/shared/epitome-polygon-deep-learning", # Inria cluster node nefgpu23 "/home/nigirard/epitome-polygon-deep-learning...
3,439
33.747475
140
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/preprocess_mapping_challenge_multires.py
import sys import os import json import skimage.transform import skimage.draw import numpy as np # from PIL import Image, ImageDraw # Image.MAX_IMAGE_PIXELS = 200000000 import tensorflow as tf import config_mapping_challenge_multires as config sys.path.append("../../../data/mapping_challenge_dataset") import read ...
11,965
43.816479
222
py
mapalignment
mapalignment-master/projects/mapalign/dataset_utils/dataset_multires.py
import sys import os import math import tensorflow as tf sys.path.append("../utils") # Mapalign sub-projects utils import visualization import skimage.io sys.path.append("../../utils") # Projects utils import tf_utils import python_utils # --- Param --- # STRING_QUEUE_CAPACITY = 4000 MIN_QUEUE_EXAMPLES = 2000 #...
27,745
47.422339
197
py
mapalignment
mapalignment-master/projects/mapalign/utils/visualization.py
import os import sys import numpy as np import cv2 current_filepath = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(current_filepath, "../../utils")) import python_utils import polygon_utils # --- Useful when code is executed inside Docker without a display: --- # # Try importing pyplot: di...
13,891
40.717718
173
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/main.py
##### # # Quicky align the OSM data of your images with this script # #### import sys import os import argparse import skimage.io import numpy as np import test sys.path.append("../../utils") import run_utils import print_utils import geo_utils # -- Default script arguments: --- # CONFIG = "config" IMAGE = "geo_im...
8,129
31.390438
176
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/3_test_plot.3_seg.py
import sys import os import matplotlib.pyplot as plt import numpy as np sys.path.append("../../utils") import python_utils # --- Params --- # IOUS_FILENAME_EXTENSION = ".iou.npy" SOURCE_PARAMS_LIST = [ { "name": "Full method", "path": "test/bradbury_buildings.seg.ds_fac_1", "plot_color":...
4,025
31.731707
151
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/5_model_buildings.py
import os.path import numpy as np import bpy, bmesh import config # --- Params --- # OUTPUT_BASE_DIRPATH = os.path.join(config.PROJECT_DIR, "3d_buildings/leibnitz") SCALE = 0.1 IMAGE_HEIGHT = 12360 * 0.5 # In meters IMAGE_WIDTH = 17184 * 0.5 # In meters UV_SCALE = (1 / (IMAGE_HEIGHT * SCALE), 1 / (IMAGE_WIDTH ...
1,792
27.460317
79
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/test.py
import sys import os import numpy as np # Import visualization first as it might change the matplotlib backend sys.path.append("../utils") import visualization import multires_pipeline sys.path.append("../evaluate_funcs") import evaluate_utils sys.path.append("../../utils") import polygon_utils def generate_disp_...
18,905
55.774775
130
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/model_utils.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import sys import tensorflow as tf sys.path.append("../../utils") import tf_utils import print_utils # --- Params --- # DEBUG = False SUMMARY = False # --- --- # def print_debug(obj): if DE...
20,710
44.820796
185
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/2_test_stereo_real_displacements.py
import sys import os import numpy as np import itertools import config import test sys.path.append("../../../data/stereo_dataset") import read sys.path.append("../../utils") import geo_utils # --- Params --- # DATASET_DIR = os.path.join(config.PROJECT_DIR, "../../../data/stereo_dataset") FILE_PARAMS = { "raw_d...
2,916
36.883117
244
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/2_test_bradbury_buildings.align_gt.py
import sys import os import tensorflow as tf import numpy as np import test # CHANGE to the path of your own read.py script: sys.path.append("../../../data/bradbury_buildings_roads_height_dataset") import read as read_bradbury_buildings sys.path.append("../../utils") import run_utils import python_utils import prin...
4,555
36.344262
187
py
mapalignment
mapalignment-master/projects/mapalign/mapalign_multires/loss_utils.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import numpy as np import tensorflow as tf sys.path.append("../../utils") import tf_utils def displacement_error(gt, preds, level_loss_coefs, polygon_map, disp_loss_params): """ :param g...
9,420
44.73301
125
py