mzechmeister / serval

calculate radial velocities from stellar spectra
MIT License
36 stars 9 forks source link

TypeError while running SERVAL #58

Closed redeaglekr closed 1 year ago

redeaglekr commented 1 year ago

Hi,

I tried to run SERVAL on a set of NRES spectra using the command;

serval starname data/stname_new/spectras -inst ABC -targ XYZ

Contrary to previous times, this gives an error;

Traceback (most recent call last): File "servalhome/serval//src/serval.py", line 2744, in serval() File "/servalhome/serval//src/serval.py", line 1190, in serval sp = Spectrum(filename, inst=inst, pfits=2 if 'HARPS' in inst.name else True, drs=drs, fib=fib, targ=targ, verb=True) File "/servalhome/serval/src/readspec.py", line 196, in init (, self.bjd, _), (self.berv_start, self.berv, self.berv_end) = brv_we14py.bjdbrv(jd_utc=jd_utcs, ra=ra, dec=de, obsname=obsname, pmra=targ.pmra, pmdec=targ.pmde, parallax=0., rv=0., zmeas=[0], leap_update=False, **obsloc) File "/servalhome/serval/src/brv_we14py.py", line 64, in bjdbrv loc = coord.EarthLocation.from_geodetic(lon, lat, height=elevation) File "/.local/lib/python3.8/site-packages/astropy/coordinates/earth.py", line 301, in from_geodetic height = u.Quantity(height, u.m, copy=False) File "/.local/lib/python3.8/site-packages/astropy/units/quantity.py", line 509, in new raise TypeError("The value must be a valid Python or " TypeError: The value must be a valid Python or Numpy numeric type.

It would be great if you could help me to fix this...

mzechmeister commented 1 year ago

Sorry, for not responding. I didn't got a notification, when the issue was opened, only when closed. I don't get this problem. Maybe you can comment, how the issue was solved.

redeaglekr commented 1 year ago

Hi,

No problem.. It was actually a small bug in the inst_NRES.py file. There are 3 telescopes at different locations. But, it was only considering two locations. I changed the code in order to facilitate 3, but made a mistake by not declaring "obsloc" as global. Now it works fine!

mzechmeister commented 1 year ago

Alright. If you like, you can make a pull request with your modified code.