All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added for new features.
- Changed for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for now removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.
- in space MOCs: upper right corner of a zone can now have a longitude of 360° [#180]
- Add support of
regions.Regions
[#163] - Add option to turn off optimization in
fill
. The optimization degrades MOCs that are way more precise than the given WCS [#166] - Creation of a MOC from a zone (defined by min/max ra and dec)
MOC.from_zone
- Creation of a single MOC from a lot of cones/boxes is faster with the new option in
MOC.from_cones
/MOC.from_boxes
: the keyword 'union_strategy' can now take the value 'small_cones'/'small_boxes' or 'large_cones'/'large_boxes'. Small cones/boxes is faster for non-overlapping cones/boxes. MOC.from_fits_images
can now loop through the HDUList to only keep images with the parameterhdu_index
set to -1 [#110]MOC.from_fits_image
now has an 'approximate' option that returns a rough approximation of the footprint of the image data from the corners of a square deduced from its WCS and does not apply any mask.
- fix healpix order corresponding to 1 pixel on the image calculation in
MOC.from_fits_image
[#169] MOC.from_fits_images
will return an empty MOC and emit a warning if there are no images in the FITS file instead of returning an error.
MOC.from_astropy_regions
now acceptsEllipseSkyRegion
andRectangleSkyRegion
where width > height.
from_healpix_cells
andfrom_valued_healpix_cells
accept order zero cells again
MOC.mask_uniq
allows to mas an array of uniq cells with a MOCMOC.values_and_weights_in_multiorder_map
allows to filter a multiordermap by a MOC with weights corresponding to the area of the cells intersecting the MOC and the multiordermap- the
mocpy.WCS
class can now accept a sequence of angles as its fov argument rather than always representing square areas of the sky. MOC.from_polygons
andMOC.from_polygons
now accept a booleancomplement
that allows to chose between the small MOC described by the polygon or the bigger one (its complement)- implement multi-moc operations on STMOCs (ex: stmoc1.union(stmoc2, stmoc3, ...)) for
union
,intersection
, anddifference
MOC.from_healpix_cells
also accepts an int as depth if all the cells are at the same levelMOC.from_vizier_table()
does not call the MOCServer anymore. It now raises an error if the catalog of table name is invalid (see #143). It also acceptsmax_depth
as an argument. This should replacenside
in a future version.MOC.from_ivorn()
now acceptsmax_depth
as an argument. This should reb=placenside
later.
ranges
infrom_depth29_ranges
is now optional, to be consistent with the existing docstringfrom_healpix_cells
andfrom_valued_healpix_cells
now filter out invalid cells and raise a warning when they do so- fix multimoc operations (were all failing with a TypeError) [#153]
- a new method
MOC.from_cones
allows to create a list of MOCs from a list of centers and radii. This is multi-threaded. - new method
MOC.from_boxes
allows to create lists of MOCs from boxes. This is multi-threaded.
MOC.from_polygons
now accepts list of coordinates (that it assumes to be in degrees and ICRS frame) rather than only lists of SkyCoord objects [#137]
MOC.border
no does not attempt on plotting the border when the MOc is out of the view anymore.- fix an issue where the number of references to the rust side was not incremented when a moc was created from a pickle file. This also solves a lot of issues with the multiprocessing module that calls pickle behind the scenes.
MOC.sum_in_multiordermap
takes an astropy table with aUNIQ
column and a column name to sum. It returns the sum of the column in the intersection between the MOC and the Multi-order-map.MOC.probability_in_multiordermap
has a similar behavior but also converts a probability-density into a probability.- added
MOC.probabilities_in_multiordermap
, which is a multithreaded (on the Rust side) version ofMOC.probability_in_multiordermap
. MOC.from_polygons
now allows to create more efficiently some SpaceMOCs from a list a of polygons.STMOC.new_empty()
allows to create a new empty Space-Time MOC.MOC.from_box
to create rectangular MOCsMOC.from_astropy_regions
to create MOCs from astropy regions.
- currently supported versions of python now range from 3.8 to 3.12. There is a catch for python 3.8: the corresponding astropy version is pinned to astropy<5.3
- the deprecated
write
method now callssave
internally
- all methods of
MOC
with signatures likefunction(self, lon, lat, **kwargs)
now accept both lists of coordinates and single coordinates mocpy.stmoc.STMOC.from_spatial_coverages
also accepts single moc objects (had to be a list before)AbstractMOC
derives from metaclassABCMeta
save
now acceptsfits_keywords
that are added to the fits header before writing the filen_cells
gives the number of cells corresponding to a given order
- brand new support of frequency MOC ! 🚀
- documentation has galleries of notebooks
AbstractMOC.__init__
raisesPermissionError
if user tries to modify order manuallyAbstractMOC.store_index_dtype
becameAbstractMOC._store_index_dtype
as is is intended for internal use only to handle 32 and 64b systems- tests in doctrings now run in CI too
- CI won't run for linux 32 anymore, but support will still be provided upon bug repports
sum([moc1, moc2, moc3])
now works correctly (fixes #99)MOC.wcs()
now works correctly for non-squared figures (fixes #98)MOC.from_fits_image
now works even when the fits file has no CDELT (fixes #90)
MOC.__init__
andSTMOC.__init__
raisePermissionError
if user tries to modify order manually
- 🐛 position angle limited to PI/2 instead of PI in
MOC.from_elliptical_cone
MOC.MAX_ORDER
andTimeMOC.MAX_ORDER
to replace formerIntervalSet.HPX_MAX_ORDER
andIntervalSet.TIME_MAX_ORDER
MOC.to_depth29_ranges
(+test) to replace formerIntervalSet.nested
TimeMOC.to_depth61_ranges
- tests on
MOC.uniq_hpx
- 🐛 return statement was missing in
MOC.uniq_hpx
- add methods
AbstractMOC.__copy__
andAbstractMOC.__deepcopy__
- add op parameter
timeout
inquery_simbad
andquery_vizier_table
that defaults to 1000s - warning if
max_depth
is not set inMOC.from_valued_cells
⚠️ BREAKING: public functionset
inplot.axis_viewport
module has been renamed into_set_wcs
and moved to moduleplot.utils
- 🐛 a bug was introduced in [0.12.0] on the functions
query_simbad
andquery_vizier_table
that are compatible withpre_v2
format only - 🐛 when
max_depth=None
inMOC.from_valued_cells
⚠️ BREAKING: Deserialisation of ST-MOCs from FITs HDU (reading/writting FITS file fully supported on the Rust side)⚠️ BREAKING: Remove support of pre_v2 ST-MOC fits file writing (reading still ok)⚠️ BREAKING: internal classIntervalSet
removed⚠️ BREAKING:utils
file removed
- add
hdu_index
optional parameter inMOC.from_fits_images
TimeMOC.to_time_ranges
to get time ranges from a T-MOCMOC.to_rgba
andMOC.dsiplay_preview
for a quick S-MOC allsky viewuniq_gen
anduniq_zorder
added toAbstractMOC
flatten
added toAbstractMOC
- constructor
MOC.from_healpix_depth29_ranges
- parameter
values_are_densities
inMOC.from_valued_healpix_cells
- parameter
complement
inMOC.from_polygon
+
,|
,-
,&
,~
operators redefinition forunion
,union
,difference
,intersect
andcomplement
respectively.contains_skycoords
andcontains_lonlat
to replacecontains
- add
fold
parameter intosave
andto_string
- add
MOC.barycenter
andMOC.largest_distance_from_coo_to_vertices
of a moc - add
MOC.wcs
giving an astropy WCS centered around a the barycenter of moc
⚠️ BREAKING:times_to_microseconds
andmicroseconds_to_times
moved fromutils
totmoc
.⚠️ BREAKING:uniq
removed fromIntervalSet
, but replacing methoduniq_hpx
added toMOC
⚠️ BREAKING: the output ofuniq_hpx
is not sorted (but follow the order of the cells in the internal range list)
⚠️ BREAKING:STMOC.query_by_time
now takes in input aTimeMOC
⚠️ BREAKING:STMOC.query_by_space
now returns aMOC
⚠️ BREAKING:TimeMOC.contains
does not take any longer a time resolution as input parameter⚠️ BREAKING:TimeMOC.contains_with_timeresolution
as been added with the previous behaviour ofTimeMOC.contains
- add
save
toAbstractMOC
and remove from sub-classes - add
to_string
toAbstractMOC
and remove from sub-classes from_uniq
removed fromIntervalSet
and added toMOC
- change the
contains
implementation to be much memory efficient, faster, and thus working at all HEALPix orders. - update
cdshealpix
andmoc
dependencies ⚠️ BREAKING:MOC.from_healpix_cells
- now requires the
max_depth
, the depth of the MOC we want to create - optional parameter
fully_covered
removed since it was not used
- now requires the
⚠️ BREAKING: inMOC.from_valued_healpix_cells
, the user now have to degrade manually the resolution if max_depth < deepest cell depth.⚠️ BREAKING:World2ScreenMPL
has been renamedWCS
- Add
MOC.from_ring
- Option
include_indirect_neighbours
tosplit
andsplit_count
- Extend the
moc.fill
andmoc.border
to directly accept an astropy wcs object. This solves the issue #69 - Addresses the plotting artefacts when plotting big HEALPix cells. Cells of depth < 3 are subdivided to the depth 3 before being plotted
- Set the default
time_order
from 29 to 61, i.e. tomax_order
instmoc.from_spatial_coverages
(29 was themax_order
in the previous MOC V2.0 version).
- More robust FITS UNIQ deserialization (ignoring 0 values)
- Rename
TimeMOC
logical operations taking a deltaT constraint adding the sufix_with_timeresolution
- WARNING logical
TimeMOC
logical operations are now at the deepest depth (no time resolution parameter)
- Deprecate
from_fits
, ... methods - Add
MOC.spli_count
,MOC.split
,MOC.from_multiordermap_fits_file
- Add support for u16 and u32 fits MOC and TMOC in 'load'
- Replace empty moc shape (1, 0) by (0, 2)
- Fix
tmoc.max_time
- Fix doc (due to an evolution of sphinx)
- Add compatibility with MOC2.0: Time depth in now in
[0, 61]
instead of[0, 29]
- Add
from_time_ranges_in_microsec_since_jd_origin
intemporal_coverage.rs
- Time operations now precise to the microseconds, see:
utils.times_to_microseconds
utils.microseconds_to_times
- Add several options to
moc.from_valued_healpix_cells
- Add
load
andsave
methods for serialization/deserialization in pure Rust (ensuring MOC2.0 compatibility). - Improve performance and some operations (like intersection and union)
- Improve
to_uniq
performances (x5 according to a bench in pure Rust) - Improve
add_neighbours
andremove_neighbours
performances (now in pure Rust)
complement()
: remove from AbstractMoc / IntervalSet, and add it in Moc and TimeMoc (because complement now depends on the qty)
- Remove the
moc
crate from MOCPy and publish it as a standalone here (with a lot of added stuff) - Add FITS serialization/deserialization on the Rust code.
- Add ASCII and JSON serialization/deserialization on the Rust code.
- Move
rand
from dependencies to dev-dependenciies - Generalize the code to support various quantities with different dimensions (HEALPix indices, Time, ...)
- create
MocableQty
andMocQty
implemented byHpx
andTime
- create
- Remove depth/qty dependent operations from
Ranges
(depth/complement/degrade), create a trait for generic operations - Add
MocRange(s)
since we introducedMocQty
for depth dependent operations, and introduce both:HpxRange(s)
andTimeRange(s)
- Add
MocRanges2D
for depth dependent operations - Rename
NestedXX
inHpxXX
to possibly support Ring indices (the code should be the same as far as the NSIDE is a power of 2) - ...
- change the CI: replace travis and appveyor by github actions
- replace setuptools rust by maturin
- update dependencies
- remove ',' separator when deserializing MOC from ascii (this follows the MOC 1.1 standard http://ivoa.net/documents/MOC/20191007/REC-MOC-1.1-20191007.pdf)
- from_valued_healpix_cells
- API Breaking change! from_image -> from_fits_image(hdulist, max_norder)
- WCS -> World2ScreenMPL. It's a context manager class
- Change API for ST-MOC: query_by_time, query_by_space
- Space-Time coverages, classmethod from creating them from (time, ra, dec) tuples
- Query a Space-Time coverages with time frames and spatial coverages
- Rust backend
- Add tests for windows py27 and py3
- from_polygon relies on cdshealpix. spherical_geometry dependency removed!
- change astropy-healpix dependency from mandatory to optional. astropy-healpix is now used in only a few deprecated methods
(such as the old plot method from
mocpy.MOC
andget_boundaries
which will soon make use of cdshealpix too).
- API CHANGE!: the
inside
parameter of from_polygon and from_polygon_skycoord has been removed ! The inside of the polygon is deduced from the order of the sky coordinates passed.
- Change from_cells to from_healpix_cells. Its API does change too. It now takes the three ipix, depth and flags numpy arrays separatly instead as a numpy structure. This has the advantage of direcltly passing the arrays returned by
cdshealpix
. Creating a numpy structured array from simple numpy column arrays needed to copy the data from the arrays to the structural array. - Add cdshealpix as a dep. Will remove astropy-healpix dep. When cdshealpix will be merged into astropy-healpix then the astropy-healpix dep will be restored.
- Serialize to str. Call moc.serialize(format="str")
- Load a MOC from a str (see section 2.3.2 of MOC IVOA paper).
- Fix vizualization bug when plotting all the allsky MOC. Biggest cells to plot are limited to depth 2. Cells of depth 0 and 1 are subdivided into cells of depth 2 for the visualization purpose.
- Add of a
overwrite
optional keyword in the write method. Before 0.5.6 the default behaviour was to always overwrite already existing files. Now it does not overwrite by default. To do that, you have to set theoverwrite
keyword.
- Plotting a moc with matplotlib axes is faster (concers fill and border methods). The level of detail of the plotted MOC is function of the FoV. The MOC is degraded to the minimum depth so that a cell of this depth can be contained in 1px at the center of the projection. For small FoVs, we only plot the part of MOC contained in the view (thanks to the speed of logical operation between MOCs).
- The docs features more examples on how to plot a MOC, perform logical operations between MOCs, etc...
- The doc of the API has been reviewed and features some test codes that can be run with the sphinx command
make doctest
.
- The use of multiprocessing in the
fill
method.
- Novel python file hierarchy. moc/ and tmoc/ containing the sources for MOC (resp. TMOC) classes.
- A new mocpy.WCS object type that must be declared in a context (with WCS(...) as wcs:) for use. This facilitates the creation of an astropy.wcs.WCS object for plotting a MOC in a matplotlib axes. This replaces the wcs.spatial.utils.make_wcs method that returned an astropy.wcs.WCS object.
- Use of multiprocessing.Pool in mocpy.MOC.fill
- wcs.spatial.utils.make_wcs has been removed. See mocpy.WCS as replacement.
- A new constructor from_cells. It returns a new MOC instance from a numpy structured array representing the cells of a MOC. The structured array passed must contains 3 attributes: "ipix": np.uint64, "depth": np.uint32, "fully_covered": np.uint8 (a flag bit. For the moment its value has no effect for the newly created MOC).
- A new from_polygon_skycoord method added where you can pass an astropy.coordinates.SkyCoord describing the polygon coordinates instead of two lon, lat astropy.units.Quantity. The max_depth, and inside optional arguments remain.
- Remove spherical geom from dependency so that astroquery.cds wheel for windows/py3 can be generated. Spherical Geom is only used in MOC.from_polygon. A message is addressed to the user telling him to install sphrical geom if it is not installed and if he wants to create a MOC from a polygon.
pip install mocpy
now installs all the dependencies of mocpy. See the setup.py file. (requires changed to install_requires).
- Two methods
fill
andborder
taking an astropy.wcs.WCS and a matplotlib axis.fill
projects the MOC into the WCS and draws it on the MPL axis using pathpatches for each HEALPix cell.border
draws the border the same way and requires a WCS and an MPL axe too. You can pass to these functions additional keyword arguments that will directly be passed to MPL when plotting (e.g. the color, the linewidth, and alpha component etc...). Check the notebooks to see how to use these new methods. - You can retrieve the list of skycoords describing the border MOC. Each skycoord from the list refers to one border of the MOC (either an external border or the border of a hole in a connexe MOC). The process takes for the moment a quite amount of time and thus may be optimized in the future. A new GALEX boundaries notebook has been added so that you can check how it works. I recommend to decrease the order of GALEX to 5 before computing the boundaries otherwise it will take some time. This add relies on the issue #29 initiated by @ggreco77.
- A new
from_polygon
method taking the vertices (i.e. (skycoords) or (lon, lat) tuples) responsible for setting up a new MOC from a polygon. An inside SkyCoord point is requested and says to the algorithm which area (2 possible as on the sphere, an area and its complement are both finite) must be chosen. If no inside sky coord is given, we consider the mean of the vertices of the polygon as belonging to the MOC (This is without ambiguity for convex polygons but it may not work for concave ones). Vertices describing a convex or concave polygon are accepted. Vertices describing a self-intersecting polygon are not accepted. This method does not rely on astropy_healpix as there is for the moment no method returning the set of HEALPix cells belonging to a polygon and is thus implemented purely in Python. - A new
serialize
public method allows to serialize the MOC in two possible format, FITS and json. For a FITS serialization the method returns an astropy HDU binary table. For a JSON serialization, the method returns a python dictionary storing order-[list of HEALPix cells] as key-value pairs.
write
method does not take awrite_to_file
argument. For serialization purpose, there is now a newserialize
method.- astropy_healpix.HEALPix.lonlat_to_healpix seems to not accept astropy MaskedColumn anymore. For lon as a MaskedColumn, please pass lon.T * u.deg to mocpy.MOC.from_lonlat. We need to transpose the column and then convert it to an astropy.units.Quantity.
- Notebooks have been updated and all the plots now use the new methods
fill
andborder
. - A new package
spatial
, invisible from the user, but keeping all the code of spatial MOCs (plotting methods, border computation, special utils for creating WCS...) has been created. tmocs and core functions are still located in the root of the project. - Add of a changelog