Open dnelson86 opened 7 months ago
Documentation for the structure of such files:
Same result with:
sc = ax.scatter(ds['RA']*ds.ureg['deg'], ds['DEC']*ds.ureg['deg'], s=0.05, c=ds['PI'], rasterized=True)
WARNING:pint.util:Calling the getitem method from a UnitRegistry is deprecated. use `parse_expression` method or use the registry as a callable.
WARNING:pint.util:Calling the getitem method from a UnitRegistry is deprecated. use `parse_expression` method or use the registry as a callable.
/u/dnelson/.local/envs/py3/lib/python3.9/site-packages/numpy/ma/core.py:2820: UnitStrippedWarning: The unit of the quantity is stripped when downcasting to ndarray.
_data = np.array(data, dtype=dtype, copy=copy,
/u/dnelson/.local/envs/py3/lib/python3.9/site-packages/matplotlib/axes/_axes.py:4353: UnitStrippedWarning: The unit of the quantity is stripped when downcasting to ndarray.
c = np.asanyarray(c, dtype=float)
One can test this without units:
ds_nounits = scida.load(path + filename, units=False)
ds = scida.load(path + filename)
which gives the same result except for carrying "unknown units" as a pint.Quantity for
assert np.all(ds.data["RA"].magnitude.compute() == ds.data["RA"].compute())
I would expect this problem to be unrelated to the unit attachment?
In [5]: RA.min()
Out[5]: 126.20363814596136
In [6]: RA.max()
Out[6]: 145.82010938548257
In [7]: DEC.min()
Out[7]: -3.223283315519501
In [8]: DEC.max()
Out[8]: 6.099576083087285
The result is the same with ds = scida.load(path + filename, units=False)
.
Isn't the computed data range correct?
Yes, just the visual plot is wrong. Turning off the aitoff projection with ax = fig.add_subplot(111)
fixes everything, and produces this image (7.6M photons in eFEDS):
Is this just some matplotlib bug, or some strange interaction between scida and matplotlib?
It is the same when you pass these arrays cast to numpy, so I do not think this has anything to do with scida.
Regarding units for eFEDS: If there is no metadata, we do not make an assumption for the units here. We can provide a minimal unit file.
With correct x-axis, and sorting by photon energy:
All 172M photons of the full eRASS1, unfortunately I think (vs Merloni+24 Fig 6) it suffers from a similar bug, i.e. the data should not fill the sky:
Did you check the matplotlib docs? I could imagine it uses radians rather than degrees.
I copied the example code for the SDSS FITS file, for a different file:
which produces the following image:
but the distribution of RA,DEC in this file (in theory) are localized to a small sky region like this:
Is this possibly because the fields in this FITS file have no units?
or possibly something else?