Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
97e9543
update sample script #! to python3
patricia-nasa Jun 1, 2023
65f58f2
add option to read other vars that uv10m and v10m
patricia-nasa Jun 1, 2023
3548ba4
script to sample tqv and to3 only from merra-2
patricia-nasa Jun 1, 2023
bb06378
add feature to read tqv_to3 file
patricia-nasa Jun 1, 2023
42c3daf
script to run sample tqv_to3
patricia-nasa Jun 1, 2023
8c5b877
modify modis cmakelists to install sample tqv_to3 scripts
patricia-nasa Jun 1, 2023
75a23b3
updates to train and test on the angstrom linear fit
patricia-nasa Jun 7, 2023
77d061d
use develop GMAOpyobs branch. this is temporary
patricia-nasa Jun 7, 2023
4dce9ca
Merge remote-tracking branch 'origin/feature/pcastell/2-add-nnr-code-…
patricia-nasa Jun 7, 2023
b97a92d
update GMAOpyobs to v1.0.4
patricia-nasa Jun 7, 2023
c4360eb
Merge remote-tracking branch 'origin/develop' into feature/pcastell/u…
patricia-nasa Jun 8, 2023
c9ea144
update GMAOpyobs to v1.0.5
patricia-nasa Aug 22, 2023
70f6684
Merge remote-tracking branch 'origin/develop' into feature/pcastell/u…
patricia-nasa Aug 22, 2023
a91bbc2
update changelog for added tqv and to3
patricia-nasa Sep 6, 2023
f5d46c1
Merge pull request #7 from GEOS-ESM/feature/pcastell/update_modis_nnr
patricia-nasa Sep 6, 2023
5f54225
add sknet to this repo
patricia-nasa Dec 15, 2023
62b9289
per Patricia guidance
rtodling Jan 13, 2024
0a8be43
comment on change
rtodling Jan 13, 2024
ca4968b
Update to ESMA_env v4.8.2
mathomp4 Sep 24, 2024
6555267
Merge pull request #9 from GEOS-ESM/bugfix/mathomp4/esma-env-4.8.2
patricia-nasa Sep 24, 2024
758e2c9
Merge branch 'develop' into feature/rtodling/abs2obs
patricia-nasa Oct 23, 2024
f4423d2
Merge pull request #8 from GEOS-ESM/feature/rtodling/abs2obs
patricia-nasa Oct 23, 2024
67e7c2c
Update GitHub Actions
mathomp4 Nov 6, 2024
eaca4e1
Merge pull request #10 from GEOS-ESM/feature/mathomp4/update-actions-…
patricia-nasa Jul 2, 2025
c072132
new cmakelists for GAAS_App
patricia-nasa Jul 2, 2025
c6a96c1
add gaas_app scripts from latest version of GEOSadas
patricia-nasa Jul 2, 2025
c5fcc39
update cmake to install new applications directory
patricia-nasa Jul 2, 2025
6a62318
update Changelog
patricia-nasa Jul 2, 2025
6b93577
update changelog for new release
patricia-nasa Jul 2, 2025
03f2ec7
Merge pull request #12 from GEOS-ESM/feature/pcastell/add_gass_app
patricia-nasa Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
validate-YAML:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v4
- id: yaml-lint
name: yaml-lint
uses: ibiqlik/action-yamllint@v3
Expand All @@ -24,7 +24,7 @@ jobs:
format: colored
config_file: .yamllint.yml

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: yamllint-logfile
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@

### Changed

## [v1.1.0] 2025-07-02

### Added

- create an Applications folder for GAAS_App scripts that do the NNR pre-processing for the DAS
- ability to train on the AE linear fit to spectral AOD
- use TQV and TO3 as inputs

### Fixed

- Minor fix associated with installation location of software.

### Changed

- updated GMAOpyobs to latest v1.0.5
- Update to ESMA_env v4.8.2 (Fixes for RHEL8 GMAO Machines)

## [v1.0.0] 2023-06-07

### Added
Expand Down
4 changes: 2 additions & 2 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AeroML:
env:
local: ./env@
remote: ../ESMA_env.git
tag: v4.8.0
tag: v4.8.2
develop: main

