Changeset 37504
- Timestamp:
- Oct 20, 2014, 2:37:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mops/mops_ringsv3/populate_ringsv3_database.py
r37503 r37504 1 #!/usr/bin/env python 1 #!/usr/bin/env python2.7 2 2 3 3 import MySQLdb … … 42 42 fits = pyfits.open(tesselation) 43 43 table = fits[1].data 44 raProjectionCenterRadians = numpy.radians(table ['crval1'])44 raProjectionCenterRadians = numpy.radians(table.field('CRVAL1')) 45 45 craProjectionCenter = numpy.cos(raProjectionCenterRadians) 46 46 sraProjectionCenter = numpy.sin(raProjectionCenterRadians) 47 decProjectionCenterRadians = numpy.radians(table ['crval2'])47 decProjectionCenterRadians = numpy.radians(table.field('CRVAL2')) 48 48 cdecProjectionCenter = numpy.cos(decProjectionCenterRadians) 49 49 sdecProjectionCenter = numpy.sin(decProjectionCenterRadians) 50 data = [ table ['name'],51 table ['crval1'], craProjectionCenter, sraProjectionCenter,52 table ['crval2'], cdecProjectionCenter, sdecProjectionCenter,53 table ['crpix1'], table['crpix2'],50 data = [ table.field('NAME'), 51 tablefield('CRVAL1'), craProjectionCenter, sraProjectionCenter, 52 tablefield('CRVAL2'), cdecProjectionCenter, sdecProjectionCenter, 53 tablefield('CRPIX1'), tablefield('CRPIX2'), 54 54 ] 55 55 cursor = database.cursor()
Note:
See TracChangeset
for help on using the changeset viewer.
