Git Product home page Git Product logo

montage-wrapper's Introduction

Astropy

The Astropy Project (https://astropy.org/) is a community effort to develop a single core package for Astronomy in Python and foster interoperability between Python astronomy packages. This repository contains the core package which is intended to contain much of the core functionality and some common tools needed for performing astronomy and astrophysics with Python.

Table of Contents

Installation

Releases are registered on PyPI, and development is occurring at the project's GitHub page.

For detailed installation instructions, see the online documentation or docs/install.rst in this source distribution.

To install astropy from PyPI, use:

pip install astropy

Contributing

The Astropy Project is made both by and for its users, so we welcome and encourage contributions of many kinds. Our goal is to keep this a positive, inclusive, successful, and growing community by abiding with the Astropy Community Code of Conduct.

More detailed information on contributing to the project or submitting feedback can be found on the contributions page. A summary of contribution guidelines can also be used as a quick reference when you are ready to start writing or validating code for submission.

Getting Started with GitHub Codespaces

Codespaces is a cloud development environment supported by GitHub. None of the Astropy build machinery depends on it, but it is a convenient way to quickly get started doing development on Astropy.

To get started, create a codespace for this repository by clicking this:

Open in GitHub Codespaces

A codespace will open in a web-based version of Visual Studio Code. The dev container is fully configured with software needed for this project. For help, see the GitHub Codespaces Support page.

Note: Dev containers is an open spec which is supported by GitHub Codespaces and other tools.

Supporting the Project

Powered by NumFOCUS Donate

The Astropy Project is sponsored by NumFOCUS, a 501(c)(3) nonprofit in the United States. You can donate to the project by using the link above, and this donation will support our mission to promote sustainable, high-level code base for the astronomy community, open code development, educational materials, and reproducible scientific research.

License

Astropy is licensed under a 3-clause BSD style license - see the LICENSE.rst file.

montage-wrapper's People

Contributors

astr2600student avatar astrobot avatar astrofrog avatar bsipocz avatar cdeil avatar eteq avatar jat255 avatar kbarbary avatar keflavich avatar larrybradley avatar luzuku avatar mwcraig avatar olebole avatar sargas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

montage-wrapper's Issues

tiny bug in mFixNan?

I am using montage v3.3 with this package.
I got 'no such file' error using mFixNan function. It seems that montage's command is mFixNaN whereas in the mFixNan function mFixNan is used, and this is causing the error.

reproject FITS cube generated from CLASS

Error with make header table (see below). Sample data at http://www.eso.org/~kwang/tmp/fred.fits

Any idea? Thanks!

In [2]: from montage_wrapper.wrappers import reproject_cube
In [3]: reproject_cube(in_image='fred.fits', out_image='tst.fits', system='GAL')

MontageError                              Traceback (most recent call last)
<ipython-input-3-6985a69ca613> in <module>()
----> 1 reproject_cube(in_image='fred.fits', out_image='tst.fits', system='GAL')

/home/kwang/anaconda/lib/python2.7/site-packages/montage_wrapper/wrappers.pyc in reproject_cube(in_image, out_image, header, bitpix, north_aligned, system, equinox, factor, common, cleanup, clobber, silent_cleanup, hdu)
    151     if not header:
    152         m.mMakeHdr(images_raw_tbl, header_hdr, north_aligned=north_aligned,
--> 153                    system=system, equinox=equinox)
    154 
    155     cubefile = fits.open(in_image)

/home/kwang/anaconda/lib/python2.7/site-packages/montage_wrapper/commands.pyc in mMakeHdr(images_table, template_header, debug_level, status_file, cdelt, north_aligned, system, equinox)
   1466     if stderr:
   1467         raise Exception(stderr)
-> 1468     return status.parse_struct("mMakeHdr", p.stdout.read().strip())
   1469 
   1470 

/home/kwang/anaconda/lib/python2.7/site-packages/montage_wrapper/status.pyc in parse_struct(command, string)
     31     else:
     32         if 'struct' in string:
---> 33             result = Struct(command, string)
     34         else:
     35             print(string)

/home/kwang/anaconda/lib/python2.7/site-packages/montage_wrapper/status.pyc in **init**(self, command, string)
     68 
     69         if self.stat == "ERROR":
---> 70             raise MontageError("%s: %s" % (command, self.msg))
     71         elif self.stat == "WARNING":
     72             log.warn(self.msg)

MontageError: mMakeHdr: Invalid table file: /tmp/tmpjXROOO/images_raw.tbl

Add unit tests to montage-wrapper

montage-wrapper should have unit tests.
@astrofrog Do you want to make a list here of things you think should be covered?
Coding the unit tests isn't so hard, maybe this is a good way to get started for for GSoC applicants?

Montage commands not found --but in path

Hi,

I am getting the following error:

ERROR: Montage commands could not be found.
...
and ensure that the Montage commands (e.g. mAdd, mProject, etc.) are in
your $PATH. Your current $PATH variable contains the following paths,
but none of them contain the Montage commands:

    PATH = /Users/maria/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/s
       bin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/usr/local/bin:/Us
       ers/maria/bin:/Users/maria/anaconda/bin:/usr/local/bin/Montag
       e/Montage

However the commands are in the last directory in the path:

Marias-MacBook-Pro:Montage maria$ pwd
/usr/local/bin/Montage/Montage
Marias-MacBook-Pro:Montage maria$ ls
Configure.sh mConvert.c mShrink.c
Makefile.Darwin mCoverageCheck.c mShrinkCube.c
Makefile.LINUX mDiff.c mSubCube.c
Makefile.SunOS mDiffExec.c mSubimage.c
checkFile.c mDiffFitExec.c mSubset.c
checkHdr.c mFitExec.c mTANHdr.c
checkWCS.c mFitplane.c mTblSort.c
debugCheck.c mFlattenExec.c mTileHdr.c
filePath.c mGetHdr.c mTileImage.c
get_files.c mHdrCheck.c montage.h
get_hdr.c mHdrtbl.c overlapArea.c
get_hfiles.c mImgtbl.c overlapAreaPP.c
get_hhdr.c mMakeHdr.c print_hrec.c
hdr_rec.h mMakeImg.c print_rec.c
ltqnorm.c mNaN.h projTest.c
mAdd.c mOverlaps.c subCube.c
mAddCube.c mProjExec.c subCube.h
mAddExec.c mProject.c subImage.c
mBackground.c mProjectCube.c subImage.h
mBgExec.c mProjectPP.c
mBgModel.c mPutHdr.c

Thanks,

mHdr does not support the -t option

The montage wrapper command mHdr does not support the -t option to have the zero point for 2Mass files put into header templates. From inspecting the wrapper code this looks trivial to add, and it would be helpful to me, at least.

No images were successfully projected

Hi,
I am getting this error:

montage.mosaic('Yerkes-astrometry/', 'mosaic.fits')
INFO: Listing raw frames [montage_wrapper.wrappers]
INFO: Computing optimal header [montage_wrapper.wrappers]
INFO: Projecting raw frames [montage_wrapper.wrappers]
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/montage_wrapper-0.9.9.dev237-py2.7.egg/montage_wrapper/wrappers.py", line 557, in mosaic
raise MontageError("No images were successfully projected")
montage_wrapper.status.MontageError: No images were successfully projected

The normal Montage commands seem to work fine, and I'm not too sure what is actually causing this error. It's a little vague.

Installation problem (no builtins with python 2 and no attribute decode with python 3)

Salut !

I am having a problem with montage-wrapper. When trying to build it with python 2 I guess the following error:

python2 setup.py build
running build
running build_py
generating default montage_wrapper.cfg file
Generation of default configuration item failed! Stdout and stderr are shown below.
Stdout:

Stderr:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/astropy/config/configuration.py", line 627, in generate_all_config_items
package = get_loader(pkgornm).load_module(pkgornm)
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/mederic/arch/montage-wrapper/src/montage-wrapper-0.9.5/build/lib/montage_wrapper/init.py", line 13, in
import builtins as builtins
ImportError: No module named builtins

With python 3 I guess a different but nevertheless interesting error too:

python setup.py build
running build
running build_py
generating default montage_wrapper.cfg file
ERROR: AttributeError: 'str' object has no attribute 'decode' [astropy.setup_helpers]
Traceback (most recent call last):
File "setup.py", line 117, in
entry_points=entry_points
File "/usr/lib/python3.3/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.3/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.3/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3.3/distutils/command/build.py", line 126, in run
self.run_command(cmd_name)
File "/usr/lib/python3.3/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.3/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3.3/site-packages/astropy/setup_helpers.py", line 546, in run
self.distribution.packages[0])
File "/usr/lib/python3.3/site-packages/astropy/setup_helpers.py", line 586, in generate_default_config
msg = ('Generation of default configuration item failed! Stdout '
AttributeError: 'str' object has no attribute 'decode'

Merci !

Médéric

[pip] ConfigParser bug in setup.py

Hi @astrofrog

The 0.9.8 release on pypi cannot be built via pip using python3.5. Is it possible for you to make a release of what is on master?

$ pip install montage_wrapper 
 Collecting montage_wrapper 
   Using cached montage-wrapper-0.9.8.tar.gz 
     Complete output from command python setup.py egg_info: 
     git submodule command failed unexpectedly: 
     fatal: Not a git repository (or any of the parent directories): .git 
      
     /Users/ojones/anaconda/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg/pkg_resources/__init__.py:187: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need. 
     /Users/ojones/anaconda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. 
       warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') 
     /Users/ojones/anaconda/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. 
       warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') 
     Traceback (most recent call last): 
       File "<string>", line 1, in <module> 
       File "/private/var/folders/2l/v4cs8jdx1rd0rzrykclw77n80001dy/T/pip-build-3tofr4b8/montage-wrapper/setup.py", line 25, in <module> 
         conf = config.ConfigParser() 
     AttributeError: module 'distutils.config' has no attribute 'ConfigParser' 
      
     ---------------------------------------- 
 Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2l/v4cs8jdx1rd0rzrykclw77n80001dy/T/pip-build-3tofr4b8/montage-wrapper/ 

Mistake in mBgExec documentation

I just noticed what seems to be an error in the documentation for mBgExec, found at:

http://montage-wrapper.readthedocs.org/en/v0.9.5/_generated/montage_wrapper.commands.mBgExec.html#montage_wrapper.commands.mBgExec

It says that the corrections_table input parameter should be "Table of corrections generated by mFitExec"; however providing this table gives the error "Table does not contain column [id]".

The corrections_table input parameter should in fact be the table produce by mBgModel (which works for me).

Cheers!

montage-wrapper does not detect montage installation on Windows

Hi,

After building montage on windows, and adding the directory to my PATH, montage-wrapper still complained that it was not installed. Looking at the code, it appears that this is because in montage_wrapper\__init__.py, the path is searched by splitting by ':'.

On Windows, the path variable is split by ';' instead. I patched this locally, so I'll submit a PR to fix the issue, in case anyone else is having issues.

Citable record?

We're planning to reference and cite all Astropy affiliated packages in the upcoming Astropy v2.0 paper. I couldn't find a citable record for this package - are you interested in creating one so that we can cite it? For example, you can create a zenodo record and just comment back here to let me know that it's done. Please also let me know if you'd like to opt out of a citation and we'll just link to the package. Thanks!

Using north=True distorts images

Hi,

I've downloaded montage and I can successfully import montage_wrapper, but when I attempt to use north=True to reorient images the resulting image is oddly distorted.

When I input this

Data_File = '500_micron copy.fits'
fig_Perseus = aplpy.FITSFigure(Data_File, hdu=1, north=True)
fig_Perseus.show_colorscale(cmap=color_table, vmin=12, vmax=25.625)
fig_Perseus.show_contour(Data_File, hdu=1, levels=Her500_Jybm, colors='white')
fig_Perseus.ticks.set_color('black')
fig_Perseus.save('Oph_region_Figure.pdf')

The image looks like
Oph_region_Figure.pdf

removing the north=True from the second line gives the correct image
Oph_region_Figure.pdf

Is there a fix for this? I'm running montage-wrapper 0.9.8 and Montage_v5.0

Thanks

Raggedy edges in reprojection

When reprojecting into a rotated coordinate system, montage's default behavior is apparently to leave edge pixels blank if they don't fit perfectly into the reprojected coordinate system.

I think a workaround is to project onto a slightly larger grid prior to doing mAdd. I'll try to implement this, but if anyone has code that would nicely determine how big "slightly larger" has to be to avoid this, it would be helpful. Alternately, I'd be happy with any other solution.

montagecropexample

Interrupted system call when reprojecting

Really weird error, when reprojecting - it works every 5th time or so, but most of the time it throws this error. Attached - the file that makes trouble.

https://moria.astro.utoronto.ca/owncloud/public.php?service=files&t=f0039a91966259a9f9dd686f4a120314

In [2]: from montage_wrapper import wrappers
WARNING: ConfigurationDefaultMissingWarning: Requested default configuration file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/montage_wrapper-0.9.5-py2.7.egg/montage_wrapper/montage_wrapper.cfg is not a file. Cannot install default profile. If you are importing from source, this is expected. [montage_wrapper]

In [3]: from astropy.io import fits

In [4]: tmp = wrappers.reproject_hdu(fits.open('hst_f550m.fits')[0], north_aligned=True)
ERROR: IOError: [Errno 4] Interrupted system call [montage_wrapper.commands]
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-4-37eec9bd158b> in <module>()
----> 1 tmp = wrappers.reproject_hdu(fits.open('hst_f550m.fits')[0], north_aligned=True)

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/montage_wrapper-0.9.5-py2.7.egg/montage_wrapper/wrappers.pyc in reproject_hdu(in_hdu, **kwargs)
     48     fits.writeto(in_image, in_hdu.data, in_hdu.header)
     49 
---> 50     reproject(in_image, out_image, **kwargs)
     51 
     52     out_hdu = fits.open(out_image)[0]

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/montage_wrapper-0.9.5-py2.7.egg/montage_wrapper/wrappers.pyc in reproject(in_images, out_images, header, bitpix, north_aligned, system, equinox, factor, common, exact_size, hdu, cleanup, silent_cleanup)
    330     if not header:
    331         m.mMakeHdr(images_raw_tbl, header_hdr, north_aligned=north_aligned,
--> 332                    system=system, equinox=equinox)
    333 
    334     for i, in_image in enumerate(in_images):

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/montage_wrapper-0.9.5-py2.7.egg/montage_wrapper/commands.pyc in mMakeHdr(images_table, template_header, debug_level, status_file, cdelt, north_aligned, system, equinox)
   1463     p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE,
   1464         stderr=subprocess.PIPE)
