Skip to content

ROMSslice modification#1

Open
simion1232006 wants to merge 83 commits intoofringer:masterfrom
mrayson:master
Open

ROMSslice modification#1
simion1232006 wants to merge 83 commits intoofringer:masterfrom
mrayson:master

Conversation

@simion1232006
Copy link

@simion1232006 simion1232006 commented Jul 28, 2016

Matt,

I found the previous ROMSslice class was not very straightforward, so I modified it a little bit. Once you do this, everyone can make a slice time series with a function input rather than modified the tstep in object.
'object'= ROMSslice(filename,np.linspace(123.2,121.95,50),np.linspace(-15.5,-14.1,50))
temp_slice = 'object'('zeta',range(0,10)) ;

Note there is also a bug fix(could you please check whether this is right?)
data[tt,:,:] = self.F(dataslice[tt,:,:].ravel())
data[:,kk,:] = self.F(dataslice[kk,:,:].ravel())

Maybe you can merge this into your branch.
def call(self,varname,tstep=None):
# Load the data

numstep = len(self.time)

    dataslice = self.loadData(varname=varname,tstep=tstep)
    ndim = dataslice.ndim
    # Create the interpolation object
    self.xy = np.array([self.X.ravel(),self.Y.ravel()]).T

    self.F = interpXYZ(self.xy,self.xyout)

Nt = len(self.tstep)

    Nt = len(tstep)
    Nk = len(self.K)

    # Interpolate onto the output data
    data = np.zeros((Nt,Nk,self.nslice))

    if ndim == 2:
        return self.F(dataslice.ravel())
    elif Nt>1 and Nk==1 and ndim==3:
        for tt in range(Nt):

            data[tt,:,:] = self.F(dataslice[tt,:,:].ravel())
    elif Nk>1 and Nt==1 and ndim==3:
        for kk in range(Nk):

            data[:,kk,:] = self.F(dataslice[kk,:,:].ravel())           
    elif ndim == 4: # 4D array
        for kk in range(Nk):
            for tt in range(Nt):

                data[tt,kk,:] = self.F(dataslice[tt,kk,:,:].ravel())
    data[data>1e36]=0.
    return data.squeeze()

jadelson and others added 30 commits July 16, 2015 15:25
 - Added a ncmetadata.yaml file for automated netcdf file generation
 - Added dict_toxray function in netcdfio for automated conversion to xray.Dataset
- Added unstructured grid reordering routine into ugridgen tools.
- Fixed problem in sunboundary for handling large datasets.
mrayson and others added 30 commits November 1, 2016 14:18
…nd debugged imports in getNOAAWeatherStation.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants