Hi Kris,
The easiest way to do this with things as they are is to run a script through the Jython Shell. You can use this script as an example. All you should have to do is change the dataDir variable to point to the data directory on your machine. Note that all of the *.nc files in the dataDir directory will be loaded and displayed:
Code: Select all
# import glob, which will be used later
import glob
# define the directory where the data exists
dataDir = 'C:/Users/rcarp/Data/GLM/'
# initialize an empty list. data objects will be added to this list later
dataList = []
# loop through all of the *.nc files in the dataDir directory and load
# the Flash_extent_density field of each of them. Append each data object
# to the dataList list initialized earlier.
for f in glob.glob('%s*.nc' % dataDir):
dataParms = dict(
filename = f,
field = 'Flash_extent_density'
)
# loadGrid function for each file
data = loadGrid(**dataParms)
# append each data object to the dataList list
dataList.append(data)
# display a loop of the dataList
layer = activeDisplay().createLayer('Image Sequence Display', dataList)
Normally, when the filename includes the date/time information you can write a NcML wrapper file where you can use
dateFormatMark to extract the date/time information. This allows you to simply go to the Data Sources tab of the Data Explorer, select the NcML file, click Add Source, and go on and display your data without a script. However, this doesn't work with these particular files because of the characters separating the date/time. For example:
IXTR99_KNES_02
1514_8788.
2018080215.nc
IXTR99_KNES_02
1515_8790.
2018080215.nc
IXTR99_KNES_02
1516_8792.
2018080215.nc
IXTR99_KNES_02
1517_8794.
2018080215.nc
IXTR99_KNES_02
1518_8796.
2018080215.nc
The red text above contains the hours/minutes. The blue text above contains the year, month, day, and hour. Because the end of each filename string is the same, the minutes would need to be specified in the dateFormatMark. However, this doesn't work because of the 8788, 8790, 8792, 8794, and 8796 parts of the filename string. If you have the ability to change these filenames, it could be worth appending the minutes to the end of the filename strings. This would make the NcML wrapper file with dateFormatMark possible. For example, your files could be named:
IXTR99_KNES_021514_8788.201808021514.nc
IXTR99_KNES_021515_8790.201808021515.nc
IXTR99_KNES_021516_8792.201808021516.nc
IXTR99_KNES_021517_8794.201808021517.nc
IXTR99_KNES_021518_8796.201808021518.nc
You can find more information about dateFormatMark by searching the forums. For example:
McIDAS-V version 1.7u1 and GOES-RCreate time Series from date/time in filename (ncml wrapper)problem making time sequence, single time gridsPlease let me know if you have any questions about this.
Thanks,
Bob Carp