You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the eBOSS option of the mocks: see PR desihub/desisim#481 and PR desihub/specsim#100 and issue desihub/desisim#437.
We need a dummy eBOSS fiberpos, I created it via a copy of $DESIMODEL/data/focalplane/fiberpos.fits, keeping only the first two spectrographs, getting a random x and y position within a radius of 325. mm, within the two half-plates.
How @sbailey, do you want me to parse this file?
I was thinking of an option set to None by default, and if given read eBOSS file. Does that sound reasonable? Also where should I copy the fits file?
import fitsio
import scipy as sp
def main():
radius = 325.
outpath = 'eboss_fiberpos.fits'
p = '$DESIMODEL/data/focalplane/fiberpos.fits'
sp.random.seed(42)
h = fitsio.FITS(p)
print(h[1].read_header())
### Store
cat = {}
for k in h[1].get_colnames():
cat[k] = h[1][k][:]
w = cat['SPECTRO']<2
for k in cat.keys():
cat[k] = cat[k][w]
theta = sp.pi*sp.random.rand(500)
r = radius*sp.sqrt(sp.random.rand(500))
x = r*sp.cos(theta)
y = r*sp.sin(theta)
cat['X'][cat['SPECTRO']==0] = x
cat['Y'][cat['SPECTRO']==0] = y
theta = (2*sp.pi-sp.pi)*sp.random.rand(500)+sp.pi
r = radius*sp.sqrt(sp.random.rand(500))
x = r*sp.cos(theta)
y = r*sp.sin(theta)
cat['X'][cat['SPECTRO']==1] = x
cat['Y'][cat['SPECTRO']==1] = y
print(cat['X'],cat['Y'])
import matplotlib.pyplot as plt
plt.errorbar(cat['X'],cat['Y'],fmt='o')
plt.grid()
plt.show()
### Save
out = fitsio.FITS(outpath,'rw',clobber=True)
cols = [ v for v in cat.values() ]
names = [ k for k in cat.keys() ]
out.write(cols,names=names)
out.close()
return
main()
The text was updated successfully, but these errors were encountered:
Could you provide some more context about why we need a fiberpos file for eBOSS when eBOSS doesn't have fiber positioners at fixed locations? i.e. specifically what doesn't work if this file doesn't exist? It smells like we're using the fiber positioners file as a convenience for interpolating x, y, z, platescale, etc. when maybe that should be parameterized differently.
@londumasdesisim.simexp.simulate_spectra() has a specsim_config_file parameter - if that's set to 'eboss' maybe we can force it to generate these fiber positions on the fly, rather than having to add a separate file to desimodel?
For the eBOSS option of the mocks: see PR desihub/desisim#481 and PR desihub/specsim#100 and issue desihub/desisim#437.
We need a dummy eBOSS fiberpos, I created it via a copy of
$DESIMODEL/data/focalplane/fiberpos.fits
, keeping only the first two spectrographs, getting a random x and y position within a radius of325. mm
, within the two half-plates.How @sbailey, do you want me to parse this file?
I was thinking of an option set to
None
by default, and if given readeBOSS
file. Does that sound reasonable? Also where should I copy the fits file?desimodel/py/desimodel/io.py
Line 117 in afc16d2
The text was updated successfully, but these errors were encountered: