jcbird / ppv

Tools for dealing with SDSS-V plate files and plate runs.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

No targetdb tables in /sas/sdss5/target/development/0.1.0/ #9

Closed AxelSchwope closed 3 years ago

AxelSchwope commented 4 years ago

If I understand ppv correctly, I need to read the targetDB file for the cartons I want to inspect. I find the files for mwm_cb_300pc, mwm_cb_cvcandidates, and mwm_cb_gaiagalex, but nor for the uvex cartons. Are these not supposed to be vetted with ppv?

jcbird commented 4 years ago

Hi!

I see the uvex cartons! Go to

https://data.sdss.org/sas/sdss5/target/development/0.1.0/ (this requires the 'standard' survey-wide password for SDSS-IV)

I suggest you get all of your targetDB files from that address as it's the latest version.

AxelSchwope commented 4 years ago

I saw and I see those files (e.g. mwm_cb_uvex1_0.1.0.fits.gz) but there is no associated targetdb file like for all other cartons (e.g. mwm_cb_gaiagalex_0.1.0.fits.gz and mwm_cb_gaiagalex_0.1.0_targetdb.fits.gz). From the tutorial I took that ppv wanted to have the the associated targetdb file, not the other file (without targetdb in its name)

jcbird commented 4 years ago

Looked at the targets file, it has the data you need (catalogid, RA, DEC). Here's how to load it in as a targets object:

from ppv.targets import Targets \ cbuvex_targets_raw = Table.read('/home/jquark/projects/sdss5/ppv/data/raw/mwm_cb_uvex3_0.1.0.fits.gz')\ # colnames is a 3-element list with the column names of the catalogid, RA, and Dec arrays \ cbuvex_targets = Targets(cbuvex_targets_raw, colnames=['catalogid', 'gaia_ra', 'gaia_dec'])

Everything should just work with the cbuvex_targets !

Let me know how this works out for you.

AxelSchwope commented 4 years ago

I do the following

uvex1_targetDB = Table.read('/work1/schwope/sdss5/targeting/targs_0.1.0/mwm_cb_uvex1_0.1.0.fits.gz') uvex1_targets = Targets(uvex1_targetDB, colnames=['catalogid','gaia_ra','gaia_dec']) uvex1_targetDB from ppv.targets import Targets uvex1_targets = Targets(uvex1_targetDB) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/site-packages/ppv-0.0.1-py3.6.egg/ppv/targets.py", line 55, in init File "/usr/lib/python3.6/site-packages/ppv-0.0.1-py3.6.egg/ppv/targets.py", line 81, in _get File "/home/schwope/.local/lib/python3.6/site-packages/astropy/table/table.py", line 1349, in getitem return self.columns[item] File "/home/schwope/.local/lib/python3.6/site-packages/astropy/table/table.py", line 191, in getitem return OrderedDict.getitem(self, item) KeyError: 'ra'

Something does not work. Have to leave now and will be back online in about 1.5 hours

jcbird commented 4 years ago

in your code above, uvex1_targetDB points to the astropy Table that you loaded when you read the fits file. and uvex1_targets points to a ppv Targets object.

so just do:

uvex1_targetDB = Table.read('/work1/schwope/sdss5/targeting/targs_0.1.0/mwm_cb_uvex1_0.1.0.fits.gz') uvex1_targets = Targets(uvex1_targetDB, colnames=['catalogid','gaia_ra','gaia_dec'])

and use uvex1_targets and you should be good to go.

jcbird commented 3 years ago

I think this had been resolved. Reply here again if that's in error! Thanks!