tcjansen / GSoC

Google Summer of Code with OpenAstronomy: Extending the capabilities of synphot, a Python package for generating synthetic photometry
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Enhancement: download queries for SDSS filters #1

Closed bmorris3 closed 5 years ago

bmorris3 commented 5 years ago

Enhancement proposal: ultimately you'll be making a PR to astroquery which queries the VO service from the SVO Filter Profile Service 🌈 , but for now, you can do something simpler to retrieve the filter response curves for Sloan filters. Use the astropy.utils.data.download_file function to grab the response curves for each filter from the following links (and remove the step in the tutorial which says 'you can download the filter response curves here...'). The goal here is to avoid including any data files in the PR or requiring the user to manually download something which can be done in the code.

tcjansen commented 5 years ago

Woah, so upon implementing download_file (which works well, yay), I noticed that the SDSS transmissions from SVO are much different from those provided by APO... Is this due to some physical difference between the filters at the two sites (APO and Sloan)? At any rate it unfortunately changes the counts significantly as you can see in the new commit.

tcjansen commented 5 years ago

Also, I thought deleting sdss/ in my local branch and pushing it here would get rid of it remotely but I guess that's not the case... what's the correct/best way of deleting folders remotely?

bmorris3 commented 5 years ago

Also, I thought deleting sdss/ in my local branch and pushing it here would get rid of it remotely but I guess that's not the case... what's the correct/best way of deleting folders remotely?

When you delete the files you must delete them from the command line like this:

git rm sdss/*

This command will still work even if the sdss/ directory is no longer there but you didn't use the git prefix when you rm'ed the files.

bmorris3 commented 5 years ago

Woah, so upon implementing download_file (which works well, yay), I noticed that the SDSS transmissions from SVO are much different from those provided by APO... Is this due to some physical difference between the filters at the two sites (APO and Sloan)? At any rate it unfortunately changes the counts significantly as you can see in the new commit.

Sloan filters should be standardized, so the difference between the SVO files and the ones you had downloaded from the Sloan webpage may be problematic (not your fault, of course).

How much do the counts change? You can drag and drop a copy of the figure file into this thread for ease of chatting about it.

bmorris3 commented 5 years ago

Hmm so I see the difference, it appears to be the difference between the "prime" filters and the not-prime filters. The SVO filter service has the "not-prime" profiles that look like this image whereas the primed filters look like this image

bmorris3 commented 5 years ago

I don't fully understand the difference between the two but I think there is a difference.

bmorris3 commented 5 years ago

Ah! It looks like the history is spelled out here.

bmorris3 commented 5 years ago

Ok, I think the thing to do is this:

tcjansen commented 5 years ago

Hmm, I think I'm misunderstanding something about how to download files. When I copy the link from the APO website and try:

sdss = ['r', 'z']  # only want r- and z-bands for now
apo_sdss_link = 'http://filters.apo.nmsu.edu/curves/SDSS/'

bandpasses = {}
for band in sdss:
    local_path = download_file(apo_sdss_link + band + '.dat')
    bp = SpectralElement.from_file(local_path)

I get a 404 error. I also tried the ftp protocol, which timed out. Got any more hints?

tcjansen commented 5 years ago

(also thanks for your investigation into the filters problem!)

bmorris3 commented 5 years ago

The problem is the link is close but not quite right. You're looking for r.dat and z.dat under: http://filters.apo.nmsu.edu/data/SDSS/

tcjansen commented 5 years ago

Ah! Thank you. Silly.

Hopefully you saw that I emailed SVO. In the meantime I'll query from SDSS as suggested.

bmorris3 commented 5 years ago

Little update for the thread, SVO has been updated to include SDSS primed filters! 🎉