Git Product home page Git Product logo

Comments (10)

AdamJDuncan avatar AdamJDuncan commented on July 22, 2024

have you populated the db with chirps & ncep information for that shapefile area and daterange? need to do that first. (the data.conf step)

from rheas.

kashingtonDC avatar kashingtonDC commented on July 22, 2024

Ah, got it, thanks. I populated the database by adding parameters to data.conf and running ./bin/rheas -u data.conf. Then updated the nowcast.conf and nowcast.in files to reflect changes. This solved the above error.

However now when I run ./bin/rheas nowcast.conf I get:

File "/Users/macbookpro/RHEAS/bin/rheas", line 15, in <module> sys.exit(rheas.run()) File "/Users/macbookpro/RHEAS/src/rheas.py", line 81, in run nowcast.execute(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 187, in execute runVIC(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 29, in runVIC runDeterministicVIC(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 69, in runDeterministicVIC startday, endyear, endmonth, endday, name) File "/Users/macbookpro/RHEAS/src/vic/vic.py", line 52, in __init__ "select resolution from vic.input order by abs(resolution - {0})".format(resolution)) psycopg2.ProgrammingError: relation "vic.input" does not exist

When I run ./bin/rheas -d postgres nowcast.confI get:

ERROR: relation "vic.input" does not exist at character 24 STATEMENT: select resolution from vic.input order by abs(resolution - 0.25) Traceback (most recent call last): File "/Users/macbookpro/RHEAS/bin/rheas", line 15, in <module> sys.exit(rheas.run()) File "/Users/macbookpro/RHEAS/src/rheas.py", line 81, in run nowcast.execute(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 187, in execute runVIC(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 29, in runVIC runDeterministicVIC(dbname, options) File "/Users/macbookpro/RHEAS/src/nowcast.py", line 69, in runDeterministicVIC startday, endyear, endmonth, endday, name) File "/Users/macbookpro/RHEAS/src/vic/vic.py", line 52, in __init__ "select resolution from vic.input order by abs(resolution - {0})".format(resolution)) psycopg2.ProgrammingError: relation "vic.input" does not exist

Looks like I am missing some of the VIC inputs. Is there a conf file for vic?

I'm happy to close this issue and open another one if that's preferable. Thanks!

from rheas.

AdamJDuncan avatar AdamJDuncan commented on July 22, 2024

I think this may be caused by the initial state setting? Try vanilla, eg:

[nowcast]
model: vic
startdate: 2003-1-1
enddate: 2003-3-31
basin: data/tests/basin.shp
name: vanillatest
resolution: 0.25

[vic]
precip: chirps
temperature: ncep
wind: ncep
initialize: no
save to: db
save: net_short, soil_moist

from rheas.

kashingtonDC avatar kashingtonDC commented on July 22, 2024

When trying to populate the database with ncep (e.g. ./bin/rheas -u data.conf I get:

WARNING! Overwriting raster in tmax.ncep_4 table for 2003-01-01
Traceback (most recent call last):
  File "/Users/macbookpro/RHEAS/bin/rheas", line 15, in <module>
    sys.exit(rheas.run())
  File "/Users/macbookpro/RHEAS/src/rheas.py", line 76, in run
    update(dbname, config_filename)
  File "/Users/macbookpro/RHEAS/src/rheas.py", line 64, in update
    mod.download(dbname, dt, bbox)
  File "/Users/macbookpro/RHEAS/src/datasets/ncep.py", line 72, in download
    _downloadVariable(varname, dbname, dt, bbox)
  File "/Users/macbookpro/RHEAS/src/datasets/ncep.py", line 62, in _downloadVariable
    print("Imported {0} in {1}".format(t.strftime("%Y-%m-%d"), table))
  File "netCDF4/_netCDF4.pyx", line 3647, in netCDF4._netCDF4.Variable.__getattr__ (netCDF4/_netCDF4.c:35947)
  File "netCDF4/_netCDF4.pyx", line 3458, in netCDF4._netCDF4.Variable.getncattr (netCDF4/_netCDF4.c:33184)
  File "netCDF4/_netCDF4.pyx", line 1112, in netCDF4._netCDF4._get_att (netCDF4/_netCDF4.c:4200)
AttributeError: NetCDF: Attribute not found

Here is my data.conf file:

[domain]
minlat: 1.0
maxlat: 1.25
minlon: 35
maxlon: 35.25

[chirps]
startdate: 2003-1-1
enddate: 2003-3-31

[ncep]
startdate: 2003-1-1
enddate: 2003-3-31

from rheas.

akssinghe avatar akssinghe commented on July 22, 2024

Hi Kostas,

Even though it has been installed all necessary dependencies, it gives below error when downloading NCEP data. Kindly have a look.

Traceback (most recent call last):
File "./bin/rheas", line 16, in
sys.exit(rheas.run())
File "/home/susantha/RHEAS/src/rheas.py", line 76, in run
update(dbname, config_filename)
File "/home/susantha/RHEAS/src/rheas.py", line 64, in update
mod.download(dbname, dt, bbox)
File "/home/susantha/RHEAS/src/datasets/ncep.py", line 72, in download
_downloadVariable(varname, dbname, dt, bbox)
File "/home/susantha/RHEAS/src/datasets/ncep.py", line 62, in _downloadVariable
print("Imported {0} in {1}".format(t.strftime("%Y-%m-%d"), table))
File "_netCDF4.pyx", line 3633, in netCDF4._netCDF4.Variable.getattr (netCDF4/_netCDF4.c:31607)
File "_netCDF4.pyx", line 3448, in netCDF4._netCDF4.Variable.getncattr (netCDF4/_netCDF4.c:29324)
File "_netCDF4.pyx", line 1099, in netCDF4._netCDF4._get_att (netCDF4/_netCDF4.c:4112)

AttributeError: NetCDF: Attribute not found

from rheas.

kandread avatar kandread commented on July 22, 2024

This is probably related to an issue with the upstream netCDF python package. Can you try updating to the newest package and see if that solves it?
Also, the newest RHEAS version has a self-contained test suite so running ./bin/test after a correct installation should pass all 13 tests.

from rheas.

akssinghe avatar akssinghe commented on July 22, 2024

Hi K,

I am getting "psycopg2.ProgrammingError: relation "raster_resampled" does not exist" error since couple of days ago. I have installed psycopg2 and am with necessary input data sets. Pls advice to resolve this error.


Traceback (most recent call last):
File "./bin/rheas", line 16, in
sys.exit(rheas.run())
File "/home/rheas/RHEAS/src/rheas.py", line 81, in run
nowcast.execute(dbname, options)
File "/home/rheas/RHEAS/src/nowcast.py", line 191, in execute
runVIC(dbname, options)
File "/home/rheas/RHEAS/src/nowcast.py", line 29, in runVIC
runDeterministicVIC(dbname, options)
File "/home/rheas/RHEAS/src/nowcast.py", line 75, in runDeterministicVIC
prec, tmax, tmin, wind = model.getForcings(options['vic'])
File "/home/rheas/RHEAS/src/vic/vic.py", line 355, in getForcings
rtables[v] = self.createIndexTable("{0}.{1}".format(v, options[v]))
File "/home/rheas/RHEAS/src/vic/vic.py", line 296, in createIndexTable
"select * from raster_resampled where sname='{0}' and tname like '{1}_%' and resolution={2}".format(sname, tname, self.res))
psycopg2.ProgrammingError: relation "raster_resampled" does not exist

LINE 1: select * from raster_resampled where sname='precip' and tnam...

from rheas.

kandread avatar kandread commented on July 22, 2024

How are you ingesting the datasets, are you using rheas -d data.conf? That should trigger the creation of the raster catalog (see here) so it should always exist (unless the downloading was stopped externally).
In any case, in order to fix this go inside a psql shell and paste
create or replace function resampled(_s text, _t text, out result double precision) as $func$ begin execute format('select st_scalex(rast) from %s.%s limit 1',quote_ident(_s),quote_ident(_t)) into result; end $func$ language plpgsql;
After that is finished paste this and you should have the catalog
create or replace view raster_resampled as (select r_table_schema as sname,r_table_name as tname,resampled(r_table_schema,r_table_name) as resolution from raster_columns);

from rheas.

akssinghe avatar akssinghe commented on July 22, 2024

Hi K,

I am using rheas -u data.conf to ingest datasets.

Now it is working well. Thanks for guidance.

From: Kostas Andreadis [mailto:[email protected]]
Sent: Monday, July 25, 2016 8:47 PM
To: nasa/RHEAS [email protected]
Cc: Susantha Jayasinghe [email protected]; Comment <
[email protected]>
Subject: Re: [nasa/RHEAS] Nowcast test error: relation "raster_resampled"
does not exist (#43)

How are you ingesting the datasets, are you using rheas -d data.conf? That
should trigger the creation of the raster catalog (see here
https://github.com/nasa/RHEAS/blob/master/src/dbio.py#L174) so it should
always exist (unless the downloading was stopped externally).
In any case, in order to fix this go inside a psql shell and paste
create or replace function resampled(_s text, _t text, out result double
precision) as
$func$
begin
execute format('select st_scalex(rast) from %s.%s limit
1',quote_ident(_s),quote_ident(_t)) into result;
end
$func$ language plpgsql;
After that is finished paste this and you should have the catalog
create or replace view raster_resampled as (select r_table_schema as
sname,r_table_name as tname,resampled(r_table_schema,r_table_name) as
resolution from raster_columns);


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#43 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AROogGu4C-ifdipgIEm74go1VVcxM3feks5qZL5dgaJpZM4IQGzB
.[image: Image removed by sender.]

from rheas.

kandread avatar kandread commented on July 22, 2024

Ok, closing the issue.

from rheas.

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.