nasa / RHEAS

Regional Hydrologic Extremes Assessment System
MIT License
73 stars 54 forks source link

Dryspells order (Low importance) #41

Closed AdamJDuncan closed 8 years ago

AdamJDuncan commented 8 years ago

I'm making an animated map of dryspells and noticed that the table is not sorted by fdate. I just go CREATE TABLE dryspellssorted AS (SELECT * FROM dryspells2015.dryspells ORDER BY fdate ASC); but others in the future may get confused, as the table does not fit the program's standard output style. Cheers.

kandread commented 8 years ago

The same function that writes the rest of the variables is used for dry spells so they should end up the same way. I can probably force it, but let me do some benchmarking. Sorting for large tables might slow things down enough to actually notice.

kandread commented 8 years ago

Just tested and I cannot reproduce this. Using the following configuration

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

[vic]
precip: chirps
temperature: ncep
wind: ncep
save to: db
save: dryspells, soil_moist

and running select fdate from test.dryspells; inside psql I get

fdate

2003-01-01 2003-01-02 2003-01-03 2003-01-04 2003-01-05 2003-01-06 2003-01-07 2003-01-08 2003-01-09 2003-01-10 2003-01-11 2003-01-12 2003-01-13 2003-01-14 2003-01-15 2003-01-16 2003-01-17 2003-01-18 2003-01-19 2003-01-20 2003-01-21 2003-01-22 2003-01-23 2003-01-24 2003-01-25 2003-01-26 2003-01-27 2003-01-28 2003-01-29 2003-01-30 2003-01-31 (31 rows)

Can you print your output after you run it?

AdamJDuncan commented 8 years ago

I just looked at another dryspells result and it was fine... I do get the same issue on soilmoist_std but consider it nitpicking. Closing the issue; thanks for checking.

rheas=# select fdate from kayahlongnowcast.soil_moist_std;
   fdate    
------------
 2010-10-16
 2010-09-26
 2010-09-10
 2010-10-24
 2010-10-05
 2010-10-18
 2010-09-17
 2010-09-22
 2010-10-23
 2010-09-02
 2010-09-11
 2010-10-09
 2010-10-03
 2010-10-21
 2010-10-29
 2010-09-23
 2010-10-26
 2010-10-07
 2010-10-14
 2010-09-24
 2010-10-25
 2010-09-12
 2010-10-02
 2010-10-22
 2010-09-07
 2010-10-13