cmake:
Expand All @@ -22,5 +22,5 @@ ecbuild:
GMAOpyobs:
local: ./src/Shared/GMAO_Shared/GMAO_pyobs@
remote: ../GMAOpyobs.git
branch: fix/pcastell/no-types-module
tag: v1.0.5
develop: develop
1 change: 1 addition & 0 deletions src/Applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory (GAAS_App)
17 changes: 17 additions & 0 deletions src/Applications/GAAS_App/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
esma_set_this()

set(pythonscripts modis_l2a.py mxd04_l2a.py avhrr_l2a.py patmosx_l2a.py)
install(PROGRAMS ${pythonscripts} DESTINATION bin)

install(
FILES mxd04_nnr.py avhrr_nnr.py
DESTINATION lib/Python
)


file(GLOB pcf_files *.pcf)

install (
FILES ${pcf_files}
DESTINATION etc
)
86 changes: 86 additions & 0 deletions src/Applications/GAAS_App/aeronet_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env python3
"""
Splits AERONET into synoptic chunks.
"""

import os
import sys

from datetime import date, datetime, timedelta

from pyobs.aeronet import AERONET_L2, granules


#---------------------------------------------------------------------
def makethis_dir(path):
"""Creates the relevant directory if necessary."""
if path != '':
rc = os.system('mkdir -p '+path)
if rc:
raise IOError("could not create directory "+path)

if __name__ == "__main__":

RootDir = '/nobackup/AERONET/MERRA-2'
ods_blank = '/nobackup/NNR/Misc/blank.ods'

oneday = timedelta(seconds=24*60*60)
onehour = timedelta(seconds=60*60)

if len(sys.argv)<2:
print("Usage:")
print(" aeronet4_all.py year1 [year2]")
sys.exit(1)
else:
y1 = sys.argv[1]
if len(sys.argv)>2:
y2 = sys.argv[2]
else:
y2 = y1
Years = list(range(int(y1),int(y2)+1))

# Loop over years
# ---------------
for year in Years:
tyme0 = datetime(year,1,1)
toy = datetime(year,12,31) - tyme0
ndays = 1 + int(toy.total_seconds()/(24*60*60))
for doy in range(1,ndays+1):

today = tyme0 + (doy-1) * oneday

print('Day: ', today)

# Read AERONET for this day
# -------------------------
Files = granules(today,bracket='left')
a = AERONET_L2(Files,Verbose=True)

# Output directories
# ------------------
dirL2 = RootDir + '/Level2/ODS/Y%d/M%02d'%(today.year,today.month)
dirL3 = RootDir + '/Level3/Y%d/M%02d'%(today.year,today.month)

for h in range(0,24,3):

tyme = tyme0 + (doy-1) * oneday + h * onehour

# Make sure directories exist
# ---------------------------
makethis_dir(dirL2)
makethis_dir(dirL3)

# Write & compress the files
# --------------------------
fnL2, nobs = a.writeODS(tyme,dir=dirL2)
fnL3 = a.writeGridded(tyme,dir=dirL3)

# Compress daily file
# -------------------
if a.nobs>0:
if os.system("n4zip "+fnL2+" > /dev/null"):
warnings.warn('cannot compress output ODS file <%s>'%fnL2)
if os.system("n4zip "+fnL3+" > /dev/null"):
warnings.warn('cannot compress output NC4 file <%s>'%fnL3)
else:
os.system("touch %s.empty"%fnL2)
46 changes: 46 additions & 0 deletions src/Applications/GAAS_App/avhrr_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
"""
Splits AVHRR into synoptic chunks.
"""

import os
import sys

from datetime import date, datetime, timedelta

if __name__ == "__main__":

oneday = timedelta(seconds=24*60*60)
onehour = timedelta(seconds=60*60)

if len(sys.argv)<2:
print("Usage:")
print(" avhrr_all.py year1 [year2]")
sys.exit(1)
else:
y1 = sys.argv[1]
if len(sys.argv)>2:
y2 = sys.argv[2]
else:
y2 = y1
Years = list(range(int(y1),int(y2)+1))

# Loop over years
# ---------------
for year in Years:
tyme0 = datetime(year,1,1)
toy = datetime(year,12,31) - tyme0
ndays = 1 + int(toy.total_seconds()/(24*60*60))
for doy in range(1,ndays+1):

for h in range(0,24,3):

tyme = tyme0 + (doy-1) * oneday + h * onehour

nymd = tyme.year*10000 + tyme.month*100 + tyme.day
nhms = tyme.hour*10000 + tyme.minute*100 + tyme.second

