ckrawczyk / gz3d_production Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello!
While running Working_with_GZ3D.ipynb
(after correcting the previous issue in marvin_subclass.py
) we encounter an error with the file path for the data file. The error is as follows:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-2-43d72828a907> in <module>()
1 from gz3d_fits import gz3d_fits
2
----> 3 data = gz3d_fits('/Volumes/Work/GZ3D/MPL5_fits/1-167242_127_5679242.fits.gz')
4 data.get_bpt()
5 data.make_all_spaxel_masks()
/raid5/homes/sshamsi/Untitled Folder/gz3d_fits.py in __init__(self, filename)
51 self.subject_id = filename.split('/')[-1].split('_')[-1].split('.')[0]
52 # read in the fits file
---> 53 self.hdulist = fits.open(filename)
54 # grab the wcs
55 self.wcs = WCS(self.hdulist[1].header)
~/.local/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in fitsopen(name, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs)
162
163 return HDUList.fromfile(name, mode, memmap, save_backup, cache,
--> 164 lazy_load_hdus, **kwargs)
165
166
~/.local/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in fromfile(cls, fileobj, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs)
398 return cls._readfrom(fileobj=fileobj, mode=mode, memmap=memmap,
399 save_backup=save_backup, cache=cache,
--> 400 lazy_load_hdus=lazy_load_hdus, **kwargs)
401
402 @classmethod
~/.local/lib/python3.5/site-packages/astropy/io/fits/hdu/hdulist.py in _readfrom(cls, fileobj, data, mode, memmap, save_backup, cache, lazy_load_hdus, **kwargs)
985 if not isinstance(fileobj, _File):
986 # instantiate a FITS file object (ffo)
--> 987 fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
988 # The Astropy mode is determined by the _File initializer if the
989 # supplied mode was None
~/.local/lib/python3.5/site-packages/astropy/utils/decorators.py in wrapper(*args, **kwargs)
486 # one with the name of the new argument to the function
487 kwargs[new_name[i]] = value
--> 488 return function(*args, **kwargs)
489
490 return wrapper
~/.local/lib/python3.5/site-packages/astropy/io/fits/file.py in __init__(self, fileobj, mode, memmap, overwrite, cache)
173 self._open_fileobj(fileobj, mode, overwrite)
174 elif isinstance(fileobj, str):
--> 175 self._open_filename(fileobj, mode, overwrite)
176 else:
177 self._open_filelike(fileobj, mode, overwrite)
~/.local/lib/python3.5/site-packages/astropy/io/fits/file.py in _open_filename(self, filename, mode, overwrite)
525 ext = os.path.splitext(self.name)[1]
526
--> 527 if not self._try_read_compressed(self.name, magic, mode, ext=ext):
528 self._file = fileobj_open(self.name, IO_FITS_MODES[mode])
529 self.close_on_error = True
~/.local/lib/python3.5/site-packages/astropy/io/fits/file.py in _try_read_compressed(self, obj_or_name, magic, mode, ext)
423 else:
424 kwargs['fileobj'] = obj_or_name
--> 425 self._file = gzip.GzipFile(**kwargs)
426 self.compression = 'gzip'
427 elif ext == '.zip' or magic.startswith(PKZIP_MAGIC):
~/.local/lib/python3.5/site-packages/marvin/tools/spaxel.py in spaxel_factory(cls, *args, **kwargs)
70
71 if cls is not SpaxelBase:
---> 72 return type.__call__(cls, *args, **kwargs)
73
74 cube = kwargs.pop('cube', None)
/usr/lib/python3.5/gzip.py in __init__(self, filename, mode, compresslevel, fileobj, mtime)
161 mode += 'b'
162 if fileobj is None:
--> 163 fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
164 if filename is None:
165 filename = getattr(fileobj, 'name', '')
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/Work/GZ3D/MPL5_fits/1-167242_127_5679242.fits.gz'
Thank you!
Hello!
The file marvin_subclass.py
causes an error as in line 1
it cannot import module from marvin.tools.spectrum import Spectrum
. This creates an error when Working_with_GZ3D.ipynb
is run. The error is as follows:
INFO: No release version set. Setting default to MPL-6
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-43d72828a907> in <module>()
----> 1 from gz3d_fits import gz3d_fits
2
3 data = gz3d_fits('/Volumes/Work/GZ3D/MPL5_fits/1-167242_127_5679242.fits.gz')
4 data.get_bpt()
5 data.make_all_spaxel_masks()
/raid5/homes/sshamsi/Untitled Folder/gz3d_fits.py in <module>()
8 import json
9 from marvin import config
---> 10 from marvin_subclass import CubeFast, Suppressor
11 import marvin.utils.dap.bpt as bpt
12
/raid5/homes/sshamsi/Untitled Folder/marvin_subclass.py in <module>()
----> 1 from marvin.tools.spectrum import Spectrum
2 from marvin.tools.cube import Cube
3 import numpy as np
4 import sys
5 import traceback
ImportError: No module named 'marvin.tools.spectrum'
Changing 1 from marvin.tools.spectrum import Spectrum
in marvin_subclass.py
to 1 from marvin.tools.quantities.spectrum import Spectrum
removes this error.
Thank you!
I get the following Marvin Deprecation Error running the trial Notebook which calls this code. Not quite sure what changed with Marvin that breaks this.... can you help me figure it out?
MarvinDeprecationError Traceback (most recent call last)
<ipython-input-5-50dda1424bbf> in <module>
4 data.get_bpt()
5 data.make_all_spaxel_masks()
----> 6 data.get_mean_spectra(inv=True)
/raid5/homes/klmasters/Galaxy Zoo 3D/gz3d_fits.py in get_mean_spectra(self, inv)
226 if self.cube != 'no_data':
227 self.make_all_spaxel_masks()
--> 228 self.mean_bar = self._stack_spectra('bar_mask_spaxel')
229 self.mean_spiral = self._stack_spectra('spiral_mask_spaxel')
230 self.mean_center = self._stack_spectra('center_mask_spaxel')
/gz3d_fits.py in _stack_spectra(self, mask_name, inv)
212 if len(mdx[0] > 0):
213 weights = mask[mdx]
--> 214 spaxels = self.cube[mdx]
215 spectra = np.array([s.spectrum for s in spaxels])
216 if len(spectra) == 1:
marvin_subclass.py in __getitem__(self, xy)
111 def __getitem__(self, xy):
112 """Returns the spaxel for ``(x, y)`` without propserties"""
--> 113 spaxel = self.getSpaxel(x=xy[0], y=xy[1], properties=False, xyorig='lower')
114 if isinstance(spaxel, list):
115 for s in spaxel:
/packages/python3.6.8/lib/python3.6/site-packages/marvin/tools/cube.py in getSpaxel(self, x, y, ra, dec, maps, modelcube, **kwargs)
576 raise marvin.core.exceptions.MarvinDeprecationError(
577 'the {0} parameter has been deprecated. '
--> 578 'Use maps or modelcube.'.format(old_param))
579
580 return marvin.utils.general.general.getSpaxel(x=x, y=y, ra=ra, dec=dec,
MarvinDeprecationError: the properties parameter has been deprecated. Use maps or modelcube.
You can submit this error to Marvin GitHub Issues (https://github.com/sdss/marvin/issues/new).
Fill out a subject and some text describing the error that just occurred.
If able, copy and paste the full traceback information into the issue as well.```
Error in the "plotting theta=zero" line
x_theta, y_theta = zero_theta_line(data)
Error is ```---> 62 map_wcs = wcs.WCS(gz3d.maps['spx_ellcoo_elliptical_azimuth'].header, naxis=2)
Marvin says ```AttributeError: 'Map' object has no 'header' member```
Presumably another change in Marvin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.