tsherwen / AC_tools

Module for working with global/regional Chemical Transport Model (CTM) output and observations
MIT License
13 stars 10 forks source link

fix bug in latest push & setup temporary landmap data in example dir #45

Closed tsherwen closed 8 years ago

tsherwen commented 8 years ago

Temporarily use existing landmap files. Replace these with smaller files asap.

error message: " {'debug': False, 'res': '4x5', 'wd': None, 'time': None} Folder does not exist /LANDMAP_LWI_ctm ERROR:root:Could not get the surface area! Traceback (most recent call last):

... raise ValueError("Could not find the surface area")

"

BenNewsome commented 8 years ago

There is kind of a work around for this:

if you pass the wd to the get_surface_area then it tries to get the surface area from the wd instead of a lookup table.

But yes, this is not a fix

tsherwen commented 8 years ago

Ok. The issue was "os.path.join(" does evaluate to the required address. I've fixed this and transferred the files to the current (very large) apache server. I will update the code to pull these files and create a directory. Maybe a rename of test_files to example_files and placing this in the main directory would be best.

e.g.

In [21]: os.path.join( '/work/home/ts551/data//misc_ref/', '/LANDMAP_LWI_ctm' ) Out[21]: '/LANDMAP_LWI_ctm'

In [22]: os.path.join( '/work/home/ts551/data//misc_ref/', 'LANDMAP_LWI_ctm' ) Out[22]: '/work/home/ts551/data//misc_ref/LANDMAP_LWI_ctm'

BenNewsome commented 8 years ago

I have setup a script to download data from earth in the Scripts folder. An example of how to call in a bad way is in examples/plot_surface_ozone.py

without changing funcs_vars and breaking your work, I am not sure how to implement this.

The data is downloaded to AC_tools/data

The test suit is now using this too, but changing this to a subfolder in data may be something to do in the future.

tsherwen commented 8 years ago

This looks good. What do you think will be broken?

funcs_vars needs to be updated, so this is going to happen anyway and I update . I think we should move to a config now and update to Just a text file that builds a dictionary of a users location. This file would then be the user's job to maintain and give flexibility to add in new addresses.

A lot of the smvgear approaches (in func_vars) will be redundant anyway with the onset of v11 which shelves the integrator for KPP.

One thing is apparent. The calls to get_dir generally seem to (incorrectly) import from func_vars, but actually this has ended up in funcs4core in the reorganisation.