Personal tools
You are here: Home Members azubrow's Home ioapiTools Concatenating iovar variables
Document Actions

Concatenating iovar variables

by Alexis Zubrow last modified 2005-09-20 16:25
 

This tutorial describes the concatenating function.  In general, you can achieve the same results by using the scan function and the resulting iofilescan object,



## Open two day's IOAPI files
f = ioT.open("~/tmp/exampleData/CCTM_ACONC.D2.001")
g = ioT.open("~/tmp/exampleData/CCTM_ACONC.D2.002")

## Get o3 for day 1 and 2
o3_1 = f("o3")
o3_2 = g("o3")

## Concatenate the variables into 1 long variable
o3_conc = ioT.concatenate([o3_1,o3_2])

## Show new time axis of concatenated variable
o3_conc.getTime()
##
id: time
Designated a time axis.
units: hours since 1996-6-24 6:0:0.0
Length: 48
First: 0.0
Last: 47.0
Other axis attributes:
calendar: gregorian
axis: T
##
The concatenate function will only concatenate variables of equal spatial dimensions (layer, yLat, and xLon) and will always concatenate along the time axis.  The variables do not need to be continuous, for example one variable could be hourly data from 1996-6-24 through 1996-6-25 and the next variable could start at 1996-6-27.  But, non-contiguous variables need to be stored in CF netCDF format to properly retain the time axis.  The variables should not have overlapping dates or subsetting may act unpredictably.  Other than time, all other metadata is copied from the first variable in the variable list.


  Table of Contents Previous Next
Contents Previous Next


Powered by Plone