Code Monkey home page Code Monkey logo

idl-coyote / coyote Goto Github PK

View Code? Open in Web Editor NEW
63.0 63.0 37.0 6.15 MB

The Coyote Library evolved from work David Fanning was doing teaching IDL courses and answering IDL questions on the IDL newsgroup. It is meant to be a well-documented library that demonstrates how to write solid (dare we say eloquent) IDL programs that are easy to maintain and extend. You can learn more about these programs and about IDL programming in general at David's web page, Coyote's Guide to IDL Programming.

IDL 94.04% HTML 5.96%

coyote's People

Contributors

ct6502 avatar davidwfanning avatar flamingbear avatar mandrakos avatar met-pub avatar sappjw-noaa avatar wlandsman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coyote's Issues

Horizontal 'blob' (single row) breaks fit_ellipse

What steps will reproduce the problem?

  1. Obtain an image with a horizontal 'blob' (i.e., single row)
  2. Run fit_ellipse on said image
  3. Fail

Can be reproduced with the following code:
IDL> x = bytarr(64, 64)
IDL> x[10:24, 32] = 1
IDL> res = fit_ellipse(x)
% Compiled module: FIT_ELLIPSE.
% Compiled module: ARRAY_INDICES.
% TOTAL: For input argument ARRAY, Dimension must be 1.
% Execution halted at: FIT_ELLIPSE 157
....\coyote\fit_ellipse.pro
% $MAIN$

NCDF_data__define: duplicate tag names

NetCDF attribute names are case-sensitive, IDL tag names are case-insensitive and this may lead to duplicate name errors. In NCDF_data__define.pro, the check at line 1947 should be repeated at line 1974.

NCDF_variable GetInfo() breaks when _FillValue and missing_value occur together

Hi all,
I have a netCDF file with a variable which has both attributes _FillValue and missing_value.
In the GetInfo() function for ncdf_variables, lines 622-634, the info is constructed in such a way, that the _FillValue tag is added to the info structure whenever _FillValue or missing_value is found as a variable attribute. This is what the code looks like:
attrNames = self -> GetAttrNames()
attrIndex = Where(attrNames EQ 'scale_factor', count)
IF count GT 0 THEN info = Create_Struct(info, 'scale_factor', $
self -> GetAttrValue('scale_factor'))
attrIndex = Where(attrNames EQ 'add_offset', count)
IF count GT 0 THEN info = Create_Struct(info, 'add_offset', $
self -> GetAttrValue('add_offset'))
attrIndex = Where(attrNames EQ 'missing_value', count)
IF count GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('missing_value'))
attrIndex = Where(attrNames EQ '_FillValue', count)
IF count GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('_FillValue'))

However, that will create a "Conflicting or duplicate structure tag definition" error if both attributes are there.
I think, one could either put both attributes into the info structure, or avoid the error by filling the _FillValue tag in the info structure with the _FillValue attribute value as the priority, doing something like this:
attrNames = self -> GetAttrNames()
attrIndex = Where(attrNames EQ 'scale_factor', count)
IF count GT 0 THEN info = Create_Struct(info, 'scale_factor', $
self -> GetAttrValue('scale_factor'))
attrIndex = Where(attrNames EQ 'add_offset', count)
IF count GT 0 THEN info = Create_Struct(info, 'add_offset', $
self -> GetAttrValue('add_offset'))

attrIndex = Where(attrNames EQ 'missing_value', count_fill)
attrIndex = Where(attrNames EQ '_FillValue', count_miss)
IF count_fill GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('_FillValue'))
IF count_miss GT 0 AND count_fill EQ 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('missing_value'))

Thanks for the support, cheers
Achim

Graphics saved upside-down

Hi all,
since commit "Small changes in a number of files." (af66b7c), graphics are saved upside down when using this code:

data = cgDemoData(2)
LoadCT, 33, NCOLORS=12, BOTTOM=1
cgContour, data, NLEVELS=12, C_COLORS=Indgen(12)+1, /FILL, /WINDOW
cgControl, CREATE_PNG='some file'

I had come across a similar problem earlier in a different context. There, the issue was related to the !ORDER system variable. In this case, changing it, doesn't seem to make a difference.

Thanks for the support!
Cheers, Achim

cgps_setup__define error

Each time, we launch the cgPS_open, we rise an error message (line 227)
% Program caused arithmetic error: Floating illegal operand
the concerned line is
IF N_Elements(struct) EQ 0 THEN ps_struct = {cgPS_SETUP}

I tried with ISA but it doesn't work...
IF ISA(struct,'CGPS_SETUP') EQ 0 THEN ps_struct = {cgPS_SETUP}

In my code, I call at least 20 times this routine, it is a bit tiresome to get the same error messages 20 times but it doesn't have a impact on the results.

Thanks very much if somebody could improve this line or suggest a code modification or a missing (perhaps?) module in my directory to avoid it.
Best regards
A.B.

Mistaken arguments in cgimgscl.pro: 340 - 344

In cgimgscl.pro, lines 340 - 344:

          4: BEGIN ; Log scale stretch.
             tempImage =  cgLogScl(tempImage, Max=maxvalue, Min=minvalue, $
                       Mean=mean, Exponent=exponent, Negative=negative, $
                       OMIN=bottom, OMAX=top)
             END

should be

          4: BEGIN ; Log scale stretch.
             tempImage =  cgLogScl(tempImage, CONSTANT=constant, NEGATIVE=negative, $
                        MAX=maxValue, MIN=minValue, OMAX=top, OMIN=bottom)
             END

cgfixps.pro broken

With the last merge, the file cgfixps.pro is broken due to an unresolved merge conflict:

<<<<<<< HEAD
  Get_Lun, in_lun
  OpenR, in_lun, in_filename
=======
>>>>>>> 8ba3a7b34691137b0d0b3d3f508b434ded51fa12
  IF (FStat(in_lun)).size EQ 0 THEN BEGIN
    Free_lun, in_lun
    Free_lun, out_lun
    File_Delete, out_filename
    ;Print, 'Zero Length File Encountered...'
    RETURN
  ENDIF
  
<<<<<<< HEAD
  ; Move along in the file until the end of the Prolog.
  line = ""
  count = 0
  target = "void"
  buffer = StrArr(100)
  
=======
>>>>>>> 8ba3a7b34691137b0d0b3d3f508b434ded51fa12

blob_analyzer->getStats() returns negative values for center coordinates in large image

What steps will reproduce the problem?

  1. detects = obj_new('blob_analyzer', large_image, /all_neighbors)
  2. stats = detects->getStats(index_of_blob)
  3. stats.center[0 or 1] < 0

What is the expected output? What do you see instead?
The index of the blob center is negative if a large image is used (pixels/columns > 32K) and the blob is resides in a region where one of the indices is > 32k.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Problem is due to indgen() use in find_boundary().

xcm = Total( Total(mask, 2) * Indgen(xsize) ) / totalMass
ycm = Total( Total(mask, 1) * Indgen(ysize) ) / totalMass

suggest using Lindgen() instead.

Ambiguous keyword in cgMap_Grid

9fc0811 introduced a bug that breaks some existing code. IDL can't distinguish between LABEL and LABEL_WITH_DEGREE because the former may be a shortened version of the latter. Since there already exists a LABEL keyword there's now a conflict. The new keyword needs a different start to the name (maybe DEGREE_LABEL?).

Reproduce with:

IDL> cgmap_set, label=1, /grid

Traceback Report from CGMAP_SET:

     % Ambiguous keyword abbreviation: LABEL.
     % Execution halted at:  CGMAP_SET         617

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.