2. Download


Release date:20-07-2013

Major changes:

  • AsPyLib v2.0.0 is now based on the library Astropy which includes pyfits and vo.table. The installation is greatly simplified.
  • this new version includes several improvements and bug corrections

Older versions


Release date:01-04-2012

Major changes:

  • the script for automatic photometry now makes an astrometric reduction, and the positions (alpha, delta) of all measured stars are written to the output file. For each star, the best match with USNO-B1.0 is indicated (star name, position, magnitudes)
  • the script for searching variable stars (photosearch_viewresults.py) now displays for each selected star: the lightcurve, the star position, statistics information (mean magnitude, noise levels, a quality flag). An image showing the star and its immediate surrounding is shown. A button allows to export, when needed, the lightcurve data to a text file containing the complete information.

Minor changes (general):

  • all example scripts provided with the AsPyLib library are now better presented. A short summary of the script purpose, and a clear identification of the input parameters can be found in the code.
  • the license text (shown at each execution) is now much shorter, and less annoying
  • a list of colors for plotting has been created for AsPyLib. It is called conf.col. It is better than the default color list from matplotlib, and allows to use consistent colors through the library when doing plots.

Minor changes (photometry):

  • in the photometry scripts (photometry_run.py and photosearch_run.py), the step of checking the image statistics (min, max, background uniformity) is now more detailed. The min and max values are computed for both the whole image, and a smaller selected part of it. Deviations from a uniform background are calculated at the 4 corners and the image center, and the variations in time of the deviations are also calculated.
  • new scripts (load_imagestats.py and load_imageshifts.py) are provided to read the output files generated by the two photometry scripts for the image statistics and image shifts. The scripts are also plotting the image statistics and image shifts (for both the old and the new formats).
  • in the photometry scripts, to help to select the area where the min and max signals will be calculated, 5 images are combined and shown. Then the user has an idea of the image shift during the night and can select an area such that the strongest star will not exit.
  • the script photometry_run.py can generate two formats for the CdR-CdL output file: DVR and DVv. The second one (DVv) includes an estimate of the magnitude noise for the measured lightcurve.

Minor changes (others):

  • for fitting lightcurves: a new script is available (MPC_asteroid_distance.py) to generate a file with two columns (Julian date + distance asteroid-Earth) from a MPC ephemeris. This information is needed for asteroids, for correcting the time delay due to light propagation.
  • a new script (Plot_measured_data.py) has been written to plot the measured lightcurves with the module aspylib.cdr
  • image calibration: default number of hot pixels is now 100 (instead of 500), coefficient 1.2 applied to the flat frame to avoid saturation when dividing by the flat.

Bug corrections:

  • the saturation level of 32bits FITS images (as generated by Prism) was at 32767 which is not adequate in most cases. Now it is set at 65535. Problem was present in all versions starting from 1.1.0 –> fixed in v1.4.1
  • in the photometry scripts, when calculating the shifts, several options are presented. The option 4 (recalculate all images) was not re-initialising correctly the list of images to be calculated, so that if it was executed after option 3 (recalculate some images) the script was not working correctly. Problem appeared in v1.3.0 –> fixed in v1.4.1
  • projection law used for astrometric reduction was not the one that was intended (though astrometric reduction was working fine). Now the orthographic projection as described in the paper of Kaiser (see list of references or the paper here). Problem appeared with first implementation of astrometric reduction in v1.2.0 –> fixed in v1.4.1
  • small bug in cdr.plot_magdata(), the reversed vertical axis for magnitude was not implemented correctly. Problem appeared in v1.3.1 –> fixed in v1.4.1
  • small bug in cdr.load_magfile(), some information not needed was displayed in the console (remain from testing phase). Problem appeared in v1.3.0 –> fixed in v1.4.1

Documentation errors:

  • description of astrometry.project_stars() function was not correct (wrong input parameters). Problem appeared in v1.2.0 –> fixed in v1.4.1


Release date:08-03-2012

Major changes:

  • AsPyLib now works on Windows and Linux, 32bits or 64bits ! the scripts are the same on both systems. The handling of the two operating systems is made by calling the Python function platform.system(), directly inside the aspylib functions
  • In the .zip archive is included a file “INSTALL” describing all steps required for installation on all systems. A “README” file is also included to give an overview of AsPyLib.
  • a few variables have been created in conf.py to deal with differences between Windows and Linux OS. For instance, aspylib.conf.sep = “\” on Windows and = “/” on Linux.

