astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
695 stars 397 forks source link

Astropy table downloaded from Gaia fails to write to FITS #1145

Closed adrn closed 2 years ago

adrn commented 6 years ago

I downloaded a table from the Gaia science archive using astroquery, and tried to write it to a FITS file:

from astroquery.gaia import Gaia
query = '''SELECT TOP 10 * FROM gaiadr1.allwise_original_valid'''
job = Gaia.launch_job_async(query)
res = job.get_results()
res.write('/tmp/test.fits')

but get an error:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-148-708d146bcc54> in <module>()
      2 job = Gaia.launch_job_async(query)
      3 res = job.get_results()
----> 4 res.write('/tmp/test.fits')

~/anaconda/lib/python3.6/site-packages/astropy/table/table.py in write(self, *args, **kwargs)
   2558         passed through to the underlying data reader (e.g. `~astropy.io.ascii.write`).
   2559         """
-> 2560         io_registry.write(self, *args, **kwargs)
   2561 
   2562     def copy(self, copy_data=True):

~/anaconda/lib/python3.6/site-packages/astropy/io/registry.py in write(data, format, *args, **kwargs)
    558 
    559     writer = get_writer(format, data.__class__)
--> 560     writer(data, *args, **kwargs)
    561 
    562 

~/anaconda/lib/python3.6/site-packages/astropy/io/fits/connect.py in write_table_fits(input, output, overwrite)
    376 
    377     # Encode any mixin columns into standard Columns.
--> 378     input = _encode_mixins(input)
    379 
    380     table_hdu = table_to_hdu(input, character_as_bytes=True)

~/anaconda/lib/python3.6/site-packages/astropy/io/fits/connect.py in _encode_mixins(tbl)
    353         idxs = list(range(0, len(line) + 70, 70))
    354         lines = [line[i0:i1] + '\\' for i0, i1 in zip(idxs[:-1], idxs[1:])]
--> 355         lines[-1] = lines[-1][:-1]
    356         encode_tbl.meta['comments'].extend(lines)
    357 

IndexError: list index out of range

Is this a bug in the way the table is constructed from the results in astroquery?

I see the word mixin, so I tried converting all columns to plain numpy arrays, and that does seem to work:

for c in tbl.colnames:
    tbl[c] = np.array(tbl[c])
tbl.write('/tmp/test.fits')

This is somewhere between a bug in astroquery and in astropy, so I've opened an issue in both. (see astropy/astropy#7480)

bsipocz commented 2 years ago

I would say this is an astropy issue, either Table or votable. The query's output format is votable, then it's choking on parsing the columns with datatype="char" and parse them into object rather than string types.

The messed up columns are 'designation', 'cc_flags', 'var_flag', 'ph_qual', and here is the original votable

<?xml version="1.0" encoding="UTF-8"?>\n<VOTABLE version="1.3" xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://www.ivoa.net/xml/VOTable/v1.3">\n<RESOURCE type="results">\n<INFO name="QUERY_STATUS" value="OK" />\n\n<INFO name="QUERY" value="SELECT TOP 10 * FROM gaiadr1.allwise_original_valid"><![CDATA[SELECT TOP 10 * FROM gaiadr1.allwise_original_valid]]></INFO>\n<INFO name="CAPTION" value="How to cite and acknowledge Gaia: https://gea.esac.esa.int/archive/documentation/credits.html"><![CDATA[How to cite and acknowledge Gaia: https://gea.esac.esa.int/archive/documentation/credits.html]]></INFO>\n<INFO name="PAGE" value="" />\n<INFO name="PAGE_SIZE" value="" />\n<INFO name="JOBID" value="1645761954060O"><![CDATA[1645761954060O]]></INFO>\n<INFO name="JOBNAME" value="" />\n\n<TABLE>\n<FIELD datatype="long" name="allwise_oid" ucd="meta.id;meta.main">\n<DESCRIPTION>Incremental unique numeric identifier (increasing with declination).\nThis is the only field which was not in the original allWISE catalogue,\nbut was added for cross-match purposes.</DESCRIPTION>\n</FIELD>\n<FIELD arraysize="*" datatype="char" name="designation" ucd="meta.id.cross">\n<DESCRIPTION>Sexagesimal, equatorial position-based source name in the form:\nhhmmss.ss+ddmmss.s.  \nThe full naming convention for AllWISE Source Catalog sources has the\nform  \n\xe2\x80\x9cWISEA Jhhmmss.ss+ddmmss.s,\xe2\x80\x9d where \xe2\x80\x9cWISEA\xe2\x80\x9d indicates the source is from\nthe AllWISE Source Catalog, and \xe2\x80\x9cJ\xe2\x80\x9d indicates the position is J2000. The\n\xe2\x80\x9cWISEA\xe2\x80\x9d acronym is not listed explicitly in the designation column.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="ra" ucd="pos.eq.ra;meta.main" unit="deg" utype="Char.SpatialAxis.Coverage.Location.Coord.Position2D.Value2.C1">\n<DESCRIPTION>J2000 right ascension with respect to the 2MASS PSC reference frame from\nthe non-moving source extraction.  \nThe sky coverage depth for sources in the AllWISE Catalog is\napproximately twice as large in W1 and W2 as it is in W3 and W4. AllWISE\ncombined W1 and W2 Single-exposure images from the WISE 4-Band Cryo,\n3-Band Cryo and NEOWISE Post-Cryo survey phases, and W3 and W4 images\nfrom the 4-Band Cryo phase only. The additional epoch of W1 and W2\ncoverage accenuates the weight of those two bands in determining source\nproperties such as position and motion.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="dec" ucd="pos.eq.dec;meta.main" unit="deg" utype="Char.SpatialAxis.Coverage.Location.Coord.Position2D.Value2.C2">\n<DESCRIPTION>J2000 declination with respect to the 2MASS PSC reference frame from the\nnon-moving source extraction.  \nThe sky coverage depth for sources in the AllWISE Catalog is\napproximately twice as large in W1 and W2 as it is in W3 and W4. AllWISE\ncombined W1 and W2 Single-exposure images from the WISE 4-Band Cryo,\n3-Band Cryo and NEOWISE Post-Cryo survey phases, and W3 and W4 images\nfrom the 4-Band Cryo phase only. The additional epoch of W1 and W2\ncoverage accenuates the weight of those two bands in determining source\nproperties such as position and motion.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="ra_error" ucd="stat.error;pos.eq.ra" unit="arcsec">\n<DESCRIPTION>One-sigma uncertainty in right ascension coordinate from the non-moving\nsource extraction.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="dec_error" ucd="stat.error;pos.eq.dec" unit="arcsec">\n<DESCRIPTION>One-sigma uncertainty in declination coordinate from the non-moving\nsource extraction.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="radec_co_error" ucd="stat.error" unit="arcsec">\n<DESCRIPTION>The co-sigma (radecCoError) of the equatorial position uncertainties\n(raError and decError). Unit arcsec.  \nThe covariance between the position errors, C_{\\alpha \\delta} can be\nderived from the co-sigma by the formula:  \nC_{\\alpha \\delta} = radecCoError * |radecError|.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w1mpro" ucd="phot.mag;em.IR.3-4um" unit="mag">\n<DESCRIPTION>W1 magnitude measured with profile-fitting photometry, or the magnitude\nof the 95% confidence brightness upper limit if the W1 flux measurement\nhas SNR&lt;2. This column is null if the source is nominally detected in\nW1, but no useful brightness estimate could be made. The corresponding\nerror column is null if the W1 profile-fit magnitude is a 95% confidence\nupper limit.  \nCAUTION: WISE profile-fit (w?mpro) measurements are optimized for point\nsources and will systematically underestimate the true flux of resolved\nobjects. If a source entry has extFlag&gt;0, you may wish to examine the\nelliptical aperture photometry which are measured using areas that are\nscaled from 2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w1mpro_error" ucd="stat.error;phot.mag" unit="mag">\n<DESCRIPTION>W1 profile-fit photometric measurement uncertainty in mag units. This\ncolumn is null if the W1 profile-fit magnitude is a 95% confidence upper\nlimit or if the source is not measurable.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w2mpro" ucd="phot.mag;em.IR.4-8um" unit="mag">\n<DESCRIPTION>W2 magnitude measured with profile-fitting photometry, or the magnitude\nof the 95% confidence brightness upper limit if the W2 flux measurement\nhas SNR&lt;2. This column is null if the source is nominally detected in\nW2, but no useful brightness estimate could be made. The corresponding\nerror column is null if the W2 profile-fit magnitude is a 95% confidence\nupper limit.  \nCAUTION: WISE profile-fit (w?mpro) measurements are optimized for point\nsources and will systematically underestimate the true flux of resolved\nobjects. If a source entry has extFlag&gt;0, you may wish to examine the\nelliptical aperture photometry which are measured using areas that are\nscaled from 2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w2mpro_error" ucd="stat.error;phot.mag" unit="mag">\n<DESCRIPTION>W2 profile-fit photometric measurement uncertainty in mag units. This\ncolumn is null if the W2 profile-fit magnitude is a 95% confidence upper\nlimit or if the source is not measurable.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w3mpro" ucd="phot.mag.em.IR.8-15um" unit="mag">\n<DESCRIPTION>W3 magnitude measured with profile-fitting photometry, or the magnitude\nof the 95% confidence brightness upper limit if the W3 flux measurement\nhas SNR&lt;2. This column is null if the source is nominally detected in\nW3, but no useful brightness estimate could be made. The corresponding\nerror column is null if the W3 profile-fit magnitude is a 95% confidence\nupper limit.  \nCAUTION: WISE profile-fit (w?mpro) measurements are optimized for point\nsources and will systematically underestimate the true flux of resolved\nobjects. If a source entry has extFlag&gt;0, you may wish to examine the\nelliptical aperture photometry which are measured using areas that are\nscaled from 2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w3mpro_error" ucd="stat.error;phot.mag" unit="mag">\n<DESCRIPTION>W3 profile-fit photometric measurement uncertainty in mag units. This\ncolumn is null if the W3 profile-fit magnitude is a 95% confidence upper\nlimit or if the source is not measurable.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w4mpro" ucd="phot.mag.em.IR.15-30um" unit="mag">\n<DESCRIPTION>W4 magnitude measured with profile-fitting photometry, or the magnitude\nof the 95% confidence brightness upper limit if the W4 flux measurement\nhas SNR&lt;2. This column is null if the source is nominally detected in\nW4, but no useful brightness estimate could be made. The corresponding\nerror column is null if the W1 profile-fit magnitude is a 95% confidence\nupper limit.  \nCAUTION: WISE profile-fit (w?mpro) measurements are optimized for point\nsources and will systematically underestimate the true flux of resolved\nobjects. If a source entry has extFlag&gt;0, you may wish to examine the\nelliptical aperture photometry which are measured using areas that are\nscaled from 2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w4mpro_error" ucd="stat.error;phot.mag" unit="mag">\n<DESCRIPTION>W4 profile-fit photometric measurement uncertainty in mag units. This\ncolumn is null if the W4 profile-fit magnitude is a 95% confidence upper\nlimit or if the source is not measurable.</DESCRIPTION>\n</FIELD>\n<FIELD arraysize="*" datatype="char" name="cc_flags" ucd="meta.code">\n<DESCRIPTION>Contamination and confusion flag.  \nFour character string, one character per band [W1/W2/W3/W4], that\nindicates that the photometry and/or position measurements of a source\nmay be contaminated or biased due to proximity to an image artifact.  \nThe type of artifact that may contaminate the measurements is denoted by\nthe following codes. Lower-case letters correspond to instances in which\nthe source detection in a band is believed to be real but the\nmeasurement may be contaminated by the artifact. Upper-case letters are\ninstances in which the source detection in a band may be a spurious\ndetection of an artifact.\n\n-   D,d - Diffraction spike. Source may be a spurious detection of (D)\n    or contaminated by (d) a diffraction spike from a nearby bright star\n    on the same image, or\n\n-   P,p - Persistence. Source may be a spurious detection of (P) or\n    contaminated by (p) a short-term latent image left by a bright\n    source, or\n\n-   H,h - Halo. Source may be a spurious detection of (H) or\n    contaminated by (h) the scattered light halo surrounding a nearby\n    bright source, or\n\n-   O,o (letter \xe2\x80\x9co\xe2\x80\x9d) - Optical ghost. Source may be a spurious detection\n    of (O) or contaminated by (o) an optical ghost image caused by a\n    nearby bright source, or\n\n-   0 (number zero) - Source is unaffected by known artifacts.\n\nA source extraction may be affected by more than one type of artifact or\ncondition. In this event, the ccFlags value in each band is set in the\nfollowing priority order: D,P,H,O,d,p,h,o,0.  \nA source can appear in the AllWISE Source Catalog even if it is flagged\nas a spurious artifact detection in a band if there is a reliable\ndetection in another band that is not flagged as a spurious artifact\ndetection.  \nCAUTION: Non-zero ccFlags values in any band indicate the the\nmeasurement in that band may be contaminated and the photometry should\nbe used with caution.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="short" name="ext_flag" ucd="meta.code">\n<DESCRIPTION>Extended source flag.  \nThis is an integer flag, the value of which indicates whether or not the\nmorphology of a source is consistent with the WISE point spread function\nin any band, or whether the source is associated with or superimposed on\na previously known extended object from the 2MASS Extended Source\nCatalog (XSC).  \nThe values of the extFlag indicate the following conditions:\n\n-   0 - The source shape is consistent with a point-source and the\n    source is not associated with or superimposed on a 2MASS XSC source\n\n-   1 - The profile-fit photometry goodness-of-fit is &gt;3.0 in one or\n    more bands.\n\n-   2 - The source falls within the extrapolated isophotal footprint of\n    a 2MASS XSC source.\n\n-   3 - The profile-fit photometry goodness-of-fit is &gt;3.0 in one or\n    more bands, and the source falls within the extrapolated isophotal\n    footprint of a 2MASS XSC source.\n\n-   4 - The source position falls within 5 arcsec of a 2MASS XSC source.\n\n-   5 - The profile-fit photometry goodness-of-fit is &gt;3.0 in one or\n    more bands, and the source position falls within 5 arcsec of a 2MASS\n    XSC source.\n\nCAUTION: WISE profile-fit (w?mpro) measurements are optimized for point\nsources and will systematically underestimate the true flux of resolved\nobjects. If a source entry has extFlag&gt;0, you may wish to examine the\nelliptical aperture photometry which are measured using areas that are\nscaled from 2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD arraysize="*" datatype="char" name="var_flag" ucd="meta.code;src.var">\n<DESCRIPTION>Variability flag.  \nThe variability flag is a four-character string, one character per band,\nin which the value for each band is related to the probability that the\nsource flux measured on the individual WISE exposures was not constant\nwith time.  \nThe probability is computed for a band only when there are at least six\nsingle-exposure measurements available that satisfy minimum quality\ncriteria.  \nA value of \xe2\x80\x9cn\xe2\x80\x9d in a band indicates insufficient or inadequate data to\nmake a determination of possible variability.  \nValues of \xe2\x80\x9c0\xe2\x80\x9d through \xe2\x80\x9c9\xe2\x80\x9d indicate increasing probabilities of\nvariation. Values of \xe2\x80\x9c0\xe2\x80\x9d through \xe2\x80\x9c5\xe2\x80\x9d are most likely not variables.  \nSources with values of \xe2\x80\x9c6\xe2\x80\x9d and \xe2\x80\x9c7\xe2\x80\x9d are likely flux variables, but are\nthe most susceptible to false-positive variability.  \nVarFlag values greater than \xe2\x80\x9c7\xe2\x80\x9d have the highest probability of being\ntrue flux variables in a band.  \nCAUTION: Estimation of flux variability is unreliable for sources that\nare extended (extFlag&gt;0), and sources whose measurements are\ncontaminated by image artifacts in a band (ccFlags[band] != 0).</DESCRIPTION>\n</FIELD>\n<FIELD arraysize="*" datatype="char" name="ph_qual" ucd="meta.code.qual;phot">\n<DESCRIPTION>Photometric quality flag.  \nFour character flag, one character per band [W1/W2/W3/W4], that provides\na shorthand summary of the quality of the profile-fit photometry\nmeasurement in each band, as derived from the measurement\nsignal-to-noise ratio.\n\n-   A - Source is detected in this band with a flux signal-to-noise\n    ratio &gt;10.\n\n-   B - Source is detected in this band with a flux signal-to-noise\n    ratio 3&lt;snr&lt;10.\n\n-   C - Source is detected in this band with a flux signal-to-noise\n    ratio 2&lt;snr&lt;3.\n\n-   U - Upper limit on magnitude. Source measurement has w?snr&lt;2. The\n    profile-fit magnitude w?mpro is a 95% confidence upper limit.\n\n-   X - A profile-fit measurement was not possible at this location in\n    this band. The value of w?mpro and w?sigmpro will be \xe2\x80\x9cnull\xe2\x80\x9d in this\n    band.\n\n-   Z - A profile-fit source flux measurement was made at this location,\n    but the flux uncertainty could not be measured. The value of\n    w?sigmpro will be \xe2\x80\x9cnull\xe2\x80\x9d in this band. The value of w?mpro will be\n    \xe2\x80\x9cnull\xe2\x80\x9d if the measured flux, w?flux, is negative, but will not be\n    \xe2\x80\x9cnull\xe2\x80\x9d if the flux is positive. If a non-null magnitude is present,\n    it corresponds to the true flux, and not the 95% confidence upper\n    limit. This occurs for a small number of sources found in a narrow\n    range of ecliptic longitude which were covered by a large number of\n    saturated pixels from 3-Band Cryo single-exposures.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w1mjd_mean" ucd="stat.mean" unit="d">\n<DESCRIPTION>The average modified Julian Date (mJD) of the W1 single-exposures\ncovering the source.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w2mjd_mean" ucd="stat.mean" unit="d">\n<DESCRIPTION>The average modified Julian Date (mJD) of the W2 single-exposures\ncovering the source.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w3mjd_mean" ucd="stat.mean" unit="d">\n<DESCRIPTION>The average modified Julian Date (mJD) of the W3 single-exposures\ncovering the source.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w4mjd_mean" ucd="stat.mean" unit="d">\n<DESCRIPTION>The average modified Julian Date (mJD) of the W4 single-exposures\ncovering the source.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w1gmag" ucd="phot.mag;em.IR.3-4um" unit="mag">\n<DESCRIPTION>W1 magnitude of source measured in the elliptical aperture.  \nWISE profile-fit (w?mpro) measurements are optimized for point sources\nand will systematically underestimate the true flux of resolved objects.\nIf a source entry has extFlag&gt;0, you may wish to examine the elliptical\naperture photometry which are measured using areas that are scaled from\n2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w1gmag_error" ucd="stat.error" unit="mag">\n<DESCRIPTION>Uncertainty in the W1 magnitude of source measured in elliptical\naperture.  \nCAUTION: A w1gerr value of 9.999 indicates that the measurement\nuncertainty is very large, or the uncertainty could not be computed. In\neither case, the w1gmag measurement should be considered highly suspect.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w2gmag" ucd="phot.mag;em.IR.4-8um" unit="mag">\n<DESCRIPTION>W2 magnitude of source measured in the elliptical aperture.  \nWISE profile-fit (w?mpro) measurements are optimized for point sources\nand will systematically underestimate the true flux of resolved objects.\nIf a source entry has extFlag&gt;0, you may wish to examine the elliptical\naperture photometry which are measured using areas that are scaled from\n2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w2gmag_error" ucd="stat.error" unit="mag">\n<DESCRIPTION>Uncertainty in the W2 magnitude of source measured in elliptical\naperture.\n\nCAUTION: A w2gerr value of 9.999 indicates that the measurement\nuncertainty is very large, or the uncertainty could not be computed. In\neither case, the w2gmag measurement should be considered highly suspect.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w3gmag" ucd="phot.mag;em.IR.8-15um" unit="mag">\n<DESCRIPTION>W3 magnitude of source measured in the elliptical aperture.  \nWISE profile-fit (w?mpro) measurements are optimized for point sources\nand will systematically underestimate the true flux of resolved objects.\nIf a source entry has extFlag&gt;0, you may wish to examine the elliptical\naperture photometry which are measured using areas that are scaled from\n2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w3gmag_error" ucd="stat.error" unit="mag">\n<DESCRIPTION>Uncertainty in the W3 magnitude of source measured in elliptical\naperture.\n\nCAUTION: A w3gerr value of 9.999 indicates that the measurement\nuncertainty is very large, or the uncertainty could not be computed. In\neither case, the w3gmag measurement should be considered highly suspect.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w4gmag" ucd="phot.mag;em.IR.15-30um" unit="mag">\n<DESCRIPTION>W4 magnitude of source measured in the elliptical aperture.  \nWISE profile-fit (w?mpro) measurements are optimized for point sources\nand will systematically underestimate the true flux of resolved objects.\nIf a source entry has extFlag&gt;0, you may wish to examine the elliptical\naperture photometry which are measured using areas that are scaled from\n2MASS XSC morphologies.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="double" name="w4gmag_error" ucd="stat.error" unit="mag">\n<DESCRIPTION>Uncertainty in the W4 magnitude of source measured in elliptical\naperture.\n\nCAUTION: A w4gError value of 9.999 indicates that the measurement\nuncertainty is very large, or the uncertainty could not be computed. In\neither case, the w4gmag measurement should be considered highly suspect.</DESCRIPTION>\n</FIELD>\n<FIELD datatype="long" name="tmass_key" ucd="meta.id.assoc">\n<DESCRIPTION>2MASS PSC association.  \nUnique identifier of the closest source in the 2MASS Point Source\nCatalog (PSC) that falls within 3 arcsec of the non-motion fit position\nof this WISE source. This is equivalent to the pts_key in the 2MASS PSC\nentry.  \nThis column is \xe2\x80\x9cnull\xe2\x80\x9d if there is no 2MASS PSC source within 3 arcsec of\nthe WISE source position.</DESCRIPTION>\n</FIELD>\n<DATA>\n<BINARY2>\n<STREAM encoding=\'base64\'>\nACoB/wAAAAAG/ouEAAAAE0oxMDA0NDguODktNDYxNTEzLjlAYuaFAceAXcBHIH7u\n82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AAAAAAAAH/4AAAAAAAAf/gAAAAAAAB/+AAAAAAAAH/4AAAAAAAAf/gA\nAAAAAAB/+AAAAAAAAAAAAAAAAAAAACoB/wAAAAAHlHmBAAAAE0oxMzU2MDUuMjUt\nNDQxODA3LjFAaiCzfJmuksBGJqcSKCCwP+DrHEMspXo/4pN0vGp++j+3bItDlYEG\nQDGWBBiTdLw/xysCDEm6XkAxOZmZmZmaf/gAAAAAAABAKgEGJN0vG3/4AAAAAAAA\nQCKan752yLR/+AAAAAAAAAAAAAQwMDAwAAAAAAAEbm5ubgAAAARCVVVVQOsCfMUq\nVpZA6wJ8xSpWlkDrAgoG7XpBQOsCCgbtekF/+AAAAAAAAH/4AAAAAAAAf/gAAAAA\nAAB/+AAAAAAAAH/4AAAAAAAAf/gAAAAAAAB/+AAAAAAAAH/4AAAAAAAAAAAAAAAA\nAAA=\n</STREAM>\n</BINARY2>\n</DATA>\n</TABLE>\n</RESOURCE>\n</VOTABLE>

I would simply suggest saving it out to a votable rather than a fits file, then you would still have them as object, but at least within the astropy world they round trip.