[Thread Prev][Thread Next][Index]

[ferret_users] Looping over multiple input files to plot file variables and save to png



I have 51 netcdf files in a directory, and want to loop over each of these and for each plot the contents of a gridded variable and save this to a png file, using pyferret 7.1

 

I’ve been struggling with syntax, and am getting “**TMAP ERR: non-existent or not on line  filenames.txt”, with the following partial code:

 

spawn "ls basinmask/*.nc > filenames.txt" ! This is generating a file, but if I could create the filelist in memory this step could be removed

FILE/FORMAT=DELIMITED/var="filenames" filenames.txt ! < This generates the error

say "processing: ",($file) ! don’t get to here

 

 

The plot and save command will be a simple:

 

> sha basinmask4 ! Each file contains the same named variable

> frame/file=”($mypath)($myfile).png”

 

Can someone help me out to fill in the missing logic/syntax here?

 

Thanks,

 

P


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement