Git Product home page Git Product logo

Comments (11)

wtbarnes avatar wtbarnes commented on August 20, 2024

from chiantipy.

sahiggin avatar sahiggin commented on August 20, 2024

Python distribution is Anaconda Python 2.7.12.

import os
os.environ["XUVTOP"]="C:\\Users\\shiggins\\Documents\\CHIANTI"
os.environ["HOME"]="C:\\Users\\shiggins\\Documents\\CHIANTI"
import ChiantiPy.core as ch
import numpy as np
t = 10.**(5.8 + 0.05*np.arange(21.))
fe14 = ch.ion('fe_14', temperature=t, eDensity=1.e+9, em=1.e+27)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\shiggins\AppData\Local\Continuum\Anaconda2\lib\site-packages\chiantipy-0.7.dev506-py2.7.egg\ChiantiPy\core\Ion.py", line 114, in __init__
    self.Defaults = chdata.Defaults
AttributeError: 'module' object has no attribute 'Defaults'

This error occurs with chianti.ioneq present in PaxHeaders.23462 folder. If I remove the file (I just threw it on the Desktop), no errors - all works fine.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

try:
import ChiantiPy.tools.data as chdata
for akey in chdata.Defaults.keys(): print(akey)

this should give a list of things like:
abundfile
wavelength
flux
ioneqfile
gui
let us know what happens

from chiantipy.

sahiggin avatar sahiggin commented on August 20, 2024

Import succeeds, command returns:
ioneqfile
wavelength
gui
abundfile
flux

That's all, though.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

It looks like you are able to import the attribute that has the names of various default values
for example
chdata.Defaults['ioneqfile'] should give the the name 'chianti' and this corresponds to the ioneq file chianti.ioneq
you are using ChiantiPy version 0.7.0... which should be OK.
I also do not understand

PaxHeader.23462

has

that got something to do with the Anaconda package?
I am at a bit of a loss here

from chiantipy.

sahiggin avatar sahiggin commented on August 20, 2024

No, it's part of the gzipped Chianti database that you have to download prior to installing ChiantiPy.

From the instructions at http://chiantipy.sourceforge.net/installing.html:

The gzipped data tar ball can be downloaded from the CHIANTI website

  • put the file in a convenient directory, cd to the directory and untar the file
  • ChiantiPy uses the environment variable XUVTOP to find the database. Set XUVTOP to the name of the directory where the CHIANTI data tarball was placed.

So when you unzip those files, you get a series of folders - mostly element names, and then some metadata. There is a folder ioneq, which contains a file chianti.ioneq. There is also a folder ioneq/PaxHeaders.23462, which also contains a file chianti.ioneq. If I don't remove the second copy, ChiantiPy complains about it on import of ChiantiPy.core ("found more than one ioneq file.") I then get the errors that I reported. If I remove the file from that folder, everything behaves fine. I just wanted to let you know about that.

from chiantipy.

wtbarnes avatar wtbarnes commented on August 20, 2024

from chiantipy.

sahiggin avatar sahiggin commented on August 20, 2024

No problem, thanks for the response. Good to know about the SourceForge docs.

from chiantipy.

kdere avatar kdere commented on August 20, 2024

I just downloaded the database from chiantidatabase.org and it did not have the "PaxHeader" things in it. You might want to do a clean install it your have more problems like that.

from chiantipy.

wtbarnes avatar wtbarnes commented on August 20, 2024

@sahiggin what utility are you using to extract/unzip the CHIANTI tarball?

from chiantipy.

wtbarnes avatar wtbarnes commented on August 20, 2024

I've downloaded the latest tarball from the CHIANTI webpage and using the command,

$ tar xvzf /path/to/tarball.gz

on Mac OS X v10.11.6 (El Capitan) I do not get any of these PaxHeader files. A bit of googling seems to suggest this is an OS or zip-tool dependent issue:

I would try a few different zip tools, perhaps playing around with the different command-line options each offers. As you say, one option is obviously just to remove these files manually.

Either way, this seems to not be related to the ChiantiPy code itself so I'm going to go ahead and close this issue. Feel free to continue this thread if you're still having issues with these files and we can try to figure it out.

from chiantipy.

Related Issues (20)

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.