Skip to content

Commit

Permalink
📝 Rollup small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Feb 26, 2025
1 parent 3ef1dd5 commit da8f38d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 31 deletions.
4 changes: 2 additions & 2 deletions htdocs/DCP/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ Ext.onReady(function () {
lazyRender: true,
id: 'stateselector',
listeners: {
select: function (cb, record, idx) {
stationStore.load({ add: false, params: { network: record.data.abbr + "_DCP" } });
select: (_cb, record, _idx) => {
stationStore.load({ add: false, params: { network: `${record.data.abbr}_DCP` } });
return false;
}
}
Expand Down
11 changes: 11 additions & 0 deletions htdocs/GIS/apps/agclimate/gsplot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* global $ */
$(document).ready(() => {
$("#save").click(() => {
const content = $("#datatable").text().split(/\\n/).slice(2).join("\\n");

const link = document.createElement('a');
link.setAttribute('download', 'isusm.csv');
link.setAttribute('href', `data:text/plain;charset=utf-8,${encodeURIComponent(content)}`);
link.click();
});
});
16 changes: 1 addition & 15 deletions htdocs/GIS/apps/agclimate/gsplot.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,5 @@ text editor and save the data file on your machine. Most GIS systems can
then import this dataset as a layer. You may have to omit the commented lines
(#) if your GIS has trouble importing the data.
EOF;
$t->jsextra = <<<EOM
<script>
$(document).ready(function(){
$("#save").click(function(){
var content = $("#datatable").text().split(/\\n/).slice(2).join("\\n");
var link = document.createElement('a');
link.setAttribute('download', 'isusm.csv');
link.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content));
link.click();
});
});
</script>
EOM;
$t->jsextra = '<script type="text/javascript" src="gsplot.js"></script>';
$t->render('single.phtml');
1 change: 0 additions & 1 deletion htdocs/archive/raob/list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global $ */
let station = '_OAX';
let year = new Date().getFullYear();
let j2 = null;
let dt = null;

function zero(val){
Expand Down
2 changes: 1 addition & 1 deletion pylib/iemweb/request/normals.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Schema(CGIModel):
source: str = Field(
default="ncei_climate91",
description="The source of the data, defaults to ncei_climate91",
pattern=r"^(climate\d?\d?|ncdc_climate\d?\d?|ncei_climate\d?\d?)$",
pattern=r"^(climate(51|71|81)?|ncdc_climate[78]1|ncei_climate91)$",
)
station: str = Field(
default="IA0000",
Expand Down
11 changes: 6 additions & 5 deletions scripts/RUN_20_AFTER.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ python download_imerg.py --valid=$(date -u --date '35 hours ago' +'%Y-%m-%dT%H:3
python download_imerg.py --valid=$(date -u --date '6 months ago' +'%Y-%m-%dT%H:00:00')
python download_imerg.py --valid=$(date -u --date '6 months ago' +'%Y-%m-%dT%H:30:00')

cd ../ingestors/madis
python extract_hfmetar.py --hours=0 &
python to_iemaccess.py --valid=$(date -u --date '1 hour ago' +'%Y-%m-%dT%H:%M:00') &

cd ../../plots
cd ../plots
./RUN_PLOTS

cd ../ndfd
Expand All @@ -35,3 +31,8 @@ python uscrn_ingest.py

cd ../uscrn
python compute_uscrn_pday.py --date=$(date '+%Y-%m-%d')

# Run later to keep from conflicting with RUN_20MIN.sh to_iemaccess.py
cd ../ingestors/madis
python extract_hfmetar.py --hours=0 &
python to_iemaccess.py --valid=$(date -u --date '1 hour ago' +'%Y-%m-%dT%H:%M:00')
10 changes: 3 additions & 7 deletions scripts/ingestors/cocorahs/cocorahs_data_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from pyiem.database import get_sqlalchemy_conn, sql_helper
from pyiem.reference import TRACE_VALUE
from pyiem.util import logger, utc
from sqlalchemy import text

LOG = logger()

Expand All @@ -34,10 +33,9 @@ def safeP(v):
def main(conn, dt: Optional[date]) -> None:
"""Go Main Go"""
stations = pd.read_sql(
text(
"""
select iemid, id, tzname from stations where network ~* '_COCORAHS'
"""
sql_helper(
"select iemid, id, tzname from stations where "
"network ~* '_COCORAHS'"
),
conn,
index_col="id",
Expand Down Expand Up @@ -73,8 +71,6 @@ def main(conn, dt: Optional[date]) -> None:
LOG.info("Found %s obs to process", len(obs.index))
for sid, row in obs.iterrows():
if sid not in stations.index:
if sid.startswith("IA-"):
print(sid)
continue
tzinfo = ZoneInfo(stations.at[sid, "tzname"])
valid = datetime.strptime(
Expand Down

0 comments on commit da8f38d

Please sign in to comment.