-> 1465     stderr = p.stderr.read()
   1466     if stderr:
   1467         raise Exception(stderr)

IOError: [Errno 4] Interrupted system call

Install via pip looks like it does not work (but it does)

I just tried to install via pip and it looked as if that failed.
Only later did I notice the small note "Successfully installed montage-wrapper" at the bottom.
This might be an issue related to astropy-helpers?

/data/guenther/astrosoft> pip install montage-wrapper
Downloading/unpacking montage-wrapper
  Downloading montage-wrapper-0.9.8.tar.gz (208kB): 208kB downloaded
  Running setup.py (path:/tmp/pip_build_guenther/montage-wrapper/setup.py) egg_info for package montage-wrapper
    git submodule command failed unexpectedly:
    fatal: Not a git repository (or any of the parent directories): .git


Requirement already satisfied (use --upgrade to upgrade): astropy in /data/guenther/anaconda/lib/python2.7/site-packages/astropy-1.0.dev10083-py2.7-linux-x86_64.egg (from montage-wrapper)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5.1 in /data/guenther/anaconda/lib/python2.7/site-packages (from astropy->montage-wrapper)
Installing collected packages: montage-wrapper
  Running setup.py install for montage-wrapper
    git submodule command failed unexpectedly:
    fatal: Not a git repository (or any of the parent directories): .git


