Giter Site home page Giter Site logo

pyvims's Introduction

PyVIMS

Build Python Status Version License

PyPI Binder Zenodo

Python package to manipulate the Cassini VIMS data.

Install

pip install pyvims

Upgrade

pip install --upgrade pyvims

Examples

To use, simply do:

>>> from pyvims import VIMS

>>> cube = VIMS('1487096932_1')

>>> cube
<VIMS> Cube: 1487096932_1
- Size: (42, 42)
- Channel: IR
- Mode: NORMAL
- Start time: 2005-02-14 18:02:29.023000
- Stop time: 2005-02-14 18:07:32.930000
- Exposure: 0.16276 sec
- Duration: 0:05:03.907000
- Main target: TITAN
- Flyby: T3

>>> cube.time
datetime.datetime(2005, 2, 14, 18, 5, 0, 976500)

>>> cube.target_name
'TITAN'

>>> cube.NS, cube.NL
(42, 42)

For more details, take a look to the static Jupyter NoteBook where more examples of usage are provided. You can also try this live demo on Binder.

Citation

If you use this package for your research, please cite it as:

Seignovert et al. - PyVIMS (Version 1.0.4) - Zenodo

Disclaimer

This project is not supported or endorsed by either JPL or NASA. The code is provided "as is", use at your own risk.

pyvims's People

Contributors

seignovert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pedrohasselmann

pyvims's Issues

cub.createGeoTiff() and cub.saveGEOJSON() not working

Hello again @seignovert,

I would definitely like to utilize the VIMS data as GeoTIFFs for polar projections and recreate the maps from the VIMS website, but I run into the following error: OSError: Kernel folder "kernels/" does not exist when I try to generate the GeoTIFF or GeoJSON file with the cookie cutter code below:

# download data
wget.download("https://vims.univ-nantes.fr/data/isis/003TI/C1487096932_1_vis.cub")
wget.download("https://vims.univ-nantes.fr/data/isis/003TI/C1487096932_1_ir.cub")
wget.download("https://vims.univ-nantes.fr/data/isis/003TI/N1487096932_1_vis.cub")
wget.download("https://vims.univ-nantes.fr/data/isis/003TI/N1487096932_1_ir.cub")
wget.download("https://vims.univ-nantes.fr/lbl/1487096932_1", out="v1487096932_1.lbl") 
wget.download("https://vims.univ-nantes.fr/qub/1487096932_1", out="v1487096932_1.qub")
# run respective functions
testcub = pyvims.VIMS("1487096932_1")
testcub.createGeoTiff()
testcub.saveGEOJSON()

I tried looking into the source code to spot any obvious errors, but it must be linked to this \kernels folders not being created with the pyvims SPICE routines for some reason. I tried to download the raw .qub and .lbl files in the same folder, but I still received the same error. Thanks for taking the time to look into this issue.

Download example isn't working

Hello,
I am having trouble trying to use wget to download a VIMS .cub file with Windows 10 OS, but it appears that the data in the ReadMe example is inaccessible (see bullet 1). I tried to use the following commands in the Windows Powershell and Python 3.6 respectively:

  • > wget https://vims.univ-nantes.fr/data/isis/T3/C1487096932_1_vis.cub
    wget : Not Found
    The requested URL /data/isis/T3/C1487096932_1_vis.cub was not found on this server.

    I receive the following error and checked the url to see that I wasn't allowed access to these folders, which makes this downloading method unusable.

  • import wget; wget.download("https://vims.univ-nantes.fr/data/isis/T3/C1487096932_1_vis.cub")
    urllib.error.HTTPError: HTTP Error 404: Not Found
    In Python, this raises a similar error for the same example file and confirms the denied access to those folders.

  • wget.download("https://www.vims.univ-nantes.fr/ir/cal/N1790066425_1_ir.cub")
    ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
    I saw another link to download the individual C*_ir.cub and N*_ir.cub files in the ISIS3 data pipeline webpage and receive a more workable error. I tried to resolve it by editing my proxy server settings to automatic as described in StackOverflow, but it didn't change anything. I will continue to explore a solution to this error for the meantime as it might be something on my end.

Nonetheless, is there any way that you could fix the download example to allow access to the .cub files in the \flyby folders? Downloading them individually from the cube pages would be cumbersome. Thanks!

Standalone reader for ISIS3 VIS/IR cubes

For now the VIMS_ISIS3 class require the _vis.cub and _ir.cub part of the spectrum but the output from vims2isis split the .qub in two files.

If one of them is missing the loading failed To avoid incomplete metadata:

self.lbl = pvl.load(self.fname_ir)['IsisCube']
self.lbl_vis = pvl.load(self.fname_vis)['IsisCube']

But it should be possible to assert None values for the missing information. Therefore, the need for both file is no longer mandatory (only mention as a warning as missing NAV file).

NB: The thrown exception is NameError, but should be replace by FileNotFoundError.

raise NameError('ISIS VIS CUB file was not found: %s' % fname_vis)

raise NameError('ISIS IR CUB file was not found: %s' % fname_ir)

The edit also needs to be apply also to VIMS_NAV_ISIS3 which only take into account the IR part for now:

def fname(self):
'''Check if VIMS file exists.'''
fname = self.root + 'N' + self.imgID + '_ir.cub'
if not os.path.isfile(fname):
raise NameError('ISIS3 GeoCube file %s not found' % fname)
return fname
def readLBL(self):
'''Read VIMS ISIS3 geocube LBL'''
self.lbl = pvl.load(self.fname)['IsisCube']

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.