Skip to content

Support for NewEra Grids? #25

@TylerFair

Description

@TylerFair

Hi,

I am trying to use MSG for stellar grid interpolation, and was trying to set up the initial specint format for the NewEra grid, but had some difficulty. I was wondering if there was an existing converting module or whether one needs to be created for the new set of grids on the MSG grid list for NewEra (e.g. bottom of http://user.astro.wisc.edu/~townsend/static.php?ref=msg-grids). I'm specifically interested in the NewEra JWST list, but I don't see a straightforward way to work with them. I've put in a code block below how the authors access the data cube.

import numpy as np
import io
import sys
import glob


# example to read the very first spectrum from the GAIA format 
# files of the NewEra grid 

filename = 'PHOENIX-NewEraV3-JWST-SPECTRA.Z-0.0.txt'

f = open(filename,'r')

zeile = f.readline()
helper = np.loadtxt(io.StringIO(zeile),dtype=('S41'),unpack=True)

res = float(helper[7]) # resolution in nm
nwl = int(helper[8])   # number of wavelength points
wlstart = float(helper[9]) # starting wavelength in nm
wlend = float(helper[10])  # final  wavelength in nm
wl_steps = float(helper[11]) # wavelength steps in nm

teff = float(helper[12])
logg  = float(helper[13])
vturb  = float(helper[14])
Y  = float(helper[16])
Z  = float(helper[17])

feref = float(helper[18])
alpha_scale = float(helper[19])

cAbund = float(helper[20])
nAbund = float(helper[21])
oAbund = float(helper[22])
mgAbund = float(helper[23])
siAbund = float(helper[24])
caAbund = float(helper[25])
feAbund = float(helper[26])

mass = float(helper[27])


wl = np.linspace(wlstart,wlend,num=int((wlend-wlstart)/res)+1)
if(nwl != wl.shape[0]): print(nwl,wl.shape[0])

fl = np.array(nwl)

zeile = f.readline()
fl = np.loadtxt(io.StringIO(zeile),unpack=True)

# convert wl and fl to the units that the gods intended:
wl = 10.*wl            # Angstroem
fl = fl*1e10           # erg/s/cm/cm^2

f.close()

Obviously most of this can be dropped if one only cares about wavelength and flux, but the units also may be slightly off the expected format.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions