AstroChem / vis_sample

Other
13 stars 7 forks source link

Errors thrown trying to use GCF_holder #33

Open seanandrews opened 4 years ago

seanandrews commented 4 years ago

I'm following the code in example (4) in the header of 'vis_sample.py', to save the GCF_holder and corr_cache after running 1 model, and then trying to use them again in a subsequent call for a different model. The 1st vis_sample call (with return_gcf=True, return_corr_cache=True) works perfectly. But the 2nd call (providing the gcf_holder and corr_cache as keywords) fails at line 197. The reason is that the code wants to ascertain the frequency spacings before interpolation, but as far as I can tell from the code, it has not yet bothered to extract frequency information from the gcf_holder.

ryanaloomis commented 4 years ago

Which branch is it throwing the error on? casa6, master, or both?

seanandrews commented 4 years ago

How would I find out? Its just using the pip install vis_sample version. I don't believe I have the casa6 setup, so probably the master.

ryanaloomis commented 4 years ago

Sorry, perhaps naming the python 3 branch casa6 was confusing... I had originally created that branch to allow for CASA 6 compatibility, but it doesn't require CASA 6 as a prereq. If you're just doing pip install, that'll be the latest version of vis_sample, 0.3.3, which corresponds to the casa6 branch on github. The error was likely introduced then in my last few commits - will check into it.

seanandrews commented 4 years ago

Sure, no rush...I can easily/naturally avoid this (the spectral interpolation in repeat vis_sample calls). I suspect it would be straightforward to fix when you do have time (I think you'd need to add a frequency grid attribute to the Gcf_holder class), but perhaps that's for a future release.