Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLSR #19

Merged
merged 4 commits into from
Jul 18, 2021
Merged

VLSR #19

merged 4 commits into from
Jul 18, 2021

Conversation

kevinawilson
Copy link
Contributor

@kevinawilson kevinawilson commented Jul 9, 2021

I've added the ability to adjust for VLSR in the calibrated plot. I haven't gone through and updated the docs or the version number yet. I wanted to give you a chance to look the code over and perhaps test it first.

To place the reading in the VLSR reference frame, the program needs to know three pieces of information: the observer's location (in longitude, latitude, and elevation), the target of the observation, and the time of the observation. Time is already recorded in the header files, but the others needed to be added. They are passed into the observe() function as obs_parameters.

For the target, two options are available for representing the target coordinates. The coordinates can be given in ra/dec, which will work best for single observations or tracked observations. The coordinates can also be given in alt/az. This allows the telescope to perform drift scans. Since the program knows the observer's location and the time, it can convert the alt/az for each reading into ra/dec.

If someone passes in both ra/dec and alt/az as parameters, the program will use alt/az.

To perform a plot in VLSR, the parameter vlsr=True should be passed with the plot. The default is vlsr=False. I have updated the title of the calibrated plot so it indicates when the plot is in VLSR.

I've also added a way for users to control the limits of the y-axis on the calibrated plot. Passing in cal_ylim=[N1,N2] will set the lower limit to N1 and the upper limit to N2. If no parameter or cal_ylim=[0,0] is passed, the program will choose the appropriate limits on the basis of the data.

Let me know if this is a direction you would like to go.

Will resolve #18 and #16.

@0xCoto
Copy link
Owner

0xCoto commented Jul 9, 2021

I don't have time to test this, but looks interesting!

Two minor suggestions that you may disregard if you want:

  • VLSR parameters should probably be passed in virgo.plot but not as obs_parameters, because this gives the impression that the VLSR parameters affect the acquisition as well. Adjust that if you want, or leave it as-is, doesn't really bother me to be honest.
  • Does cal_ylim only apply ylim to the calibrated spectrum? Can we rename this parameter slightly so it also affects averaged spectrum?

@kevinawilson
Copy link
Contributor Author

I included the VLSR parameters in obs_parameters so they could serve as metadata for the observation (just as the time does). My horn antenna is portable, so I set it up in different places for different readings. It helps to have the location saved as part of the reading. And since I often take multiple readings of different targets, it is handy to have the target noted, especially since I often don't get a chance to plot the observations for a few days. This also makes the data more sharable, since I could pass the observation files to someone else and they would know the date, time, location, and target of the reading.

To avoid the impression that the loc, ra/dec, and alt/az affect the acquisition, we should specify these parameters are optional in the documentation.

Another way to do it would be for those parameters to be passed in as part of virgo.observe() but still saved in the header file. I had passed them in as obs_parameters because everything else that was saved in the headers was also passed in that way.

Let me know which way you want to go.

cal_ylim only applies to the calibrated spectrum. I agree that we should have a way to specify the y-axis limits for the averaged spectrum. We can't use the same value, because the two axes measure different things (i.e., dB and S/N). I'll try to add a second variable called avg_ylim in the next few days that does the same thing for the average spectrum.

@0xCoto
Copy link
Owner

0xCoto commented Jul 9, 2021

You're absolutely right, I confused ylim with xlim (which does share a common frequency unit: MHz). All good then, thanks! Let me know if you'd like me to merge this now or wait for the avg_ylim addition; I don't mind either way!

@kevinawilson
Copy link
Contributor Author

Let's wait on the avg_ylim.

@0xCoto 0xCoto merged commit e39c292 into 0xCoto:master Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VLSR
2 participants