Closed lmichel closed 4 months ago
I guess you're trying to get I/355/gaiadr3
? The valid tables names can be read from VizieR http://vizier.cds.unistra.fr/viz-bin/VizieR?-source=I/355&-to=2
You're right that the method needs a bit of grooming. We can document this better, and we should raise a warning (or even an error?) if the result is empty.
As you know, CutPast is our worse friend...
I rewrote my script:
from mocpy import MOC
for id in ["I/355", "I/355/gaiadr3", "AZERTYUIOP"]:
moc = MOC.from_vizier_table(id)
print(moc)
0/
WARNING: Keyword 'TTYPE1' found more than once in a same HDU! We use the first occurrence.
0/0-11
8/
0/
In this example, I've a valid Vizier catalogue ID (I/355), a valid Vizier table ID (I/355/gaiadr3) and an invalid ID.
However, none of those return any valid MOC
My expectations:
These are all valid MOCs.
0/
)Yes, we plan to raise a warning (or error, not decided yet) for empty MOCs in future versions.
The only correct entry here is I/355/gaiadr3
as it is a VizieR table (not catalog, see the method's name):
from mocpy import MOC
moc = MOC.from_vizier_table("I/355/gaiadr3")
print(moc)
0/0-11
8/
is the expected result. You did not specify the order. The default is 8 so you get a MOC with a max order of 8 (8/
). As the survey covers the whole sky, it has all the cells at order 0 (0/0-11
).
If you want a whole catalog, an undocumented trick is to do
from mocpy import MOC
moc = MOC.from_vizier_table("I/355/*")
print(moc)
That only works because the default of the MOCServer is to return the union of all the MOCs, and here "I/355/*" would match any gaia table.
The warning is upstream. @pferniqu , the FITS file returned by the MOCServer has two TTYPE1
in its header (one is TTYPE1 = 'UNIQ '
and the other is TTYPE1 = 'NPIX '
, see this file CDS_I_355_gaiadr3.zip that I got from Laurent's request)
I support Laurent's request. Giving an invalid VizieR table identifier should return an error, not an empty MOC.
The following code:
Produces the following output files, all with the same size:
None if these MOC files contains data.