ashleychontos / pySYD

automated measurements of global asteroseismic parameters

Home Page:https://pysyd.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An incomprehensible error when using star_info.csv to run

diyiliaoya opened this issue · comments

Hi ashleychontos,

This happened when I run TIC140938975.
When I run the command with the following arguments in the command line, there are no issues with the result:
pysyd run --star 140938975 --sp 0.5 --lx 15
But when I run the command with the arguments placed in star_info.csv, the following error occurs
Traceback (most recent call last):
File "/home/lishijie/anaconda3/envs/pySYD-env/bin/pysyd", line 8, in
sys.exit(main())
^^^^^^
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/cli.py", line 663, in main
args.func(args)
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/pipeline.py", line 193, in run
_pipe(args.stars, params)
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/pipeline.py", line 133, in _pipe
star.process_star()
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/target.py", line 157, in process_star
self.derive_parameters()
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/target.py", line 991, in derive_parameters
self.first_step()
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/target.py", line 1173, in first_step
self.global_fit()
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/target.py", line 1568, in global_fit
self.frequency_spacing()
File "/home/lishijie/anaconda3/envs/pySYD-env/lib/python3.11/site-packages/pysyd/target.py", line 1752, in
frequency_spacing
l, a = pl.pop(idx), pa.pop(idx)
^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

140938975_LC.txt
140938975_PS.txt

Hi there @diyiliaoya, thank you for bringing this to my attention!

A couple quick questions:

  • what version of pysyd are you using?
  • does the same error occur if you use python3.8, 3.9 or 3.10? I ask because the unitests run on only those 3 versions so if it's related to this, I'd like to update the compatibility.

Hi there @diyiliaoya, thank you for bringing this to my attention!

A couple quick questions:

  • what version of pysyd are you using?
  • does the same error occur if you use python3.8, 3.9 or 3.10? I ask because the unitests run on only those 3 versions so if it's related to this, I'd like to update the compatibility.

pysyd=6.10.5
the same error occur when I use python 3.8, 3.9, 3.10

commented

Hi @ashleychontos ,

I found a similar error when running the star KIC 1028267. Tracing back, the error was found to be with the auto correlation function (attached plot) not having enough peaks, when comparing with the auto correlation function of KIC 1027337 (for whom PySYD worked well!). Looking at the code, I understand that lack of enough peaks maybe the reason why the function "_max_elements" fail ? ":thinking_face"
autoact_1027337
autoact_1028267

Thanks @redeaglekr for looking into this and that sounds like a very plausible explanation. One way around this would be to crank down the smoothing of the power spectrum (i.e. --sp via command line). By default it is 2.5 muHz, which works well for less evolved stars but based on your provided ACF (x-axis values)... it looks like your star may be more evolved. If it's over-smoothing the PS, that will remove most features in the ACF >> and thus, leading to this error. One can also try changing '--npeaks' if that really is the problem.

However, what @diyiliaoya brought up is an inconsistency with how the program operates on a more macro level. I agree that what @redeaglekr suggested is probably what happened in the second scenario the caused the original issue, meaning that the '--sp 0.5' probably didn't read in properly from the star_info.csv file.

Just a heads up to you both that I am currently working on the way the inputs are handled, which may ultimately solve this problem.... unless @diyiliaoya you've figured out an alternate solution?