cmd = 'python avhrr_l2a.py -v asc %d %d'%(nymd,nhms)

print(cmd)
os.system(cmd)
25 changes: 25 additions & 0 deletions src/Applications/GAAS_App/avhrr_l2a.pcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#AVHRR_L2A processing

AVHRR_L2A_VERBOSE = YES

AVHRR_L2A_EXPID = ${EXPID}
AVHRR_L2A_ORBITS = asc,des

#--AVHRR_L2A_L2_DIR = /archive/input/dao_ops/obs/reanalysis/patmosx/Synoptic
#--AVHRR_L2A_OUT_DIR = ./Results/obs/Level%lev/%prod/Y%y4/M%m2
AVHRR_L2A_L2_DIR = ${FVWORK}
AVHRR_L2A_OUT_DIR = ${FVWORK}

AVHRR_L2A_OVERWRITE = YES
AVHRR_L2A_OUT_TEMPLATE = '%s.%prod_L%leva.%orb.%y4%m2%d2_%h2%n2z.%ext'
AVHRR_L2A_RESOLUTION = e

AVHRR_L2A_WIND_FILE = ${EXPID}.gaas_bkg.sfc.%y4%m2%d2_%h2z.nc4
AVHRR_L2A_TPW_FILE = ${EXPID}.gaas_bkg.sfc.%y4%m2%d2_%h2z.nc4
AVHRR_L2A_AOD_FILE = ${EXPID}.gaas_bkg.sfc.%y4%m2%d2_%h2z.nc4

AVHRR_L2A_NN_FILE = ExtData/g5chem/x/NN/nnr_001.avhrr_Tau.net
AVHRR_L2A_BLANK_ODS = ExtData/g5chem/x/blank_syn8.ods
AVHRR_L2A_COXMUNK_LUT = ExtData/g5chem/x/avhrr.cox-munk_lut.npz

#END AVHRR_L2A processing
64 changes: 64 additions & 0 deletions src/Applications/GAAS_App/avhrr_l2a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
# -W ignore::DeprecationWarning

"""

Simple wrapper script to parse Prep config file and create ODS with NNR AVHRR retrievals.

October 2013
arlindo.dasilva@nasa.gov
"""

from os import system
from optparse import OptionParser
from MAPL import Config

if __name__ == "__main__":

# Parse command line options
# --------------------------
parser = OptionParser(usage="Usage: %prog prep_config_file nymd nhms",
version='avhrr_l2a-1.0.0' )
parser.add_option("-n", "--dryrun",
action="store_true", dest="dryrun",
help="Dry run.")

(options, args) = parser.parse_args()

if len(args) == 3:
prep_config, nymd, nhms = args
else:
parser.error("must have 3 arguments: prep_config_filename nymd nhms")

# Parse prep config
# -----------------
cf = Config(prep_config,delim=' = ')

Options = " --expid=" + cf('AVHRR_L2A_EXPID') + \
" --l2_dir=" + cf('AVHRR_L2A_L2_DIR') + \
" --res=" + cf('AVHRR_L2A_RESOLUTION') + \
" --dir=" + cf('AVHRR_L2A_OUT_DIR') + \
" --fname=" + cf('AVHRR_L2A_OUT_TEMPLATE') + \
" --net=" + cf('AVHRR_L2A_NN_FILE') + \
" --wind=" + cf('AVHRR_L2A_WIND_FILE') + \
" --tpw=" + cf('AVHRR_L2A_TPW_FILE') + \
" --aod=" + cf('AVHRR_L2A_AOD_FILE') + \
" --blank_ods=" + cf('AVHRR_L2A_BLANK_ODS') + \
" --coxmunk=" + cf('AVHRR_L2A_COXMUNK_LUT')

if cf('AVHRR_L2A_OVERWRITE').upper() == 'YES': Options += " --force"
if cf('AVHRR_L2A_VERBOSE').upper() == 'YES': Options += " -v"

# Generate products
# -----------------
i = 0
for orbit in cf('AVHRR_L2A_ORBITS').split(','):
cmd = "patmosx_l2a.py %s %s %s %s"%(Options,orbit,nymd,nhms)
print(cmd)
if not options.dryrun:
if system(cmd):
raise ValueError("patmosx_l2a.py failed for %s on %s %s"%(orbit,nymd,nhms))

i += 1


Loading