Minor changes:

  • a flag has been added to the scripts photometry_run.py and photosearch_run.py : when set to ‘True’ the image shifts are not calculated but are read from a text file. This way, the shift calculation is not repeated when the photometric extraction is done several times.
  • script photosearch_run.py: the distorsion law can be de-activated with the parameter ‘dist_order’ set to 0. Then the photometric calculations are less accurate but more robust.
  • the function astro.find_shift_by_triangles() has been removed. It was a draft and it will not be better than the existing functions.
  • all mentions to “x” and “y” coordinates in the user interface and output files, have been replaced by “vert” and “horiz”. This avoids some confusion in the interpretation of the results. One needs to know that x ccordinate is vertical for AsPyLib only for writing scripts.

Bug corrections:

  • in photo_script4.py, rejected measurements for object N were still rejected for object N+1, in v1.2.0, v1.2.1, v1.2.2, v.1.3.0, v1.3.1 –> fixed in v1.4.0
  • in photosearch_viewresults.py, the orientation of the vertical axis was changed each time a new lightcurve was displayed, in v.1.3.1 –> fixed in v1.4.0
  • in photosearch_run.py, stars are detected on a reference image obtained by stacking 10 images. A margin was needed at the edges of the obtained image due to the image co-alignment process, in v1.3.0, v1.3.1 –> fixed in v1.4.0
  • module conf.py was not loaded when doing “import aspylib”, in v1.2.0, v1.2.1, v1.2.2, v.1.3.0, v1.3.1 –> fixed in v1.4.0

Documentation errors:

  • astro.set_focus(), on Windows systems, does not work from console, it works only from scripts. This comes from a limitation in the Windows API. The console help has been updated.


Release date:25-02-2012

Minor changes:

  • the distorsion law of photosearch_run.py is now linear, with in total 6 coefficients. It can compensate for translation, scaling and rotation of the image. Successful tests have been made on images with a rotation of the field during the night.
  • better colors for plots of reference stars lightcurves and target lightcurves as a function of disk size, in photometry_run.py script
  • no more legend (sometimes hiding the curves) for plot showing X/Y image shifts in photometry_run.py and photosearch_run.py
  • for all plots showing magnitude as a function of time, the magnitude axes have been switched, to have lower magnitudes (and thus stronger fluxes) on the top of the graphs
  • now the best lightcurves are shown for each object at the end of the script photometry_run.py
  • one digit less for output of function astro.astro.decdegrees_to_degrees(), giving for instance 23:45:23.3 instead of 23:45:23.32

Bug corrections:

  • incorrect Julian dates written to output file “target_05_best_diff_magnitudes.txt”, when using photometry_run.py script, due to error in function photometry.write_best_magnitude(), in v1.1.0, v1.1.1, v1.2.0, v1.2.1, v1.2.2, v1.3.0 –> fixed in v1.3.1
  • in astro.find_shift_stars_matching(), poor reliability of image shift calculation due to the use of np.mean (not appropriate for the algorithm) instead of np.ma.median to calculate the shift from several candidate values, in v1.2.0, v1.2.1, v1.2.2, v1.3.0 –> fixed in v1.3.1
  • in astro.find_shift_crosscorrelation(), in some (rare) cases a crash occured due to np.where() returning several positions in the image equal to the max value, in v1.1.0, v1.1.1, v1.2.0, v1.2.1, v1.2.2, v1.3.0 –> fixed in v1.3.1
  • “Imagelist” was defined in script “07_astrometry\get_star_info.py” while the code needs “Image” in v1.3.0 –> fixed in v1.3.1


Release date:21-02-2012

Major changes:

  • AsPyLib is now able to read all files compatible with the CourbRot format (for a description see this link), provided there is one single header section and data section. In particular: headers like “POS -1”, “POS 0”, “POS +1” are accepted, headers like “FMT xxDxVv” or “FORMAT CDR” (for Calaphot) are accepted. Dates with format YYYYMMDD.dddd are also accepted.
  • A new script has been written for automatic photometry of all stars, giving very accurate results. It is based on the algorithm of the Monitor project (see here). The star detection is made only one time on a stack of 10 images (better SNR and no cosmic rays). It is able to absorb a progressive deformation of the field, due for instance to atmospheric refraction on a wide field. The bright stars are used to place the photometry disk for the faint stars. Finally, 3 sizes of photometry disks are used. Have a look at the paper for more details !
  • New functions are introduced for astrometric reduction. A script (“07_astrometry\get_star_info.py”) allows to overwrite all the USNO-B1 positions on an image, and to display star information in the console (alpha, delta, USNO-B1 magnitudes) when clicking on the stars

