Using Merge Multidimensional Rasters in Model Builder

552
1
Jump to solution
10-18-2022 05:40 AM
BDeFee
by
New Contributor

Hello everyone. 

I have hundreds of netCDF files containing daily values which are already aggregated by month and stored in a folder by year - one .nc file for each month. I need to merge them to create a single crf file for each year. While I can use the Merge Multidimensional Rasters tool manually, it would be much easier if I could iterate over the folders, collecting a list of files for the year, then merge them. Here's a quick model builder layout for reference:

BDeFee_0-1666095459716.png

If I run the model through the Collect Values step, it will feed the Merge Multidimensional Rasters tool a list of files to merge, but it throws the error "CreateRasterDatasetName: The workspace E:\folder\OutputRasters does not exist."

The folder is there. I can see it in Windows Explorer and I can use it as an output folder if I use Merge Multidimensional Rasters as a standalone tool. It only throws this error when I try to use the tool as part of a model.

Any suggestions?

1 Solution

Accepted Solutions
BDeFee
by
New Contributor

Replying to my own post with a workaround. After much frustration, I built a python script to circumvent the problem. The script asks for an input folder and an output filename for the crf. It iterates through the files in the input folder and adds them to a list. The list is then used as the file input for the merge multidimensional rasters tool.

View solution in original post

1 Reply
BDeFee
by
New Contributor

Replying to my own post with a workaround. After much frustration, I built a python script to circumvent the problem. The script asks for an input folder and an output filename for the crf. It iterates through the files in the input folder and adds them to a list. The list is then used as the file input for the merge multidimensional rasters tool.