Skip to content

Commit

Permalink
Merge branch 'main' into issue_338
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofle authored Oct 9, 2024
2 parents 956b3dc + 21a520b commit 6baa84d
Show file tree
Hide file tree
Showing 8 changed files with 2,450 additions and 181 deletions.
873 changes: 873 additions & 0 deletions notebooks/developer/test_nodding.py

Large diffs are not rendered by default.

31 changes: 14 additions & 17 deletions notebooks/developer/test_smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@
import numpy as np
import matplotlib.pyplot as plt


from specutils import Spectrum1D
import astropy.units as u
import numpy as np
from astropy.io import fits
from specutils import Spectrum1D
from specutils.manipulation import box_smooth, gaussian_smooth, trapezoid_smooth

import matplotlib.pyplot as plt

from dysh.fits.sdfitsload import SDFITSLoad
from dysh.fits.gbtfitsload import GBTFITSLoad
import dysh.util as util
from dysh.util.selection import Selection
from dysh.util.files import dysh_data


def parr(data, n, w=1):
""" print values of an array +/-w around n
"""
print(data[n-w:n+w+1])


#%% testing simple spectra; but we're not using specutils anymore
#%% testing simple spectra; even though we're not using specutils anymore

spec1 = Spectrum1D(spectral_axis=np.arange(1, 50) * u.nm, flux=np.random.default_rng(12345).random(49)*u.Jy)

Expand All @@ -31,19 +38,10 @@ def parr(data, n, w=1):

#%% testing using a PS

import numpy as np
import numpy.ma as ma
from scipy.stats import norm
import astropy.units as u
from astropy.io import fits
import matplotlib.pyplot as plt
from dysh.fits.sdfitsload import SDFITSLoad
from dysh.fits.gbtfitsload import GBTFITSLoad
import dysh.util as util
from dysh.util.selection import Selection


f1 = util.get_project_testdata() / 'TGBT21A_501_11/TGBT21A_501_11.raw.vegas.fits'
# s1 = SDFITSLoad(f1)
f1 = dysh_data(test="getps")

sdf1 = GBTFITSLoad(f1)
sdf1.info()
Expand Down Expand Up @@ -74,7 +72,7 @@ def parr(data, n, w=1):
example1=\
"""
filein,"TGBT21A_501_11.raw.vegas.fits"
getps,152,ifnum=0,plnum=0,intnum=0
getps,152,ifnum=0,plnum=0,intnum=0
fileout,"TGBT21A_501_11_getps_scan_152_intnum_0_ifnum_0_plnum_0.fits"
keep
"""
Expand All @@ -92,7 +90,6 @@ def parr(data, n, w=1):
d2g = fits.open(util.get_project_testdata() / base1g)[1].data['DATA'][0]
d2s = fits.open(util.get_project_testdata() / base1s)[1].data['DATA'][0]


e2 = d1-d2
e2b = (d1b-d2b)
e2h = (d1h-d2h)
Expand Down
566 changes: 566 additions & 0 deletions notebooks/examples/nodding.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 6baa84d

Please sign in to comment.