Skip to content
Open
Changes from all commits
Commits
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
21 changes: 15 additions & 6 deletions bin/terra_and_aqua_l1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def execute
exit_with_error("too many/not enough pds files => #{pds.join(' ')}", 11) if (pds.length != 1)

# update luts
shell_out!(conf['processing'][platform]['update_luts']) if conf['processing'][platform]['update_luts']
shell_out_seadas(conf['processing'][platform]['update_luts'], conf) if conf['processing'][platform]['update_luts']

# To l1
shell_out!("#{conf['processing'][platform]['l1_driver']} #{pds.first}")
shell_out_seadas("#{conf['processing'][platform]['l1_driver']} #{pds.first}",conf)

# find L1A_LAC
rLACs = Dir.glob('[AT]*L1A_LAC')
Expand All @@ -41,10 +41,10 @@ def execute
end

# perform gbad processing, if needed
shell_out!(conf['processing'][platform]['gbad']) if (conf['processing'][platform]['gbad'])
shell_out_seadas(conf['processing'][platform]['gbad'], conf) if (conf['processing'][platform]['gbad'])

# geo processing
shell_out!("#{conf['processing'][platform]['geo_driver']} #{rLACs.first}")
shell_out_seadas("#{conf['processing'][platform]['geo_driver']} #{rLACs.first}", conf)

# find GEOs
rGEOs = Dir.glob('[AT]*GEO')
Expand All @@ -53,7 +53,7 @@ def execute
end

# L1B processing
shell_out!("#{conf['processing'][platform]['l1b_driver']} #{rLACs.first} #{rGEOs.first}")
shell_out_seadas("#{conf['processing'][platform]['l1b_driver']} #{rLACs.first} #{rGEOs.first}", conf)

# find L1B_LAC
rL1B_LACs = Dir.glob('[AT]*L1B_LAC')
Expand All @@ -62,7 +62,7 @@ def execute
end

# perform destriping, if needed
shell_out!("#{conf['processing'][platform]['destripe']} #{rL1B_LACs.first}") if (conf['processing'][platform]['destripe'])
shell_out_seadas("#{conf['processing'][platform]['destripe']} #{rL1B_LACs.first}", conf) if (conf['processing'][platform]['destripe'])

gina_name = get_gina_name(rL1B_LACs.first, platform, get_l1_time(rGEOs.first))

Expand Down Expand Up @@ -104,6 +104,15 @@ def get_gina_name(item, platform, pass_tm)
platform + '.' + pass_tm.strftime('%y%j.%H%M')
end

#sources "modis_tools_setup" before running the command to setup the environment.
def shell_out_seadas(cmd, cfg)
if cfg["modis_tools_setup"]
shell_out!(". #{cfg["modis_tools_setup"]} ; #{cmd}")
else
shell_out!(cfg)
end
end

end

ModisL1Clamp.run