Minor changes:

  • new function to convert dates with format YYYYMMDD.ddddd into Julian dates
  • new functions to convert decimal degrees (XX.xxxxxx) into a string with format degrees/arcmin/arcsec (DD:MM:SS.ss) or hours/min/sec (HH:MM:SS.ss)
  • several improvements of the photometry scripts (concerns all scripts contained in folder “05_photometry”)

Bug corrections:

  • astro.mean_psf() was looking for module process3 without finding it, causing crash in v1.2.0, v1.2.1, v1.2.2 –> fixed in v1.3.0
  • astro.find_stars() was crashing if keyword “excluded” was used in v1.2.0, v1.2.1, v1.2.2 –> fixed in v1.3.0
  • when using parallel calculation, parallel threads were not properly destroyed after execution in v1.2.0, v1.2.1, v1.2.2 –> fixed in v1.3.0
  • script “05_photometry\photosearch_viewresults.py” was crashing if all values of the quality flags (0-5) were not represented by at least one star, in v1.2.0, v1.2.1, v1.2.2 –> fixed in v1.3.0
  • system memory error when calculating photometry of a large amount of data, happening with low probability. This error was discovered when programming the new script for automatic photometry, it never happened before. It was due to error in Python code in photometry.aperture_photometry() –> fixed in v1.3.0

Documentation errors:

  • error in console help for astro.julian_day(): this function converts lists of dates, not a single date, in v1.1.1, v1.2.0, v1.2.1, v1.2.2 –> fixed in v1.3.0


Release date:25-01-2012

Minor changes:

  • the functions to send queries to Vizier and SkyBoT servers have been splitted in two. The first function sends the request, retrieves the data in a .xml file and saved it on the hard disk. The second function loads the .xml file and convert the obtained VOtable to a Numpy record array.
  • new example scripts in the “07_astrometry” folder to illustrate how to make queries to Vizier and SkyBoT


Release date:20-01-2012

Minor changes:

  • the number of reference stars can be adjusted by the user in the script for automatic photometry
  • the script for accurate photometry now adds the header “POS -1” automatically in the output file. This header allows to record the exposure time used when taking the images, so that later it’s possible to shift the Julian dates (assumed to be at start of exposure) to mid-exposure for better accuracy. With this header, the output file is compatible with the CourbRot software.

Bug corrections:

  • in script for automatic photometry, error when exporting names of reference stars to output file in v1.2.0 –> fixed in v1.2.1


Release date:15-01-2012

New requirements:

  • 2 new modules required for the installation of AsPyLib = pp (parallel Python) and vo.table (see here for installation and there for the documentation)

Major changes:

  • this version includes a script for searching variable stars, with automatic photometry on all the detected stars
  • two functions are available for sending web requests to Vizier and SkyBoT and retrieve information about stars and asteroids (position, magnitude, etc)
  • some time-consuming tasks of the photometry scripts are performed with parallel computing (SMP). With 4 processors at 2.40 GHz the gain in computation time is about 3, and the automatic photometry of 2000 stars on 100 images takes 60 sec.

Minor changes:

  • complete console help for the aspylib.astro, aspylib.cdr, and the functions for Vizier and SkyBoT requests, by typing “help(aspylib.function)”
  • script for accurate photometry of a small number of targets has been improved. Better handling of special cases (star close to image boundary, negative intensity, etc.) for which the magnitude is numpy.nan (nan = not a number)
  • new algorithm for star detection, based on image filtering (more efficient). All functions for star detection and fitting have been re-written and allow several options (star rejection based on saturation, checking distance between calculated centroid and position of maximum, removing duplicates, etc).
  • script for accurate photometry makes use of 3 photometry methods. In order of decreasing accuracy: ‘centroid’ (photometry disk centered on star centroid, formerly called ‘recenter’), ‘maximum’ (photometry disk centered on star maximum, formerly called ‘normal’), ‘select’ (photometry disk centered on selected pixel). The ‘select’ method works well on defocused stars on telescopes where the maximum signal is not always at center.
  • improved organisation of AsPyLib package

