Skip to content

Commit

Permalink
Modified the IRTF reading to handle properly the data type of the flux.
Browse files Browse the repository at this point in the history
  • Loading branch information
bretonr committed Oct 27, 2015
1 parent 2bd9b11 commit 6515d4d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Atmosphere/Atmo_spectro_IRTF.py
Expand Up @@ -333,13 +333,9 @@ def Read_IRTF(fln, oversample=None, sigma=None, tophat=None, thin=None, wave_cut
## The wavelength is contained in the first column and the flux in the second.
wav, grid = np.loadtxt(fln, usecols=(0,1), unpack=True)

## Grid values are log10(F_lambda) [cgs]
#grid = 10**grid * 4/cts.PI**2 # Conversion to flux units (make sure that in the Get_flux routine does not re-correct again!)
#grid = (2 / cts.PI / np.sqrt(3)) * 10**grid
#grid = (2 / cts.PI / np.sqrt(3)) * grid
## NOT COMPLETELY CERTAIN
## BUT: if the values are stored in log10(F_lambda) [cgs], then we need to convert as np.log(10**grid) to be usable by our scripts
grid = grid * np.log(10)
## Data file values are stored in F_lambda [cgs]
## For the grid, we store values in log(F_lambda) [log(cgs)] -- natural log -- and then the interpolator interpolates and exponentiates them because summing over the surface elements.
grid = np.log(grid)

## Wavelengths are often not ordered so we re-order them
inds = wav.argsort()
Expand Down

0 comments on commit 6515d4d

Please sign in to comment.