Repository navigation
io.ascii.cds does not implement some aspects of the CDS missing value specification - #1335
Conversation
|
I'm not 100% sure how to interpret "when there is a string of ". Would that be a regex like |
|
That's how it is in this table and that's how I understand their answer. (I know it should be possible to read through their fortran code to see |
|
I've encountered the same (or related) problems in several other CDS tables now, e.g. in table 1 and 2 of: Table 1 form the link above has a related problem. The code for fill values is After all, we don't want to write a CDS table verifier, but a tool that reads all CDS tables hassle free (even if they may not correspond to the published format, but only to the format read by the published fortran code). |
|
@taldcroft |
|
I don't understand what the Travis fails means... advice? |
|
@hamogu - thanks, this looks generally good. The Travis fail is just a random occurrence, probably resource related. When you push up changes in response to my comments then hopefully it will go all the way through with no fails. |
|
I don't want to change the This is mostly a left-over from asciitable, I think, when users could run this without having numpy installed. |
|
For this CDS file the current In the following the output dtype for |
|
What you list above is not a bug, that's a feature :-) OK, seriously, I thought we would still (as we did in asciitable) support reading an ascii file with fill_value value, where the value in question would be replaced and not masked. If that is the case, then "0" would be a very bad fill value for RA, "-99" would be much better (even if it changes the format). Now, as I look for it, I don't see the option that would allow me to read an ascii table with missing values and not get a masked table back. If there is no way to "replace" instead of "mask", then all that matters for a fill value is that it fits the format of the colum, because we never look "behind the mask". That also means that the in I say "almost entirely" because all that matters is that the value has the same type as the remaining column, e.g. float. However, there would be no reason for the user to set it, we could just find the datatype of the list of non-masked entries and use that as column value. (However, changing the definition of the |
We dropped that. If any values match the fill_value
Exactly. That's why we use I think in the asciitable to io.ascii transition we left the fill value stuff exactly for backward compatibility. One thing that has been nagging me forever is the lack of support for automatically setting the numpy masked array
When reading an ASCII table there is no way to specify the |
|
@taldcroft Travis passed for the previous commit and now fails again with something totally unrelated. I set the default to '0', but did not add tests to check if we change any of the column width. Before we do that, we should decide if that is actually a required feature (tests) or just nice to have (no tests). Since not every format expression that could occur in CDS tables has an exact equivalent in python, I don't think we should require that all formats are exactly the same (e.g. what about float precision on 32 vs 64 bit systems - they might differ). If you want, we can add the test for the lengths of string columns. |
|
Looks good to me, merging. |
io.ascii.cds does not implement some aspects of the CDS missing value specification
io.ascii.cds does not implement some aspects of the CDS missing value specification
|
It is an old story... CDS usage asks a specialized understanding.. I expect that it would be improved with the renewal of documentation ! |
I found a machine-readable table on CDS that failed to read with asciitable. I compared that table with the specifications and concluded that the CDS table violated the CDS pecification for machine-readable tables. Thus, I reported this table to CDS. However, in their reply CDS states that my interpretation of the standard is not correct. Apparently, they treat the code of the fortran table reader as the authorative standard and not the documentation on the website.
Thus, this has now to be considered as an
astropy.io.asciibug that should be fixed.My email exchange with the CDS is below.
Hi,
I am using
ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/485/155/table4.dat
and the associated readme file:
ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/485/155/ReadMe
However, my software fails to read this file. Comparing the table with the definition of machine-readable tables at http://cds.u-strasbg.fr/doc/catstd-3.4.htx#NULL
I tracked this down to an error in the ReadMe file.
In the table format description it says there
48- 50 I3 deg Slope ?=- Slope in the K vs. (H-K) diagram
However, in the table NULL values are marked with "--".
Thus, this line should be:
48- 50 I3 deg Slope ?=-- Slope in the K vs. (H-K) diagram
Yours,
Moritz
Dear Moritz,
The expression "?=-" means "no value when there is a string of -".
We don't have problems here with this reference.
As the standards have changed, I suggest you to re-copy the
"anafile" (I suppose that you use it) available at
ftp://cdsarc.u-strasbg.fr/pub/sw/anafile.tar.gz
Sincerely,
Patricia Vannier, CDS