Bug corrections:

  • bad management of minus sign in astro.degrees_to_decdegrees() in v1.1.0, v1.1.1 –> fixed in v1.2.0
  • instruction “import scipy.fftpack as fft” missing in astro\process3.py file, preventing image co-registration by cross-correlation to work in v1.1.1 –> fixed in v1.2.0
  • photometry scripts: error when rejecting images with incorrect shift calculation: image N-1 rejected instead of N in v1.1.0, v1.1.1 –> fixed in v1.2.0


Release date:08-12-2011

Major changes:

  • the package name has been changed to comply with implicit naming rules in the Python community. All occurences of “astropython” (“AstroPython”) are replaced with “aspylib” (“AsPyLib”).
  • a complete console help has been written for the module astro. Just write “help(astro)” or “help(astro.any_function())” and you get a description of the module and any of its functions.
  • the functions for image co-registration have been slightly modified. The functions arguments are different, the internal algorithms are unchanged.

Minor changes:

  • the mirror transformations have been renamed mirror_vert() and mirror_horiz() (formerly mirror_x() and mirror_y()).
  • more functionalites for object selection (size and shape of the markers can be changed)
  • in the code, naming of some variable have been changed for PSF fitting functions. The user interface is unchanged.

Bug corrections:

  • in astro.add_sigma_clipping(), dummy instruction using the “time” module is causing an error in v1.1.0 –> fixed in v1.1.1.
  • installation bug (mentioned below) in v1.1.0 –> fixed in v1.1.1.

AstroPython 1.1.0

Release date:27-11-2011

Major changes:

  • Astropython is now a real package with several modules
  • image display has been improved
  • FITS headers implemented as Python dictionaries (before they were lists)
  • pre-programmed functions for calibration (with management of image saturation, hot pixels)
  • faster access to C++ dlls
  • management of large images (up to 4096*4096) has been improved
  • module for lightcurve fitting with Fourier series (for asteroid lightcurves or eclipsing binaries)
  • script for photometry is reasonably mature

Installation bug:

  • the folder “astropython_v1.1.0\astropython_v1.1.0” must be renamed “astropython_v1.1.0\astropython”. Otherwise, the installation will not work correctly. The problem appears only with this version (1.1.0).


Release date:28-04-2011

The functions are exactly the same as in version 1.0.3.

The difference is that only the AstroPython functions are now provided. Example scripts have been removed from the .zip archive, they can now be found in the HTML documentation.


Release date:23-04-2011

Main changes

  • new function astro.select_stars() where stars are selected with a right click (instead of typing the (x,y) coordinates manually)
  • new aperture photometry functions that handle an arbitrary number of moving objects ; pictures with 2 (or more) asteroids can now be processed for photometry
  • in functions astro.find_stars(), astro.find_shift_stars_matching() and astro.find_shift_by_triangles() the keywords “included” and “excluded” which define the rectangular area where the stars are (or are not) detected, are now lists. An arbitrary number of rectangular zones can now be specified, and the algebraic union of these zones is used (or not used) for star detection
  • a new list of functions based on the Windows API, is available to control the size, position and state of the console window and image display windows. The windows are identified with their title ; the new function astro.diplay() allows to specify the title of the image display windows


  • a small bug corrected in astro.find_stars() which was failing when a star centroid was too close from image border. Now this case is detected, and the star is not reported with the detected stars


Release date:01-04-2011

Main changes

  • a description has been written for all functions (such as: purpose, use of inputs/outputs), in the form of comments in the corresponding .py files
  • the functions for aperture photometry have been re-written for better readibility and flexibility. They now allow to perform photometry by centering the measurement disks at the star pixel with maximum signal, or at the star PSF centroid, after having shifted it to an exact pixel center
  • input parameter text_display, that is equal to ‘yes’ or ‘no’, is now available for astro.getdata() (to read FITS image data), astro.getheaders() (to read FITS headers), astro.find_shift_stars_matching() and astro.find_shift_by_triangles() (to compute shifts between pairs of images). For the shift computation, when text_display is set to ‘yes’ some numerical information about the quality of the star/triangle matching is printed in the console window
  • in astro.find_stars() : a redundant test has been removed, and PSF fit now uses the elliptical gaussian PSF (more accurate than circular gaussian)


Release date:29-03-2011

Main changes

  • the formats of the header lists generated by astro.getheaders() and astro.create_headers() have been harmonised. Now, both are compatible with astro.save()
  • astro.save() was only saving individual images ; it now handles lists of images


Release date:27-03-2011

First release