CSTARS / spatial-cimis

New repository for the DWR Spatial CIMIS program
MIT License
0 stars 1 forks source link

[UCD] Error calculating solar on cimis-goes-s #85

Closed gjscheer-ucd closed 5 years ago

gjscheer-ucd commented 5 years ago

Here is the output error when importing and calculating solar

cimis@cimis-goes-s:~/gdb/solar$ grass /home/cimis/gdb/goes17/cimis --exec g.cimis sec=goes cmd=import,solar arg="files=$(echo /home/cimis/CA/20190803T0511PST-B2.pgm)"
WARNING: Searched for a web browser, but none found
Cleaning up temporary files...
Starting GRASS GIS...
Executing <g.cimis sec=goes cmd=import,solar arg=files=/home/cimis/CA/20190803T0511PST-B2.pgm> ...
WARNING: G__open(write): Unable to open
         '/home/cimis/gdb/goes17/20190803/WIND': No such file or directory
goes17/20190803/0511PST-B2
imported
 100%
20190803/sretr
Specify elevin [meters]
WARNING: raster <_hel_Gci0509> not found
 sretr-Gisolar/20190803/0511PST-B2
20190803/etc/cloud_window
0511PST-P 0511PST-K Specify elevin [meters]
WARNING: raster <_hel_Gci0511> not found
0511PST-Gi Invalid map <0511PST-Gi>
Invalid map <sretr-Gi>
Parse error
ERROR: parse error
 0511PST-G
sunrise
Execution of <g.cimis sec=goes cmd=import,solar arg=files=/home/cimis/CA/20190803T0511PST-B2.pgm> finished.
Cleaning up temporary files...
qjhart commented 5 years ago

Remember this is just s ascript that runs, so you can easily replicate each step for decoding. So first enter grass:

grass /home/cimis/gdb17/goes17/cimis

Then you can see what the script will do. Note that the -n shows what to do:

g.cimis sec=goes cmd=import,solar -n arg="files=$(echo /home/cimis/CA/20190803T0511PST-B2.pgm)"

[[ `g.gisenv LOCATION_NAME` = "solar" && `g.gisenv MAPSET` = "20190803" ]] || g.mapset --quiet location=solar mapset=20190803; r.heliosat -i `g.solar_time cmd=sretr_parms` elevin=Z@500m linkein=linkeT_0801@500m latitude=latitude@500m ssha=ssha; g.rename raster=_hel_Gci`g.solar_time cmd=sretr`,sretr-Gi; echo -n " sretr-Gi"
[[ `g.gisenv LOCATION_NAME` = "solar" && `g.gisenv MAPSET` = "20190803" ]] || g.mapset --quiet location=solar mapset=20190803; r.heliosat -i `g.solar_time cmd=day_parms` `hhmm=0511; echo "hour=${hhmm%??} minute=${hhmm#??}"` elevin=Z@500m linkein=linkeT_0801@500m latitude=latitude@500m ssha=ssha; g.rename --quiet raster=_hel_Gci0511,0511PST-Gi; echo -n "0511PST-Gi "
[[ `g.gisenv LOCATION_NAME` = "solar" && `g.gisenv MAPSET` = "20190803" ]] || g.mapset --quiet location=solar mapset=20190803; r.mapcalc --overwrite --quiet expression="'0511PST-G'=('0511PST-Gi'-'sretr-Gi')*'0511PST-K'"; echo ' 0511PST-G'

Okay, it's easy enough to see the first steps there:

[[ `g.gisenv LOCATION_NAME` = "solar" && `g.gisenv MAPSET` = "20190803" ]] || g.mapset --quiet location=solar mapset=20190803;
r.heliosat -i `g.solar_time cmd=sretr_parms` elevin=Z@500m linkein=linkeT_0801@500m latitude=latitude@500m ssha=ssha;

Results in:
Specify elevin [meters]

Well why not?

r.info Z@500m
ERROR: Raster map <Z@500m> not found
# Hmm....
ls ~/gdb17/solar/
20190421  20190716  20190802  20190803-  20190805  20190807  20190809  cimis
20190710  20190729  20190803  20190804   20190806  20190808  500m.txt  PERMANENT
# Hmmm.
cat ~/gdb17/solar/500m.txt 
Download the GRASS 500m DEM mapset from:
https://ucdavis.box.com/s/d2y76umkodqhbdrjajm0tsouzcrqfwq2

Well that seems to be the problem

cd ~/gdb17/solar;
unzip ~quinn/500m.zip 

And retry.

grass /home/cimis/gdb17/goes17/cimis --exec g.cimis sec=goes cmd=import,solar arg="files=$(echo /home/cimis/CA/20190803T0511PST-B2.pgm)"

All good! Try with more....

grass /home/cimis/gdb17/goes17/cimis --exec g.cimis sec=goes cmd=import,solar arg="files=$(echo /home/cimis/CA/20190803T05??PST-B2.pgm)"

Still Good!