Successfully installed montage-wrapper
Cleaning up...
/data/guenther/astrosoft> 

0.9.9: test_all fails

Hi,

when trying to build 0.9.9 (which is, BTW, on pypi but not on github) for Debian, I get a failure in test_all:

___________________________________ test_all ___________________________________

    def test_all():
    
>       stat = mArchiveList('2MASS', 'k', 'M31', 0.2, 0.2, 'm31_2mass_k.tbl')

montage_wrapper/tests/test_commands.py:10: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
montage_wrapper/commands.py:284: in mArchiveList
    return status.parse_struct("mArchiveList", p.stdout.read().strip())
montage_wrapper/status.py:33: in parse_struct
    result = Struct(command, string)
montage_wrapper/status.py:67: in __init__
    self.__dict__[key] = simplify(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

value = '"Invalid URL string (must start \'http://\''

    def simplify(value):
        try:
            return int(value)
        except:
>           return float(value)
E           ValueError: could not convert string to float: "Invalid URL string (must start 'http://'

montage_wrapper/status.py:12: ValueError

I also get a number of warnings:

  [pytest] section in setup.cfg files is deprecated, use [tool:pytest] instead.
lib.linux-x86_64-2.7/montage_wrapper/tests/test_wrappers.py::TestMosaic::()::test_mosaic
  /usr/lib/python2.7/dist-packages/astropy/utils/decorators.py:482: AstropyDeprecationWarning: "clobber" was deprecated in version 2.0 and will be removed in a future version. Use argument "overwrite" instead.
    AstropyDeprecationWarning)

and

  /usr/lib/python2.7/dist-packages/astropy/io/ascii/ui.py:706: AstropyDeprecationWarning: /tmp/montage_mosaic_raw_Mtv1KJ/images_raw_all.tbl already exists. Automatically overwriting ASCII files is deprecated. Use the argument 'overwrite=True' in the future.
    output), AstropyDeprecationWarning)

reproject_cube calls deprecated astropy.io.fits.Header.fromTxtFile (missing since astropy version 1.1)

The astropy.io.fits.Header.fromTxtFile method is missing since astropy version 1.1, resulting in the following error:
AttributeError: 'Header' object has no attribute 'fromTxtFile'

I tested simply replacing line 176 in wrappers.py with
newheader = newheader.fromtextfile(header_temp)

This simple fix seems to work, but I'm not sure if wrappers.py should handle astropy versions < 1.1

The line in question:

newheader.fromTxtFile(header_temp)

pip install montage-wrapper fails to install astropy dependency

I see this error from pip (Python 2.7) on a fresh Ubuntu 13.04 VM:

deil@ubuntu:/tmp$ sudo pip install montage-wrapper
Downloading/unpacking montage-wrapper
  Downloading montage-wrapper-0.9.5.tar.gz
  Running setup.py egg_info for package montage-wrapper
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/tmp/build/montage-wrapper/setup.py", line 30, in <module>
        import astropy
    ImportError: No module named astropy
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/tmp/build/montage-wrapper/setup.py", line 30, in <module>

    import astropy

ImportError: No module named astropy

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/build/montage-wrapper
Storing complete log in /home/deil/.pip/pip.log

On my Mac in a fresh virtualenv (Python 2.7) I see this error:


(mw)eduroam-3-163:tmp deil$ pip install montage-wrapper
Downloading/unpacking montage-wrapper
  Downloading montage-wrapper-0.9.5.tar.gz
  Running setup.py egg_info for package montage-wrapper
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/private/tmp/mw/build/montage-wrapper/setup.py", line 16, in <module>
        from distribute_setup import use_setuptools
    ImportError: No module named distribute_setup
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/private/tmp/mw/build/montage-wrapper/setup.py", line 16, in <module>

    from distribute_setup import use_setuptools

ImportError: No module named distribute_setup

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /private/tmp/mw/build/montage-wrapper
Storing complete log in /Users/deil/.pip/pip.log

With Python 3 I see Unicode-related errors.

@astrofrog Can you reproduce or does it work for you?

Error installing montage-wrapper having the IPAC montage software

I first installed the IPAC montage software and put the bin/ folder in my $PATH. Montage is working:

madd
[struct stat="ERROR", msg="Usage: mAdd [-p imgdir] [-n(o-areas)] [-a mean|median|count] [-e(xact-size)] [-d level] [-s statusfile] images.tbl template.hdr out.fits"]

Then I tried to install montage-wrapper

sudo pip install montage-wrapper

Then I get the following error:

>ERROR: Montage commands could not be found.

>In order to use the montage_wrapper module, you will first need to

>install the IPAC Montage software from:

>    http://montage.ipac.caltech.edu

>and ensure that the Montage commands (e.g. mAdd, mProject, etc.) are in

>your $PATH. Your current $PATH variable contains the following paths,

>but none of them contain the Montage commands:

>   PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

>If the Montage commands are in one of these directories, then please

>report this as an issue with montage-wrapper.
>----------------------------------------
>Command python setup.py egg_info failed with error code 1
>Storing complete log in /home/eduardo/.pip/pip.log

The thing is that IPAC is installed and if I do

echo $PATH

My $PATH variable contains more directories than the stated by the ERROR message.
I believe the installer is not actually reading my $PATH variable but just looking in

PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Is that true? how can I solve this?

0.9.8: test fails with montage-4.0

When testing the wrapper with the new version 4.0 of Montage, the numbers seem to have shifted a bit, causing the unit test to fail:

montage_wrapper/tests/test_wrappers.py::TestMosaic::test_mosaic FAILED
montage_wrapper/tests/test_wrappers.py::TestMosaic::test_mosaic_background_match xfail

=================================== FAILURES ===================================
____________________________ TestMosaic.test_mosaic ____________________________

