[ncl-talk] Masking Issue When Moving To New Computer
Bassill, Nick
nbassill at albany.edu
Tue Feb 24 09:43:02 MST 2026
Hi All,
Not sure if this is solve-able, but I'm transitioning NCL scripts from one computer to another. Each runs the same version of NCL. I can run the same script with the same data, and they both make an image without any critical/different errors or warnings. However, on the new machine it doesn't do the masking it's supposed to do (I clip to NY). I'm attaching examples of the same plot from both machines. I've tried all sorts of different settings for DataBaseVersion/DataSetName/projections/masks/etc and I can't find a solution.
To make it more confusing, I thought I'd get around it by doing my own masking, with a shapefile. If I run a snippet of code like:
load "./shapefile_utils.ncl"
sname = "Counties_Shoreline.shp"
maskres = True
maskres at return_mask = True
maskres at minlat=latmin
maskres at minlon=lonmin
maskres at maxlat=latmax
maskres at maxlon=lonmax
maskres at shape_var = "NAME"
maskres at shape_names :=(/"Albany","Queens","Kings","Richmond","New York","Bronx"/); ;; just an example
data_mask := shapefile_mask_data(newdata,sname,maskres)
newdata=newdata*data_mask
printMinMax(data_mask,1)
on the new machine I'll get "min = 0, max = 0" as an output, which is incorrect. On the old one, it will correctly be 0,1. If I use the shapefile utility to plot what it thinks the shapefile is (again, same code), I get the other attached two images, which seems to make the problem obvious. For reasons unknown to me, the shape is being incorrectly rotated and sent around the world. Presumably this is something similar to what's happening in NCL's native masking.
Any suggestions? I'm somewhat resigned to this being an issue with NCL being incompatible with new machines, but figured I'd ask anyway. Here is new OS, FWIW:
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Nick Bassill, PhD
Director of the NY State Weather Risk Communication Center
Director of Research & Development, Center Of Excellence
Affiliated with NYS Mesonet
Room 488B, Harriman Campus; ETEC Building, 1220 Washington Ave, Albany, NY 12226
Contact: (518) 442-6375 | @NickPBassill | https://nyswrcc.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260224/ce9644d7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhnew.png
Type: image/png
Size: 600488 bytes
Desc: rhnew.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260224/ce9644d7/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhold.png
Type: image/png
Size: 387375 bytes
Desc: rhold.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260224/ce9644d7/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Counties_Shoreline-Old.png
Type: image/png
Size: 101098 bytes
Desc: Counties_Shoreline-Old.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260224/ce9644d7/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Counties_Shoreline-New.png
Type: image/png
Size: 104240 bytes
Desc: Counties_Shoreline-New.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20260224/ce9644d7/attachment-0007.png>
More information about the ncl-talk
mailing list