Giter VIP home page Giter VIP logo

Comments (6)

durack1 avatar durack1 commented on July 19, 2024

@dnadeau4 this is the offending line:

cmor.write(varid,values,time_vals=d.getTime()[:],time_bnds=d.getTime().genGenericBounds())

from cmor.

durack1 avatar durack1 commented on July 19, 2024

There are a couple of issues here:

  • CMOR SHOULD faithfully reproduce a time axis if it is provided with the dataset, NOT overwrite this by generating a new time axis using the time_bounds
  • The input time_axis is off by 15hrs, 12hrs, 3hrs or similar hrs depending on the month - the first value SHOULD BE 2015-1-16 12:0:0 NOT 2015-01-16 18 or 2015-01-16 03
  • The time_bnds are not set correctly using time_bnds=d.getTime().genGenericBounds()

from cmor.

durack1 avatar durack1 commented on July 19, 2024

@dnadeau4 the issue has been resolved by providing more reasonable time_bnds to CMOR by using the following:

time    = d.getTime()
cmor.write(varid,values,time_vals=time[:],time_bnds=time.getBounds())

I would recommend however that in documentation the fact that CMOR uses time_bnds and ignores the provided time_axis values is highlighted - it is certainly an unusual logical decision to this user

from cmor.

doutriaux1 avatar doutriaux1 commented on July 19, 2024

@Durack it IS documented in the manual. Did you read it 😉

[coord_vals] = 1-d array (single precision float, double precision float, or, for
labels, character strings) containing coordinate values, ordered consistently
with the data array that will be passed by the user to CMOR through
function cmor_write (see documentation below). This argument is required
except if: 1) the axis is a simple “index axis” (i.e., an axis without
coordinate values), or 2) for a time coordinate, the user intends to pass the
coordinate values when the cmor_write function is called. Note that the
coordinate values must be ordered monotonically, so, for example, in the
case of longitudes that might have the values, 0., 10., 20, ... 170., 180., 190.,
200., ... 340., 350., passing the (equivalent) values, 0., 10., 20, ... 170.,
180., -170., -160., ... -20., -10. is forbidden. In the case of time-coordinate
values, if cell bounds are also passed, then CMOR will first check that each
coordinate value is not outside its associated cell bounds; subsequently,
however, the user-defined coordinate value will be replaced by the midpoint
of the interval defined by its bounds, and it is this value that will be
written to the netCDF file. In the case of character string coord_vals there
are no cell_bounds, but for the C version of the function, the argument
cell_bounds_ndim is used to specify the length of the strings in the
coord_vals array (i.e., the array will be dimensioned
[length][cell_bounds_ndim]).
type = type of the coord_vals/bnds passed, 

from cmor.

durack1 avatar durack1 commented on July 19, 2024

@doutriaux1 that would be a NO, my bad.. However, following your advice _where_ is the manual located?

I've found http://www-pcmdi.llnl.gov/software/cmor/cmor_users_guide.pdf and https://pcmdi.github.io/cmor-site/index.html which would seem to be out of sync - or have similar content.. Which is the most recent?

I think @dnadeau4 was planning on updating that to https://pcmdi.llnl.gov/cmor/ using the formatting provided on http://uvcdat.llnl.gov/documentation/cdms/cdms.html

from cmor.

durack1 avatar durack1 commented on July 19, 2024

@dnadeau4 this is no longer a problem - I do think that the docs should _VERY CLEARLY_ state that this is the case (bounds are used not the time axis)

from cmor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.