self = <montage_wrapper.tests.test_wrappers.TestMosaic object at 0x7f55b9a59190>

    def test_mosaic(self): [...]
>       assert_allclose(np.std(valid), 0.12658458001333581)

montage_wrapper/tests/test_wrappers.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/dist-packages/numpy/testing/utils.py:1297: in assert_allclose
    verbose=verbose, header=header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

comparison = <function compare at 0x7f55bacd8488>
x = array(0.12658488750457764, dtype=float32), y = array(0.1265845800133358)
err_msg = '', verbose = True
header = 'Not equal to tolerance rtol=1e-07, atol=0', precision = 6
[...]
    def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
                             header='', precision=6): [...]
                if not cond :
>                   raise AssertionError(msg)
E                   AssertionError: 
E                   Not equal to tolerance rtol=1e-07, atol=0
E                   
E                   (mismatch 100.0%)
E                    x: array(0.12658488750457764, dtype=float32)
E                    y: array(0.1265845800133358)

/usr/lib/python2.7/dist-packages/numpy/testing/utils.py:665: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO: Listing raw frames [montage_wrapper.wrappers]
INFO: Computing optimal header [montage_wrapper.wrappers]
INFO: Projecting raw frames [montage_wrapper.wrappers]
INFO: Mosaicking frames [montage_wrapper.wrappers]
INFO: Deleting work directory /tmp/montage_mosaic_raw_LgGrKY [montage_wrapper.wrappers]
===================== 1 failed, 1 xfailed in 6.19 seconds ======================

Similarly for np.mean and np.median.
Increasing the rtol to 1e-5 for al three asserts helps here (by keeping compatibility with the old Montage version).

Should setup.py install astropy if not found?

Shouldn't montage-wrapper install astropy if it is not found?
Currently without having astropy installed I get an ImportError from montage-wrapper:

$ cd montage-wrapper
$ python setup.py build
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmpNKMmNo
Now working in /tmp/tmpNKMmNo/distribute-0.6.28
Building a Distribute egg in /home/deil/software/montage-wrapper
/home/deil/software/montage-wrapper/distribute-0.6.28-py2.7.egg
Traceback (most recent call last):
  File "setup.py", line 30, in <module>
    import astropy
ImportError: No module named astropy

mpirun process exiting without calling "finalize"

mosaic() (v.0.9.7) is giving the following error when mpi == True:

vterron@iaa:~/lemon$ ./montage.py 
INFO: Listing raw frames [montage_wrapper.wrappers]
INFO: Computing optimal header [montage_wrapper.wrappers]
INFO: Projecting raw frames [montage_wrapper.wrappers]
INFO: Determining overlaps [montage_wrapper.wrappers]
INFO: Modeling background [montage_wrapper.wrappers]
INFO: Matching background [montage_wrapper.wrappers]
ERROR: Exception: --------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 26373 on
node iaa exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
 [montage_wrapper.commands]
Traceback (most recent call last):
  File "./montage.py", line 11, in <module>
    montage.mosaic(input_dir, output_dir, **kwargs)
  File "/home/vterron/.local/lib/python2.6/site-packages/montage_wrapper/wrappers.py", line 546, in mosaic
    proj_dir=projected_dir, mpi=mpi, n_proc=n_proc)
  File "/home/vterron/.local/lib/python2.6/site-packages/montage_wrapper/commands.py", line 487, in mBgExec
    raise Exception(stderr)
Exception: --------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 26373 on
node iaa exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------

The MPI-enabled Montage (v3.3) binaries are installed and present in PATH:

vterron@iaa:~$ which mAddMPI 
/home/vterron/.local/bin/Montage_v3.3/bin/mAddMPI
vterron@iaa:~$
vterron@iaa:~/lemon$ mpirun --version
mpirun (Open MPI) 1.4.2

Report bugs to http://www.open-mpi.org/community/help/
vterron@iaa:~$
vterron@iaa:~/lemon$ mpicc --version
gcc (Debian 4.4.5-8) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Test code to help you reproduce it:

import montage_wrapper as montage

kwargs = dict(background_match = True,
              mpi = True,
              n_proc = 4)

input_dir = "ngc2264_mosaic_input/"
output_dir = "ngc2264_mosaic_output/"
montage.mosaic(input_dir, output_dir, **kwargs)

The contents of ngc2264_mosaic_input/ are these FITS images.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.